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..5ee92604dfc45e762425cf1f28472bb3c6a46a2c |
--- /dev/null |
+++ b/webrtc/media/base/videosourceinterface.h |
@@ -0,0 +1,45 @@ |
+/* |
+ * 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_VIDEOSOURCEINTERFACE_H_ |
+#define WEBRTC_MEDIA_BASE_VIDEOSOURCEINTERFACE_H_ |
+ |
+#include "webrtc/media/base/videosinkinterface.h" |
+#include "webrtc/base/callback.h" |
+ |
+namespace rtc { |
+ |
+struct VideoSinkHints { |
pthatcher1
2016/02/08 20:59:40
This could use a comment explaining what it is and
perkj_webrtc
2016/02/09 13:23:57
Done.
|
+ bool operator==(const VideoSinkHints& rh) const { |
+ return can_apply_rotation == rh.can_apply_rotation; |
+ } |
+ bool operator!=(const VideoSinkHints& rh) const { return !operator==(rh); } |
+ |
+ // Tells the source whether the sink can handle rotation. By default, the |
+ // rotation is applied by the source. |
+ bool can_apply_rotation = false; |
+}; |
+ |
+template <typename VideoFrameT> |
+class VideoSourceInterface { |
+ public: |
+ virtual void AddSink(VideoSinkInterface<VideoFrameT>* sink) = 0; |
nisse-webrtc
2016/02/08 14:57:04
I don't quite understand the need for both AddSink
pthatcher1
2016/02/08 20:59:40
Originally, I thought that would be annoying to th
perkj_webrtc
2016/02/09 13:23:57
Done.
|
+ // RemoveSink must guarantee that at the time the method returns, |
+ // there is no current and no future calls to VideoSinkInterface::OnFrame. |
+ virtual void RemoveSink(VideoSinkInterface<VideoFrameT>* sink) = 0; |
+ virtual void AddOrUpdateSink(VideoSinkInterface<VideoFrameT>* sink, |
+ const VideoSinkHints& hints) = 0; |
+ |
+ protected: |
+ virtual ~VideoSourceInterface() {} |
+}; |
+ |
+} // namespace rtc |
+#endif // WEBRTC_MEDIA_BASE_VIDEOSOURCEINTERFACE_H_ |