| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2012 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 |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 const webrtc::MediaConstraintsInterface* constraints, | 280 const webrtc::MediaConstraintsInterface* constraints, |
| 281 bool remote) { | 281 bool remote) { |
| 282 RTC_DCHECK(worker_thread != NULL); | 282 RTC_DCHECK(worker_thread != NULL); |
| 283 RTC_DCHECK(capturer != NULL); | 283 RTC_DCHECK(capturer != NULL); |
| 284 rtc::scoped_refptr<VideoSource> source(new rtc::RefCountedObject<VideoSource>( | 284 rtc::scoped_refptr<VideoSource> source(new rtc::RefCountedObject<VideoSource>( |
| 285 worker_thread, capturer, remote)); | 285 worker_thread, capturer, remote)); |
| 286 source->Initialize(constraints); | 286 source->Initialize(constraints); |
| 287 return source; | 287 return source; |
| 288 } | 288 } |
| 289 | 289 |
| 290 rtc::scoped_refptr<VideoSource> VideoSource::Create( |
| 291 rtc::Thread* worker_thread, |
| 292 cricket::VideoCapturer* capturer, |
| 293 bool remote) { |
| 294 return Create(worker_thread, capturer, nullptr, remote); |
| 295 } |
| 296 |
| 290 VideoSource::VideoSource(rtc::Thread* worker_thread, | 297 VideoSource::VideoSource(rtc::Thread* worker_thread, |
| 291 cricket::VideoCapturer* capturer, | 298 cricket::VideoCapturer* capturer, |
| 292 bool remote) | 299 bool remote) |
| 293 : signaling_thread_(rtc::Thread::Current()), | 300 : signaling_thread_(rtc::Thread::Current()), |
| 294 worker_thread_(worker_thread), | 301 worker_thread_(worker_thread), |
| 295 video_capturer_(capturer), | 302 video_capturer_(capturer), |
| 296 started_(false), | 303 started_(false), |
| 297 state_(kInitializing), | 304 state_(kInitializing), |
| 298 remote_(remote) { | 305 remote_(remote) { |
| 299 video_capturer_->SignalStateChange.connect( | 306 video_capturer_->SignalStateChange.connect( |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 } | 432 } |
| 426 | 433 |
| 427 void VideoSource::SetState(SourceState new_state) { | 434 void VideoSource::SetState(SourceState new_state) { |
| 428 if (state_ != new_state) { | 435 if (state_ != new_state) { |
| 429 state_ = new_state; | 436 state_ = new_state; |
| 430 FireOnChanged(); | 437 FireOnChanged(); |
| 431 } | 438 } |
| 432 } | 439 } |
| 433 | 440 |
| 434 } // namespace webrtc | 441 } // namespace webrtc |
| OLD | NEW |