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

Side by Side Diff: webrtc/api/videotracksource.cc

Issue 1765423005: Change VideoRtpReceiver to create remote VideoTrack and VideoTrackSource. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixed up the comments. Created 4 years, 9 months 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 | « webrtc/api/videotracksource.h ('k') | webrtc/media/base/videobroadcaster.h » ('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 * Copyright 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2016 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 14 matching lines...) Expand all
25 state_(kInitializing), 25 state_(kInitializing),
26 remote_(remote) {} 26 remote_(remote) {}
27 27
28 void VideoTrackSource::SetState(SourceState new_state) { 28 void VideoTrackSource::SetState(SourceState new_state) {
29 if (state_ != new_state) { 29 if (state_ != new_state) {
30 state_ = new_state; 30 state_ = new_state;
31 FireOnChanged(); 31 FireOnChanged();
32 } 32 }
33 } 33 }
34 34
35 void VideoTrackSource::OnSourceDestroyed() {
36 source_ = nullptr;
37 }
38
35 void VideoTrackSource::AddOrUpdateSink( 39 void VideoTrackSource::AddOrUpdateSink(
36 rtc::VideoSinkInterface<cricket::VideoFrame>* sink, 40 rtc::VideoSinkInterface<cricket::VideoFrame>* sink,
37 const rtc::VideoSinkWants& wants) { 41 const rtc::VideoSinkWants& wants) {
42 if (!source_) {
43 return;
44 }
38 worker_thread_->Invoke<void>(rtc::Bind( 45 worker_thread_->Invoke<void>(rtc::Bind(
39 &rtc::VideoSourceInterface<cricket::VideoFrame>::AddOrUpdateSink, source_, 46 &rtc::VideoSourceInterface<cricket::VideoFrame>::AddOrUpdateSink, source_,
40 sink, wants)); 47 sink, wants));
41 } 48 }
42 49
43 void VideoTrackSource::RemoveSink( 50 void VideoTrackSource::RemoveSink(
44 rtc::VideoSinkInterface<cricket::VideoFrame>* sink) { 51 rtc::VideoSinkInterface<cricket::VideoFrame>* sink) {
52 if (!source_) {
53 return;
54 }
45 worker_thread_->Invoke<void>( 55 worker_thread_->Invoke<void>(
46 rtc::Bind(&rtc::VideoSourceInterface<cricket::VideoFrame>::RemoveSink, 56 rtc::Bind(&rtc::VideoSourceInterface<cricket::VideoFrame>::RemoveSink,
47 source_, sink)); 57 source_, sink));
48 } 58 }
49 59
50 } // namespace webrtc 60 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/api/videotracksource.h ('k') | webrtc/media/base/videobroadcaster.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698