OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2004 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #include "webrtc/api/peerconnectionfactory.h" | 11 #include "webrtc/api/peerconnectionfactory.h" |
12 | 12 |
13 #include <utility> | 13 #include <utility> |
14 | 14 |
15 #include "webrtc/api/audiotrack.h" | 15 #include "webrtc/api/audiotrack.h" |
16 #include "webrtc/api/localaudiosource.h" | 16 #include "webrtc/api/localaudiosource.h" |
17 #include "webrtc/api/mediaconstraintsinterface.h" | 17 #include "webrtc/api/mediaconstraintsinterface.h" |
18 #include "webrtc/api/mediastream.h" | 18 #include "webrtc/api/mediastream.h" |
19 #include "webrtc/api/mediastreamproxy.h" | 19 #include "webrtc/api/mediastreamproxy.h" |
20 #include "webrtc/api/mediastreamtrackproxy.h" | 20 #include "webrtc/api/mediastreamtrackproxy.h" |
21 #include "webrtc/api/peerconnection.h" | 21 #include "webrtc/api/peerconnection.h" |
22 #include "webrtc/api/peerconnectionfactoryproxy.h" | 22 #include "webrtc/api/peerconnectionfactoryproxy.h" |
23 #include "webrtc/api/peerconnectionproxy.h" | 23 #include "webrtc/api/peerconnectionproxy.h" |
24 #include "webrtc/api/videosource.h" | 24 #include "webrtc/api/videocapturertracksource.h" |
25 #include "webrtc/api/videosourceproxy.h" | 25 #include "webrtc/api/videosourceproxy.h" |
26 #include "webrtc/api/videotrack.h" | 26 #include "webrtc/api/videotrack.h" |
27 #include "webrtc/base/bind.h" | 27 #include "webrtc/base/bind.h" |
28 #include "webrtc/media/engine/webrtcmediaengine.h" | 28 #include "webrtc/media/engine/webrtcmediaengine.h" |
29 #include "webrtc/media/engine/webrtcvideodecoderfactory.h" | 29 #include "webrtc/media/engine/webrtcvideodecoderfactory.h" |
30 #include "webrtc/media/engine/webrtcvideoencoderfactory.h" | 30 #include "webrtc/media/engine/webrtcvideoencoderfactory.h" |
31 #include "webrtc/modules/audio_device/include/audio_device.h" | 31 #include "webrtc/modules/audio_device/include/audio_device.h" |
32 #include "webrtc/p2p/base/basicpacketsocketfactory.h" | 32 #include "webrtc/p2p/base/basicpacketsocketfactory.h" |
33 #include "webrtc/p2p/client/basicportallocator.h" | 33 #include "webrtc/p2p/client/basicportallocator.h" |
34 | 34 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 } | 201 } |
202 | 202 |
203 rtc::scoped_refptr<AudioSourceInterface> | 203 rtc::scoped_refptr<AudioSourceInterface> |
204 PeerConnectionFactory::CreateAudioSource(const cricket::AudioOptions& options) { | 204 PeerConnectionFactory::CreateAudioSource(const cricket::AudioOptions& options) { |
205 RTC_DCHECK(signaling_thread_->IsCurrent()); | 205 RTC_DCHECK(signaling_thread_->IsCurrent()); |
206 rtc::scoped_refptr<LocalAudioSource> source( | 206 rtc::scoped_refptr<LocalAudioSource> source( |
207 LocalAudioSource::Create(options_, &options)); | 207 LocalAudioSource::Create(options_, &options)); |
208 return source; | 208 return source; |
209 } | 209 } |
210 | 210 |
211 rtc::scoped_refptr<VideoSourceInterface> | 211 rtc::scoped_refptr<VideoTrackSourceInterface> |
212 PeerConnectionFactory::CreateVideoSource( | 212 PeerConnectionFactory::CreateVideoSource( |
213 cricket::VideoCapturer* capturer, | 213 cricket::VideoCapturer* capturer, |
214 const MediaConstraintsInterface* constraints) { | 214 const MediaConstraintsInterface* constraints) { |
215 RTC_DCHECK(signaling_thread_->IsCurrent()); | 215 RTC_DCHECK(signaling_thread_->IsCurrent()); |
216 rtc::scoped_refptr<VideoSource> source(VideoSource::Create( | 216 rtc::scoped_refptr<VideoTrackSourceInterface> source( |
217 worker_thread_, capturer, constraints, false)); | 217 VideoCapturerTrackSource::Create(worker_thread_, capturer, constraints, |
218 return VideoSourceProxy::Create(signaling_thread_, source); | 218 false)); |
| 219 return VideoTrackSourceProxy::Create(signaling_thread_, source); |
219 } | 220 } |
220 | 221 |
221 rtc::scoped_refptr<VideoSourceInterface> | 222 rtc::scoped_refptr<VideoTrackSourceInterface> |
222 PeerConnectionFactory::CreateVideoSource(cricket::VideoCapturer* capturer) { | 223 PeerConnectionFactory::CreateVideoSource(cricket::VideoCapturer* capturer) { |
223 RTC_DCHECK(signaling_thread_->IsCurrent()); | 224 RTC_DCHECK(signaling_thread_->IsCurrent()); |
224 rtc::scoped_refptr<VideoSource> source( | 225 rtc::scoped_refptr<VideoTrackSourceInterface> source( |
225 VideoSource::Create(worker_thread_, capturer, false)); | 226 VideoCapturerTrackSource::Create(worker_thread_, capturer, false)); |
226 return VideoSourceProxy::Create(signaling_thread_, source); | 227 return VideoTrackSourceProxy::Create(signaling_thread_, source); |
227 } | 228 } |
228 | 229 |
229 bool PeerConnectionFactory::StartAecDump(rtc::PlatformFile file, | 230 bool PeerConnectionFactory::StartAecDump(rtc::PlatformFile file, |
230 int64_t max_size_bytes) { | 231 int64_t max_size_bytes) { |
231 RTC_DCHECK(signaling_thread_->IsCurrent()); | 232 RTC_DCHECK(signaling_thread_->IsCurrent()); |
232 return channel_manager_->StartAecDump(file, max_size_bytes); | 233 return channel_manager_->StartAecDump(file, max_size_bytes); |
233 } | 234 } |
234 | 235 |
235 void PeerConnectionFactory::StopAecDump() { | 236 void PeerConnectionFactory::StopAecDump() { |
236 RTC_DCHECK(signaling_thread_->IsCurrent()); | 237 RTC_DCHECK(signaling_thread_->IsCurrent()); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 return PeerConnectionProxy::Create(signaling_thread(), pc); | 313 return PeerConnectionProxy::Create(signaling_thread(), pc); |
313 } | 314 } |
314 | 315 |
315 rtc::scoped_refptr<MediaStreamInterface> | 316 rtc::scoped_refptr<MediaStreamInterface> |
316 PeerConnectionFactory::CreateLocalMediaStream(const std::string& label) { | 317 PeerConnectionFactory::CreateLocalMediaStream(const std::string& label) { |
317 RTC_DCHECK(signaling_thread_->IsCurrent()); | 318 RTC_DCHECK(signaling_thread_->IsCurrent()); |
318 return MediaStreamProxy::Create(signaling_thread_, | 319 return MediaStreamProxy::Create(signaling_thread_, |
319 MediaStream::Create(label)); | 320 MediaStream::Create(label)); |
320 } | 321 } |
321 | 322 |
322 rtc::scoped_refptr<VideoTrackInterface> | 323 rtc::scoped_refptr<VideoTrackInterface> PeerConnectionFactory::CreateVideoTrack( |
323 PeerConnectionFactory::CreateVideoTrack( | |
324 const std::string& id, | 324 const std::string& id, |
325 VideoSourceInterface* source) { | 325 VideoTrackSourceInterface* source) { |
326 RTC_DCHECK(signaling_thread_->IsCurrent()); | 326 RTC_DCHECK(signaling_thread_->IsCurrent()); |
327 rtc::scoped_refptr<VideoTrackInterface> track( | 327 rtc::scoped_refptr<VideoTrackInterface> track( |
328 VideoTrack::Create(id, source)); | 328 VideoTrack::Create(id, source)); |
329 return VideoTrackProxy::Create(signaling_thread_, track); | 329 return VideoTrackProxy::Create(signaling_thread_, track); |
330 } | 330 } |
331 | 331 |
332 rtc::scoped_refptr<AudioTrackInterface> | 332 rtc::scoped_refptr<AudioTrackInterface> |
333 PeerConnectionFactory::CreateAudioTrack(const std::string& id, | 333 PeerConnectionFactory::CreateAudioTrack(const std::string& id, |
334 AudioSourceInterface* source) { | 334 AudioSourceInterface* source) { |
335 RTC_DCHECK(signaling_thread_->IsCurrent()); | 335 RTC_DCHECK(signaling_thread_->IsCurrent()); |
(...skipping 20 matching lines...) Expand all Loading... |
356 } | 356 } |
357 | 357 |
358 cricket::MediaEngineInterface* PeerConnectionFactory::CreateMediaEngine_w() { | 358 cricket::MediaEngineInterface* PeerConnectionFactory::CreateMediaEngine_w() { |
359 ASSERT(worker_thread_ == rtc::Thread::Current()); | 359 ASSERT(worker_thread_ == rtc::Thread::Current()); |
360 return cricket::WebRtcMediaEngineFactory::Create( | 360 return cricket::WebRtcMediaEngineFactory::Create( |
361 default_adm_.get(), video_encoder_factory_.get(), | 361 default_adm_.get(), video_encoder_factory_.get(), |
362 video_decoder_factory_.get()); | 362 video_decoder_factory_.get()); |
363 } | 363 } |
364 | 364 |
365 } // namespace webrtc | 365 } // namespace webrtc |
OLD | NEW |