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

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

Powered by Google App Engine
This is Rietveld 408576698