Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(813)

Side by Side Diff: talk/app/webrtc/videosource.cc

Issue 1522903002: Add a 'remote' property to MediaSourceInterface. Also adding an implementation to the relevant sour… (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Address comments Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « talk/app/webrtc/videosource.h ('k') | talk/app/webrtc/videosource_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 RTC_DISALLOW_COPY_AND_ASSIGN(FrameInputWrapper); 324 RTC_DISALLOW_COPY_AND_ASSIGN(FrameInputWrapper);
325 }; 325 };
326 326
327 } // anonymous namespace 327 } // anonymous namespace
328 328
329 namespace webrtc { 329 namespace webrtc {
330 330
331 rtc::scoped_refptr<VideoSource> VideoSource::Create( 331 rtc::scoped_refptr<VideoSource> VideoSource::Create(
332 cricket::ChannelManager* channel_manager, 332 cricket::ChannelManager* channel_manager,
333 cricket::VideoCapturer* capturer, 333 cricket::VideoCapturer* capturer,
334 const webrtc::MediaConstraintsInterface* constraints) { 334 const webrtc::MediaConstraintsInterface* constraints,
335 bool remote) {
335 ASSERT(channel_manager != NULL); 336 ASSERT(channel_manager != NULL);
336 ASSERT(capturer != NULL); 337 ASSERT(capturer != NULL);
337 rtc::scoped_refptr<VideoSource> source( 338 rtc::scoped_refptr<VideoSource> source(new rtc::RefCountedObject<VideoSource>(
338 new rtc::RefCountedObject<VideoSource>(channel_manager, 339 channel_manager, capturer, remote));
339 capturer));
340 source->Initialize(constraints); 340 source->Initialize(constraints);
341 return source; 341 return source;
342 } 342 }
343 343
344 VideoSource::VideoSource(cricket::ChannelManager* channel_manager, 344 VideoSource::VideoSource(cricket::ChannelManager* channel_manager,
345 cricket::VideoCapturer* capturer) 345 cricket::VideoCapturer* capturer,
346 bool remote)
346 : channel_manager_(channel_manager), 347 : channel_manager_(channel_manager),
347 video_capturer_(capturer), 348 video_capturer_(capturer),
348 state_(kInitializing) { 349 state_(kInitializing),
350 remote_(remote) {
349 channel_manager_->SignalVideoCaptureStateChange.connect( 351 channel_manager_->SignalVideoCaptureStateChange.connect(
350 this, &VideoSource::OnStateChange); 352 this, &VideoSource::OnStateChange);
351 } 353 }
352 354
353 VideoSource::~VideoSource() { 355 VideoSource::~VideoSource() {
354 channel_manager_->StopVideoCapture(video_capturer_.get(), format_); 356 channel_manager_->StopVideoCapture(video_capturer_.get(), format_);
355 channel_manager_->SignalVideoCaptureStateChange.disconnect(this); 357 channel_manager_->SignalVideoCaptureStateChange.disconnect(this);
356 } 358 }
357 359
358 void VideoSource::Initialize( 360 void VideoSource::Initialize(
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 void VideoSource::SetState(SourceState new_state) { 466 void VideoSource::SetState(SourceState new_state) {
465 // TODO(hbos): Temporarily disabled VERIFY due to webrtc:4776. 467 // TODO(hbos): Temporarily disabled VERIFY due to webrtc:4776.
466 // if (VERIFY(state_ != new_state)) { 468 // if (VERIFY(state_ != new_state)) {
467 if (state_ != new_state) { 469 if (state_ != new_state) {
468 state_ = new_state; 470 state_ = new_state;
469 FireOnChanged(); 471 FireOnChanged();
470 } 472 }
471 } 473 }
472 474
473 } // namespace webrtc 475 } // namespace webrtc
OLDNEW
« no previous file with comments | « talk/app/webrtc/videosource.h ('k') | talk/app/webrtc/videosource_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698