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

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

Issue 2308533003: Break tight coupling of VideoCaptureDeviceClient to renderer_host (Closed)
Patch Set: mcasas' comments plus rebase Created 4 years, 3 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/browser/renderer_host/media/video_capture_device_client.h
diff --git a/content/browser/renderer_host/media/video_capture_device_client.h b/content/browser/renderer_host/media/video_capture_device_client.h
index c5447ca18e74eed9969270fb657a72e2aefd87f6..8bc493110f57e63cf3cc8c5f4d16413c8974b8b5 100644
--- a/content/browser/renderer_host/media/video_capture_device_client.h
+++ b/content/browser/renderer_host/media/video_capture_device_client.h
@@ -17,13 +17,14 @@
#include "media/capture/video/video_capture_device.h"
namespace content {
-class VideoCaptureBufferPool;
-class VideoCaptureController;
-class VideoCaptureGpuJpegDecoder;
+class ProducerVideoCaptureBufferPool;
+class VideoFrameReceiver;
+class VideoCaptureJpegDecoderFactory;
+class VideoCaptureJpegDecoder;
-// Receives events from the VideoCaptureDevice and posts them to a |controller_|
+// Receives events from the VideoCaptureDevice and posts them to a |receiver_|
// on the IO thread. An instance of this class may safely outlive its target
-// VideoCaptureController. This is a shallow class meant to convert incoming
+// VideoFrameReceiver. This is a shallow class meant to convert incoming
// frames and holds no significant state.
//
// Methods of this class may be called from any thread, and in practice will
@@ -40,8 +41,10 @@ class CONTENT_EXPORT VideoCaptureDeviceClient
public base::SupportsWeakPtr<VideoCaptureDeviceClient> {
public:
VideoCaptureDeviceClient(
- const base::WeakPtr<VideoCaptureController>& controller,
- const scoped_refptr<VideoCaptureBufferPool>& buffer_pool);
+ std::unique_ptr<VideoFrameReceiver> receiver,
+ const scoped_refptr<ProducerVideoCaptureBufferPool>& buffer_pool,
+ std::unique_ptr<VideoCaptureJpegDecoderFactory> jpeg_decoder_factory,
+ const base::Closure& check_thread_closure);
~VideoCaptureDeviceClient() override;
// VideoCaptureDevice::Client implementation.
@@ -91,17 +94,17 @@ class CONTENT_EXPORT VideoCaptureDeviceClient
uint8_t** u_plane_data,
uint8_t** v_plane_data);
- // The controller to which we post events.
- const base::WeakPtr<VideoCaptureController> controller_;
+ // The receiver to which we post events.
+ std::unique_ptr<VideoFrameReceiver> receiver_;
emircan 2016/09/08 19:57:56 const
chfremer 2016/09/09 00:55:38 Done.
- // Hardware JPEG decoder.
- std::unique_ptr<VideoCaptureGpuJpegDecoder> external_jpeg_decoder_;
+ const std::unique_ptr<VideoCaptureJpegDecoderFactory> jpeg_decoder_factory_;
+ std::unique_ptr<VideoCaptureJpegDecoder> external_jpeg_decoder_;
// Whether |external_jpeg_decoder_| has been initialized.
bool external_jpeg_decoder_initialized_;
// The pool of shared-memory buffers used for capturing.
- const scoped_refptr<VideoCaptureBufferPool> buffer_pool_;
+ const scoped_refptr<ProducerVideoCaptureBufferPool> buffer_pool_;
#if DCHECK_IS_ON()
// Counter used to track the number of times consecutive capture buffers are

Powered by Google App Engine
This is Rietveld 408576698