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<!--
84 Non-Secure decoder capabilities
85 (MB is defined as 16x16)
86 _____________________________________________________________________
87 | Codec       | W       H       fps     Mbps    MB/s        Max MB/s|
88 |_____________|_____________________________________________________|
89 | h264        | 1920    1088    480     220     3916800     3916800 |
90 |             | 3820    2160    120     220     3888000             |
91 |             | 4096    2160    96      220     3317760             |
92 |             | 4096    2304    60      220     2211840             |
93 |             | 7680    4320    30      220     3888000             |
94 |             | 8192    4320    24      220     3317760             |
95 | hevc        | 1920    1088    480     220     3916800     3916800 |
96 |             | 3820    2160    120     220     3888000             |
97 |             | 4096    2160    96      220     3317760             |
98 |             | 4096    2304    60      220     2211840             |
99 |             | 7680    4320    30      220     3888000             |
100 |             | 8192    4320    24      220     3317760             |
101 | mpeg4-sw    | 1920    1088    30      40      244800      244800  |
102 | vp8         | 1280    720     240     100     864000      1036800 |
103 |             | 1920    1088    120     100     979200              |
104 |             | 3840    2160    30      100     972000              |
105 |             | 4096    2160    30      100     1036800             |
106 |             | 4096    2304    24      100     884736              |
107 | vp9         | 1920    1088    480     220     3916800     3916800 |
108 |             | 3820    2160    120     220     3888000             |
109 |             | 4096    2160    96      220     3317760             |
110 |             | 4096    2304    60      220     2211840             |
111 |             | 7680    4320    30      220     3888000             |
112 |             | 8192    4320    24      220     3317760             |
113 | h263-sw     | 864     480     30      16       48600       48600  |
114 | mpeg2       | 1920    1088    30      40      244800      244800  |
115 |_____________|_____________________________________________________|
116
117 Secure decoder capabilities
118 (MB is defined as 16x16)
119 __________________________________________________________________
120 | Codec    | W       H       fps     Mbps    MB/s        Max MB/s|
121 |__________|_____________________________________________________|
122 | h264     | 1280    720     60      40      216000      2073600 |
123 |          | 1920    1088    60      40      489600              |
124 |          | 3840    2160    60      40      1944000             |
125 |          | 4096    2160    60      40      2073600             |
126 |          | 4096    2304    30      40      1105920             |
127 | hevc     | 1280    720     60      40      216000      2073600 |
128 |          | 1920    1088    60      40      489600              |
129 |          | 3840    2160    60      40      1944000             |
130 |          | 4096    2160    60      40      2073600             |
131 |          | 4096    2304    30      40      1105920             |
132 | vp9      | 1280    720     60      40      216000      2073600 |
133 |          | 1920    1088    60      40      489600              |
134 |          | 3840    2160    60      40      1944000             |
135 |          | 4096    2160    60      40      2073600             |
136 |          | 4096    2304    30      40      1105920             |
137 | mpeg2    | 1920    1088    30      40      244800      244800  |
138 |__________|_____________________________________________________|
139
140 Non-Secure encoder capabilities (Secure not supported)
141 (MB is defined as 16x16)
142 __________________________________________________________________
143 | Codec    | W       H       fps     Mbps    MB/s        Max MB/s|
144 |__________|_____________________________________________________|
145 | h264     | 1280    720     480     160     1728000     1958400 |
146 |          | 1920    1088    240     160     1958400             |
147 |          | 3840    2160    60      160     1944000             |
148 |          | 4096    2160    48      160     1658880             |
149 |          | 4096    2304    30      160     1105920             |
150 | hevc     | 1280    720     480     160     1728000     1958400 |
151 |          | 1920    1088    240     160     1958400             |
152 |          | 3840    2160    60      160     1944000             |
153 |          | 4096    2160    48      160     1658880             |
154 |          | 4096    2304    30      160     1105920             |
155 | mpeg4-sw | 1280    720     30       4      108000      108000  |
156 | vp8      | 1280    720     240     40      864000      1036800 |
157 |          | 1920    1088    120     40      979200              |
158 |          | 3840    2160    30      40      972000              |
159 |          | 4096    2160    30      40      1036800             |
160 |          | 4096    2304    24      40      884736              |
161 | h263-sw  | 864     480     30      2       48600       48600   |
162 |__________|_____________________________________________________|
163-->
164
165<MediaCodecs>
166    <Include href="media_codecs_google_audio.xml" />
167    <Include href="media_codecs_google_telephony.xml" />
168    <Settings>
169        <Setting name="max-video-encoder-input-buffers" value="11" />
170    </Settings>
171    <Encoders>
172        <!-- Video Hardware  -->
173        <MediaCodec name="OMX.qcom.video.encoder.avc" type="video/avc" >
174            <Quirk name="requires-allocate-on-input-ports" />
175            <Quirk name="requires-allocate-on-output-ports" />
176            <Quirk name="requires-loaded-to-idle-after-allocation" />
177            <Limit name="size" min="96x96" max="4096x2304" />
178            <Limit name="alignment" value="2x2" />
179            <Limit name="block-size" value="16x16" />
180            <Limit name="blocks-per-second" min="36" max="1958400" />
181            <Limit name="bitrate" range="1-160000000" />
182            <Limit name="frame-rate" range="1-480" />
183            <Limit name="concurrent-instances" max="16" />
184            <Limit name="performance-point-4096x2304" value="56" />
185            <Limit name="performance-point-4096x2160" value="60" />
186            <Limit name="performance-point-3840x2160" value="60" />
187            <Limit name="performance-point-1920x1080" value="240" />
188            <Limit name="performance-point-1280x720" value="480" />
189        </MediaCodec>
190        <MediaCodec name="OMX.qcom.video.encoder.vp8" type="video/x-vnd.on2.vp8" >
191            <Quirk name="requires-allocate-on-input-ports" />
192            <Quirk name="requires-allocate-on-output-ports" />
193            <Quirk name="requires-loaded-to-idle-after-allocation" />
194            <Limit name="size" min="96x96" max="4096x2304" />
195            <Limit name="alignment" value="2x2" />
196            <Limit name="block-size" value="16x16" />
197            <Limit name="blocks-per-second" min="36" max="1036800" />
198            <Limit name="bitrate" range="1-40000000" />
199            <Limit name="frame-rate" range="1-240" />
200            <Limit name="concurrent-instances" max="16" />
201            <Limit name="performance-point-4096x2304" value="24" />
202            <Limit name="performance-point-4096x2160" value="30" />
203            <Limit name="performance-point-3840x2160" value="30" />
204            <Limit name="performance-point-1920x1080" value="120" />
205            <Limit name="performance-point-1280x720" value="240" />
206        </MediaCodec>
207        <MediaCodec name="OMX.qcom.video.encoder.hevc" type="video/hevc" >
208            <Quirk name="requires-allocate-on-input-ports" />
209            <Quirk name="requires-allocate-on-output-ports" />
210            <Quirk name="requires-loaded-to-idle-after-allocation" />
211            <Limit name="size" min="96x96" max="4096x2304" />
212            <Limit name="alignment" value="2x2" />
213            <Limit name="block-size" value="16x16" />
214            <Limit name="blocks-per-second" min="36" max="1958400" />
215            <Limit name="bitrate" range="1-160000000" />
216            <Limit name="frame-rate" range="1-480" />
217            <Limit name="concurrent-instances" max="16" />
218            <Limit name="quality" range="0-100" default="80" />
219            <Limit name="performance-point-4096x2304" value="56" />
220            <Limit name="performance-point-4096x2160" value="60" />
221            <Limit name="performance-point-3840x2160" value="60" />
222            <Limit name="performance-point-1920x1080" value="240" />
223            <Limit name="performance-point-1280x720" value="480" />
224            <Feature name="bitrate-modes" value="VBR,CBR" />
225        </MediaCodec>
226        <MediaCodec name="OMX.qcom.video.encoder.hevc.cq" type="video/hevc" >
227            <Quirk name="requires-allocate-on-input-ports" />
228            <Quirk name="requires-allocate-on-output-ports" />
229            <Quirk name="requires-loaded-to-idle-after-allocation" />
230            <Limit name="size" min="96x96" max="512x512" />
231            <Limit name="frame-rate" range="1-20" />
232            <Limit name="concurrent-instances" max="16" />
233            <Limit name="quality" range="0-100" default="80" />
234            <Limit name="performance-point-512x512" value="480" />
235            <Feature name="bitrate-modes" value="CQ" />
236        </MediaCodec>
237        <!-- Video Software -->
238        <MediaCodec name="OMX.qcom.video.encoder.h263sw" type="video/3gpp" >
239            <Quirk name="requires-allocate-on-input-ports" />
240            <Quirk name="requires-allocate-on-output-ports" />
241            <Quirk name="requires-loaded-to-idle-after-allocation" />
242            <Limit name="size" min="96x96" max="864x480" />
243            <Limit name="alignment" value="4x4" />
244            <Limit name="block-size" value="16x16" />
245            <Limit name="blocks-per-second" min="36" max="48600" />
246            <Limit name="bitrate" range="1-2000000" />
247            <Limit name="frame-rate" range="1-30" />
248            <Limit name="concurrent-instances" max="16" />
249            <Limit name="performance-point-720x480" value="30" />
250        </MediaCodec>
251        <MediaCodec name="OMX.qcom.video.encoder.mpeg4sw" type="video/mp4v-es" >
252             <Quirk name="requires-allocate-on-input-ports" />
253             <Quirk name="requires-allocate-on-output-ports" />
254             <Quirk name="requires-loaded-to-idle-after-allocation" />
255             <Limit name="size" min="96x96" max="1280x720" />
256             <Limit name="alignment" value="2x2" />
257             <Limit name="block-size" value="16x16" />
258             <Limit name="blocks-per-second" min="36" max="108000" />
259             <Limit name="bitrate" range="1-4000000" />
260             <Limit name="frame-rate" range="1-30" />
261             <Limit name="concurrent-instances" max="16" />
262             <Limit name="performance-point-1280x720" value="30" />
263        </MediaCodec>
264    </Encoders>
265    <Decoders>
266       <!-- Video Hardware  -->
267        <MediaCodec name="OMX.qcom.video.decoder.avc" type="video/avc" >
268            <Quirk name="requires-allocate-on-input-ports" />
269            <Quirk name="requires-allocate-on-output-ports" />
270            <Limit name="size" min="96x96" max="8192x4320" />
271            <Limit name="alignment" value="2x2" />
272            <Limit name="block-size" value="16x16" />
273            <Limit name="blocks-per-second" min="36" max="3916800" />
274            <Limit name="bitrate" range="1-220000000" />
275            <Limit name="frame-rate" range="1-480" />
276            <Feature name="adaptive-playback" />
277            <Limit name="concurrent-instances" max="16" />
278            <Limit name="performance-point-4096x2304" value="60" />
279            <Limit name="performance-point-4096x2160" value="96" />
280            <Limit name="performance-point-3840x2160" value="120" />
281            <Limit name="performance-point-1920x1088" range="480" />
282            <Limit name="performance-point-1920x1088" range="240" />
283            <Limit name="performance-point-1280x720" value="480" />
284        </MediaCodec>
285        <MediaCodec name="OMX.qcom.video.decoder.avc.secure" type="video/avc" >
286            <Quirk name="requires-allocate-on-input-ports" />
287            <Quirk name="requires-allocate-on-output-ports" />
288            <Limit name="size" min="96x96" max="4096x2304" />
289            <Limit name="alignment" value="2x2" />
290            <Limit name="block-size" value="16x16" />
291            <Limit name="blocks-per-second" min="36" max="2073600" />
292            <Limit name="bitrate" range="1-40000000" />
293            <Limit name="frame-rate" range="1-60" />
294            <Feature name="adaptive-playback" />
295            <Feature name="secure-playback" required="true" />
296            <Limit name="concurrent-instances" max="3" />
297            <Limit name="performance-point-4096x2304" value="30" />
298            <Limit name="performance-point-4096x2160" value="60" />
299            <Limit name="performance-point-3840x2160" value="60" />
300        </MediaCodec>
301        <MediaCodec name="OMX.qcom.video.decoder.mpeg2" type="video/mpeg2" >
302            <Quirk name="requires-allocate-on-input-ports" />
303            <Quirk name="requires-allocate-on-output-ports" />
304            <Limit name="size" min="96x96" max="1920x1088" />
305            <Limit name="alignment" value="2x2" />
306            <Limit name="block-size" value="16x16" />
307            <Limit name="blocks-per-second" min="36" max="244800" />
308            <Limit name="bitrate" range="1-40000000" />
309            <Limit name="frame-rate" range="1-30" />
310            <Feature name="adaptive-playback" />
311            <Limit name="concurrent-instances" max="16" />
312            <Limit name="performance-point-1920x1080" value="30" />
313        </MediaCodec>
314        <MediaCodec name="OMX.qcom.video.decoder.mpeg2.secure" type="video/mpeg2" >
315            <Quirk name="requires-allocate-on-input-ports" />
316            <Quirk name="requires-allocate-on-output-ports" />
317            <Limit name="size" min="96x96" max="1920x1088" />
318            <Limit name="alignment" value="2x2" />
319            <Limit name="block-size" value="16x16" />
320            <Limit name="blocks-per-second" min="36" max="244800" />
321            <Limit name="bitrate" range="1-40000000" />
322            <Limit name="frame-rate" range="1-30" />
323            <Feature name="adaptive-playback" />
324            <Feature name="secure-playback" required="true" />
325            <Limit name="concurrent-instances" max="3" />
326            <Limit name="performance-point-1920x1080" value="30" />
327        </MediaCodec>
328        <MediaCodec name="OMX.qcom.video.decoder.vp8" type="video/x-vnd.on2.vp8" >
329            <Quirk name="requires-allocate-on-input-ports" />
330            <Quirk name="requires-allocate-on-output-ports" />
331            <Limit name="size" min="96x96" max="4096x2304" />
332            <Limit name="alignment" value="2x2" />
333            <Limit name="block-size" value="16x16" />
334            <Limit name="blocks-per-second" min="36" max="1036800" />
335            <Limit name="bitrate" range="1-100000000" />
336            <Limit name="frame-rate" range="1-240" />
337            <Feature name="adaptive-playback" />
338            <Limit name="concurrent-instances" max="16" />
339            <Limit name="performance-point-4096x2304" value="24" />
340            <Limit name="performance-point-4096x2160" value="30" />
341            <Limit name="performance-point-3840x2160" value="30" />
342            <Limit name="performance-point-1920x1080" value="120" />
343            <Limit name="performance-point-1280x720" value="240" />
344        </MediaCodec>
345        <MediaCodec name="OMX.qcom.video.decoder.vp9" type="video/x-vnd.on2.vp9" >
346            <Quirk name="requires-allocate-on-input-ports" />
347            <Quirk name="requires-allocate-on-output-ports" />
348            <Limit name="size" min="96x96" max="8192x4320" />
349            <Limit name="alignment" value="2x2" />
350            <Limit name="block-size" value="16x16" />
351            <Limit name="blocks-per-second" min="36" max="3916800" />
352            <Limit name="bitrate" range="1-220000000" />
353            <Limit name="frame-rate" range="1-480" />
354            <Feature name="adaptive-playback" />
355            <Limit name="concurrent-instances" max="6" />
356            <Limit name="performance-point-4096x2304" value="60" />
357            <Limit name="performance-point-4096x2160" value="96" />
358            <Limit name="performance-point-3840x2160" value="120" />
359            <Limit name="performance-point-1920x1088" range="480" />
360            <Limit name="performance-point-1920x1088" range="240" />
361            <Limit name="performance-point-1280x720" value="480" />
362        </MediaCodec>
363        <MediaCodec name="OMX.qcom.video.decoder.vp9.secure" type="video/x-vnd.on2.vp9" >
364            <Quirk name="requires-allocate-on-input-ports" />
365            <Quirk name="requires-allocate-on-output-ports" />
366            <Limit name="size" min="96x96" max="4096x2304" />
367            <Limit name="alignment" value="2x2" />
368            <Limit name="block-size" value="16x16" />
369            <Limit name="blocks-per-second" min="36" max="2073600" />
370            <Limit name="bitrate" range="1-40000000" />
371            <Limit name="frame-rate" range="1-60" />
372            <Feature name="adaptive-playback" />
373            <Feature name="secure-playback" required="true" />
374            <Limit name="concurrent-instances" max="3" />
375            <Limit name="performance-point-4096x2304" value="30" />
376            <Limit name="performance-point-4096x2160" value="60" />
377            <Limit name="performance-point-3840x2160" value="60" />
378        </MediaCodec>
379        <MediaCodec name="OMX.qcom.video.decoder.hevc" type="video/hevc" >
380            <Quirk name="requires-allocate-on-input-ports" />
381            <Quirk name="requires-allocate-on-output-ports" />
382            <Limit name="size" min="96x96" max="8192x4320" />
383            <Limit name="alignment" value="2x2" />
384            <Limit name="block-size" value="16x16" />
385            <Limit name="blocks-per-second" min="36" max="3916800" />
386            <Limit name="bitrate" range="1-220000000" />
387            <Limit name="frame-rate" range="1-480" />
388            <Feature name="adaptive-playback" />
389            <Limit name="concurrent-instances" max="16" />
390            <Limit name="performance-point-4096x2304" value="60" />
391            <Limit name="performance-point-4096x2160" value="96" />
392            <Limit name="performance-point-3840x2160" value="120" />
393            <Limit name="performance-point-1920x1088" range="480" />
394            <Limit name="performance-point-1920x1088" range="240" />
395            <Limit name="performance-point-1280x720" value="480" />
396        </MediaCodec>
397        <MediaCodec name="OMX.qcom.video.decoder.hevc.secure" type="video/hevc" >
398            <Quirk name="requires-allocate-on-input-ports" />
399            <Quirk name="requires-allocate-on-output-ports" />
400            <Limit name="size" min="96x96" max="4096x2304" />
401            <Limit name="alignment" value="2x2" />
402            <Limit name="block-size" value="16x16" />
403            <Limit name="blocks-per-second" min="36" max="2073600" />
404            <Limit name="bitrate" range="1-40000000" />
405            <Limit name="frame-rate" range="1-60" />
406            <Feature name="adaptive-playback" />
407            <Feature name="secure-playback" required="true" />
408            <Limit name="concurrent-instances" max="3" />
409            <Limit name="performance-point-4096x2304" value="30" />
410            <Limit name="performance-point-4096x2160" value="60" />
411            <Limit name="performance-point-3840x2160" value="60" />
412        </MediaCodec>
413        <!-- Video Software -->
414        <MediaCodec name="OMX.qti.video.decoder.h263sw" type="video/3gpp" >
415             <Quirk name="requires-allocate-on-input-ports" />
416             <Quirk name="requires-allocate-on-output-ports" />
417             <Limit name="size" min="96x96" max="864x480" />
418             <Limit name="alignment" value="4x4" />
419             <Limit name="block-size" value="16x16" />
420             <Limit name="blocks-per-second" min="36" max="48600" />
421             <Limit name="bitrate" range="1-16000000" />
422             <Limit name="frame-rate" range="1-30" />
423             <Feature name="adaptive-playback" />
424             <Limit name="concurrent-instances" max="16" />
425             <Limit name="performance-point-720x480" value="30" />
426        </MediaCodec>
427        <MediaCodec name="OMX.qti.video.decoder.mpeg4sw" type="video/mp4v-es">
428             <Quirk name="requires-allocate-on-input-ports" />
429             <Quirk name="requires-allocate-on-output-ports" />
430             <Limit name="size" min="96x96" max="1920x1088" />
431             <Limit name="alignment" value="2x2" />
432             <Limit name="block-size" value="16x16" />
433             <Limit name="blocks-per-second" min="36" max="244800" />
434             <Limit name="bitrate" range="1-40000000" />
435             <Limit name="frame-rate" range="1-30" />
436             <Limit name="concurrent-instances" max="16" />
437             <Limit name="performance-point-1920x1080" value="30" />
438        </MediaCodec>
439        <MediaCodec name="OMX.google.opus.decoder" type="audio/opus" update="true" rank="100"/>
440    </Decoders>
441    <Include href="media_codecs_google_video.xml" />
442</MediaCodecs>
443