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