Commit 807336f9 authored by Alexandre Courbot's avatar Alexandre Courbot Committed by Commit Bot

media/gpu/v4l2: Do not call GetSupportedDecodeProfiles() with opened device

When checking for a V4L2 workaround, we first open the decoder device in
order to check its name, before querying its supported profiles using
GetSupportedDecodeProfiles().

However GetSupportedDecodeProfiles() DCHECKs that no device is currently
opened, since it needs to open one itself - and the device is still
opened at this time.

Fix this by reinitializing the device before calling
GetSupportedDecodeProfiles().

Bug: b:140222972
Test: assert of b:140222972 not triggered.
Change-Id: I6ec44f6f6113c4fc69965d6012128b61a27cb473
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1775887
Auto-Submit: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: default avatarHirokazu Honda <hiroh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#691953}
parent 1c169851
...@@ -76,6 +76,10 @@ SupportResolutionChecker::CreateIfNeeded(V4L2Device::Type device_type, ...@@ -76,6 +76,10 @@ SupportResolutionChecker::CreateIfNeeded(V4L2Device::Type device_type,
constexpr uint32_t supported_input_fourccs[] = { constexpr uint32_t supported_input_fourccs[] = {
V4L2_PIX_FMT_VP8, V4L2_PIX_FMT_VP8,
}; };
// Recreate the V4L2 device in order to close the opened decoder, since
// we are about to query the supported decode profiles.
device = V4L2Device::Create();
auto supported_profiles = device->GetSupportedDecodeProfiles( auto supported_profiles = device->GetSupportedDecodeProfiles(
base::size(supported_input_fourccs), supported_input_fourccs); base::size(supported_input_fourccs), supported_input_fourccs);
SupportedProfileMap supported_profile_map; SupportedProfileMap supported_profile_map;
......
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