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

Unified Diff: content/renderer/media/webrtc/webrtc_video_capturer_adapter.h

Issue 2456443002: Add callback to copy texture backed frames in WebRtcVideoFrameAdapter (Closed)
Patch Set: Created 4 years, 2 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: content/renderer/media/webrtc/webrtc_video_capturer_adapter.h
diff --git a/content/renderer/media/webrtc/webrtc_video_capturer_adapter.h b/content/renderer/media/webrtc/webrtc_video_capturer_adapter.h
index 033c2cdaaa661fc37d79a720dc371a583e77e839..c2cabb451fc84714e0803258db70b1b25a46bedc 100644
--- a/content/renderer/media/webrtc/webrtc_video_capturer_adapter.h
+++ b/content/renderer/media/webrtc/webrtc_video_capturer_adapter.h
@@ -13,13 +13,21 @@
#include "base/macros.h"
#include "base/threading/thread_checker.h"
#include "content/common/content_export.h"
+#include "content/renderer/media/webrtc/webrtc_video_frame_adapter.h"
#include "media/base/video_capture_types.h"
#include "media/base/video_frame.h"
#include "media/base/video_frame_pool.h"
+#include "media/renderers/skcanvas_video_renderer.h"
#include "third_party/webrtc/media/base/videocapturer.h"
+namespace base {
+class WaitableEvent;
+} // namespace base
+
namespace content {
+class ContextProviderCommandBuffer;
+
// WebRtcVideoCapturerAdapter implements a simple cricket::VideoCapturer that is
// used for VideoCapturing in libJingle and especially in PeerConnections.
// The class is created and destroyed on the main render thread.
@@ -51,6 +59,18 @@ class CONTENT_EXPORT WebRtcVideoCapturerAdapter
cricket::VideoFormat* best_format) override;
bool IsScreencast() const override;
+ void CopyTextureFrame(
+ const scoped_refptr<media::VideoFrame>& frame,
+ scoped_refptr<media::VideoFrame>* new_frame);
+ void CopyTextureFrameOnMainThread(
+ const scoped_refptr<media::VideoFrame>& frame,
+ scoped_refptr<media::VideoFrame>* new_frame,
+ base::WaitableEvent* waiter);
mcasas 2016/10/26 16:06:02 I see with worry the existence of |base::WaitableE
emircan 2016/10/27 00:37:56 I added comments explaining it. Unfortunately, I c
+ const scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
+ const scoped_refptr<ContextProviderCommandBuffer> provider_;
+ media::SkCanvasVideoRenderer canvas_video_renderer_;
+ WebRtcVideoFrameAdapter::CopyTextureFrameCallback copy_texture_callback_;
+
// |thread_checker_| is bound to the libjingle worker thread.
base::ThreadChecker thread_checker_;
@@ -59,6 +79,8 @@ class CONTENT_EXPORT WebRtcVideoCapturerAdapter
media::VideoFramePool scaled_frame_pool_;
+ base::WeakPtrFactory<WebRtcVideoCapturerAdapter> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(WebRtcVideoCapturerAdapter);
};

Powered by Google App Engine
This is Rietveld 408576698