Index: media/gpu/v4l2_image_processor.h |
diff --git a/media/gpu/v4l2_image_processor.h b/media/gpu/v4l2_image_processor.h |
index 337face0127547a47fd00281817a0a30b76a26d5..bbebe8d01670bc4d8dd791e1e89ab9f29c8364d1 100644 |
--- a/media/gpu/v4l2_image_processor.h |
+++ b/media/gpu/v4l2_image_processor.h |
@@ -41,6 +41,7 @@ class MEDIA_GPU_EXPORT V4L2ImageProcessor { |
bool Initialize(VideoPixelFormat input_format, |
VideoPixelFormat output_format, |
v4l2_memory input_memory_type, |
+ v4l2_memory output_memory_type, |
gfx::Size input_visible_size, |
gfx::Size input_allocated_size, |
gfx::Size output_visible_size, |
@@ -84,9 +85,13 @@ class MEDIA_GPU_EXPORT V4L2ImageProcessor { |
// Called by client to process |frame|. The resulting processed frame will be |
// stored in |output_buffer_index| output buffer and notified via |cb|. The |
// processor will drop all its references to |frame| after it finishes |
- // accessing it. |
- void Process(const scoped_refptr<VideoFrame>& frame, |
+ // accessing it. If |output_memory_type_| is V4L2_MEMORY_DMABUF, the caller |
+ // should pass non-empty |output_dmabuf_fds| and the processed frame will be |
+ // stored in those buffers. If the number of |output_dmabuf_fds| is not |
+ // expected, this function will return false. |
+ bool Process(const scoped_refptr<VideoFrame>& frame, |
int output_buffer_index, |
+ std::vector<base::ScopedFD> output_dmabuf_fds, |
const FrameReadyCB& cb); |
// Reset all processing frames. After this method returns, no more callbacks |
@@ -110,19 +115,26 @@ class MEDIA_GPU_EXPORT V4L2ImageProcessor { |
// Record for output buffers. |
struct OutputRecord { |
OutputRecord(); |
+ OutputRecord(OutputRecord&&) = default; |
~OutputRecord(); |
bool at_device; |
+ // The processed frame will be stored in these buffers if |
+ // |output_memory_type_| is V4L2_MEMORY_DMABUF |
+ std::vector<base::ScopedFD> dmabuf_fds; |
}; |
// Job record. Jobs are processed in a FIFO order. This is separate from |
// InputRecord, because an InputRecord may be returned before we dequeue |
// the corresponding output buffer. The processed frame will be stored in |
- // |output_buffer_index| output buffer. |
+ // |output_buffer_index| output buffer. If |output_memory_type_| is |
+ // V4L2_MEMORY_DMABUF, the processed frame will be stored in |
+ // |output_dmabuf_fds|. |
struct JobRecord { |
JobRecord(); |
~JobRecord(); |
scoped_refptr<VideoFrame> frame; |
int output_buffer_index; |
+ std::vector<base::ScopedFD> output_dmabuf_fds; |
FrameReadyCB ready_cb; |
}; |
@@ -164,6 +176,7 @@ class MEDIA_GPU_EXPORT V4L2ImageProcessor { |
VideoPixelFormat input_format_; |
VideoPixelFormat output_format_; |
v4l2_memory input_memory_type_; |
+ v4l2_memory output_memory_type_; |
uint32_t input_format_fourcc_; |
uint32_t output_format_fourcc_; |