beast: Deccommonize media codecs
authorNolen Johnson <johnsonnolen@gmail.com>
Fri, 24 May 2024 16:31:03 +0000 (12:31 -0400)
committerNolen Johnson <johnsonnolen@gmail.com>
Fri, 24 May 2024 16:31:34 +0000 (16:31 +0000)
Change-Id: I9e6898801afe1781836b99f2adc680f2ffd7482e
(cherry picked from commit a9b1b57cfd46f91b3dab4645d57dd16e75874b30)

device.mk
media/media_codecs_performance.xml [new file with mode: 0644]
media/media_profiles_V1_0.xml [new file with mode: 0644]

index 529c9eac9c4630b0f2c68cb87b052373c861d0cd..3e8a05ccba66f29bce4a99f81e4df5cc5be66507 100644 (file)
--- a/device.mk
+++ b/device.mk
@@ -26,9 +26,13 @@ PRODUCT_PACKAGES += \
     8822bs
 
 ## Media
+PRODUCT_COPY_FILES += \
+    $(LOCAL_PATH)/media/media_profiles_V1_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_profiles_V1_0.xml
+
 ifneq ($(PRODUCT_USE_SW_OMX),true)
 PRODUCT_COPY_FILES += \
-    $(LOCAL_PATH)/media/media_codecs.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs.xml
+    $(LOCAL_PATH)/media/media_codecs.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs.xml \
+    $(LOCAL_PATH)/media/media_codecs_performance.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_performance.xml
 endif
 
 ## Platform
