Commit bc8d313f authored by Alexandre Courbot's avatar Alexandre Courbot Committed by Commit Bot

media/gpu/v4l2ip: partial convert to V4L2Queue

Convert what we can of the V4L2IP to use V4L2Queue, which helps removing
a bit of code.

The queueing of CAPTURE buffers is still not managed by V4L2Queue. This is
because IP currently picks an output buffer from the index passed by
its client, which the V4L2Queue interface does not allow. This can be
fixed once the V4L2VDA does not depend on the V4L2IP using a given
buffer index to process a given frame. In the meantime, this still makes
the code a bit less verbose.

BUG=792790
TEST=Checked that VDA passed on Hana and VEA on Peach

Change-Id: I7538f4df496c1d435ac70695e27fb8e0df6d42a6
Reviewed-on: https://chromium-review.googlesource.com/c/1170708
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: default avatarHirokazu Honda <hiroh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#629146}
parent 6a5a37f2
This diff is collapsed.
...@@ -75,15 +75,6 @@ class MEDIA_GPU_EXPORT V4L2ImageProcessor : public ImageProcessor { ...@@ -75,15 +75,6 @@ class MEDIA_GPU_EXPORT V4L2ImageProcessor : public ImageProcessor {
ErrorCB error_cb); ErrorCB error_cb);
private: private:
// Record for input buffers.
struct InputRecord {
InputRecord();
InputRecord(const V4L2ImageProcessor::InputRecord&);
~InputRecord();
scoped_refptr<VideoFrame> frame;
bool at_device;
};
// Record for output buffers. // Record for output buffers.
struct OutputRecord { struct OutputRecord {
OutputRecord(); OutputRecord();
...@@ -189,20 +180,12 @@ class MEDIA_GPU_EXPORT V4L2ImageProcessor : public ImageProcessor { ...@@ -189,20 +180,12 @@ class MEDIA_GPU_EXPORT V4L2ImageProcessor : public ImageProcessor {
// All the below members are to be accessed from device_thread_ only // All the below members are to be accessed from device_thread_ only
// (if it's running). // (if it's running).
base::queue<std::unique_ptr<JobRecord>> input_queue_; base::queue<std::unique_ptr<JobRecord>> input_job_queue_;
base::queue<std::unique_ptr<JobRecord>> running_jobs_; base::queue<std::unique_ptr<JobRecord>> running_jobs_;
// Input queue state. scoped_refptr<V4L2Queue> input_queue_;
bool input_streamon_; scoped_refptr<V4L2Queue> output_queue_;
// Number of input buffers enqueued to the device.
int input_buffer_queued_count_;
// Input buffers ready to use; LIFO since we don't care about ordering.
std::vector<int> free_input_buffers_;
// Mapping of int index to an input buffer record.
std::vector<InputRecord> input_buffer_map_;
// Output queue state.
bool output_streamon_;
// Number of output buffers enqueued to the device. // Number of output buffers enqueued to the device.
int output_buffer_queued_count_; int output_buffer_queued_count_;
// Mapping of int index to an output buffer record. // Mapping of int index to an output buffer record.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment