| 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 7da95da8e75174d4440a68122547119bed32c8d0..2201fe1d7fef2022b06ca6df766b18a914764cec 100644
|
| --- a/content/browser/renderer_host/media/video_capture_device_client.h
|
| +++ b/content/browser/renderer_host/media/video_capture_device_client.h
|
| @@ -10,8 +10,11 @@
|
| #include "base/memory/weak_ptr.h"
|
| #include "content/common/content_export.h"
|
| #include "media/video/capture/video_capture_device.h"
|
| +#include "media/video/jpeg_decode_accelerator.h"
|
|
|
| namespace content {
|
| +class CapturedData;
|
| +class JpegDecodeData;
|
| class VideoCaptureBufferPool;
|
| class VideoCaptureController;
|
|
|
| @@ -20,12 +23,13 @@ class VideoCaptureController;
|
| // VideoCaptureController. 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
|
| -// often be called on some auxiliary thread depending on the platform and the
|
| -// device type; including, for example, the DirectShow thread on Windows, the
|
| -// v4l2_thread on Linux, and the UI thread for tab capture.
|
| +// Methods of this class may be called from any thread if not specified, and in
|
| +// practice will often be called on some auxiliary thread depending on the
|
| +// platform and the device type; including, for example, the DirectShow thread
|
| +// on Windows, the v4l2_thread on Linux, and the UI thread for tab capture.
|
| class CONTENT_EXPORT VideoCaptureDeviceClient
|
| - : public media::VideoCaptureDevice::Client {
|
| + : public media::VideoCaptureDevice::Client,
|
| + public media::JpegDecodeAccelerator::Client {
|
| public:
|
| VideoCaptureDeviceClient(
|
| const base::WeakPtr<VideoCaptureController>& controller,
|
| @@ -57,10 +61,24 @@ class CONTENT_EXPORT VideoCaptureDeviceClient
|
| void OnError(const std::string& reason) override;
|
| void OnLog(const std::string& message) override;
|
|
|
| + // JpegDecodeAccelerator::Client implementation.
|
| + // These will be called in IO thread.
|
| + virtual void VideoFrameReady(int32_t buffer_id) override;
|
| + virtual void NotifyError(int32_t buffer_id,
|
| + media::JpegDecodeAccelerator::Error error) override;
|
| +
|
| private:
|
| + bool InitializeJpegDecoder();
|
| + // TODO(kcwu): better name
|
| + void OnIncomingCapturedData2(const CapturedData& captured_data);
|
| +
|
| // The controller to which we post events.
|
| const base::WeakPtr<VideoCaptureController> controller_;
|
|
|
| + bool jpeg_failed_;
|
| + scoped_ptr<media::JpegDecodeAccelerator> jpeg_decoder_;
|
| + scoped_ptr<JpegDecodeData> jpeg_decode_data_;
|
| +
|
| // The pool of shared-memory buffers used for capturing.
|
| const scoped_refptr<VideoCaptureBufferPool> buffer_pool_;
|
|
|
|
|