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

media/gpu/v4l2vd: add missing checks and logs when queuing buffers

The queue statements on input buffers were not checked, which could lead
to errors going unnoticed and only being noticed later. Similarly an
error when queueing an output buffer should result in an error message.

BUG=None
TEST=video.DecodeAccel.h264 passes on Trogdor.

Change-Id: Ib96af994c34dadf63c827f0284a8c8a581c016b1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2440327
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: default avatarFritz Koenig <frkoenig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#813626}
parent 4d4c3a72
......@@ -213,7 +213,10 @@ void V4L2StatefulVideoDecoderBackend::DoDecodeWork() {
}
// The V4L2 input buffer contains a decodable entity, queue it.
std::move(*current_input_buffer_).QueueMMap();
if (!std::move(*current_input_buffer_).QueueMMap()) {
LOG(ERROR) << "Error while queuing input buffer!";
client_->OnBackendError();
}
current_input_buffer_.reset();
// If we can still progress on a decode request, do it.
......@@ -297,8 +300,10 @@ void V4L2StatefulVideoDecoderBackend::EnqueueOutputBuffers() {
if (no_buffer)
break;
if (!ret)
if (!ret) {
LOG(ERROR) << "Error while queueing output buffer!";
client_->OnBackendError();
}
}
DVLOGF(3) << output_queue_->QueuedBuffersCount() << "/"
......@@ -428,7 +433,10 @@ bool V4L2StatefulVideoDecoderBackend::InitiateFlush(
// Submit any pending input buffer at the time of flush.
if (current_input_buffer_) {
std::move(*current_input_buffer_).QueueMMap();
if (!std::move(*current_input_buffer_).QueueMMap()) {
LOG(ERROR) << "Error while queuing input buffer!";
client_->OnBackendError();
}
current_input_buffer_.reset();
}
......
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