OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ |
6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ | 6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 int sdp_mline_index, | 117 int sdp_mline_index, |
118 const std::string& sdp); | 118 const std::string& sdp); |
119 | 119 |
120 WebRtcAudioDeviceImpl* GetWebRtcAudioDevice(); | 120 WebRtcAudioDeviceImpl* GetWebRtcAudioDevice(); |
121 | 121 |
122 protected: | 122 protected: |
123 // Asks the PeerConnection factory to create a Local MediaStream object. | 123 // Asks the PeerConnection factory to create a Local MediaStream object. |
124 virtual scoped_refptr<webrtc::LocalMediaStreamInterface> | 124 virtual scoped_refptr<webrtc::LocalMediaStreamInterface> |
125 CreateLocalMediaStream(const std::string& label); | 125 CreateLocalMediaStream(const std::string& label); |
126 | 126 |
| 127 // Asks the PeerConnection factory to create a Local Audio Source. |
| 128 virtual scoped_refptr<webrtc::AudioSourceInterface> |
| 129 CreateLocalAudioSource( |
| 130 const webrtc::MediaConstraintsInterface* constraints); |
| 131 |
127 // Asks the PeerConnection factory to create a Local Video Source. | 132 // Asks the PeerConnection factory to create a Local Video Source. |
128 virtual scoped_refptr<webrtc::VideoSourceInterface> | 133 virtual scoped_refptr<webrtc::VideoSourceInterface> |
129 CreateVideoSource(int video_session_id, | 134 CreateLocalVideoSource( |
130 bool is_screen_cast, | 135 int video_session_id, |
131 const webrtc::MediaConstraintsInterface* constraints); | 136 bool is_screen_cast, |
| 137 const webrtc::MediaConstraintsInterface* constraints); |
132 | 138 |
133 // Initializes the source using audio parameters for the selected | 139 // Initializes the source using audio parameters for the selected |
134 // capture device and specifies which capture device to use as capture | 140 // capture device and specifies which capture device to use as capture |
135 // source. | 141 // source. |
136 virtual bool InitializeAudioSource(const StreamDeviceInfo& device_info); | 142 virtual bool InitializeAudioSource(const StreamDeviceInfo& device_info); |
137 | 143 |
138 // Creates a media::AudioCapturerSource with an implementation that is | 144 // Creates a media::AudioCapturerSource with an implementation that is |
139 // specific for a WebAudio source. The created WebAudioCapturerSource | 145 // specific for a WebAudio source. The created WebAudioCapturerSource |
140 // instance will function as audio source instead of the default | 146 // instance will function as audio source instead of the default |
141 // WebRtcAudioCapturer. | 147 // WebRtcAudioCapturer. |
142 virtual bool CreateWebAudioSource(WebKit::WebMediaStreamSource* source); | 148 virtual bool CreateWebAudioSource(WebKit::WebMediaStreamSource* source); |
143 | 149 |
| 150 // Asks the PeerConnection factory to create a Local AudioTrack object. |
| 151 virtual scoped_refptr<webrtc::LocalAudioTrackInterface> |
| 152 CreateLocalAudioTrack(const std::string& label, |
| 153 webrtc::AudioSourceInterface* source); |
| 154 |
144 // Asks the PeerConnection factory to create a Local VideoTrack object. | 155 // Asks the PeerConnection factory to create a Local VideoTrack object. |
145 virtual scoped_refptr<webrtc::VideoTrackInterface> | 156 virtual scoped_refptr<webrtc::VideoTrackInterface> |
146 CreateLocalVideoTrack(const std::string& label, | 157 CreateLocalVideoTrack(const std::string& label, |
147 webrtc::VideoSourceInterface* source); | 158 webrtc::VideoSourceInterface* source); |
148 | 159 |
149 // Asks the PeerConnection factory to create a Local AudioTrack object. | |
150 virtual scoped_refptr<webrtc::LocalAudioTrackInterface> | |
151 CreateLocalAudioTrack(const std::string& label, | |
152 webrtc::AudioDeviceModule* audio_device); | |
153 | |
154 virtual bool EnsurePeerConnectionFactory(); | 160 virtual bool EnsurePeerConnectionFactory(); |
155 virtual bool PeerConnectionFactoryCreated(); | 161 virtual bool PeerConnectionFactoryCreated(); |
156 | 162 |
157 private: | 163 private: |
158 // Creates and deletes |pc_factory_|, which in turn is used for | 164 // Creates and deletes |pc_factory_|, which in turn is used for |
159 // creating PeerConnection objects. | 165 // creating PeerConnection objects. |
160 bool CreatePeerConnectionFactory(); | 166 bool CreatePeerConnectionFactory(); |
161 | 167 |
162 void InitializeWorkerThread(talk_base::Thread** thread, | 168 void InitializeWorkerThread(talk_base::Thread** thread, |
163 base::WaitableEvent* event); | 169 base::WaitableEvent* event); |
(...skipping 18 matching lines...) Expand all Loading... |
182 talk_base::Thread* signaling_thread_; | 188 talk_base::Thread* signaling_thread_; |
183 talk_base::Thread* worker_thread_; | 189 talk_base::Thread* worker_thread_; |
184 base::Thread chrome_worker_thread_; | 190 base::Thread chrome_worker_thread_; |
185 | 191 |
186 DISALLOW_COPY_AND_ASSIGN(MediaStreamDependencyFactory); | 192 DISALLOW_COPY_AND_ASSIGN(MediaStreamDependencyFactory); |
187 }; | 193 }; |
188 | 194 |
189 } // namespace content | 195 } // namespace content |
190 | 196 |
191 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ | 197 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ |
OLD | NEW |