Index: content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.h |
diff --git a/content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.h b/content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.h |
index c1541ec7d2b6cc8db91dff3b264962c710bf3e7f..9367df232b6a9a3c52db25a354eec9029f4bce71 100644 |
--- a/content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.h |
+++ b/content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.h |
@@ -31,17 +31,7 @@ class VideoFrame; |
namespace content { |
-// Adapter to GpuJpegDecodeAccelerator for VideoCaptureDevice::Client. It takes |
-// care of GpuJpegDecodeAccelerator creation, shared memory, and threading |
-// issues. |
-// |
-// All public methods except JpegDecodeAccelerator::Client ones should be called |
-// on the same thread. JpegDecodeAccelerator::Client methods should be called on |
-// the IO thread. |
-class CONTENT_EXPORT VideoCaptureGpuJpegDecoder |
- : public media::JpegDecodeAccelerator::Client, |
- public base::NonThreadSafe, |
- public base::SupportsWeakPtr<VideoCaptureGpuJpegDecoder> { |
+class CONTENT_EXPORT VideoCaptureJpegDecoder { |
public: |
// Enumeration of decoder status. The enumeration is published for clients to |
// decide the behavior according to STATUS. |
@@ -52,31 +42,59 @@ class CONTENT_EXPORT VideoCaptureGpuJpegDecoder |
// decode error. |
}; |
- typedef base::Callback<void( |
+ using DecodeDoneCB = base::Callback<void( |
std::unique_ptr<media::VideoCaptureDevice::Client::Buffer>, |
- const scoped_refptr<media::VideoFrame>&)> |
- DecodeDoneCB; |
+ const scoped_refptr<media::VideoFrame>&)>; |
- // |decode_done_cb| is called on the IO thread when decode succeed. This can |
- // be on any thread. |decode_done_cb| is never called after |
- // VideoCaptureGpuJpegDecoder is destroyed. |
- explicit VideoCaptureGpuJpegDecoder(const DecodeDoneCB& decode_done_cb); |
- ~VideoCaptureGpuJpegDecoder() override; |
+ virtual ~VideoCaptureJpegDecoder() {} |
// Creates and intializes decoder asynchronously. |
- void Initialize(); |
+ virtual void Initialize() = 0; |
// Returns initialization status. |
- STATUS GetStatus() const; |
+ virtual STATUS GetStatus() const = 0; |
// Decodes a JPEG picture. |
+ virtual void DecodeCapturedData( |
+ const uint8_t* data, |
+ size_t in_buffer_size, |
+ const media::VideoCaptureFormat& frame_format, |
+ base::TimeTicks reference_time, |
+ base::TimeDelta timestamp, |
+ std::unique_ptr<media::VideoCaptureDevice::Client::Buffer> |
+ out_buffer) = 0; |
+}; |
+ |
+// Adapter to GpuJpegDecodeAccelerator for VideoCaptureDevice::Client. It takes |
+// care of GpuJpegDecodeAccelerator creation, shared memory, and threading |
+// issues. |
+// |
+// All public methods except JpegDecodeAccelerator::Client ones should be called |
+// on the same thread. JpegDecodeAccelerator::Client methods should be called on |
+// the IO thread. |
+class CONTENT_EXPORT VideoCaptureGpuJpegDecoder |
+ : public VideoCaptureJpegDecoder, |
+ public media::JpegDecodeAccelerator::Client, |
+ public base::NonThreadSafe, |
+ public base::SupportsWeakPtr<VideoCaptureGpuJpegDecoder> { |
+ public: |
+ // |decode_done_cb| is called on the IO thread when decode succeed. This can |
+ // be on any thread. |decode_done_cb| is never called after |
+ // VideoCaptureGpuJpegDecoder is destroyed. |
+ explicit VideoCaptureGpuJpegDecoder(const DecodeDoneCB& decode_done_cb); |
+ ~VideoCaptureGpuJpegDecoder() override; |
+ |
+ // Implementation of VideoCaptureJpegDecoder: |
+ void Initialize() override; |
+ STATUS GetStatus() const override; |
void DecodeCapturedData( |
const uint8_t* data, |
size_t in_buffer_size, |
const media::VideoCaptureFormat& frame_format, |
base::TimeTicks reference_time, |
base::TimeDelta timestamp, |
- std::unique_ptr<media::VideoCaptureDevice::Client::Buffer> out_buffer); |
+ std::unique_ptr<media::VideoCaptureDevice::Client::Buffer> out_buffer) |
+ override; |
// JpegDecodeAccelerator::Client implementation. |
// These will be called on IO thread. |