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

Unified Diff: content/browser/renderer_host/media/video_frame_receiver_on_io_thread.h

Issue 2551193002: [Mojo Video Capture] Decouple VCController from VCBufferPool and VCDeviceClient (Closed)
Patch Set: Added TODO comment Created 4 years 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/browser/renderer_host/media/video_frame_receiver_on_io_thread.h
diff --git a/content/browser/renderer_host/media/video_frame_receiver_on_io_thread.h b/content/browser/renderer_host/media/video_frame_receiver_on_io_thread.h
new file mode 100644
index 0000000000000000000000000000000000000000..9925dd11e5d54c5ebc38ceed5afefdbb1d9131a0
--- /dev/null
+++ b/content/browser/renderer_host/media/video_frame_receiver_on_io_thread.h
@@ -0,0 +1,37 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_FRAME_RECEIVER_ON_IO_THREAD_H_
+#define CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_FRAME_RECEIVER_ON_IO_THREAD_H_
+
+#include "content/common/content_export.h"
+#include "media/capture/video/video_frame_receiver.h"
+
+namespace content {
+
+// Decorator for media::VideoFrameReceiver that forwards all incoming calls
+// to the Browser IO thread.
+// TODO(chfremer): Change this to VideoFrameReceiverOnTaskRunner and have the
+// target task runner be passed into the constructor. See crbug.com/674190.
+class CONTENT_EXPORT VideoFrameReceiverOnIOThread
+ : public media::VideoFrameReceiver {
+ public:
+ explicit VideoFrameReceiverOnIOThread(
+ const base::WeakPtr<VideoFrameReceiver>& receiver);
+ ~VideoFrameReceiverOnIOThread() override;
+
+ void OnIncomingCapturedVideoFrame(
+ std::unique_ptr<media::VideoCaptureDevice::Client::Buffer> buffer,
+ scoped_refptr<media::VideoFrame> frame) override;
+ void OnError() override;
+ void OnLog(const std::string& message) override;
+ void OnBufferDestroyed(int buffer_id_to_drop) override;
+
+ private:
+ base::WeakPtr<VideoFrameReceiver> receiver_;
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_FRAME_RECEIVER_ON_IO_THREAD_H_

Powered by Google App Engine
This is Rietveld 408576698