• Hirokazu Honda's avatar
    media/gpu/vaapiWrapper: Enforce supported resolutions in CreateContext() · 72c52cf1
    Hirokazu Honda authored
    VaapiWrapper reports the supported min and max resolutions by
    VaapiWrapper::GetSupportedDec/EncodeProfiles(). They might be
    different from the min and max resolutions supported by a
    hardware and driver for some reason. For instance, we set
    the minimum encoder resolution to 321x241 and the webrtc encoder
    enforces the resolution per kWebRtcUseMinMaxVEADimensions
    (e.g. crbug.com/1008491).
    Clients of VaapiWrapper were expected to respect the supported
    resolutions, but could still request values outside of that
    range, thus using hardware codecs unintentionally. This CL
    enforces the supported range in VaapiWrapper::CreateContext().
    This also introduces a feature,
    VaapiEnforceVideoMinMaxResolution, to disable this check for
    testing.
    
    Bug: b:171041334
    Test: video.Play.vp9_hw on atlas and cyan
    Test: video_decode_accelerator_tests on atlas and cyan
    Test: video_encode_accelerator_tests on atlas and cyan
    Test: appr.tc/?vsc=h264&vrc=h264&debug=loopback on atlas and cyan
    Change-Id: Ide589ee4d1456553e400a271cb8b3383b472b4d4
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2549161
    Commit-Queue: Hirokazu Honda <hiroh@chromium.org>
    Auto-Submit: Hirokazu Honda <hiroh@chromium.org>
    Reviewed-by: default avatarAndres Calderon Jaramillo <andrescj@chromium.org>
    Reviewed-by: default avatarMiguel Casas <mcasas@chromium.org>
    Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#832609}
    72c52cf1
media_switches.cc 39.1 KB