]> git.sesse.net Git - ffmpeg/blob - libavcodec/mediacodecdec.c
Merge commit '38434a9ff5b9a1a048f32c1c7e2a9519cf12f8ba'
[ffmpeg] / libavcodec / mediacodecdec.c
1 /*
2  * Android MediaCodec MPEG-2 / H.264 / H.265 / MPEG-4 / VP8 / VP9 decoders
3  *
4  * Copyright (c) 2015-2016 Matthieu Bouron <matthieu.bouron stupeflix.com>
5  *
6  * This file is part of FFmpeg.
7  *
8  * FFmpeg is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * FFmpeg is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with FFmpeg; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22
23 #include <stdint.h>
24 #include <string.h>
25
26 #include "libavutil/avassert.h"
27 #include "libavutil/common.h"
28 #include "libavutil/fifo.h"
29 #include "libavutil/opt.h"
30 #include "libavutil/intreadwrite.h"
31 #include "libavutil/pixfmt.h"
32
33 #include "avcodec.h"
34 #include "decode.h"
35 #include "h264_parse.h"
36 #include "hevc_parse.h"
37 #include "hwaccel.h"
38 #include "internal.h"
39 #include "mediacodec_wrapper.h"
40 #include "mediacodecdec_common.h"
41
42 typedef struct MediaCodecH264DecContext {
43
44     MediaCodecDecContext *ctx;
45
46     AVFifoBuffer *fifo;
47
48     AVPacket buffered_pkt;
49
50 } MediaCodecH264DecContext;
51
52 static av_cold int mediacodec_decode_close(AVCodecContext *avctx)
53 {
54     MediaCodecH264DecContext *s = avctx->priv_data;
55
56     ff_mediacodec_dec_close(avctx, s->ctx);
57     s->ctx = NULL;
58
59     av_fifo_free(s->fifo);
60
61     av_packet_unref(&s->buffered_pkt);
62
63     return 0;
64 }
65
66 #if CONFIG_H264_MEDIACODEC_DECODER || CONFIG_HEVC_MEDIACODEC_DECODER
67 static int h2645_ps_to_nalu(const uint8_t *src, int src_size, uint8_t **out, int *out_size)
68 {
69     int i;
70     int ret = 0;
71     uint8_t *p = NULL;
72     static const uint8_t nalu_header[] = { 0x00, 0x00, 0x00, 0x01 };
73
74     if (!out || !out_size) {
75         return AVERROR(EINVAL);
76     }
77
78     p = av_malloc(sizeof(nalu_header) + src_size);
79     if (!p) {
80         return AVERROR(ENOMEM);
81     }
82
83     *out = p;
84     *out_size = sizeof(nalu_header) + src_size;
85
86     memcpy(p, nalu_header, sizeof(nalu_header));
87     memcpy(p + sizeof(nalu_header), src, src_size);
88
89     /* Escape 0x00, 0x00, 0x0{0-3} pattern */
90     for (i = 4; i < *out_size; i++) {
91         if (i < *out_size - 3 &&
92             p[i + 0] == 0 &&
93             p[i + 1] == 0 &&
94             p[i + 2] <= 3) {
95             uint8_t *new;
96
97             *out_size += 1;
98             new = av_realloc(*out, *out_size);
99             if (!new) {
100                 ret = AVERROR(ENOMEM);
101                 goto done;
102             }
103             *out = p = new;
104
105             i = i + 2;
106             memmove(p + i + 1, p + i, *out_size - (i + 1));
107             p[i] = 0x03;
108         }
109     }
110 done:
111     if (ret < 0) {
112         av_freep(out);
113         *out_size = 0;
114     }
115
116     return ret;
117 }
118 #endif
119
120 #if CONFIG_H264_MEDIACODEC_DECODER
121 static int h264_set_extradata(AVCodecContext *avctx, FFAMediaFormat *format)
122 {
123     int i;
124     int ret;
125
126     H264ParamSets ps;
127     const PPS *pps = NULL;
128     const SPS *sps = NULL;
129     int is_avc = 0;
130     int nal_length_size = 0;
131
132     memset(&ps, 0, sizeof(ps));
133
134     ret = ff_h264_decode_extradata(avctx->extradata, avctx->extradata_size,
135                                    &ps, &is_avc, &nal_length_size, 0, avctx);
136     if (ret < 0) {
137         goto done;
138     }
139
140     for (i = 0; i < MAX_PPS_COUNT; i++) {
141         if (ps.pps_list[i]) {
142             pps = (const PPS*)ps.pps_list[i]->data;
143             break;
144         }
145     }
146
147     if (pps) {
148         if (ps.sps_list[pps->sps_id]) {
149             sps = (const SPS*)ps.sps_list[pps->sps_id]->data;
150         }
151     }
152
153     if (pps && sps) {
154         uint8_t *data = NULL;
155         int data_size = 0;
156
157         if ((ret = h2645_ps_to_nalu(sps->data, sps->data_size, &data, &data_size)) < 0) {
158             goto done;
159         }
160         ff_AMediaFormat_setBuffer(format, "csd-0", (void*)data, data_size);
161         av_freep(&data);
162
163         if ((ret = h2645_ps_to_nalu(pps->data, pps->data_size, &data, &data_size)) < 0) {
164             goto done;
165         }
166         ff_AMediaFormat_setBuffer(format, "csd-1", (void*)data, data_size);
167         av_freep(&data);
168     } else {
169         av_log(avctx, AV_LOG_ERROR, "Could not extract PPS/SPS from extradata");
170         ret = AVERROR_INVALIDDATA;
171     }
172
173 done:
174     ff_h264_ps_uninit(&ps);
175
176     return ret;
177 }
178 #endif
179
180 #if CONFIG_HEVC_MEDIACODEC_DECODER
181 static int hevc_set_extradata(AVCodecContext *avctx, FFAMediaFormat *format)
182 {
183     int i;
184     int ret;
185
186     HEVCParamSets ps;
187     HEVCSEI sei;
188
189     const HEVCVPS *vps = NULL;
190     const HEVCPPS *pps = NULL;
191     const HEVCSPS *sps = NULL;
192     int is_nalff = 0;
193     int nal_length_size = 0;
194
195     uint8_t *vps_data = NULL;
196     uint8_t *sps_data = NULL;
197     uint8_t *pps_data = NULL;
198     int vps_data_size = 0;
199     int sps_data_size = 0;
200     int pps_data_size = 0;
201
202     memset(&ps, 0, sizeof(ps));
203     memset(&sei, 0, sizeof(sei));
204
205     ret = ff_hevc_decode_extradata(avctx->extradata, avctx->extradata_size,
206                                    &ps, &sei, &is_nalff, &nal_length_size, 0, 1, avctx);
207     if (ret < 0) {
208         goto done;
209     }
210
211     for (i = 0; i < HEVC_MAX_VPS_COUNT; i++) {
212         if (ps.vps_list[i]) {
213             vps = (const HEVCVPS*)ps.vps_list[i]->data;
214             break;
215         }
216     }
217
218     for (i = 0; i < HEVC_MAX_PPS_COUNT; i++) {
219         if (ps.pps_list[i]) {
220             pps = (const HEVCPPS*)ps.pps_list[i]->data;
221             break;
222         }
223     }
224
225     if (pps) {
226         if (ps.sps_list[pps->sps_id]) {
227             sps = (const HEVCSPS*)ps.sps_list[pps->sps_id]->data;
228         }
229     }
230
231     if (vps && pps && sps) {
232         uint8_t *data;
233         int data_size;
234
235         if ((ret = h2645_ps_to_nalu(vps->data, vps->data_size, &vps_data, &vps_data_size)) < 0 ||
236             (ret = h2645_ps_to_nalu(sps->data, sps->data_size, &sps_data, &sps_data_size)) < 0 ||
237             (ret = h2645_ps_to_nalu(pps->data, pps->data_size, &pps_data, &pps_data_size)) < 0) {
238             goto done;
239         }
240
241         data_size = vps_data_size + sps_data_size + pps_data_size;
242         data = av_mallocz(data_size);
243         if (!data) {
244             ret = AVERROR(ENOMEM);
245             goto done;
246         }
247
248         memcpy(data                                , vps_data, vps_data_size);
249         memcpy(data + vps_data_size                , sps_data, sps_data_size);
250         memcpy(data + vps_data_size + sps_data_size, pps_data, pps_data_size);
251
252         ff_AMediaFormat_setBuffer(format, "csd-0", data, data_size);
253
254         av_freep(&data);
255     } else {
256         av_log(avctx, AV_LOG_ERROR, "Could not extract VPS/PPS/SPS from extradata");
257         ret = AVERROR_INVALIDDATA;
258     }
259
260 done:
261     ff_hevc_ps_uninit(&ps);
262
263     av_freep(&vps_data);
264     av_freep(&sps_data);
265     av_freep(&pps_data);
266
267     return ret;
268 }
269 #endif
270
271 #if CONFIG_MPEG2_MEDIACODEC_DECODER
272 static int mpeg2_set_extradata(AVCodecContext *avctx, FFAMediaFormat *format)
273 {
274     int ret = 0;
275
276     if (avctx->extradata) {
277         ff_AMediaFormat_setBuffer(format, "csd-0", avctx->extradata, avctx->extradata_size);
278     }
279
280     return ret;
281 }
282 #endif
283
284 #if CONFIG_MPEG4_MEDIACODEC_DECODER
285 static int mpeg4_set_extradata(AVCodecContext *avctx, FFAMediaFormat *format)
286 {
287     int ret = 0;
288
289     if (avctx->extradata) {
290         ff_AMediaFormat_setBuffer(format, "csd-0", avctx->extradata, avctx->extradata_size);
291     }
292
293     return ret;
294 }
295 #endif
296
297 #if CONFIG_VP8_MEDIACODEC_DECODER || CONFIG_VP9_MEDIACODEC_DECODER
298 static int vpx_set_extradata(AVCodecContext *avctx, FFAMediaFormat *format)
299 {
300     int ret = 0;
301
302     if (avctx->extradata) {
303         ff_AMediaFormat_setBuffer(format, "csd-0", avctx->extradata, avctx->extradata_size);
304     }
305
306     return ret;
307 }
308 #endif
309
310 static av_cold int mediacodec_decode_init(AVCodecContext *avctx)
311 {
312     int ret;
313
314     const char *codec_mime = NULL;
315
316     FFAMediaFormat *format = NULL;
317     MediaCodecH264DecContext *s = avctx->priv_data;
318
319     format = ff_AMediaFormat_new();
320     if (!format) {
321         av_log(avctx, AV_LOG_ERROR, "Failed to create media format\n");
322         ret = AVERROR_EXTERNAL;
323         goto done;
324     }
325
326     switch (avctx->codec_id) {
327 #if CONFIG_H264_MEDIACODEC_DECODER
328     case AV_CODEC_ID_H264:
329         codec_mime = "video/avc";
330
331         ret = h264_set_extradata(avctx, format);
332         if (ret < 0)
333             goto done;
334         break;
335 #endif
336 #if CONFIG_HEVC_MEDIACODEC_DECODER
337     case AV_CODEC_ID_HEVC:
338         codec_mime = "video/hevc";
339
340         ret = hevc_set_extradata(avctx, format);
341         if (ret < 0)
342             goto done;
343         break;
344 #endif
345 #if CONFIG_MPEG2_MEDIACODEC_DECODER
346     case AV_CODEC_ID_MPEG2VIDEO:
347         codec_mime = "video/mpeg2";
348
349         ret = mpeg2_set_extradata(avctx, format);
350         if (ret < 0)
351             goto done;
352         break;
353 #endif
354 #if CONFIG_MPEG4_MEDIACODEC_DECODER
355     case AV_CODEC_ID_MPEG4:
356         codec_mime = "video/mp4v-es",
357
358         ret = mpeg4_set_extradata(avctx, format);
359         if (ret < 0)
360             goto done;
361         break;
362 #endif
363 #if CONFIG_VP8_MEDIACODEC_DECODER
364     case AV_CODEC_ID_VP8:
365         codec_mime = "video/x-vnd.on2.vp8";
366
367         ret = vpx_set_extradata(avctx, format);
368         if (ret < 0)
369             goto done;
370         break;
371 #endif
372 #if CONFIG_VP9_MEDIACODEC_DECODER
373     case AV_CODEC_ID_VP9:
374         codec_mime = "video/x-vnd.on2.vp9";
375
376         ret = vpx_set_extradata(avctx, format);
377         if (ret < 0)
378             goto done;
379         break;
380 #endif
381     default:
382         av_assert0(0);
383     }
384
385     ff_AMediaFormat_setString(format, "mime", codec_mime);
386     ff_AMediaFormat_setInt32(format, "width", avctx->width);
387     ff_AMediaFormat_setInt32(format, "height", avctx->height);
388
389     s->ctx = av_mallocz(sizeof(*s->ctx));
390     if (!s->ctx) {
391         av_log(avctx, AV_LOG_ERROR, "Failed to allocate MediaCodecDecContext\n");
392         ret = AVERROR(ENOMEM);
393         goto done;
394     }
395
396     if ((ret = ff_mediacodec_dec_init(avctx, s->ctx, codec_mime, format)) < 0) {
397         s->ctx = NULL;
398         goto done;
399     }
400
401     av_log(avctx, AV_LOG_INFO, "MediaCodec started successfully, ret = %d\n", ret);
402
403     s->fifo = av_fifo_alloc(sizeof(AVPacket));
404     if (!s->fifo) {
405         ret = AVERROR(ENOMEM);
406         goto done;
407     }
408
409 done:
410     if (format) {
411         ff_AMediaFormat_delete(format);
412     }
413
414     if (ret < 0) {
415         mediacodec_decode_close(avctx);
416     }
417
418     return ret;
419 }
420
421 static int mediacodec_receive_frame(AVCodecContext *avctx, AVFrame *frame)
422 {
423     MediaCodecH264DecContext *s = avctx->priv_data;
424     int ret;
425     int got_frame = 0;
426     int is_eof = 0;
427     AVPacket pkt = { 0 };
428
429     /*
430      * MediaCodec.flush() discards both input and output buffers, thus we
431      * need to delay the call to this function until the user has released or
432      * renderered the frames he retains.
433      *
434      * After we have buffered an input packet, check if the codec is in the
435      * flushing state. If it is, we need to call ff_mediacodec_dec_flush.
436      *
437      * ff_mediacodec_dec_flush returns 0 if the flush cannot be performed on
438      * the codec (because the user retains frames). The codec stays in the
439      * flushing state.
440      *
441      * ff_mediacodec_dec_flush returns 1 if the flush can actually be
442      * performed on the codec. The codec leaves the flushing state and can
443      * process again packets.
444      *
445      * ff_mediacodec_dec_flush returns a negative value if an error has
446      * occurred.
447      *
448      */
449     if (ff_mediacodec_dec_is_flushing(avctx, s->ctx)) {
450         if (!ff_mediacodec_dec_flush(avctx, s->ctx)) {
451             return AVERROR(EAGAIN);
452         }
453     }
454
455     ret = ff_decode_get_packet(avctx, &pkt);
456     if (ret == AVERROR_EOF)
457         is_eof = 1;
458     else if (ret == AVERROR(EAGAIN))
459         ; /* no input packet, but fallthrough to check for pending frames */
460     else if (ret < 0)
461         return ret;
462
463     /* buffer the input packet */
464     if (pkt.size) {
465         if (av_fifo_space(s->fifo) < sizeof(pkt)) {
466             ret = av_fifo_realloc2(s->fifo,
467                                    av_fifo_size(s->fifo) + sizeof(pkt));
468             if (ret < 0) {
469                 av_packet_unref(&pkt);
470                 return ret;
471             }
472         }
473         av_fifo_generic_write(s->fifo, &pkt, sizeof(pkt), NULL);
474     }
475
476     /* process buffered data */
477     while (!got_frame) {
478         /* prepare the input data */
479         if (s->buffered_pkt.size <= 0) {
480             av_packet_unref(&s->buffered_pkt);
481
482             /* no more data */
483             if (av_fifo_size(s->fifo) < sizeof(AVPacket)) {
484                 AVPacket null_pkt = { 0 };
485                 if (is_eof) {
486                     ret = ff_mediacodec_dec_decode(avctx, s->ctx, frame,
487                                                    &got_frame, &null_pkt);
488                     if (ret < 0)
489                         return ret;
490                     else if (got_frame)
491                         return 0;
492                     else
493                         return AVERROR_EOF;
494                 }
495                 return AVERROR(EAGAIN);
496             }
497
498             av_fifo_generic_read(s->fifo, &s->buffered_pkt, sizeof(s->buffered_pkt), NULL);
499         }
500
501         ret = ff_mediacodec_dec_decode(avctx, s->ctx, frame, &got_frame, &s->buffered_pkt);
502         if (ret < 0)
503             return ret;
504
505         s->buffered_pkt.size -= ret;
506         s->buffered_pkt.data += ret;
507     }
508
509     return 0;
510 }
511
512 static void mediacodec_decode_flush(AVCodecContext *avctx)
513 {
514     MediaCodecH264DecContext *s = avctx->priv_data;
515
516     while (av_fifo_size(s->fifo)) {
517         AVPacket pkt;
518         av_fifo_generic_read(s->fifo, &pkt, sizeof(pkt), NULL);
519         av_packet_unref(&pkt);
520     }
521     av_fifo_reset(s->fifo);
522
523     av_packet_unref(&s->buffered_pkt);
524
525     ff_mediacodec_dec_flush(avctx, s->ctx);
526 }
527
528 static const AVCodecHWConfigInternal *mediacodec_hw_configs[] = {
529     &(const AVCodecHWConfigInternal) {
530         .public          = {
531             .pix_fmt     = AV_PIX_FMT_MEDIACODEC,
532             .methods     = AV_CODEC_HW_CONFIG_METHOD_AD_HOC |
533                            AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX,
534             .device_type = AV_HWDEVICE_TYPE_MEDIACODEC,
535         },
536         .hwaccel         = NULL,
537     },
538     NULL
539 };
540
541 #if CONFIG_H264_MEDIACODEC_DECODER
542 AVCodec ff_h264_mediacodec_decoder = {
543     .name           = "h264_mediacodec",
544     .long_name      = NULL_IF_CONFIG_SMALL("H.264 Android MediaCodec decoder"),
545     .type           = AVMEDIA_TYPE_VIDEO,
546     .id             = AV_CODEC_ID_H264,
547     .priv_data_size = sizeof(MediaCodecH264DecContext),
548     .init           = mediacodec_decode_init,
549     .receive_frame  = mediacodec_receive_frame,
550     .flush          = mediacodec_decode_flush,
551     .close          = mediacodec_decode_close,
552     .capabilities   = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE,
553     .caps_internal  = FF_CODEC_CAP_SETS_PKT_DTS,
554     .bsfs           = "h264_mp4toannexb",
555     .hw_configs     = mediacodec_hw_configs,
556     .wrapper_name   = "mediacodec",
557 };
558 #endif
559
560 #if CONFIG_HEVC_MEDIACODEC_DECODER
561 AVCodec ff_hevc_mediacodec_decoder = {
562     .name           = "hevc_mediacodec",
563     .long_name      = NULL_IF_CONFIG_SMALL("H.265 Android MediaCodec decoder"),
564     .type           = AVMEDIA_TYPE_VIDEO,
565     .id             = AV_CODEC_ID_HEVC,
566     .priv_data_size = sizeof(MediaCodecH264DecContext),
567     .init           = mediacodec_decode_init,
568     .receive_frame  = mediacodec_receive_frame,
569     .flush          = mediacodec_decode_flush,
570     .close          = mediacodec_decode_close,
571     .capabilities   = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE,
572     .caps_internal  = FF_CODEC_CAP_SETS_PKT_DTS,
573     .bsfs           = "hevc_mp4toannexb",
574     .hw_configs     = mediacodec_hw_configs,
575     .wrapper_name   = "mediacodec",
576 };
577 #endif
578
579 #if CONFIG_MPEG2_MEDIACODEC_DECODER
580 AVCodec ff_mpeg2_mediacodec_decoder = {
581     .name           = "mpeg2_mediacodec",
582     .long_name      = NULL_IF_CONFIG_SMALL("MPEG-2 Android MediaCodec decoder"),
583     .type           = AVMEDIA_TYPE_VIDEO,
584     .id             = AV_CODEC_ID_MPEG2VIDEO,
585     .priv_data_size = sizeof(MediaCodecH264DecContext),
586     .init           = mediacodec_decode_init,
587     .receive_frame  = mediacodec_receive_frame,
588     .flush          = mediacodec_decode_flush,
589     .close          = mediacodec_decode_close,
590     .capabilities   = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE,
591     .caps_internal  = FF_CODEC_CAP_SETS_PKT_DTS,
592     .hw_configs     = mediacodec_hw_configs,
593     .wrapper_name   = "mediacodec",
594 };
595 #endif
596
597 #if CONFIG_MPEG4_MEDIACODEC_DECODER
598 AVCodec ff_mpeg4_mediacodec_decoder = {
599     .name           = "mpeg4_mediacodec",
600     .long_name      = NULL_IF_CONFIG_SMALL("MPEG-4 Android MediaCodec decoder"),
601     .type           = AVMEDIA_TYPE_VIDEO,
602     .id             = AV_CODEC_ID_MPEG4,
603     .priv_data_size = sizeof(MediaCodecH264DecContext),
604     .init           = mediacodec_decode_init,
605     .receive_frame  = mediacodec_receive_frame,
606     .flush          = mediacodec_decode_flush,
607     .close          = mediacodec_decode_close,
608     .capabilities   = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE,
609     .caps_internal  = FF_CODEC_CAP_SETS_PKT_DTS,
610     .hw_configs     = mediacodec_hw_configs,
611     .wrapper_name   = "mediacodec",
612 };
613 #endif
614
615 #if CONFIG_VP8_MEDIACODEC_DECODER
616 AVCodec ff_vp8_mediacodec_decoder = {
617     .name           = "vp8_mediacodec",
618     .long_name      = NULL_IF_CONFIG_SMALL("VP8 Android MediaCodec decoder"),
619     .type           = AVMEDIA_TYPE_VIDEO,
620     .id             = AV_CODEC_ID_VP8,
621     .priv_data_size = sizeof(MediaCodecH264DecContext),
622     .init           = mediacodec_decode_init,
623     .receive_frame  = mediacodec_receive_frame,
624     .flush          = mediacodec_decode_flush,
625     .close          = mediacodec_decode_close,
626     .capabilities   = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE,
627     .caps_internal  = FF_CODEC_CAP_SETS_PKT_DTS,
628     .hw_configs     = mediacodec_hw_configs,
629     .wrapper_name   = "mediacodec",
630 };
631 #endif
632
633 #if CONFIG_VP9_MEDIACODEC_DECODER
634 AVCodec ff_vp9_mediacodec_decoder = {
635     .name           = "vp9_mediacodec",
636     .long_name      = NULL_IF_CONFIG_SMALL("VP9 Android MediaCodec decoder"),
637     .type           = AVMEDIA_TYPE_VIDEO,
638     .id             = AV_CODEC_ID_VP9,
639     .priv_data_size = sizeof(MediaCodecH264DecContext),
640     .init           = mediacodec_decode_init,
641     .receive_frame  = mediacodec_receive_frame,
642     .flush          = mediacodec_decode_flush,
643     .close          = mediacodec_decode_close,
644     .capabilities   = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE,
645     .caps_internal  = FF_CODEC_CAP_SETS_PKT_DTS,
646     .hw_configs     = mediacodec_hw_configs,
647     .wrapper_name   = "mediacodec",
648 };
649 #endif