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_vendor_audio.xml" />
135    <Include href="media_codecs_google_telephony.xml" />
136    <Settings>
137        <Setting name="max-video-encoder-input-buffers" value="11" />
138    </Settings>
139    <Encoders>
140        <!-- Video Hardware  -->
141        <MediaCodec name="OMX.qcom.video.encoder.avc" type="video/avc" >
142            <Quirk name="requires-allocate-on-input-ports" />
143            <Quirk name="requires-allocate-on-output-ports" />
144            <Quirk name="requires-loaded-to-idle-after-allocation" />
145            <Limit name="size" min="96x96" max="4096x2304" />
146            <Limit name="alignment" value="2x2" />
147            <Limit name="block-size" value="16x16" />
148            <Limit name="blocks-per-second" min="24" max="2073600" />
149            <Limit name="bitrate" range="1-120000000" />
150            <Limit name="frame-rate" range="1-480" />
151            <Limit name="concurrent-instances" max="16" />
152            <Limit name="performance-point-4096x2160" value="24" />
153            <Limit name="performance-point-3840x2160" value="30" />
154            <Limit name="performance-point-1920x1080" value="120" />
155            <Limit name="performance-point-1280x720" value="240" />
156        </MediaCodec>
157        <MediaCodec name="OMX.qcom.video.encoder.vp8" type="video/x-vnd.on2.vp8" >
158            <Quirk name="requires-allocate-on-input-ports" />
159            <Quirk name="requires-allocate-on-output-ports" />
160            <Quirk name="requires-loaded-to-idle-after-allocation" />
161            <Limit name="size" min="96x96" max="4096x2304" />
162            <Limit name="alignment" value="2x2" />
163            <Limit name="block-size" value="16x16" />
164            <Limit name="blocks-per-second" min="24" max="1036800" />
165            <Limit name="bitrate" range="1-120000000" />
166            <Limit name="frame-rate" range="1-240" />
167            <Limit name="concurrent-instances" max="16" />
168            <Limit name="performance-point-1920x1080" value="60" />
169            <Limit name="performance-point-1280x720" value="120" />
170        </MediaCodec>
171        <MediaCodec name="OMX.qcom.video.encoder.hevc" type="video/hevc" >
172            <Quirk name="requires-allocate-on-input-ports" />
173            <Quirk name="requires-allocate-on-output-ports" />
174            <Quirk name="requires-loaded-to-idle-after-allocation" />
175            <Limit name="size" min="96x96" max="4096x2304" />
176            <Limit name="alignment" value="2x2" />
177            <Limit name="block-size" value="16x16" />
178            <Limit name="blocks-per-second" min="24" max="2073600" />
179            <Limit name="bitrate" range="1-120000000" />
180            <Limit name="frame-rate" range="1-480" />
181            <Limit name="concurrent-instances" max="16" />
182            <Limit name="performance-point-4096x2160" value="24" />
183            <Limit name="performance-point-3840x2160" value="30" />
184            <Limit name="performance-point-1920x1080" value="120" />
185            <Limit name="performance-point-1280x720" value="240" />
186            <Limit name="quality" range="0-100" default="80" />
187            <Feature name="bitrate-modes" value="VBR,CBR" />
188        </MediaCodec>
189        <MediaCodec name="OMX.qcom.video.encoder.hevc.cq" type="video/hevc" >
190            <Quirk name="requires-allocate-on-input-ports" />
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="512x512" max="512x512" />
195            <Limit name="frame-rate" range="1-20" />
196            <Limit name="concurrent-instances" max="16" />
197            <Limit name="quality" range="0-100" default="80" />
198            <Limit name="performance-point-512x512" value="480" />
199            <Feature name="bitrate-modes" value="CQ" />
200        </MediaCodec>
201        <MediaCodec name="OMX.qcom.video.encoder.heic" type="image/vnd.android.heic" >
202            <Quirk name="requires-allocate-on-input-ports" />
203            <Quirk name="requires-allocate-on-input-ports" />
204            <Quirk name="requires-allocate-on-output-ports" />
205            <Quirk name="requires-loaded-to-idle-after-allocation" />
206            <Limit name="size" min="512x512" max="8192x8192" />
207            <Limit name="frame-rate" range="1-20" />
208            <Limit name="concurrent-instances" max="6" />
209            <Limit name="quality" range="0-100" default="80" />
210            <Limit name="performance-point-4096x2160" value="12" />
211            <Limit name="performance-point-1920x1080" value="40" />
212            <Limit name="performance-point-1920x1080" value="30" />
213            <Limit name="performance-point-1280x720" value="80" />
214            <Limit name="performance-point-1280x720" value="60" />
215            <Feature name="bitrate-modes" value="CQ" />
216        </MediaCodec>
217        <!-- Video Software -->
218        <MediaCodec name="OMX.qcom.video.encoder.h263sw" type="video/3gpp" >
219            <Quirk name="requires-allocate-on-input-ports" />
220            <Quirk name="requires-allocate-on-output-ports" />
221            <Quirk name="requires-loaded-to-idle-after-allocation" />
222            <Limit name="size" min="32x32" max="864x480" />
223            <Limit name="alignment" value="4x4" />
224            <Limit name="block-size" value="16x16" />
225            <Limit name="blocks-per-second" min="1" max="48600" />
226            <Limit name="bitrate" range="1-2000000" />
227            <Limit name="frame-rate" range="1-30" />
228            <Limit name="concurrent-instances" max="16" />
229            <Limit name="performance-point-720x480" value="30" />
230        </MediaCodec>
231        <MediaCodec name="OMX.qcom.video.encoder.mpeg4sw" type="video/mp4v-es" >
232             <Quirk name="requires-allocate-on-input-ports" />
233             <Quirk name="requires-allocate-on-output-ports" />
234             <Quirk name="requires-loaded-to-idle-after-allocation" />
235             <Limit name="size" min="32x32" max="1280x720" />
236             <Limit name="alignment" value="2x2" />
237             <Limit name="block-size" value="16x16" />
238             <Limit name="blocks-per-second" min="1" max="108000" />
239             <Limit name="bitrate" range="1-4000000" />
240             <Limit name="frame-rate" range="1-30" />
241             <Limit name="concurrent-instances" max="16" />
242             <Limit name="performance-point-1280x720" value="30" />
243        </MediaCodec>
244    </Encoders>
245    <Decoders>
246       <!-- Video Hardware  -->
247        <MediaCodec name="OMX.qcom.video.decoder.avc" type="video/avc" >
248            <Quirk name="requires-allocate-on-input-ports" />
249            <Quirk name="requires-allocate-on-output-ports" />
250            <Limit name="size" min="96x96" max="4096x2304" />
251            <Limit name="alignment" value="2x2" />
252            <Limit name="block-size" value="16x16" />
253            <Limit name="blocks-per-second" min="24" max="2073600" />
254            <Limit name="bitrate" range="1-120000000" />
255            <Limit name="frame-rate" range="1-480" />
256            <Feature name="adaptive-playback" />
257            <Limit name="concurrent-instances" max="16" />
258            <Limit name="performance-point-4096x2160" value="24" />
259            <Limit name="performance-point-3840x2160" value="30" />
260            <Limit name="performance-point-1920x1088" range="120" />
261            <Limit name="performance-point-1280x720" value="240" />
262        </MediaCodec>
263        <MediaCodec name="OMX.qcom.video.decoder.avc.secure" type="video/avc" >
264            <Quirk name="requires-allocate-on-input-ports" />
265            <Quirk name="requires-allocate-on-output-ports" />
266            <Limit name="size" min="96x96" max="4096x2304" />
267            <Limit name="alignment" value="2x2" />
268            <Limit name="block-size" value="16x16" />
269            <Limit name="blocks-per-second" min="24" max="2073600" />
270            <Limit name="bitrate" range="1-40000000" />
271            <Limit name="frame-rate" range="1-60" />
272            <Feature name="adaptive-playback" />
273            <Feature name="secure-playback" required="true" />
274            <Limit name="concurrent-instances" max="3" />
275            <Limit name="performance-point-4096x2160" value="24" />
276            <Limit name="performance-point-3840x2160" value="30" />
277            <Limit name="performance-point-1920x1088" value="60" />
278        </MediaCodec>
279        <MediaCodec name="OMX.qcom.video.decoder.mpeg2" type="video/mpeg2" >
280            <Quirk name="requires-allocate-on-input-ports" />
281            <Quirk name="requires-allocate-on-output-ports" />
282            <Limit name="size" min="96x96" max="1920x1088" />
283            <Limit name="alignment" value="2x2" />
284            <Limit name="block-size" value="16x16" />
285            <Limit name="blocks-per-second" min="24" max="244800" />
286            <Limit name="bitrate" range="1-40000000" />
287            <Limit name="frame-rate" range="1-30" />
288            <Feature name="adaptive-playback" />
289            <Limit name="concurrent-instances" max="16" />
290            <Limit name="performance-point-1920x1080" value="30" />
291        </MediaCodec>
292        <MediaCodec name="OMX.qcom.video.decoder.mpeg2.secure" type="video/mpeg2" >
293            <Quirk name="requires-allocate-on-input-ports" />
294            <Quirk name="requires-allocate-on-output-ports" />
295            <Limit name="size" min="96x96" max="1920x1088" />
296            <Limit name="alignment" value="2x2" />
297            <Limit name="block-size" value="16x16" />
298            <Limit name="blocks-per-second" min="24" max="244800" />
299            <Limit name="bitrate" range="1-40000000" />
300            <Limit name="frame-rate" range="1-30" />
301            <Feature name="adaptive-playback" />
302            <Feature name="secure-playback" required="true" />
303            <Limit name="concurrent-instances" max="3" />
304            <Limit name="performance-point-1920x1080" value="30" />
305        </MediaCodec>
306        <MediaCodec name="OMX.qcom.video.decoder.vp8" type="video/x-vnd.on2.vp8" >
307            <Quirk name="requires-allocate-on-input-ports" />
308            <Quirk name="requires-allocate-on-output-ports" />
309            <Limit name="size" min="96x96" max="4096x2304" />
310            <Limit name="alignment" value="2x2" />
311            <Limit name="block-size" value="16x16" />
312            <Limit name="blocks-per-second" min="24" max="1036800" />
313            <Limit name="bitrate" range="1-120000000" />
314            <Limit name="frame-rate" range="1-240" />
315            <Feature name="adaptive-playback" />
316            <Limit name="concurrent-instances" max="16" />
317            <Limit name="performance-point-1920x1080" value="60" />
318            <Limit name="performance-point-1280x720" value="120" />
319        </MediaCodec>
320        <MediaCodec name="OMX.qcom.video.decoder.vp9" type="video/x-vnd.on2.vp9" >
321            <Quirk name="requires-allocate-on-input-ports" />
322            <Quirk name="requires-allocate-on-output-ports" />
323            <Limit name="size" min="96x96" max="4096x2304" />
324            <Limit name="alignment" value="2x2" />
325            <Limit name="block-size" value="16x16" />
326            <Limit name="blocks-per-second" min="24" max="2073600" />
327            <Limit name="bitrate" range="1-120000000" />
328            <Limit name="frame-rate" range="1-480" />
329            <Feature name="adaptive-playback" />
330            <Limit name="concurrent-instances" max="6" />
331            <Limit name="performance-point-4096x2160" value="24" />
332            <Limit name="performance-point-3840x2160" value="30" />
333            <Limit name="performance-point-1920x1088" range="120" />
334            <Limit name="performance-point-1280x720" value="240" />
335        </MediaCodec>
336        <MediaCodec name="OMX.qcom.video.decoder.vp9.secure" type="video/x-vnd.on2.vp9" >
337            <Quirk name="requires-allocate-on-input-ports" />
338            <Quirk name="requires-allocate-on-output-ports" />
339            <Limit name="size" min="96x96" max="4096x2304" />
340            <Limit name="alignment" value="2x2" />
341            <Limit name="block-size" value="16x16" />
342            <Limit name="blocks-per-second" min="24" max="2073600" />
343            <Limit name="bitrate" range="1-40000000" />
344            <Limit name="frame-rate" range="1-60" />
345            <Feature name="adaptive-playback" />
346            <Feature name="secure-playback" required="true" />
347            <Limit name="concurrent-instances" max="3" />
348            <Limit name="performance-point-4096x2160" value="24" />
349            <Limit name="performance-point-3840x2160" value="30" />
350            <Limit name="performance-point-1920x1088" value="60" />
351        </MediaCodec>
352        <MediaCodec name="OMX.qcom.video.decoder.hevc" type="video/hevc" >
353            <Quirk name="requires-allocate-on-input-ports" />
354            <Quirk name="requires-allocate-on-output-ports" />
355            <Limit name="size" min="96x96" max="4096x2304" />
356            <Limit name="alignment" value="2x2" />
357            <Limit name="block-size" value="16x16" />
358            <Limit name="blocks-per-second" min="24" max="2073600" />
359            <Limit name="bitrate" range="1-120000000" />
360            <Limit name="frame-rate" range="1-480" />
361            <Feature name="adaptive-playback" />
362            <Limit name="concurrent-instances" max="16" />
363            <Limit name="performance-point-4096x2160" value="24" />
364            <Limit name="performance-point-3840x2160" value="30" />
365            <Limit name="performance-point-1920x1088" range="120" />
366            <Limit name="performance-point-1280x720" value="240" />
367        </MediaCodec>
368        <MediaCodec name="OMX.qcom.video.decoder.hevc.secure" type="video/hevc" >
369            <Quirk name="requires-allocate-on-input-ports" />
370            <Quirk name="requires-allocate-on-output-ports" />
371            <Limit name="size" min="96x96" max="4096x2304" />
372            <Limit name="alignment" value="2x2" />
373            <Limit name="block-size" value="16x16" />
374            <Limit name="blocks-per-second" min="24" max="2073600" />
375            <Limit name="bitrate" range="1-40000000" />
376            <Limit name="frame-rate" range="1-60" />
377            <Feature name="adaptive-playback" />
378            <Feature name="secure-playback" required="true" />
379            <Limit name="concurrent-instances" max="3" />
380            <Limit name="performance-point-4096x2160" value="24" />
381            <Limit name="performance-point-3840x2160" value="30" />
382            <Limit name="performance-point-1920x1088" value="60" />
383        </MediaCodec>
384        <!-- Video Software -->
385        <MediaCodec name="OMX.qti.video.decoder.h263sw" type="video/3gpp" >
386             <Quirk name="requires-allocate-on-input-ports" />
387             <Quirk name="requires-allocate-on-output-ports" />
388             <Limit name="size" min="16x16" max="864x480" />
389             <Limit name="alignment" value="4x4" />
390             <Limit name="block-size" value="16x16" />
391             <Limit name="blocks-per-second" min="1" max="48600" />
392             <Limit name="bitrate" range="1-16000000" />
393             <Limit name="frame-rate" range="1-30" />
394             <Feature name="adaptive-playback" />
395             <Limit name="concurrent-instances" max="16" />
396             <Limit name="performance-point-720x480" value="30" />
397        </MediaCodec>
398        <MediaCodec name="OMX.qti.video.decoder.mpeg4sw">
399             <Quirk name="requires-allocate-on-input-ports" />
400             <Quirk name="requires-allocate-on-output-ports" />
401             <Type name="video/mp4v-es">
402                <Limit name="size" min="16x16" max="1920x1088" />
403                <Limit name="alignment" value="2x2" />
404                <Limit name="block-size" value="16x16" />
405                <Limit name="blocks-per-second" min="1" max="244800" />
406                <Limit name="bitrate" range="1-40000000" />
407                <Limit name="frame-rate" range="1-30" />
408                <Limit name="concurrent-instances" max="16" />
409                <Limit name="performance-point-1920x1080" value="30" />
410             </Type>
411             <Type name="video/mp4v-esdp">
412                <Limit name="size" min="16x16" max="1920x1088" />
413                <Limit name="alignment" value="2x2" />
414                <Limit name="block-size" value="16x16" />
415                <Limit name="blocks-per-second" min="1" max="244800" />
416                <Limit name="bitrate" range="1-40000000" />
417                <Limit name="frame-rate" range="1-30" />
418                <Limit name="concurrent-instances" max="16" />
419                <Limit name="performance-point-1920x1080" value="30" />
420             </Type>
421        </MediaCodec>
422        <MediaCodec name="OMX.qti.video.decoder.vc1sw" type="video/x-ms-wmv" >
423            <Quirk name="requires-allocate-on-input-ports" />
424            <Quirk name="requires-allocate-on-output-ports" />
425            <Limit name="size" min="64x64" max="1920x1088" />
426            <Limit name="alignment" value="2x2" />
427            <Limit name="block-size" value="16x16" />
428            <Limit name="blocks-per-second" min="1" max="244800" />
429            <Limit name="bitrate" range="1-20000000" />
430            <Limit name="frame-rate" range="1-30" />
431            <Feature name="adaptive-playback" />
432            <Limit name="concurrent-instances" max="16" />
433            <Limit name="performance-point-1920x1080" value="30" />
434        </MediaCodec>
435        <!-- Audio Software  -->
436    </Decoders>
437    <Include href="media_codecs_google_video.xml" />
438</MediaCodecs>
439