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

Unified Diff: webrtc/test/frame_generator.cc

Issue 2348533002: Reland Replace interface VideoCapturerInput with VideoSinkInterface. (Closed)
Patch Set: Fix rtp timestamp in quality test. Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/test/frame_generator.h ('k') | webrtc/test/frame_generator_capturer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/test/frame_generator.cc
diff --git a/webrtc/test/frame_generator.cc b/webrtc/test/frame_generator.cc
index ed7e95a12679d2abc36da2e56a4e194206c7d198..dbf39c4e096f8c64a9b1b7ab4e2bf65ea5816c97 100644
--- a/webrtc/test/frame_generator.cc
+++ b/webrtc/test/frame_generator.cc
@@ -239,6 +239,27 @@ class ScrollingImageFrameGenerator : public FrameGenerator {
} // namespace
+FrameForwarder::FrameForwarder() : sink_(nullptr) {}
+
+void FrameForwarder::IncomingCapturedFrame(const VideoFrame& video_frame) {
+ rtc::CritScope lock(&crit_);
+ if (sink_)
+ sink_->OnFrame(video_frame);
+}
+
+void FrameForwarder::AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink,
+ const rtc::VideoSinkWants& wants) {
+ rtc::CritScope lock(&crit_);
+ RTC_DCHECK(!sink_ || sink_ == sink);
+ sink_ = sink;
+}
+
+void FrameForwarder::RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) {
+ rtc::CritScope lock(&crit_);
+ RTC_DCHECK_EQ(sink, sink_);
+ sink_ = nullptr;
+}
+
FrameGenerator* FrameGenerator::CreateChromaGenerator(size_t width,
size_t height) {
return new ChromaGenerator(width, height);
« no previous file with comments | « webrtc/test/frame_generator.h ('k') | webrtc/test/frame_generator_capturer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698