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 240 matching lines...) Loading... |
251 | 251 |
252 return mandatory == 0; | 252 return mandatory == 0; |
253 } | 253 } |
254 | 254 |
255 } // anonymous namespace | 255 } // anonymous namespace |
256 | 256 |
257 namespace webrtc { | 257 namespace webrtc { |
258 | 258 |
259 rtc::scoped_refptr<VideoTrackSourceInterface> VideoCapturerTrackSource::Create( | 259 rtc::scoped_refptr<VideoTrackSourceInterface> VideoCapturerTrackSource::Create( |
260 rtc::Thread* worker_thread, | 260 rtc::Thread* worker_thread, |
261 cricket::VideoCapturer* capturer, | 261 std::unique_ptr<cricket::VideoCapturer> capturer, |
262 const webrtc::MediaConstraintsInterface* constraints, | 262 const webrtc::MediaConstraintsInterface* constraints, |
263 bool remote) { | 263 bool remote) { |
264 RTC_DCHECK(worker_thread != NULL); | 264 RTC_DCHECK(worker_thread != NULL); |
265 RTC_DCHECK(capturer != NULL); | 265 RTC_DCHECK(capturer != NULL); |
266 rtc::scoped_refptr<VideoCapturerTrackSource> source( | 266 rtc::scoped_refptr<VideoCapturerTrackSource> source( |
267 new rtc::RefCountedObject<VideoCapturerTrackSource>(worker_thread, | 267 new rtc::RefCountedObject<VideoCapturerTrackSource>( |
268 capturer, remote)); | 268 worker_thread, std::move(capturer), remote)); |
269 source->Initialize(constraints); | 269 source->Initialize(constraints); |
270 return source; | 270 return source; |
271 } | 271 } |
272 | 272 |
273 rtc::scoped_refptr<VideoTrackSourceInterface> VideoCapturerTrackSource::Create( | 273 rtc::scoped_refptr<VideoTrackSourceInterface> VideoCapturerTrackSource::Create( |
274 rtc::Thread* worker_thread, | 274 rtc::Thread* worker_thread, |
275 cricket::VideoCapturer* capturer, | 275 std::unique_ptr<cricket::VideoCapturer> capturer, |
276 bool remote) { | 276 bool remote) { |
277 RTC_DCHECK(worker_thread != NULL); | 277 RTC_DCHECK(worker_thread != NULL); |
278 RTC_DCHECK(capturer != NULL); | 278 RTC_DCHECK(capturer != NULL); |
279 rtc::scoped_refptr<VideoCapturerTrackSource> source( | 279 rtc::scoped_refptr<VideoCapturerTrackSource> source( |
280 new rtc::RefCountedObject<VideoCapturerTrackSource>(worker_thread, | 280 new rtc::RefCountedObject<VideoCapturerTrackSource>( |
281 capturer, remote)); | 281 worker_thread, std::move(capturer), remote)); |
282 source->Initialize(nullptr); | 282 source->Initialize(nullptr); |
283 return source; | 283 return source; |
284 } | 284 } |
285 | 285 |
286 VideoCapturerTrackSource::VideoCapturerTrackSource( | 286 VideoCapturerTrackSource::VideoCapturerTrackSource( |
287 rtc::Thread* worker_thread, | 287 rtc::Thread* worker_thread, |
288 cricket::VideoCapturer* capturer, | 288 std::unique_ptr<cricket::VideoCapturer> capturer, |
289 bool remote) | 289 bool remote) |
290 : VideoTrackSource(capturer, remote), | 290 : VideoTrackSource(capturer.get(), remote), |
291 signaling_thread_(rtc::Thread::Current()), | 291 signaling_thread_(rtc::Thread::Current()), |
292 worker_thread_(worker_thread), | 292 worker_thread_(worker_thread), |
293 video_capturer_(capturer), | 293 video_capturer_(std::move(capturer)), |
294 started_(false) { | 294 started_(false) { |
295 video_capturer_->SignalStateChange.connect( | 295 video_capturer_->SignalStateChange.connect( |
296 this, &VideoCapturerTrackSource::OnStateChange); | 296 this, &VideoCapturerTrackSource::OnStateChange); |
297 } | 297 } |
298 | 298 |
299 VideoCapturerTrackSource::~VideoCapturerTrackSource() { | 299 VideoCapturerTrackSource::~VideoCapturerTrackSource() { |
300 video_capturer_->SignalStateChange.disconnect(this); | 300 video_capturer_->SignalStateChange.disconnect(this); |
301 Stop(); | 301 Stop(); |
302 } | 302 } |
303 | 303 |
(...skipping 84 matching lines...) Loading... |
388 capture_state)); | 388 capture_state)); |
389 return; | 389 return; |
390 } | 390 } |
391 | 391 |
392 if (capturer == video_capturer_.get()) { | 392 if (capturer == video_capturer_.get()) { |
393 SetState(GetReadyState(capture_state)); | 393 SetState(GetReadyState(capture_state)); |
394 } | 394 } |
395 } | 395 } |
396 | 396 |
397 } // namespace webrtc | 397 } // namespace webrtc |
OLD | NEW |