1<?xml version="1.0" encoding="utf-8"?> 2<!-- Copyright (C) 2012-2020 The Linux Foundation. All rights reserved. 3 Not a contribution. 4 Copyright (C) 2012-2013 The Android Open Source Project 5 6 Licensed under the Apache License, Version 2.0 (the "License"); 7 you may not use this file except in compliance with the License. 8 You may obtain a copy of the License at 9 10 http://www.apache.org/licenses/LICENSE-2.0 11 12 Unless required by applicable law or agreed to in writing, software 13 distributed under the License is distributed on an "AS IS" BASIS, 14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 See the License for the specific language governing permissions and 16 limitations under the License. 17--> 18 19<!-- 20<!DOCTYPE MediaCodecs [ 21<!ELEMENT Include EMPTY> 22<!ATTLIST Include href CDATA #REQUIRED> 23<!ELEMENT MediaCodecs (Decoders|Encoders|Include)*> 24<!ELEMENT Decoders (MediaCodec|Include)*> 25<!ELEMENT Encoders (MediaCodec|Include)*> 26<!ELEMENT MediaCodec (Type|Quirk|Include)*> 27<!ATTLIST MediaCodec name CDATA #REQUIRED> 28<!ATTLIST MediaCodec type CDATA> 29<!ELEMENT Type EMPTY> 30<!ATTLIST Type name CDATA #REQUIRED> 31<!ELEMENT Quirk EMPTY> 32<!ATTLIST Quirk name CDATA #REQUIRED> 33]> 34 35There's a simple and a complex syntax to declare the availability of a 36media codec: 37 38A codec that properly follows the OpenMax spec and therefore doesn't have any 39quirks and that only supports a single content type can be declared like so: 40 41 <MediaCodec name="OMX.foo.bar" type="something/interesting" /> 42 43If a codec has quirks OR supports multiple content types, the following syntax 44can be used: 45 46 <MediaCodec name="OMX.foo.bar" > 47 <Type name="something/interesting" /> 48 <Type name="something/else" /> 49 ... 50 <Quirk name="requires-allocate-on-input-ports" /> 51 <Quirk name="requires-allocate-on-output-ports" /> 52 <Quirk name="output-buffers-are-unreadable" /> 53 </MediaCodec> 54 55Only the three quirks included above are recognized at this point: 56 57"requires-allocate-on-input-ports" 58 must be advertised if the component does not properly support specification 59 of input buffers using the OMX_UseBuffer(...) API but instead requires 60 OMX_AllocateBuffer to be used. 61 62"requires-allocate-on-output-ports" 63 must be advertised if the component does not properly support specification 64 of output buffers using the OMX_UseBuffer(...) API but instead requires 65 OMX_AllocateBuffer to be used. 66 67"output-buffers-are-unreadable" 68 must be advertised if the emitted output buffers of a decoder component 69 are not readable, i.e. use a custom format even though abusing one of 70 the official OMX colorspace constants. 71 Clients of such decoders will not be able to access the decoded data, 72 naturally making the component much less useful. The only use for 73 a component with this quirk is to render the output to the screen. 74 Audio decoders MUST NOT advertise this quirk. 75 Video decoders that advertise this quirk must be accompanied by a 76 corresponding color space converter for thumbnail extraction, 77 matching surfaceflinger support that can render the custom format to 78 a texture and possibly other code, so just DON'T USE THIS QUIRK. 79 80 81--> 82<!-- 83 Non-Secure decoder capabilities 84 (MB is defined as 16x16) 85 86 _____________________________________________________ 87 | Codec | W H fps Mbps MB/s | 88 |_____________|_______________________________________| 89 | h264 | 3840 2176 30 100 979200 | 90 | | 4096 2176 24 100 | 91 | hevc | 3840 2176 30 100 979200 | 92 | | 4096 2176 24 100 | 93 | mpeg4-sw | 1920 1088 30 40 244800 | 94 | vp9 | 3840 2176 30 100 979200 | 95 | | 4096 2176 24 100 | 96 | h263-sw | 864 480 30 16 48600 | 97 | mpeg2 | 1920 1088 30 40 244800 | 98 |_____________|_______________________________________| 99 100 Secure decoder capabilities 101 (MB is defined as 16x16) 102 103 _________________________________________________ 104 | Codec | W H fps Mbps MB/s | 105 |__________|_____________________________________| 106 | h264 | 3840 2176 30 40 979200 | 107 | | 4096 2176 24 40 | 108 | vp9 | 3840 2176 30 40 979200 | 109 | | 4096 2176 24 40 | 110 | hevc | 3840 2176 30 40 979200 | 111 | | 4096 2176 24 40 | 112 | mpeg2 | 1920 1088 30 40 244800 | 113 |__________|_____________________________________| 114 115 116 Non-Secure encoder capabilities (Secure not supported) 117 (MB is defined as 16x16) 118 119 _________________________________________________ 120 | Codec | W H fps Mbps MB/s | 121 |__________|_____________________________________| 122 | h264 | 3840 2176 30 100 979200 | 123 | | 4096 2176 24 100 | 124 | hevc | 3840 2176 30 100 979200 | 125 | | 4096 2176 24 100 | 126 | mpeg4-sw | 864 480 30 8 48600 | 127 | h263-sw | 864 480 30 2 48600 | 128 |__________|_____________________________________| 129--> 130 131<MediaCodecs> 132 <Include href="media_codecs_google_audio.xml" /> 133 <Include href="media_codecs_google_telephony.xml" /> 134 <Settings> 135 <Setting name="max-video-encoder-input-buffers" value="11" /> 136 </Settings> 137 <Encoders> 138 <!-- Video Hardware --> 139 <MediaCodec name="OMX.qcom.video.encoder.avc" type="video/avc" > 140 <Quirk name="requires-allocate-on-input-ports" /> 141 <Quirk name="requires-allocate-on-output-ports" /> 142 <Quirk name="requires-loaded-to-idle-after-allocation" /> 143 <Limit name="size" min="128x128" max="4096x2176" /> 144 <Limit name="alignment" value="2x2" /> 145 <Limit name="block-size" value="16x16" /> 146 <Limit name="blocks-per-second" min="64" max="979200" /> 147 <Limit name="bitrate" range="1-100000000" /> 148 <Limit name="frame-rate" range="1-240" /> 149 <Limit name="performance-point-4096x2304" value="24" /> 150 <Limit name="performance-point-3840x2160" value="30" /> 151 <Limit name="performance-point-1920x1080" value="120" /> 152 <Limit name="performance-point-1280x720" value="240" /> 153 <Limit name="concurrent-instances" max="16" /> 154 </MediaCodec> 155 <MediaCodec name="OMX.qcom.video.encoder.hevc" type="video/hevc" > 156 <Quirk name="requires-allocate-on-input-ports" /> 157 <Quirk name="requires-allocate-on-output-ports" /> 158 <Quirk name="requires-loaded-to-idle-after-allocation" /> 159 <Limit name="size" min="128x128" max="4096x2176" /> 160 <Limit name="alignment" value="2x2" /> 161 <Limit name="block-size" value="16x16" /> 162 <Limit name="blocks-per-second" min="64" max="979200" /> 163 <Limit name="bitrate" range="1-100000000" /> 164 <Limit name="frame-rate" range="1-240" /> 165 <Limit name="concurrent-instances" max="16" /> 166 <Limit name="quality" range="0-100" default="80" /> 167 <Feature name="bitrate-modes" value="VBR,CBR" /> 168 <Limit name="performance-point-4096x2304" value="24" /> 169 <Limit name="performance-point-3840x2160" value="30" /> 170 <Limit name="performance-point-1920x1080" value="120" /> 171 <Limit name="performance-point-1280x720" value="240" /> 172 </MediaCodec> 173 <MediaCodec name="OMX.qcom.video.encoder.hevc.cq" type="video/hevc" > 174 <Quirk name="requires-allocate-on-input-ports" /> 175 <Quirk name="requires-allocate-on-input-ports" /> 176 <Quirk name="requires-allocate-on-output-ports" /> 177 <Quirk name="requires-loaded-to-idle-after-allocation" /> 178 <Limit name="size" min="128x128" max="512x512" /> 179 <Limit name="frame-rate" range="1-20" /> 180 <Limit name="concurrent-instances" max="16" /> 181 <Limit name="quality" range="0-100" default="80" /> 182 <Feature name="bitrate-modes" value="CQ" /> 183 <Limit name="performance-point-512x512" value="2025" /> 184 </MediaCodec> 185 <MediaCodec name="OMX.qcom.video.encoder.heic" type="image/vnd.android.heic" > 186 <Quirk name="requires-allocate-on-input-ports" /> 187 <Quirk name="requires-allocate-on-input-ports" /> 188 <Quirk name="requires-allocate-on-output-ports" /> 189 <Quirk name="requires-loaded-to-idle-after-allocation" /> 190 <Limit name="size" min="512x512" max="8192x8192" /> 191 <Limit name="frame-rate" range="1-20" /> 192 <Limit name="concurrent-instances" max="6" /> 193 <Limit name="quality" range="0-100" default="80" /> 194 <Feature name="bitrate-modes" value="CQ" /> 195 <Limit name="performance-point-8192x4320" value="3" /> 196 <Limit name="performance-point-1920x1080" value="6" /> 197 </MediaCodec> 198 <!-- Video Software --> 199 <MediaCodec name="OMX.qcom.video.encoder.h263sw" type="video/3gpp" > 200 <Quirk name="requires-allocate-on-input-ports" /> 201 <Quirk name="requires-allocate-on-output-ports" /> 202 <Quirk name="requires-loaded-to-idle-after-allocation" /> 203 <Limit name="size" min="96x96" max="864x480" /> 204 <Limit name="alignment" value="4x4" /> 205 <Limit name="block-size" value="16x16" /> 206 <Limit name="blocks-per-second" min="36" max="48600" /> 207 <Limit name="bitrate" range="1-2000000" /> 208 <Limit name="frame-rate" range="1-30" /> 209 <Limit name="concurrent-instances" max="3" /> 210 <Limit name="performance-point-720x480" value="30" /> 211 </MediaCodec> 212 <MediaCodec name="OMX.qcom.video.encoder.mpeg4sw" type="video/mp4v-es" > 213 <Quirk name="requires-allocate-on-input-ports" /> 214 <Quirk name="requires-allocate-on-output-ports" /> 215 <Quirk name="requires-loaded-to-idle-after-allocation" /> 216 <Limit name="size" min="96x96" max="864x480" /> 217 <Limit name="alignment" value="2x2" /> 218 <Limit name="block-size" value="16x16" /> 219 <Limit name="blocks-per-second" min="36" max="48600" /> 220 <Limit name="bitrate" range="1-8000000" /> 221 <Limit name="frame-rate" range="1-30" /> 222 <Limit name="concurrent-instances" max="3" /> 223 <Limit name="performance-point-720x480" value="30" /> 224 </MediaCodec> 225 </Encoders> 226 <Decoders> 227 <!-- Video Hardware --> 228 <MediaCodec name="OMX.qcom.video.decoder.avc" type="video/avc" > 229 <Quirk name="requires-allocate-on-input-ports" /> 230 <Quirk name="requires-allocate-on-output-ports" /> 231 <Limit name="size" min="128x128" max="4096x2176" /> 232 <Limit name="alignment" value="2x2" /> 233 <Limit name="block-size" value="16x16" /> 234 <Limit name="blocks-per-second" min="64" max="979200" /> 235 <Limit name="bitrate" range="1-100000000" /> 236 <Limit name="frame-rate" range="1-240" /> 237 <Feature name="adaptive-playback" /> 238 <Limit name="concurrent-instances" max="16" /> 239 <Limit name="performance-point-4096x2304" value="24" /> 240 <Limit name="performance-point-3840x2160" value="30" /> 241 <Limit name="performance-point-1920x1080" value="120" /> 242 <Limit name="performance-point-1280x720" value="240" /> 243 </MediaCodec> 244 <MediaCodec name="OMX.qcom.video.decoder.avc.secure" type="video/avc" > 245 <Quirk name="requires-allocate-on-input-ports" /> 246 <Quirk name="requires-allocate-on-output-ports" /> 247 <Limit name="size" min="128x128" max="4096x2176" /> 248 <Limit name="alignment" value="2x2" /> 249 <Limit name="block-size" value="16x16" /> 250 <Limit name="blocks-per-second" min="64" max="979200" /> 251 <Limit name="bitrate" range="1-40000000" /> 252 <Limit name="frame-rate" range="1-60" /> 253 <Feature name="adaptive-playback" /> 254 <Feature name="secure-playback" required="true" /> 255 <Limit name="concurrent-instances" max="3" /> 256 <Limit name="performance-point-4096x2304" value="24" /> 257 <Limit name="performance-point-3840x2160" value="30" /> 258 <Limit name="performance-point-1920x1080" value="60" /> 259 </MediaCodec> 260 <MediaCodec name="OMX.qcom.video.decoder.mpeg2" type="video/mpeg2" > 261 <Quirk name="requires-allocate-on-input-ports" /> 262 <Quirk name="requires-allocate-on-output-ports" /> 263 <Limit name="size" min="128x128" max="1920x1088" /> 264 <Limit name="alignment" value="2x2" /> 265 <Limit name="block-size" value="16x16" /> 266 <Limit name="blocks-per-second" min="64" max="244800" /> 267 <Limit name="bitrate" range="1-40000000" /> 268 <Limit name="frame-rate" range="1-30" /> 269 <Feature name="adaptive-playback" /> 270 <Limit name="concurrent-instances" max="16" /> 271 <Limit name="performance-point-1920x1080" value="30" /> 272 </MediaCodec> 273 <MediaCodec name="OMX.qcom.video.decoder.mpeg2.secure" type="video/mpeg2" > 274 <Quirk name="requires-allocate-on-input-ports" /> 275 <Quirk name="requires-allocate-on-output-ports" /> 276 <Limit name="size" min="128x128" max="1920x1088" /> 277 <Limit name="alignment" value="2x2" /> 278 <Limit name="block-size" value="16x16" /> 279 <Limit name="blocks-per-second" min="64" max="244800" /> 280 <Limit name="bitrate" range="1-40000000" /> 281 <Limit name="frame-rate" range="1-30" /> 282 <Feature name="adaptive-playback" /> 283 <Feature name="secure-playback" required="true" /> 284 <Limit name="concurrent-instances" max="3" /> 285 <Limit name="performance-point-1920x1080" value="30" /> 286 </MediaCodec> 287 <MediaCodec name="OMX.qcom.video.decoder.vp9" type="video/x-vnd.on2.vp9" > 288 <Quirk name="requires-allocate-on-input-ports" /> 289 <Quirk name="requires-allocate-on-output-ports" /> 290 <Limit name="size" min="128x128" max="4096x2176" /> 291 <Limit name="alignment" value="2x2" /> 292 <Limit name="block-size" value="16x16" /> 293 <Limit name="blocks-per-second" min="64" max="979200" /> 294 <Limit name="bitrate" range="1-100000000" /> 295 <Limit name="frame-rate" range="1-240" /> 296 <Feature name="adaptive-playback" /> 297 <Limit name="concurrent-instances" max="6" /> 298 <Limit name="performance-point-4096x2304" value="24" /> 299 <Limit name="performance-point-3840x2160" value="30" /> 300 <Limit name="performance-point-1920x1080" value="120" /> 301 <Limit name="performance-point-1280x720" value="240" /> 302 </MediaCodec> 303 <MediaCodec name="OMX.qcom.video.decoder.vp9.secure" type="video/x-vnd.on2.vp9" > 304 <Quirk name="requires-allocate-on-input-ports" /> 305 <Quirk name="requires-allocate-on-output-ports" /> 306 <Limit name="size" min="128x128" max="4096x2176" /> 307 <Limit name="alignment" value="2x2" /> 308 <Limit name="block-size" value="16x16" /> 309 <Limit name="blocks-per-second" min="64" max="979200" /> 310 <Limit name="bitrate" range="1-40000000" /> 311 <Limit name="frame-rate" range="1-60" /> 312 <Feature name="adaptive-playback" /> 313 <Feature name="secure-playback" required="true" /> 314 <Limit name="concurrent-instances" max="3" /> 315 <Limit name="performance-point-4096x2304" value="24" /> 316 <Limit name="performance-point-3840x2160" value="30" /> 317 <Limit name="performance-point-1920x1080" value="60" /> 318 </MediaCodec> 319 <MediaCodec name="OMX.qcom.video.decoder.hevc" type="video/hevc" > 320 <Quirk name="requires-allocate-on-input-ports" /> 321 <Quirk name="requires-allocate-on-output-ports" /> 322 <Limit name="size" min="128x128" max="4096x2176" /> 323 <Limit name="alignment" value="2x2" /> 324 <Limit name="block-size" value="16x16" /> 325 <Limit name="blocks-per-second" min="64" max="979200" /> 326 <Limit name="bitrate" range="1-100000000" /> 327 <Limit name="frame-rate" range="1-240" /> 328 <Feature name="adaptive-playback" /> 329 <Limit name="concurrent-instances" max="16" /> 330 <Limit name="performance-point-4096x2304" value="24" /> 331 <Limit name="performance-point-3840x2160" value="30" /> 332 <Limit name="performance-point-1920x1080" value="120" /> 333 <Limit name="performance-point-1280x720" value="240" /> 334 </MediaCodec> 335 <MediaCodec name="OMX.qcom.video.decoder.hevc.secure" type="video/hevc" > 336 <Quirk name="requires-allocate-on-input-ports" /> 337 <Quirk name="requires-allocate-on-output-ports" /> 338 <Limit name="size" min="128x128" max="4096x2176" /> 339 <Limit name="alignment" value="2x2" /> 340 <Limit name="block-size" value="16x16" /> 341 <Limit name="blocks-per-second" min="64" max="979200" /> 342 <Limit name="bitrate" range="1-40000000" /> 343 <Limit name="frame-rate" range="1-60" /> 344 <Feature name="adaptive-playback" /> 345 <Feature name="secure-playback" required="true" /> 346 <Limit name="concurrent-instances" max="3" /> 347 <Limit name="performance-point-4096x2304" value="24" /> 348 <Limit name="performance-point-3840x2160" value="30" /> 349 <Limit name="performance-point-1920x1080" value="60" /> 350 </MediaCodec> 351 <!-- Video Software --> 352 <MediaCodec name="OMX.qti.video.decoder.h263sw" type="video/3gpp" > 353 <Quirk name="requires-allocate-on-input-ports" /> 354 <Quirk name="requires-allocate-on-output-ports" /> 355 <Limit name="size" min="96x96" max="864x480" /> 356 <Limit name="alignment" value="4x4" /> 357 <Limit name="block-size" value="16x16" /> 358 <Limit name="blocks-per-second" min="36" max="48600" /> 359 <Limit name="bitrate" range="1-16000000" /> 360 <Limit name="frame-rate" range="1-30" /> 361 <Feature name="adaptive-playback" /> 362 <Limit name="concurrent-instances" max="4" /> 363 <Limit name="performance-point-720x480" value="30" /> 364 </MediaCodec> 365 <MediaCodec name="OMX.qti.video.decoder.mpeg4sw" type="video/mp4v-es"> 366 <Quirk name="requires-allocate-on-input-ports" /> 367 <Quirk name="requires-allocate-on-output-ports" /> 368 <Limit name="size" min="96x96" max="1920x1088" /> 369 <Limit name="alignment" value="2x2" /> 370 <Limit name="block-size" value="16x16" /> 371 <Limit name="blocks-per-second" min="36" max="244800" /> 372 <Limit name="bitrate" range="1-40000000" /> 373 <Limit name="frame-rate" range="1-30" /> 374 <Limit name="concurrent-instances" max="4" /> 375 <Limit name="performance-point-1920x1080" value="30" /> 376 </MediaCodec> 377 <MediaCodec name="OMX.google.opus.decoder" type="audio/opus" update="true" rank="100"/> 378 </Decoders> 379 <Include href="media_codecs_google_video.xml" /> 380</MediaCodecs> 381