From 911a0de1bf83e3510ae60d531fa049fcb3ad0be0 Mon Sep 17 00:00:00 2001 From: David Staessens Date: Mon, 7 Dec 2020 14:16:51 +0900 Subject: [PATCH] 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 Tested-by: kokoro Tested-by: David Staessens Commit-Queue: David Staessens --- devices/src/virtio/video/encoder/mod.rs | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/devices/src/virtio/video/encoder/mod.rs b/devices/src/virtio/video/encoder/mod.rs index 29dcbd189d..9354f74a4d 100644 --- a/devices/src/virtio/video/encoder/mod.rs +++ b/devices/src/virtio/video/encoder/mod.rs @@ -1055,10 +1055,23 @@ impl EncoderDevice { }, 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));