diff --git a/media/media_codecs_performance.xml b/media/media_codecs_performance.xml
new file mode 100644 (file)
index 0000000..dbf161f
--- /dev/null
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!-- Copyright 2015 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<MediaCodecs>
+    <Encoders>
+        <MediaCodec name="OMX.amlogic.video.encoder.avc" type="video/avc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="415-415" />
+            <Limit name="measured-frame-rate-720x480" range="133-133" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.h263.encoder" type="video/3gpp" update="true">
+            <Limit name="measured-frame-rate-176x144" range="267-267" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.mpeg4.encoder" type="video/mp4v-es" update="true">
+            <Limit name="measured-frame-rate-176x144" range="223-223" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.vp8.encoder" type="video/x-vnd.on2.vp8" update="true">
+            <Limit name="measured-frame-rate-320x180" range="120-120" />
+            <Limit name="measured-frame-rate-640x360" range="37-37" />
+        </MediaCodec>
+    </Encoders>
+    <Decoders>
+        <MediaCodec name="OMX.amlogic.h263.decoder.awesome" type="video/3gpp" update="true">
+            <Limit name="measured-frame-rate-176x144" range="197-197" />
+            <Limit name="measured-frame-rate-352x288" range="195-195" />
+        </MediaCodec>
+        <MediaCodec name="OMX.amlogic.avc.decoder.awesome" type="video/avc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="835-835" />
+            <Limit name="measured-frame-rate-720x480" range="580-580" />
+            <Limit name="measured-frame-rate-1280x720" range="290-290" />
+            <Limit name="measured-frame-rate-1920x1080" range="135-135" />
+        </MediaCodec>
+        <MediaCodec name="OMX.amlogic.vp9.decoder.awesome" type="video/x-vnd.on2.vp9" update="true">
+            <Limit name="measured-frame-rate-320x180" range="944-944" />
+            <Limit name="measured-frame-rate-640x360" range="816-816" />
+            <Limit name="measured-frame-rate-1280x720" range="290-290" />
+            <Limit name="measured-frame-rate-1920x1080" range="133-133" />
+            <Limit name="measured-frame-rate-3840x2160" range="62-62" />
+        </MediaCodec>
+        <MediaCodec name="OMX.amlogic.hevc.decoder.awesome" type="video/hevc" update="true">
+            <Limit name="measured-frame-rate-352x288" range="458-458" />
+            <Limit name="measured-frame-rate-640x360" range="500-500" />
+            <Limit name="measured-frame-rate-720x480" range="516-516" />
+            <Limit name="measured-frame-rate-1280x720" range="294-294" />
+            <Limit name="measured-frame-rate-1920x1080" range="132-132" />
+            <Limit name="measured-frame-rate-3840x2160" range="66-66" />
+        </MediaCodec>
+        <MediaCodec name="OMX.amlogic.mpeg4.decoder.awesome" type="video/mp4v-es" update="true">
+            <Limit name="measured-frame-rate-176x144" range="228-228" />
+            <Limit name="measured-frame-rate-480x360" range="209-209" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.h263.decoder" type="video/3gpp" update="true">
+            <Limit name="measured-frame-rate-176x144" range="451-451" />
+            <Limit name="measured-frame-rate-352x288" range="795-795" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.h264.decoder" type="video/avc" update="true">
+            <Limit name="measured-frame-rate-320x240" range="290-290" />
+            <Limit name="measured-frame-rate-720x480" range="115-115" />
+            <Limit name="measured-frame-rate-1280x720" range="43-43" />
+            <Limit name="measured-frame-rate-1920x1080" range="18-18" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.hevc.decoder" type="video/hevc" update="true">
+            <Limit name="measured-frame-rate-352x288" range="247-247" />
+            <Limit name="measured-frame-rate-640x360" range="151-151" />
+            <Limit name="measured-frame-rate-720x480" range="137-137" />
+            <Limit name="measured-frame-rate-1280x720" range="62-62" />
+            <Limit name="measured-frame-rate-1920x1080" range="35-35" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.mpeg4.decoder" type="video/mp4v-es" update="true">
+            <Limit name="measured-frame-rate-176x144" range="594-594" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.vp8.decoder" type="video/x-vnd.on2.vp8" update="true">
+            <Limit name="measured-frame-rate-320x180" range="676-676" />
+            <Limit name="measured-frame-rate-640x360" range="130-130" />
+            <Limit name="measured-frame-rate-1280x720" range="26-26" />
+            <Limit name="measured-frame-rate-1920x1080" range="11-11" />
+        </MediaCodec>
+        <MediaCodec name="OMX.google.vp9.decoder" type="video/x-vnd.on2.vp9" update="true">
+            <Limit name="measured-frame-rate-320x180" range="265-265" />
+            <Limit name="measured-frame-rate-640x360" range="115-115" />
+            <Limit name="measured-frame-rate-1280x720" range="49-49" />
+        </MediaCodec>
+    </Decoders>
+</MediaCodecs>
diff --git a/media/media_profiles_V1_0.xml b/media/media_profiles_V1_0.xml
new file mode 100644 (file)
index 0000000..16e8eb8
--- /dev/null
@@ -0,0 +1,229 @@
+<MediaSettings>
+
+    <!-- Each camcorder profile defines a set of predefined configuration parameters -->
+    <CamcorderProfiles cameraId="0" startOffsetMs="50">
+
+        <EncoderProfile quality="720p" fileFormat="3gp" duration="60">
+            <Video codec="h264"
+            bitRate="6000000"
+            width="1280"
+            height="720"
+            frameRate="30" />
+
+            <Audio codec="amrwb"
+            bitRate="23050"
+            sampleRate="16000"
+            channels="1" />
+        </EncoderProfile>
+
+        <EncoderProfile quality="timelapse720p" fileFormat="3gp" duration="60">
+            <Video codec="h264"
+            bitRate="6000000"
+            width="1280"
+            height="720"
+            frameRate="30" />
+
+            <Audio codec="amrwb"
+            bitRate="23050"
+            sampleRate="16000"
+            channels="1" />
+        </EncoderProfile>
+
+        <EncoderProfile quality="480p" fileFormat="3gp" duration="60">
+            <Video codec="h264"
+            bitRate="6000000"
+            width="640"
+            height="480"
+            frameRate="30" />
+
+            <Audio codec="amrwb"
+            bitRate="23050"
+            sampleRate="16000"
+            channels="1" />
+        </EncoderProfile>
+
+        <EncoderProfile quality="timelapse480p" fileFormat="3gp" duration="60">
+            <Video codec="h264"
+            bitRate="6000000"
+            width="640"
+            height="480"
+            frameRate="30" />
+
+            <Audio codec="amrwb"
+            bitRate="23050"
+            sampleRate="16000"
+            channels="1" />
+        </EncoderProfile>
+
+        <EncoderProfile quality="cif" fileFormat="3gp" duration="30">
+            <Video codec="h264"
+            bitRate="1440000"
+            width="352"
+            height="288"
+            frameRate="30" />
+
+            <Audio codec="amrwb"
+            bitRate="23050"
+            sampleRate="16000"
+            channels="1" />
+        </EncoderProfile>
+
+        <EncoderProfile quality="timelapsecif" fileFormat="3gp" duration="30">
+            <Video codec="h264"
+            bitRate="1440000"
+            width="352"
+            height="288"
+            frameRate="30" />
+
+            <Audio codec="amrwb"
+            bitRate="23050"
+            sampleRate="16000"
+            channels="1" />
+        </EncoderProfile>
+
+        <ImageEncoding quality="70" />
+        <ImageEncoding quality="80" />
+        <ImageEncoding quality="90" />
+
+    </CamcorderProfiles>
+
+    <CamcorderProfiles cameraId="1" startOffsetMs="50">
+
+        <EncoderProfile quality="720p" fileFormat="3gp" duration="60">
+            <Video codec="h264"
+            bitRate="6000000"
+            width="1280"
+            height="720"
+            frameRate="30" />
+
+            <Audio codec="amrwb"
+            bitRate="23050"
+            sampleRate="16000"
+            channels="1" />
+        </EncoderProfile>
+
+        <EncoderProfile quality="timelapse720p" fileFormat="3gp" duration="60">
+            <Video codec="h264"
+            bitRate="6000000"
+            width="1280"
+            height="720"
+            frameRate="30" />
+
+            <Audio codec="amrwb"
+            bitRate="23050"
+            sampleRate="16000"
+            channels="1" />
+        </EncoderProfile>
+
+        <EncoderProfile quality="480p" fileFormat="3gp" duration="60">
+            <Video codec="h264"
+            bitRate="6000000"
+            width="640"
+            height="480"
+            frameRate="30" />
+
+            <Audio codec="amrwb"
+            bitRate="23050"
+            sampleRate="16000"
+            channels="1" />
+        </EncoderProfile>
+
+        <EncoderProfile quality="timelapse480p" fileFormat="3gp" duration="60">
+            <Video codec="h264"
+            bitRate="6000000"
+            width="640"
+            height="480"
+            frameRate="30" />
+
+            <Audio codec="amrwb"
+            bitRate="23050"
+            sampleRate="16000"
+            channels="1" />
+        </EncoderProfile>
+
+        <EncoderProfile quality="cif" fileFormat="3gp" duration="30">
+            <Video codec="h264"
+            bitRate="1440000"
+            width="352"
+            height="288"
+            frameRate="30" />
+
+            <Audio codec="amrwb"
+            bitRate="23050"
+            sampleRate="16000"
+            channels="1" />
+        </EncoderProfile>
+
+        <EncoderProfile quality="timelapsecif" fileFormat="3gp" duration="30">
+            <Video codec="h264"
+            bitRate="1440000"
+            width="352"
+            height="288"
+            frameRate="30" />
+
+            <Audio codec="amrwb"
+            bitRate="23050"
+            sampleRate="16000"
+            channels="1" />
+        </EncoderProfile>
+
+        <ImageEncoding quality="70" />
+        <ImageEncoding quality="80" />
+        <ImageEncoding quality="90" />
+
+    </CamcorderProfiles>
+
+    <EncoderOutputFileFormat name="3gp" />
+    <EncoderOutputFileFormat name="mp4" />
+
+    <VideoDecoderCap name="wmv" enabled="true" />
+    <AudioDecoderCap name="wma" enabled="true" />
+
+    <VideoEncoderCap name="h263" enabled="true"
+        minBitRate="192000" maxBitRate="420000"
+        minFrameWidth="176" maxFrameWidth="352"
+        minFrameHeight="144" maxFrameHeight="288"
+        minFrameRate="1" maxFrameRate="20" />
+
+    <VideoEncoderCap name="h264" enabled="true"
+        minBitRate="192000" maxBitRate="6000000"
+        minFrameWidth="176" maxFrameWidth="1280"
+        minFrameHeight="144" maxFrameHeight="720"
+        minFrameRate="5" maxFrameRate="30" />
+
+    <VideoEncoderCap name="m4v" enabled="true"
+        minBitRate="192000" maxBitRate="1440000"
+        minFrameWidth="176" maxFrameWidth="640"
+        minFrameHeight="144" maxFrameHeight="480"
+        minFrameRate="1" maxFrameRate="15" />
+
+    <AudioEncoderCap name="amrwb" enabled="true"
+        minBitRate="6600" maxBitRate="23050"
+        minSampleRate="16000" maxSampleRate="16000"
+        minChannels="1" maxChannels="1" />
+
+    <AudioEncoderCap name="aac" enabled="true"
+        minBitRate="758" maxBitRate="288000"
+        minSampleRate="8000" maxSampleRate="48000"
+        minChannels="1" maxChannels="1" />
+
+    <AudioEncoderCap name="heaac" enabled="true"
+        minBitRate="8000" maxBitRate="64000"
+        minSampleRate="16000" maxSampleRate="48000"
+        minChannels="1" maxChannels="1" />
+
+    <AudioEncoderCap name="aaceld" enabled="true"
+        minBitRate="16000" maxBitRate="192000"
+        minSampleRate="16000" maxSampleRate="48000"
+        minChannels="1" maxChannels="1" />
+
+    <AudioEncoderCap name="amrwb" enabled="true"
+        minBitRate="6600" maxBitRate="23050"
+        minSampleRate="16000" maxSampleRate="16000"
+        minChannels="1" maxChannels="1" />
+
+    <AudioEncoderCap name="amrnb" enabled="true"
+        minBitRate="4750" maxBitRate="12200"
+        minSampleRate="8000" maxSampleRate="8000"
+        minChannels="1" maxChannels="1" />
+</MediaSettings>