[go: nahoru, domu]

media/gpu/AVD: Notify profile change by kConfigChange event

AcceleratedVideoDecoder notifies a resolution change, but not a profile change
while parsing a bitstream. Some hardware video decoders (e.g. decoder using
VA-API) may need to reconfigure with the new profile. AcceleratedVideoDecoder
needs to inform the client the profile change.

From this CL, AcceleratedVideoDecoder returns kConfigChange on Decode()
if it detects a profile change or resolution change. This is reasonable because
* a profile can vary in IDR frame (H264) or key frame (VP8, VP9, AV1), which
a resolution may change at that time, and
* a new surface needs to be allocated by the profile change, for example, vp9
profile 2 (10bit), h264 high 10 profile (10bit) and av1 profile 2 (12bit). (1*)

This is the first step to handle the profile change. This CL changes
AcceleratedVideoDecodeAccelerator, and handle profile changes in Videodecoder/
VideoDecodeAccelerator using V4L2-API.

(1*) Note that we need to allocate new surfaces even though a profile is
unchanged in av1, because bit depth is 8 and 10 bit in av1 profile main.

Bug: 1022246
Test: video.DecodeAccel(VD).h264_profile_change (crrev.com/c/1924217) on kevin, eve and grunt
Change-Id: I3b9956624162146cd6242073993d41ad94e45032
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1923986
Commit-Queue: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Chih-Yu Huang <akahuang@chromium.org>
Reviewed-by: Ted Meyer <tmathmeyer@chromium.org>
Reviewed-by: Frank Liberato <liberato@chromium.org>
Cr-Commit-Position: refs/heads/master@{#718076}
20 files changed