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

Side by Side Diff: webrtc/test/vcm_capturer.cc

Issue 2470393002: Allow webrtc::test::VcmCapturer to be updated with its current sink. (Closed)
Patch Set: Created 4 years, 1 month 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 | « no previous file | no next file » | 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 (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 } 71 }
72 72
73 void VcmCapturer::Stop() { 73 void VcmCapturer::Stop() {
74 rtc::CritScope lock(&crit_); 74 rtc::CritScope lock(&crit_);
75 started_ = false; 75 started_ = false;
76 } 76 }
77 77
78 void VcmCapturer::AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink, 78 void VcmCapturer::AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink,
79 const rtc::VideoSinkWants& wants) { 79 const rtc::VideoSinkWants& wants) {
80 rtc::CritScope lock(&crit_); 80 rtc::CritScope lock(&crit_);
81 RTC_CHECK(!sink_); 81 RTC_CHECK(!sink_ || sink_ == sink);
82 sink_ = sink; 82 sink_ = sink;
83 } 83 }
84 84
85 void VcmCapturer::RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) { 85 void VcmCapturer::RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) {
86 rtc::CritScope lock(&crit_); 86 rtc::CritScope lock(&crit_);
87 RTC_CHECK(sink_ == sink); 87 RTC_CHECK(sink_ == sink);
88 sink_ = nullptr; 88 sink_ = nullptr;
89 } 89 }
90 90
91 void VcmCapturer::Destroy() { 91 void VcmCapturer::Destroy() {
(...skipping 12 matching lines...) Expand all
104 const VideoFrame& frame) { 104 const VideoFrame& frame) {
105 rtc::CritScope lock(&crit_); 105 rtc::CritScope lock(&crit_);
106 if (started_ && sink_) 106 if (started_ && sink_)
107 sink_->OnFrame(frame); 107 sink_->OnFrame(frame);
108 } 108 }
109 109
110 void VcmCapturer::OnCaptureDelayChanged(const int32_t id, const int32_t delay) { 110 void VcmCapturer::OnCaptureDelayChanged(const int32_t id, const int32_t delay) {
111 } 111 }
112 } // test 112 } // test
113 } // webrtc 113 } // webrtc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698