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

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

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.cc
diff --git a/content/browser/renderer_host/media/video_frame_receiver_on_io_thread.cc b/content/browser/renderer_host/media/video_frame_receiver_on_io_thread.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a4a46c2e67e4af9c8b130959ce079501af8506c8
--- /dev/null
+++ b/content/browser/renderer_host/media/video_frame_receiver_on_io_thread.cc
@@ -0,0 +1,45 @@
+// 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.
+
+#include "content/browser/renderer_host/media/video_frame_receiver_on_io_thread.h"
+
+#include "content/public/browser/browser_thread.h"
+
+namespace content {
+
+VideoFrameReceiverOnIOThread::VideoFrameReceiverOnIOThread(
+ const base::WeakPtr<VideoFrameReceiver>& receiver)
+ : receiver_(receiver) {}
+
+VideoFrameReceiverOnIOThread::~VideoFrameReceiverOnIOThread() = default;
+
+void VideoFrameReceiverOnIOThread::OnIncomingCapturedVideoFrame(
+ std::unique_ptr<media::VideoCaptureDevice::Client::Buffer> buffer,
+ scoped_refptr<media::VideoFrame> frame) {
+ content::BrowserThread::PostTask(
+ content::BrowserThread::IO, FROM_HERE,
+ base::Bind(&VideoFrameReceiver::OnIncomingCapturedVideoFrame, receiver_,
+ base::Passed(&buffer), frame));
+}
+
+void VideoFrameReceiverOnIOThread::OnError() {
+ content::BrowserThread::PostTask(
+ content::BrowserThread::IO, FROM_HERE,
+ base::Bind(&VideoFrameReceiver::OnError, receiver_));
+}
+
+void VideoFrameReceiverOnIOThread::OnLog(const std::string& message) {
+ content::BrowserThread::PostTask(
+ content::BrowserThread::IO, FROM_HERE,
+ base::Bind(&VideoFrameReceiver::OnLog, receiver_, message));
+}
+
+void VideoFrameReceiverOnIOThread::OnBufferDestroyed(int buffer_id_to_drop) {
+ content::BrowserThread::PostTask(
+ content::BrowserThread::IO, FROM_HERE,
+ base::Bind(&VideoFrameReceiver::OnBufferDestroyed, receiver_,
+ buffer_id_to_drop));
+}
+
+} // namespace content
« no previous file with comments | « content/browser/renderer_host/media/video_frame_receiver_on_io_thread.h ('k') | media/capture/video/video_capture_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698