| Index: media/gpu/v4l2_jpeg_decode_accelerator.h
|
| diff --git a/media/gpu/v4l2_jpeg_decode_accelerator.h b/media/gpu/v4l2_jpeg_decode_accelerator.h
|
| index b2824946b9a812bc15c0bc6d8d67071692024417..34ab7b0b99b002aff83afad7f41267aafb4e8b52 100644
|
| --- a/media/gpu/v4l2_jpeg_decode_accelerator.h
|
| +++ b/media/gpu/v4l2_jpeg_decode_accelerator.h
|
| @@ -42,12 +42,17 @@ class MEDIA_GPU_EXPORT V4L2JpegDecodeAccelerator
|
| bool IsSupported() override;
|
|
|
| private:
|
| + // Input pixel format (i.e. V4L2_PIX_FMT_JPEG) has only one physical plane.
|
| + static const uint32_t kMaxInputPlanes = 1;
|
| + // Ouput pixel format may have at most three physical planes.
|
| + static const uint32_t kMaxOutputPlanes = 3;
|
| +
|
| // Record for input/output buffers.
|
| struct BufferRecord {
|
| BufferRecord();
|
| ~BufferRecord();
|
| - void* address; // mmap() address.
|
| - size_t length; // mmap() length.
|
| + void* address[kMaxOutputPlanes]; // mmap() address.
|
| + size_t length[kMaxOutputPlanes]; // mmap() length.
|
|
|
| // Set true during QBUF and DQBUF. |address| will be accessed by hardware.
|
| bool at_device;
|
| @@ -82,6 +87,14 @@ class MEDIA_GPU_EXPORT V4L2JpegDecodeAccelerator
|
| void DestroyInputBuffers();
|
| void DestroyOutputBuffers();
|
|
|
| + // Convert |src_buffer| to I420 and copy the result to |dst_frame|.
|
| + // The function currently accepts the following format as |src_pixelformat|:
|
| + // - All splane formats that libyuv::ConvertToI420 can handle.
|
| + // - V4L2_YUV_420M
|
| + // - V4L2_YUV_422M
|
| + bool ConvertOutputImage(const BufferRecord& output_buffer,
|
| + const scoped_refptr<VideoFrame>& dst_frame);
|
| +
|
| // Return the number of input/output buffers enqueued to the device.
|
| size_t InputBufferQueuedCount();
|
| size_t OutputBufferQueuedCount();
|
| @@ -127,6 +140,9 @@ class MEDIA_GPU_EXPORT V4L2JpegDecodeAccelerator
|
| // Pixel format of output buffer.
|
| uint32_t output_buffer_pixelformat_;
|
|
|
| + // Number of physical planes the output buffers have.
|
| + uint32_t output_buffer_num_planes_;
|
| +
|
| // ChildThread's task runner.
|
| scoped_refptr<base::SingleThreadTaskRunner> child_task_runner_;
|
|
|
|
|