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

Unified Diff: webrtc/test/frame_generator_capturer.cc

Issue 2304363002: Let ViEEncoder express resolution requests as Sinkwants (Closed)
Patch Set: Rebased. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/test/frame_generator_capturer.h ('k') | webrtc/video/encoder_rtcp_feedback_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/test/frame_generator_capturer.cc
diff --git a/webrtc/test/frame_generator_capturer.cc b/webrtc/test/frame_generator_capturer.cc
index d80154a8de591f305b0286aa21b187e2bc6f2bd1..65be9562c58a100339cd18693f55c00458d09654 100644
--- a/webrtc/test/frame_generator_capturer.cc
+++ b/webrtc/test/frame_generator_capturer.cc
@@ -59,6 +59,7 @@ FrameGeneratorCapturer::FrameGeneratorCapturer(Clock* clock,
: clock_(clock),
sending_(false),
sink_(nullptr),
+ sink_wants_observer_(nullptr),
tick_(EventTimerWrapper::Create()),
thread_(FrameGeneratorCapturer::Run, this, "FrameGeneratorCapturer"),
frame_generator_(frame_generator),
@@ -129,12 +130,20 @@ void FrameGeneratorCapturer::ChangeResolution(size_t width, size_t height) {
frame_generator_->ChangeResolution(width, height);
}
+void FrameGeneratorCapturer::SetSinkWantsObserver(SinkWantsObserver* observer) {
+ rtc::CritScope cs(&lock_);
+ RTC_DCHECK(!sink_wants_observer_);
+ sink_wants_observer_ = observer;
+}
+
void FrameGeneratorCapturer::AddOrUpdateSink(
rtc::VideoSinkInterface<VideoFrame>* sink,
const rtc::VideoSinkWants& wants) {
rtc::CritScope cs(&lock_);
- RTC_CHECK(!sink_);
+ RTC_CHECK(!sink_ || sink_ == sink);
sink_ = sink;
+ if (sink_wants_observer_)
+ sink_wants_observer_->OnSinkWantsChanged(sink, wants);
}
void FrameGeneratorCapturer::RemoveSink(
« no previous file with comments | « webrtc/test/frame_generator_capturer.h ('k') | webrtc/video/encoder_rtcp_feedback_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698