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

media/gpu/v4l2svda: stay in awaiting buffers state until first buffer is imported

The current state flow results in the decoder being in decoding state at
the moment the first buffer is imported, if import mode is used. This
triggers a DCHECK if an image processor is in use.

Fix this by delaying the switch to idle state and call to
ProcessPendingEventsIfNeeded() to after the first buffer is imported.

Bug: b:139901663
Test: video_decode_accelerator_tests passing on Kevin and Kukui.
Test: tast video.SeekSwitch* passes on Kevin.

Change-Id: I934f144a46d78318bffc039f24051f95fea60f4d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1837325Reviewed-by: default avatarHirokazu Honda <hiroh@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#703571}
parent cc4ed9fe
......@@ -1442,12 +1442,6 @@ void V4L2SliceVideoDecodeAccelerator::AssignPictureBuffersTask(
NOTIFY_ERROR(PLATFORM_FAILURE);
return;
}
// Put us in kIdle to allow further event processing.
// ProcessPendingEventsIfNeeded() will put us back into kDecoding after all
// other pending events are processed successfully.
state_ = kIdle;
ProcessPendingEventsIfNeeded();
}
void V4L2SliceVideoDecodeAccelerator::CreateGLImageFor(
......@@ -1613,6 +1607,18 @@ void V4L2SliceVideoDecodeAccelerator::ImportBufferForPictureTask(
}
DCHECK_EQ(gl_image_size_.width(), adjusted_coded_width);
// Put us in kIdle to allow further event processing.
// ProcessPendingEventsIfNeeded() will put us back into kDecoding after all
// other pending events are processed successfully.
if (state_ == kAwaitingPictureBuffers) {
state_ = kIdle;
decoder_thread_.task_runner()->PostTask(
FROM_HERE,
base::BindOnce(
&V4L2SliceVideoDecodeAccelerator::ProcessPendingEventsIfNeeded,
base::Unretained(this)));
}
// If in import mode, build output_frame from the passed DMABUF FDs.
if (output_mode_ == Config::OutputMode::IMPORT) {
DCHECK_EQ(gl_image_planes_count_, passed_dmabuf_fds.size());
......
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