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

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: Addressed comments. 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
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..535a9fe1b3d7caf13c06c8508fc14e368464c365
--- /dev/null
+++ b/webrtc/media/base/videobroadcaster.h
@@ -0,0 +1,52 @@
+/*
+ * 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> {
pthatcher1 2016/02/08 20:59:39 "broadcast" is one word, so "Broadcaster", with a
perkj_webrtc 2016/02/09 13:23:57 sorry - I realized that on my way home yesterday..
+ public:
+ VideoBroadCaster();
+ void AddSink(VideoSinkInterface<cricket::VideoFrame>* sink) override;
+ void RemoveSink(VideoSinkInterface<cricket::VideoFrame>* sink) override;
+ void AddOrUpdateSink(VideoSinkInterface<cricket::VideoFrame>* sink,
+ const VideoSinkHints& hints) override;
+
+ // Returns true if the next frame will be delivered to at least one sink.
+ bool FrameWillBeDelivered() const;
pthatcher1 2016/02/08 20:59:39 How about calling this frame_wanted()?
perkj_webrtc 2016/02/09 13:23:57 Done.
+
+ // Returns the hints a source is requested to fulfill. They are aggregated
+ // by all hints from all sinks.
+ VideoSinkHints DerivedHints() const;
pthatcher1 2016/02/08 20:59:39 I'd prefer a name like AggregateSinkHints(), or be
perkj_webrtc 2016/02/09 13:23:57 Done.
+
+ void OnFrame(const cricket::VideoFrame& frame) override;
+
+ protected:
+ ThreadChecker thread_checker_;
+ std::pair<VideoSinkInterface<cricket::VideoFrame>*, VideoSinkHints>
+ current_hints_;
nisse-webrtc 2016/02/08 14:57:04 This makes me puzzled. Maybe simply don't understa
pthatcher1 2016/02/08 20:59:39 I was thinking the same thing.
perkj_webrtc 2016/02/09 13:23:57 I wanted to not actually do the aggregation of wan
+ using Sinks = std::vector<VideoSinkInterface<cricket::VideoFrame>*>;
+ Sinks sinks_;
+};
+
+} // namespace rtc
+
+#endif // WEBRTC_MEDIA_BASE_VIDEOBROADCASTER_H_

Powered by Google App Engine
This is Rietveld 408576698