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

Unified Diff: webrtc/media/base/videobroadcaster.h

Issue 1655793003: Make cricket::VideoCapturer implement VideoSourceInterface (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Added dummy capturerenderadapter.cc Created 4 years, 10 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/media/base/fakevideorenderer.h ('k') | webrtc/media/base/videobroadcaster.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/base/videobroadcaster.h
diff --git a/webrtc/media/base/videobroadcaster.h b/webrtc/media/base/videobroadcaster.h
new file mode 100644
index 0000000000000000000000000000000000000000..63c22730c7f1df7d7316a682dcf2b22990e8eb2d
--- /dev/null
+++ b/webrtc/media/base/videobroadcaster.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#ifndef WEBRTC_MEDIA_BASE_VIDEOBROADCASTER_H_
+#define WEBRTC_MEDIA_BASE_VIDEOBROADCASTER_H_
+
+#include <utility>
+#include <vector>
+
+#include "webrtc/base/thread_checker.h"
+#include "webrtc/media/base/videoframe.h"
+#include "webrtc/media/base/videosinkinterface.h"
+#include "webrtc/media/base/videosourceinterface.h"
+
+namespace rtc {
+
+class VideoBroadcaster : public VideoSourceInterface<cricket::VideoFrame>,
+ public VideoSinkInterface<cricket::VideoFrame> {
+ public:
+ VideoBroadcaster();
+ void AddOrUpdateSink(VideoSinkInterface<cricket::VideoFrame>* sink,
+ const VideoSinkWants& wants) override;
+ void RemoveSink(VideoSinkInterface<cricket::VideoFrame>* sink) override;
+
+ // Returns true if the next frame will be delivered to at least one sink.
+ bool frame_wanted() const;
+
+ // Returns VideoSinkWants a source is requested to fulfill. They are
+ // aggregated by all VideoSinkWants from all sinks.
+ VideoSinkWants wants() const;
+
+ void OnFrame(const cricket::VideoFrame& frame) override;
+
+ protected:
+ struct SinkPair {
+ SinkPair(VideoSinkInterface<cricket::VideoFrame>* sink,
+ VideoSinkWants wants)
+ : sink(sink), wants(wants) {}
+ VideoSinkInterface<cricket::VideoFrame>* sink;
+ VideoSinkWants wants;
+ };
+ SinkPair* FindSinkPair(const VideoSinkInterface<cricket::VideoFrame>* sink);
+
+ ThreadChecker thread_checker_;
+
+ VideoSinkWants current_wants_;
+
+ std::vector<SinkPair> sinks_;
+};
+
+} // namespace rtc
+
+#endif // WEBRTC_MEDIA_BASE_VIDEOBROADCASTER_H_
« no previous file with comments | « webrtc/media/base/fakevideorenderer.h ('k') | webrtc/media/base/videobroadcaster.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698