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

Unified Diff: media/gpu/v4l2_jpeg_decode_accelerator.h

Issue 2559423002: media/gpu: switch v4l2_jpeg_decode_accelerator to use multi-planar APIs (Closed)
Patch Set: remove PIXEL_FORMAT_I422 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: 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..6321b8f5a6aebf0fc0cbea71c4a74f5b7b38b499 100644
--- a/media/gpu/v4l2_jpeg_decode_accelerator.h
+++ b/media/gpu/v4l2_jpeg_decode_accelerator.h
@@ -42,12 +42,20 @@ class MEDIA_GPU_EXPORT V4L2JpegDecodeAccelerator
bool IsSupported() override;
private:
+ // Input pixel format is alwasy V4L2_PIX_FMT_JPEG.
+ static const uint32_t kInputPlanes = 1;
+ // Ouput buffer can have as many as three planes.
wuchengli 2016/12/15 09:18:25 It looks like the output is always three planes, n
jcliang 2016/12/15 14:55:47 Done. I was thinking there are 2-plane and 4-plan
+ static const uint32_t kOutputPlanes = 3;
+ // Maximum number of buffer planes we are able to handle.
+ static const uint32_t kMaxBufferPlanes = 3;
wuchengli 2016/12/15 09:18:25 We are hard-coding the number of planes to be alwa
jcliang 2016/12/15 14:55:47 Done.
+
// Record for input/output buffers.
struct BufferRecord {
BufferRecord();
~BufferRecord();
- void* address; // mmap() address.
- size_t length; // mmap() length.
+ void* address[kMaxBufferPlanes]; // mmap() address.
+ size_t length[kMaxBufferPlanes]; // mmap() length.
+ size_t num_planes; // Number of mapped planes.
// Set true during QBUF and DQBUF. |address| will be accessed by hardware.
bool at_device;
@@ -82,6 +90,11 @@ class MEDIA_GPU_EXPORT V4L2JpegDecodeAccelerator
void DestroyInputBuffers();
void DestroyOutputBuffers();
wuchengli 2016/12/15 09:18:25 Document this function. What's the output format?
jcliang 2016/12/15 14:55:47 Done.
+ bool CopyOutputImage(const uint32_t src_pixelformat,
+ const BufferRecord& src_output_record,
+ const gfx::Size& src_coded_size,
+ const scoped_refptr<VideoFrame>& dst_frame);
+
// Return the number of input/output buffers enqueued to the device.
size_t InputBufferQueuedCount();
size_t OutputBufferQueuedCount();
@@ -153,6 +166,8 @@ class MEDIA_GPU_EXPORT V4L2JpegDecodeAccelerator
std::queue<linked_ptr<JobRecord>> input_jobs_;
std::queue<linked_ptr<JobRecord>> running_jobs_;
+ // V4L2 buffer type of the input buffer.
+ v4l2_buf_type input_buf_type_;
// Input queue state.
bool input_streamon_;
// Mapping of int index to an input buffer record.
@@ -161,6 +176,8 @@ class MEDIA_GPU_EXPORT V4L2JpegDecodeAccelerator
// ordering.
std::vector<int> free_input_buffers_;
+ // V4L2 buffer type of the output buffer.
+ v4l2_buf_type output_buf_type_;
// Output queue state.
bool output_streamon_;
// Mapping of int index to an output buffer record.

Powered by Google App Engine
This is Rietveld 408576698