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_ |