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

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

Issue 1655793003: Make cricket::VideoCapturer implement VideoSourceInterface (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Adding VideoSourceInterface and letting cricket::VideoCapturer implement it Created 4 years, 11 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/videosourceinterface.h
diff --git a/webrtc/media/base/videosourceinterface.h b/webrtc/media/base/videosourceinterface.h
new file mode 100644
index 0000000000000000000000000000000000000000..cae94ac6d873830162429f95dd8cd7e5604184ed
--- /dev/null
+++ b/webrtc/media/base/videosourceinterface.h
@@ -0,0 +1,46 @@
+/*
+ * 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 MEDIA_BASE_VIDEOSOURCEINTERFACE_H_
+#define MEDIA_BASE_VIDEOSOURCEINTERFACE_H_
+
+#include "webrtc/media/base/videosinkinterface.h"
+
+namespace rtc {
+
+template <typename VideoFrameT>
+class VideoSourceInterface {
+ public:
+ virtual void AddSink(VideoSinkInterface<VideoFrameT>* sink) = 0;
+ virtual void RemoveSink(VideoSinkInterface<VideoFrameT>* sink) = 0;
+
+protected:
+ virtual ~VideoSourceInterface() {};
+};
+
+template <typename VideoFrameT>
+class VideoSourceBase : public VideoSourceInterface<VideoFrameT> {
pthatcher 2016/02/01 18:40:54 Where is the impl of this?
perkj_webrtc 2016/02/02 16:24:00 Sorry - maybe I was unclear yesterday- the cl was
+ public:
+ void AddSink(VideoSinkInterface<VideoFrameT>* sink) override;
+ void RemoveSink(VideoSinkInterface<VideoFrameT>* sink) override;
+
+ protected:
+ virtual ~VideoSourceBase();
+
+ bool HasSinks() const { return !sinks_.empty(); }
+ void DeliverFrame(const VideoFrameT*);
pthatcher 2016/02/01 18:40:54 Can you call this DeliverFrameToSinks, or better,
nisse-webrtc 2016/02/02 09:52:30 I'm not entirely sure we should have a general mux
perkj_webrtc 2016/02/02 16:24:00 Done.
+
+ private:
+ VideoSinkCapabilities capabilities_;
pthatcher 2016/02/01 18:40:54 Is this a merged capabilities? Is it worth storin
perkj_webrtc 2016/02/02 16:24:00 First attempt I would just like this to handle the
+ std::vector<VideoSinkInterface<VideoFrameT>*> sinks_;
+};
+
+} // namespace rtc
+#endif // MEDIA_BASE_VIDEOSOURCEINTERFACE_H_
« webrtc/media/base/videosinkinterface.h ('K') | « webrtc/media/base/videosinkinterface.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698