Commit 869850a1 authored by Chih-Yu Huang's avatar Chih-Yu Huang Committed by Commit Bot

media/gpu/v4l2vea: Enqueue V4L2 output buffers after using them.

In CL:1824303, we changed the flow of using V4L2 output buffers. At
that CL, we forgot to enqueue V4L2 output buffers after we copy the
content to bitstream buffers and free them.
This CL fixes this issue by calling Enqueue() after that.

BUG=chromium:1015257
TEST=tast run $(DUT) video.EncodeAccelPerfH264360PI420 on elm

Change-Id: Iaa80779982c0c234ed9100095c9bb4b5b954288a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1871150Reviewed-by: default avatarHirokazu Honda <hiroh@chromium.org>
Reviewed-by: default avatarAlexandre Courbot <acourbot@chromium.org>
Commit-Queue: Chih-Yu Huang <akahuang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#707715}
parent 6df587ae
......@@ -1005,7 +1005,7 @@ void V4L2VideoEncodeAccelerator::PumpBitstreamBuffers() {
if (bitstream_buffer_pool_.empty()) {
DVLOGF(4) << "No free bitstream buffer, skip.";
output_buffer_queue_.push_front(std::move(output_buf));
return;
break;
}
auto buffer_ref = std::move(bitstream_buffer_pool_.back());
......@@ -1044,6 +1044,13 @@ void V4L2VideoEncodeAccelerator::PumpBitstreamBuffers() {
IOCTL_OR_ERROR_RETURN(VIDIOC_ENCODER_CMD, &cmd);
}
}
// We may free some V4L2 output buffers above. Enqueue them if needed.
if (output_queue_->FreeBuffersCount() > 0) {
encoder_thread_.task_runner()->PostTask(
FROM_HERE, base::BindOnce(&V4L2VideoEncodeAccelerator::Enqueue,
base::Unretained(this)));
}
}
bool V4L2VideoEncodeAccelerator::EnqueueInputRecord() {
......
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