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    30      100     1036800 |
91 | hevc        | 4096    2160    30      100     1036800 |
92 | mpeg4-sw    | 1920    1088    30      40      244800  |
93 | vp8         | 1920    1088    60      100     489600  |
94 | vp9         | 4096    2160    30      100     1036800 |
95 |             | (4096)  (2304)  (30)    (120)           |
96 | vc1         | 1920    1088    30      20      244800  |
97 | h263-sw     | 864     480     30      16       48600  |
98 | mpeg2       | 1920    1088    30      40      244800  |
99 |_____________|_________________________________________|
100
101 sdmmagpie Secure decoder capabilities
102 ______________________________________________________
103 | Codec    | W       H       fps     Mbps    MB/s    |
104 |__________|_________________________________________|
105 | h264     | 4096    2160    30      40      1036800 |
106 | vp9      | 4096    2160    30      40      1036800 |
107 | hevc     | 4096    2160    30      40      1036800 |
108 | mpeg2    | 1920    1088    30      40      244800  |
109 |__________|_________________________________________|
110
111 sdmmagpie Non-Secure encoder capabilities (Secure not supported)
112 ______________________________________________________
113 | Codec    | W       H       fps     Mbps    MB/s    |
114 |__________|_________________________________________|
115 | h264     | 4096    2160    30      100     1036800 |
116 | hevc     | 4096    2160    30      100     1036800 |
117 | mpeg4-sw | 1280     720    30      4       108000  |
118 | vp8      | 1920    1088    60      40      489600  |
119 | h263-sw  | 864     480     30      2       48600   |
120 |__________|_________________________________________|
121-->
122
123<MediaCodecs>
124    <Include href="media_codecs_google_audio.xml" />
125    <Include href="media_codecs_google_telephony.xml" />
126    <Settings>
127        <Setting name="max-video-encoder-input-buffers" value="11" />
128    </Settings>
129    <Encoders>
130        <!-- Video Hardware  -->
131        <MediaCodec name="OMX.qcom.video.encoder.avc" type="video/avc" >
132            <Quirk name="requires-allocate-on-input-ports" />
133            <Quirk name="requires-allocate-on-output-ports" />
134            <Quirk name="requires-loaded-to-idle-after-allocation" />
135            <Limit name="size" min="96x96" max="4096x2160" />
136            <Limit name="alignment" value="2x2" />
137            <Limit name="block-size" value="16x16" />
138            <Limit name="blocks-per-second" min="24" max="1036800" />
139            <Limit name="bitrate" range="1-100000000" />
140            <Limit name="frame-rate" range="1-240" />
141            <Limit name="concurrent-instances" max="16" />
142        </MediaCodec>
143        <MediaCodec name="OMX.qcom.video.encoder.vp8" type="video/x-vnd.on2.vp8" >
144            <Quirk name="requires-allocate-on-input-ports" />
145            <Quirk name="requires-allocate-on-output-ports" />
146            <Quirk name="requires-loaded-to-idle-after-allocation" />
147            <Limit name="size" min="96x96" max="1920x1088" />
148            <Limit name="alignment" value="2x2" />
149            <Limit name="block-size" value="16x16" />
150            <Limit name="blocks-per-second" min="24" max="489600" />
151            <Limit name="bitrate" range="1-40000000" />
152            <Limit name="frame-rate" range="1-120" />
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="96x96" max="4096x2160" />
160            <Limit name="alignment" value="2x2" />
161            <Limit name="block-size" value="16x16" />
162            <Limit name="blocks-per-second" min="24" max="1036800" />
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,CQ" />
168        </MediaCodec>
169        <!-- Video Software -->
170        <MediaCodec name="OMX.qcom.video.encoder.h263sw" type="video/3gpp" >
171            <Quirk name="requires-allocate-on-input-ports" />
172            <Quirk name="requires-allocate-on-output-ports" />
173            <Quirk name="requires-loaded-to-idle-after-allocation" />
174            <Limit name="size" min="32x32" max="864x480" />
175            <Limit name="alignment" value="4x4" />
176            <Limit name="block-size" value="16x16" />
177            <Limit name="blocks-per-second" min="1" max="48600" />
178            <Limit name="bitrate" range="1-2000000" />
179            <Limit name="frame-rate" range="1-30" />
180            <Limit name="concurrent-instances" max="16" />
181        </MediaCodec>
182        <MediaCodec name="OMX.qcom.video.encoder.mpeg4sw" type="video/mp4v-es" >
183             <Quirk name="requires-allocate-on-input-ports" />
184             <Quirk name="requires-allocate-on-output-ports" />
185             <Quirk name="requires-loaded-to-idle-after-allocation" />
186             <Limit name="size" min="32x32" max="1280x720" />
187             <Limit name="alignment" value="2x2" />
188             <Limit name="block-size" value="16x16" />
189             <Limit name="blocks-per-second" min="1" max="108000" />
190             <Limit name="bitrate" range="1-4000000" />
191             <Limit name="frame-rate" range="1-30" />
192             <Limit name="concurrent-instances" max="16" />
193        </MediaCodec>
194    </Encoders>
195    <Decoders>
196       <!-- Video Hardware  -->
197        <MediaCodec name="OMX.qcom.video.decoder.avc" type="video/avc" >
198            <Quirk name="requires-allocate-on-input-ports" />
199            <Quirk name="requires-allocate-on-output-ports" />
200            <Limit name="size" min="96x96" max="4096x2160" />
201            <Limit name="alignment" value="2x2" />
202            <Limit name="block-size" value="16x16" />
203            <Limit name="blocks-per-second" min="24" max="1036800" />
204            <Limit name="bitrate" range="1-100000000" />
205            <Limit name="frame-rate" range="1-240" />
206            <Feature name="adaptive-playback" />
207            <Limit name="concurrent-instances" max="16" />
208        </MediaCodec>
209        <MediaCodec name="OMX.qcom.video.decoder.avc.secure" type="video/avc" >
210            <Quirk name="requires-allocate-on-input-ports" />
211            <Quirk name="requires-allocate-on-output-ports" />
212            <Limit name="size" min="96x96" max="4096x2160" />
213            <Limit name="alignment" value="2x2" />
214            <Limit name="block-size" value="16x16" />
215            <Limit name="blocks-per-second" min="24" max="1036800" />
216            <Limit name="bitrate" range="1-40000000" />
217            <Limit name="frame-rate" range="1-60" />
218            <Feature name="adaptive-playback" />
219            <Feature name="secure-playback" required="true" />
220            <Limit name="concurrent-instances" max="3" />
221        </MediaCodec>
222        <MediaCodec name="OMX.qcom.video.decoder.mpeg2" type="video/mpeg2" >
223            <Quirk name="requires-allocate-on-input-ports" />
224            <Quirk name="requires-allocate-on-output-ports" />
225            <Limit name="size" min="96x96" max="1920x1088" />
226            <Limit name="alignment" value="2x2" />
227            <Limit name="block-size" value="16x16" />
228            <Limit name="blocks-per-second" min="24" max="244800" />
229            <Limit name="bitrate" range="1-40000000" />
230            <Limit name="frame-rate" range="1-30" />
231            <Feature name="adaptive-playback" />
232            <Limit name="concurrent-instances" max="16" />
233        </MediaCodec>
234        <MediaCodec name="OMX.qcom.video.decoder.mpeg2.secure" type="video/mpeg2" >
235            <Quirk name="requires-allocate-on-input-ports" />
236            <Quirk name="requires-allocate-on-output-ports" />
237            <Limit name="size" min="96x96" max="1920x1088" />
238            <Limit name="alignment" value="2x2" />
239            <Limit name="block-size" value="16x16" />
240            <Limit name="blocks-per-second" min="24" max="244800" />
241            <Limit name="bitrate" range="1-40000000" />
242            <Limit name="frame-rate" range="1-30" />
243            <Feature name="adaptive-playback" />
244            <Feature name="secure-playback" required="true" />
245            <Limit name="concurrent-instances" max="3" />
246        </MediaCodec>
247        <MediaCodec name="OMX.qcom.video.decoder.vp8" type="video/x-vnd.on2.vp8" >
248            <Quirk name="requires-allocate-on-input-ports" />
249            <Quirk name="requires-allocate-on-output-ports" />
250            <Limit name="size" min="96x96" max="1920x1088" />
251            <Limit name="alignment" value="2x2" />
252            <Limit name="block-size" value="16x16" />
253            <Limit name="blocks-per-second" min="24" max="489600" />
254            <Limit name="bitrate" range="1-100000000" />
255            <Limit name="frame-rate" range="1-120" />
256            <Feature name="adaptive-playback" />
257            <Limit name="concurrent-instances" max="16" />
258        </MediaCodec>
259        <MediaCodec name="OMX.qcom.video.decoder.vp9" type="video/x-vnd.on2.vp9" >
260            <Quirk name="requires-allocate-on-input-ports" />
261            <Quirk name="requires-allocate-on-output-ports" />
262            <Limit name="size" min="96x96" max="4096x2160" />
263            <Limit name="alignment" value="2x2" />
264            <Limit name="block-size" value="16x16" />
265            <Limit name="blocks-per-second" min="24" max="1036800" />
266            <Limit name="bitrate" range="1-100000000" />
267            <Limit name="frame-rate" range="1-240" />
268            <Feature name="adaptive-playback" />
269            <Limit name="concurrent-instances" max="6" />
270        </MediaCodec>
271        <MediaCodec name="OMX.qcom.video.decoder.vp9.secure" type="video/x-vnd.on2.vp9" >
272            <Quirk name="requires-allocate-on-input-ports" />
273            <Quirk name="requires-allocate-on-output-ports" />
274            <Limit name="size" min="96x96" max="4096x2160" />
275            <Limit name="alignment" value="2x2" />
276            <Limit name="block-size" value="16x16" />
277            <Limit name="blocks-per-second" min="24" max="1036800" />
278            <Limit name="bitrate" range="1-40000000" />
279            <Limit name="frame-rate" range="1-60" />
280            <Feature name="adaptive-playback" />
281            <Feature name="secure-playback" required="true" />
282            <Limit name="concurrent-instances" max="3" />
283        </MediaCodec>
284        <MediaCodec name="OMX.qcom.video.decoder.hevc" type="video/hevc" >
285            <Quirk name="requires-allocate-on-input-ports" />
286            <Quirk name="requires-allocate-on-output-ports" />
287            <Limit name="size" min="96x96" max="4096x2160" />
288            <Limit name="alignment" value="2x2" />
289            <Limit name="block-size" value="16x16" />
290            <Limit name="blocks-per-second" min="24" max="1036800" />
291            <Limit name="bitrate" range="1-100000000" />
292            <Limit name="frame-rate" range="1-240" />
293            <Feature name="adaptive-playback" />
294            <Limit name="concurrent-instances" max="16" />
295        </MediaCodec>
296        <MediaCodec name="OMX.qcom.video.decoder.hevc.secure" type="video/hevc" >
297            <Quirk name="requires-allocate-on-input-ports" />
298            <Quirk name="requires-allocate-on-output-ports" />
299            <Limit name="size" min="96x96" max="4096x2160" />
300            <Limit name="alignment" value="2x2" />
301            <Limit name="block-size" value="16x16" />
302            <Limit name="blocks-per-second" min="24" max="1036800" />
303            <Limit name="bitrate" range="1-40000000" />
304            <Limit name="frame-rate" range="1-60" />
305            <Feature name="adaptive-playback" />
306            <Feature name="secure-playback" required="true" />
307            <Limit name="concurrent-instances" max="3" />
308        </MediaCodec>
309        <!-- Video Software -->
310        <MediaCodec name="OMX.qti.video.decoder.h263sw" type="video/3gpp" >
311             <Quirk name="requires-allocate-on-input-ports" />
312             <Quirk name="requires-allocate-on-output-ports" />
313             <Limit name="size" min="16x16" max="864x480" />
314             <Limit name="alignment" value="4x4" />
315             <Limit name="block-size" value="16x16" />
316             <Limit name="blocks-per-second" min="1" max="48600" />
317             <Limit name="bitrate" range="1-16000000" />
318             <Limit name="frame-rate" range="1-30" />
319             <Feature name="adaptive-playback" />
320             <Limit name="concurrent-instances" max="16" />
321        </MediaCodec>
322        <MediaCodec name="OMX.qti.video.decoder.mpeg4sw">
323             <Quirk name="requires-allocate-on-input-ports" />
324             <Quirk name="requires-allocate-on-output-ports" />
325             <Type name="video/mp4v-es">
326                <Limit name="size" min="16x16" max="1920x1088" />
327                <Limit name="alignment" value="2x2" />
328                <Limit name="block-size" value="16x16" />
329                <Limit name="blocks-per-second" min="1" max="244800" />
330                <Limit name="bitrate" range="1-40000000" />
331                <Limit name="frame-rate" range="1-30" />
332                <Limit name="concurrent-instances" max="16" />
333             </Type>
334             <Type name="video/mp4v-esdp">
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        </MediaCodec>
344        <MediaCodec name="OMX.qti.video.decoder.vc1sw" type="video/x-ms-wmv" >
345            <Quirk name="requires-allocate-on-input-ports" />
346            <Quirk name="requires-allocate-on-output-ports" />
347            <Limit name="size" min="64x64" max="1920x1088" />
348            <Limit name="alignment" value="2x2" />
349            <Limit name="block-size" value="16x16" />
350            <Limit name="blocks-per-second" min="1" max="244800" />
351            <Limit name="bitrate" range="1-20000000" />
352            <Limit name="frame-rate" range="1-30" />
353            <Feature name="adaptive-playback" />
354            <Limit name="concurrent-instances" max="16" />
355        </MediaCodec>
356        <MediaCodec name="OMX.google.opus.decoder" type="audio/opus" update="true" rank="100"/>
357        <!-- Audio Software  -->
358    </Decoders>
359    <Include href="media_codecs_google_video.xml" />
360</MediaCodecs>
361