crosvm: Expand the list of supported encode levels.

Currently only H.264 level 1 is reported to the virto encoder when the
supported H.264 levels are queried. This CL expands the list to contain
all levels up to 5.1 which are supported by most devices, as the VEA
interface currently has no way to query the maximum supported H.264
level.

BUG=b:174967472
TEST=android.media.cts.MediaRecorderTest#testProfileAvcBaselineLevel1

Change-Id: I960f9176fa00180da6f71bcdad558da06e8247c1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2574583
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Tested-by: David Staessens <dstaessens@chromium.org>
Commit-Queue: David Staessens <dstaessens@chromium.org>
This commit is contained in:
David Staessens 2020-12-07 14:16:51 +09:00 committed by Commit Bot
parent f16084de9e
commit 911a0de1bf

View file

@ -1055,10 +1055,23 @@ impl<T: Encoder> EncoderDevice<T> {
},
QueryCtrlType::Level(format) => {
match format {
Format::H264 => {
// TODO(alexlau): Figure out valid range of values.
QueryCtrlResponse::Level(vec![Level::H264_1_0])
}
Format::H264 => QueryCtrlResponse::Level(vec![
Level::H264_1_0,
Level::H264_1_1,
Level::H264_1_2,
Level::H264_1_3,
Level::H264_2_0,
Level::H264_2_1,
Level::H264_2_2,
Level::H264_3_0,
Level::H264_3_1,
Level::H264_3_2,
Level::H264_4_0,
Level::H264_4_1,
Level::H264_4_2,
Level::H264_5_0,
Level::H264_5_1,
]),
_ => {
// Levels are only supported for H264.
return Err(VideoError::UnsupportedControl(CtrlType::Level));