1<?xml version="1.0" encoding="utf-8" ?> 2<!-- Copyright 2015 The Android Open Source Project 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15--> 16 17<!-- 18<!DOCTYPE MediaCodecs [ 19<!ELEMENT Include EMPTY> 20<!ATTLIST Include href CDATA #REQUIRED> 21<!ELEMENT MediaCodecs (Decoders|Encoders|Include)*> 22<!ELEMENT Decoders (MediaCodec|Include)*> 23<!ELEMENT Encoders (MediaCodec|Include)*> 24<!ELEMENT MediaCodec (Type|Quirk|Include)*> 25<!ATTLIST MediaCodec name CDATA #REQUIRED> 26<!ATTLIST MediaCodec type CDATA> 27<!ELEMENT Type EMPTY> 28<!ATTLIST Type name CDATA #REQUIRED> 29<!ELEMENT Quirk EMPTY> 30<!ATTLIST Quirk name CDATA #REQUIRED> 31]> 32 33There's a simple and a complex syntax to declare the availability of a 34media codec: 35 36A codec that properly follows the OpenMax spec and therefore doesn't have any 37quirks and that only supports a single content type can be declared like so: 38 39 <MediaCodec name="OMX.foo.bar" type="something/interesting" /> 40 41If a codec has quirks OR supports multiple content types, the following syntax 42can be used: 43 44 <MediaCodec name="OMX.foo.bar" > 45 <Type name="something/interesting" /> 46 <Type name="something/else" /> 47 ... 48 <Quirk name="requires-allocate-on-input-ports" /> 49 <Quirk name="requires-allocate-on-output-ports" /> 50 <Quirk name="output-buffers-are-unreadable" /> 51 </MediaCodec> 52 53Only the three quirks included above are recognized at this point: 54 55"requires-allocate-on-input-ports" 56 must be advertised if the component does not properly support specification 57 of input buffers using the OMX_UseBuffer(...) API but instead requires 58 OMX_AllocateBuffer to be used. 59 60"requires-allocate-on-output-ports" 61 must be advertised if the component does not properly support specification 62 of output buffers using the OMX_UseBuffer(...) API but instead requires 63 OMX_AllocateBuffer to be used. 64 65"output-buffers-are-unreadable" 66 must be advertised if the emitted output buffers of a decoder component 67 are not readable, i.e. use a custom format even though abusing one of 68 the official OMX colorspace constants. 69 Clients of such decoders will not be able to access the decoded data, 70 naturally making the component much less useful. The only use for 71 a component with this quirk is to render the output to the screen. 72 Audio decoders MUST NOT advertise this quirk. 73 Video decoders that advertise this quirk must be accompanied by a 74 corresponding color space converter for thumbnail extraction, 75 matching surfaceflinger support that can render the custom format to 76 a texture and possibly other code, so just DON'T USE THIS QUIRK. 77 78 79--> 80 81<MediaCodecs> 82 <Include href="media_codecs_google_audio.xml" /> 83 <Include href="media_codecs_google_telephony.xml" /> 84 <Settings> 85 <Setting name="max-video-encoder-input-buffers" value="12" /> 86 </Settings> 87 <Encoders> 88 <MediaCodec name="OMX.qcom.video.encoder.mpeg4" type="video/mp4v-es" > 89 <Quirk name="requires-allocate-on-input-ports" /> 90 <Quirk name="requires-allocate-on-output-ports" /> 91 <Quirk name="requires-loaded-to-idle-after-allocation"/> 92 <Limit name="size" min="96x64" max="1920x1088" /> 93 <Limit name="alignment" value="2x2" /> 94 <Limit name="block-size" value="16x16" /> 95 <Limit name="blocks-per-second" min="1" max="489600" /> 96 <Limit name="bitrate" range="1-60000000" /> 97 <Limit name="concurrent-instances" max="13" /> 98 </MediaCodec> 99 <MediaCodec name="OMX.qcom.video.encoder.h263" type="video/3gpp" > 100 <Quirk name="requires-allocate-on-input-ports" /> 101 <Quirk name="requires-allocate-on-output-ports" /> 102 <Quirk name="requires-loaded-to-idle-after-allocation" /> 103 <Limit name="size" min="96x64" max="864x480" /> 104 <Limit name="alignment" value="2x2" /> 105 <Limit name="block-size" value="16x16" /> 106 <Limit name="blocks-per-second" min="1" max="48600" /> 107 <Limit name="bitrate" range="1-2000000" /> 108 <Limit name="concurrent-instances" max="13" /> 109 </MediaCodec> 110 <MediaCodec name="OMX.qcom.video.encoder.avc" type="video/avc" > 111 <Quirk name="requires-allocate-on-input-ports" /> 112 <Quirk name="requires-allocate-on-output-ports" /> 113 <Quirk name="requires-loaded-to-idle-after-allocation" /> 114 <Limit name="size" min="96x64" max="4096x2160" /> 115 <Limit name="alignment" value="2x2" /> 116 <Limit name="block-size" value="16x16" /> 117 <Limit name="blocks-per-second" min="1" max="972000" /> 118 <Limit name="bitrate" range="1-100000000" /> 119 <Limit name="concurrent-instances" max="13" /> 120 <Feature name="intra-refresh" /> 121 </MediaCodec> 122 <MediaCodec name="OMX.qcom.video.encoder.vp8" type="video/x-vnd.on2.vp8" > 123 <Quirk name="requires-allocate-on-input-ports" /> 124 <Quirk name="requires-allocate-on-output-ports" /> 125 <Quirk name="requires-loaded-to-idle-after-allocation" /> 126 <Limit name="size" min="96x64" max="3840x2160" /> 127 <Limit name="alignment" value="2x2" /> 128 <Limit name="block-size" value="16x16" /> 129 <Limit name="blocks-per-second" min="1" max="972000" /> 130 <Limit name="bitrate" range="1-20000000" /> 131 <Limit name="concurrent-instances" max="13" /> 132 <Feature name="intra-refresh" /> 133 </MediaCodec> 134 <MediaCodec name="OMX.qcom.video.encoder.hevc" type="video/hevc" > 135 <Quirk name="requires-allocate-on-input-ports" /> 136 <Quirk name="requires-allocate-on-output-ports" /> 137 <Quirk name="requires-loaded-to-idle-after-allocation" /> 138 <Limit name="size" min="176x64" max="4096x2160" /> 139 <Limit name="alignment" value="2x2" /> 140 <Limit name="block-size" value="16x16" /> 141 <Limit name="blocks-per-second" min="1" max="972000" /> 142 <Limit name="bitrate" range="1-100000000" /> 143 <Limit name="concurrent-instances" max="13" /> 144 <Feature name="intra-refresh" /> 145 </MediaCodec> 146 </Encoders> 147 <Decoders> 148 <MediaCodec name="OMX.qcom.video.decoder.avc" type="video/avc" > 149 <Quirk name="requires-allocate-on-input-ports" /> 150 <Quirk name="requires-allocate-on-output-ports" /> 151 <Limit name="size" min="64x64" max="4096x2160" /> 152 <Limit name="alignment" value="2x2" /> 153 <Limit name="block-size" value="16x16" /> 154 <Limit name="blocks-per-second" min="1" max="972000" /> 155 <Limit name="bitrate" range="1-100000000" /> 156 <Feature name="adaptive-playback" /> 157 <Limit name="concurrent-instances" max="13" /> 158 </MediaCodec> 159 <MediaCodec name="OMX.qcom.video.decoder.avc.secure" type="video/avc" > 160 <Quirk name="requires-allocate-on-input-ports" /> 161 <Quirk name="requires-allocate-on-output-ports" /> 162 <Limit name="size" min="64x64" max="4096x2160" /> 163 <Limit name="alignment" value="2x2" /> 164 <Limit name="block-size" value="16x16" /> 165 <Limit name="blocks-per-second" min="1" max="972000" /> 166 <Limit name="bitrate" range="1-100000000" /> 167 <Feature name="adaptive-playback" /> 168 <Feature name="secure-playback" required="true" /> 169 <Limit name="concurrent-instances" max="6" /> 170 </MediaCodec> 171 <MediaCodec name="OMX.qcom.video.decoder.mpeg4" type="video/mp4v-es" > 172 <Quirk name="requires-allocate-on-input-ports" /> 173 <Quirk name="requires-allocate-on-output-ports" /> 174 <Limit name="size" min="64x64" max="1920x1088" /> 175 <Limit name="alignment" value="2x2" /> 176 <Limit name="block-size" value="16x16" /> 177 <Limit name="blocks-per-second" min="1" max="489600" /> 178 <Limit name="bitrate" range="1-60000000" /> 179 <Feature name="adaptive-playback" /> 180 <Limit name="concurrent-instances" max="12" /> 181 </MediaCodec> 182 <MediaCodec name="OMX.qcom.video.decoder.h263" type="video/3gpp" > 183 <Quirk name="requires-allocate-on-input-ports" /> 184 <Quirk name="requires-allocate-on-output-ports" /> 185 <Limit name="size" min="64x64" max="864x480" /> 186 <Limit name="alignment" value="2x2" /> 187 <Limit name="block-size" value="16x16" /> 188 <Limit name="blocks-per-second" min="1" max="489600" /> 189 <Limit name="bitrate" range="1-2000000" /> 190 <Feature name="adaptive-playback" /> 191 <Limit name="concurrent-instances" max="12" /> 192 </MediaCodec> 193 <MediaCodec name="OMX.qcom.video.decoder.vp8" type="video/x-vnd.on2.vp8" > 194 <Quirk name="requires-allocate-on-input-ports" /> 195 <Quirk name="requires-allocate-on-output-ports" /> 196 <Limit name="size" min="64x64" max="3840x2160" /> 197 <Limit name="alignment" value="2x2" /> 198 <Limit name="block-size" value="16x16" /> 199 <Limit name="blocks-per-second" min="1" max="972000" /> 200 <Limit name="bitrate" range="1-20000000" /> 201 <Feature name="adaptive-playback" /> 202 <Limit name="concurrent-instances" max="12" /> 203 </MediaCodec> 204 <MediaCodec name="OMX.qcom.video.decoder.hevc" type="video/hevc" > 205 <Quirk name="requires-allocate-on-input-ports" /> 206 <Quirk name="requires-allocate-on-output-ports" /> 207 <Limit name="size" min="64x64" max="4096x2160" /> 208 <Limit name="alignment" value="2x2" /> 209 <Limit name="block-size" value="16x16" /> 210 <Limit name="blocks-per-second" min="1" max="972000" /> 211 <Limit name="bitrate" range="1-100000000" /> 212 <Feature name="adaptive-playback" /> 213 <Limit name="concurrent-instances" max="12" /> 214 </MediaCodec> 215 <MediaCodec name="OMX.qcom.video.decoder.hevc.secure" type="video/hevc" > 216 <Quirk name="requires-allocate-on-input-ports" /> 217 <Quirk name="requires-allocate-on-output-ports" /> 218 <Limit name="size" min="64x64" max="4096x2160" /> 219 <Limit name="alignment" value="2x2" /> 220 <Limit name="block-size" value="16x16" /> 221 <Limit name="blocks-per-second" min="1" max="972000" /> 222 <Limit name="bitrate" range="1-100000000" /> 223 <Feature name="adaptive-playback" /> 224 <Feature name="secure-playback" required="true" /> 225 <Limit name="concurrent-instances" max="6" /> 226 </MediaCodec> 227 </Decoders> 228 <Include href="media_codecs_google_video.xml" /> 229</MediaCodecs> 230