Commit 229c7fe3 authored by Alexandre Courbot's avatar Alexandre Courbot Committed by Commit Bot

media/gpu/v4l2vd: acquire queues before using them

SetInputFormat() and SetOutputFormat() use the V4L2 queues. Make sure
they are acquired before calling these methods.

This bug slept in because I forgot to specify --use_vd to the unit test.

Bug: 1003223
Test: video_decode_accelerator_tests --use_vd passes on Kevin.

Change-Id: I3847c9ba947739e673a106a7d2d3139b1ec432b6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1844519
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: default avatarChih-Yu Huang <akahuang@chromium.org>
Auto-Submit: Alexandre Courbot <acourbot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#703220}
parent a156bcd7
......@@ -369,6 +369,16 @@ void V4L2SliceVideoDecoder::InitializeTask(const VideoDecoderConfig& config,
needs_bitstream_conversion_ = (config.codec() == kCodecH264);
pixel_aspect_ratio_ = config.GetPixelAspectRatio();
// Create Input/Output V4L2Queue
input_queue_ = device_->GetQueue(V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE);
output_queue_ = device_->GetQueue(V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE);
if (!input_queue_ || !output_queue_) {
VLOGF(1) << "Failed to create V4L2 queue.";
client_task_runner_->PostTask(FROM_HERE,
base::BindOnce(std::move(init_cb), false));
return;
}
// Setup input format.
if (!SetupInputFormat(input_format_fourcc)) {
VLOGF(1) << "Failed to setup input format.";
......@@ -385,15 +395,6 @@ void V4L2SliceVideoDecoder::InitializeTask(const VideoDecoderConfig& config,
return;
}
// Create Input/Output V4L2Queue
input_queue_ = device_->GetQueue(V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE);
output_queue_ = device_->GetQueue(V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE);
if (!input_queue_ || !output_queue_) {
VLOGF(1) << "Failed to create V4L2 queue.";
client_task_runner_->PostTask(FROM_HERE,
base::BindOnce(std::move(init_cb), false));
return;
}
if (input_queue_->AllocateBuffers(kNumInputBuffers, V4L2_MEMORY_MMAP) == 0) {
VLOGF(1) << "Failed to allocate input buffer.";
client_task_runner_->PostTask(FROM_HERE,
......
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