Commit 9e2856b7 authored by Alexandre Courbot's avatar Alexandre Courbot Committed by Commit Bot

media/gpu/v4l2(s)vda: recreate image processor device on resolution change

When the resolution changes, we recreate the image processor device
entirely. However we used to do so while reusing the same V4L2Device
instance, which is not supported and triggers a DCHECK() with Debug
builds.

This behavior is wrong anyway since we might want to use another image
processor device with the new resolution.

This also seems to be effective in fixing bug 1029396.

BUG=chromium:1029396
TEST=video.DecodeAccel.h264_resolution_switch passes 100 times in a row
on Hana.
TEST=video.DecodeAccel.h264_resolution_switch passes on Hana without
triggering DCHECK().

Change-Id: Ib506d9f038810a0683b806f8385746dce16ecd56
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2002250
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Auto-Submit: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: default avatarHirokazu Honda <hiroh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#732259}
parent 0b2495a7
...@@ -577,6 +577,14 @@ bool V4L2SliceVideoDecodeAccelerator::CreateImageProcessor() { ...@@ -577,6 +577,14 @@ bool V4L2SliceVideoDecodeAccelerator::CreateImageProcessor() {
? ImageProcessor::OutputMode::ALLOCATE ? ImageProcessor::OutputMode::ALLOCATE
: ImageProcessor::OutputMode::IMPORT); : ImageProcessor::OutputMode::IMPORT);
// Start with a brand new image processor device, since the old one was
// already opened and attempting to open it again is not supported.
image_processor_device_ = V4L2Device::Create();
if (!image_processor_device_) {
VLOGF(1) << "Could not create a V4L2Device for image processor";
return false;
}
image_processor_ = v4l2_vda_helpers::CreateImageProcessor( image_processor_ = v4l2_vda_helpers::CreateImageProcessor(
*output_format_fourcc_, *gl_image_format_fourcc_, coded_size_, *output_format_fourcc_, *gl_image_format_fourcc_, coded_size_,
gl_image_size_, decoder_->GetVisibleRect().size(), gl_image_size_, decoder_->GetVisibleRect().size(),
......
...@@ -2405,6 +2405,14 @@ bool V4L2VideoDecodeAccelerator::CreateImageProcessor() { ...@@ -2405,6 +2405,14 @@ bool V4L2VideoDecodeAccelerator::CreateImageProcessor() {
? ImageProcessor::OutputMode::ALLOCATE ? ImageProcessor::OutputMode::ALLOCATE
: ImageProcessor::OutputMode::IMPORT); : ImageProcessor::OutputMode::IMPORT);
// Start with a brand new image processor device, since the old one was
// already opened and attempting to open it again is not supported.
image_processor_device_ = V4L2Device::Create();
if (!image_processor_device_) {
VLOGF(1) << "Could not create a V4L2Device for image processor";
return false;
}
image_processor_ = v4l2_vda_helpers::CreateImageProcessor( image_processor_ = v4l2_vda_helpers::CreateImageProcessor(
*output_format_fourcc_, *egl_image_format_fourcc_, coded_size_, *output_format_fourcc_, *egl_image_format_fourcc_, coded_size_,
egl_image_size_, visible_size_, output_buffer_map_.size(), egl_image_size_, visible_size_, output_buffer_map_.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