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