From 4cdc9d3fa21088e6bc30bc16b493a42e253d3955 Mon Sep 17 00:00:00 2001 From: Linyu He Date: Thu, 15 Dec 2022 22:05:15 +0000 Subject: [PATCH] [Zuma 8k] Add 8k encoder profiles for P23 devices (3rd attempt) The 2nd attempt (ag/20294157) was reverted due to b/259732944. To avoid the bug, we explicitly define the "high" quality encoder as a 4k encoder. Note (1) below explains the reasons. 8k encoder specs: Codec: h264 bitRate: 80000000 (80M); source: b/241178681#comment3 Size: 7680x4320 (8K UHD) Frame rate: 30fps Notes: (1) Regarding b/259732944 (the bug caused by the 2nd attempt): If CamcorderProfile.QUALITY_HIGH isn't explicitly specified, the highest resolution available will be used. Therefore, when the 8k profile was added, apps requesting QUALITY_HIGH would ask HAL to perform 8k recording. This created the following issues: (a) As 8k support in HAL isn't ready, existing tests using QUALITY_HIGH will fail (such as CTS, PTS, FATP, etc.). (b) 3rd-party apps currently using QUALITY_HIGH will get 8k, which might not be their intention. So we chose to keep QUALITY_HIGH at 4k, which was the highest resolution on P22 devices. Detailed discussions are in b/259599407. ---------------- (2) Regarding the "quality" attribute in EncoderProfile: It must match what's defined in MediaProfiles::sCamcorderQualityNameMap (see frameworks/av/media/libmedia/MediaProfiles.cpp). ---------------- (3) Regarding the camera IDs: The camera IDs in media_profiles_{device_name}.xml correspond to the IDs inside vector ModelSpecificDataControllerBase::visible_camera_ids_. The vector is populated in lyric/silo/hardware/devices/{device_name}/data/model_specific_data_controller.cc According to the documentation of "visible_camera_ids_", "the first ID for each facing will be used as the default camera ID". As visible_camera_ids_[0] is always the first (default) ID for the rear camera, and only the rear camera supports 8k, we add 8k encoder profiles for camera 0 in media_profiles. The explanation above isn't obvious. You'll need to read model_specific_data_controller.cc to understand it. ---------------- (4) Regarding tests: We can't test the 8k encoder since we haven't brought up the 8k support in ISP. We can use CTS, PTS, and EECoexer to test this CL for existing use cases. Note that RecordingTest#testBasicRecording currently fails at TOT due to a different reason. For this CL, we only need to make sure no 8k stream is requested by observing logs with the "GCH_HalUtils" tag. Bug: 232811715 Bug: 262423942 Test: build & boot Android Test: atest RecordingTest#testBasicRecording Test: adb shell /data/sysval/scripts/eecoexer/eecoex.sh -s CAM,22,0,5,true,HIGH Test: manually testing GCA video recording Change-Id: Ie6c054e641810da9c231f3839961cbe8fcc16fdc --- media_profiles_husky.xml | 34 ++++++++++++++++++++++++++++++---- media_profiles_ripcurrent.xml | 34 ++++++++++++++++++++++++++++++---- media_profiles_shiba.xml | 34 ++++++++++++++++++++++++++++++---- 3 files changed, 90 insertions(+), 12 deletions(-) diff --git a/media_profiles_husky.xml b/media_profiles_husky.xml index aa947e5..43c09b2 100644 --- a/media_profiles_husky.xml +++ b/media_profiles_husky.xml @@ -79,6 +79,32 @@ + + + + + +