]> git.sesse.net Git - ffmpeg/blob - libavcodec/mediacodecdec.c
avfilter/af_aiir: rename options, provide gains in separate option
[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     av_freep(&vps_data);
262     av_freep(&sps_data);
263     av_freep(&pps_data);
264
265     return ret;
266 }
267 #endif
268
269 #if CONFIG_MPEG2_MEDIACODEC_DECODER
270 static int mpeg2_set_extradata(AVCodecContext *avctx, FFAMediaFormat *format)
271 {
272     int ret = 0;
273
274     if (avctx->extradata) {
275         ff_AMediaFormat_setBuffer(format, "csd-0", avctx->extradata, avctx->extradata_size);
276     }
277
278     return ret;
279 }
280 #endif
281
282 #if CONFIG_MPEG4_MEDIACODEC_DECODER
283 static int mpeg4_set_extradata(AVCodecContext *avctx, FFAMediaFormat *format)
284 {
285     int ret = 0;
286
287     if (avctx->extradata) {
288         ff_AMediaFormat_setBuffer(format, "csd-0", avctx->extradata, avctx->extradata_size);
289     }
290
291     return ret;
292 }
293 #endif
294
295 #if CONFIG_VP8_MEDIACODEC_DECODER || CONFIG_VP9_MEDIACODEC_DECODER
296 static int vpx_set_extradata(AVCodecContext *avctx, FFAMediaFormat *format)
297 {
298     int ret = 0;
299
300     if (avctx->extradata) {
301         ff_AMediaFormat_setBuffer(format, "csd-0", avctx->extradata, avctx->extradata_size);
302     }
303
304     return ret;
305 }
306 #endif
307
308 static av_cold int mediacodec_decode_init(AVCodecContext *avctx)
309 {
310     int ret;
311
312     const char *codec_mime = NULL;
313
314     FFAMediaFormat *format = NULL;
315     MediaCodecH264DecContext *s = avctx->priv_data;
316
317     format = ff_AMediaFormat_new();
318     if (!format) {
319         av_log(avctx, AV_LOG_ERROR, "Failed to create media format\n");
320         ret = AVERROR_EXTERNAL;
321         goto done;
322     }
323
324     switch (avctx->codec_id) {
325 #if CONFIG_H264_MEDIACODEC_DECODER
326     case AV_CODEC_ID_H264:
327         codec_mime = "video/avc";
328
329         ret = h264_set_extradata(avctx, format);
330         if (ret < 0)
331             goto done;
332         break;
333 #endif
334 #if CONFIG_HEVC_MEDIACODEC_DECODER
335     case AV_CODEC_ID_HEVC:
336         codec_mime = "video/hevc";
337
338         ret = hevc_set_extradata(avctx, format);
339         if (ret < 0)
340             goto done;
341         break;
342 #endif
343 #if CONFIG_MPEG2_MEDIACODEC_DECODER
344     case AV_CODEC_ID_MPEG2VIDEO:
345         codec_mime = "video/mpeg2";
346
347         ret = mpeg2_set_extradata(avctx, format);
348         if (ret < 0)
349             goto done;
350         break;
351 #endif
352 #if CONFIG_MPEG4_MEDIACODEC_DECODER
353     case AV_CODEC_ID_MPEG4:
354         codec_mime = "video/mp4v-es",
355
356         ret = mpeg4_set_extradata(avctx, format);
357         if (ret < 0)
358             goto done;
359         break;
360 #endif
361 #if CONFIG_VP8_MEDIACODEC_DECODER
362     case AV_CODEC_ID_VP8:
363         codec_mime = "video/x-vnd.on2.vp8";
364
365         ret = vpx_set_extradata(avctx, format);
366         if (ret < 0)
367             goto done;
368         break;
369 #endif
370 #if CONFIG_VP9_MEDIACODEC_DECODER
371     case AV_CODEC_ID_VP9:
372         codec_mime = "video/x-vnd.on2.vp9";
373
374         ret = vpx_set_extradata(avctx, format);
375         if (ret < 0)
376             goto done;
377         break;
378 #endif
379     default:
380         av_assert0(0);
381     }
382
383     ff_AMediaFormat_setString(format, "mime", codec_mime);
384     ff_AMediaFormat_setInt32(format, "width", avctx->width);
385     ff_AMediaFormat_setInt32(format, "height", avctx->height);
386
387     s->ctx = av_mallocz(sizeof(*s->ctx));
388     if (!s->ctx) {
389         av_log(avctx, AV_LOG_ERROR, "Failed to allocate MediaCodecDecContext\n");
390         ret = AVERROR(ENOMEM);
391         goto done;
392     }
393
394     if ((ret = ff_mediacodec_dec_init(avctx, s->ctx, codec_mime, format)) < 0) {
395         s->ctx = NULL;
396         goto done;
397     }
398
399     av_log(avctx, AV_LOG_INFO, "MediaCodec started successfully, ret = %d\n", ret);
400
401     s->fifo = av_fifo_alloc(sizeof(AVPacket));
402     if (!s->fifo) {
403         ret = AVERROR(ENOMEM);
404         goto done;
405     }
406
407 done:
408     if (format) {
409         ff_AMediaFormat_delete(format);
410     }
411
412     if (ret < 0) {
413         mediacodec_decode_close(avctx);
414     }
415
416     return ret;
417 }
418
419 static int mediacodec_receive_frame(AVCodecContext *avctx, AVFrame *frame)
420 {
421     MediaCodecH264DecContext *s = avctx->priv_data;
422     int ret;
423     int got_frame = 0;
424     int is_eof = 0;
425     AVPacket pkt = { 0 };
426
427     /*
428      * MediaCodec.flush() discards both input and output buffers, thus we
429      * need to delay the call to this function until the user has released or
430      * renderered the frames he retains.
431      *
432      * After we have buffered an input packet, check if the codec is in the
433      * flushing state. If it is, we need to call ff_mediacodec_dec_flush.
434      *
435      * ff_mediacodec_dec_flush returns 0 if the flush cannot be performed on
436      * the codec (because the user retains frames). The codec stays in the
437      * flushing state.
438      *
439      * ff_mediacodec_dec_flush returns 1 if the flush can actually be
440      * performed on the codec. The codec leaves the flushing state and can
441      * process again packets.
442      *
443      * ff_mediacodec_dec_flush returns a negative value if an error has
444      * occurred.
445      *
446      */
447     if (ff_mediacodec_dec_is_flushing(avctx, s->ctx)) {
448         if (!ff_mediacodec_dec_flush(avctx, s->ctx)) {
449             return AVERROR(EAGAIN);
450         }
451     }
452
453     ret = ff_decode_get_packet(avctx, &pkt);
454     if (ret == AVERROR_EOF)
455         is_eof = 1;
456     else if (ret == AVERROR(EAGAIN))
457         ; /* no input packet, but fallthrough to check for pending frames */
458     else if (ret < 0)
459         return ret;
460
461     /* buffer the input packet */
462     if (pkt.size) {
463         if (av_fifo_space(s->fifo) < sizeof(pkt)) {
464             ret = av_fifo_realloc2(s->fifo,
465                                    av_fifo_size(s->fifo) + sizeof(pkt));
466             if (ret < 0) {
467                 av_packet_unref(&pkt);
468                 return ret;
469             }
470         }
471         av_fifo_generic_write(s->fifo, &pkt, sizeof(pkt), NULL);
472     }
473
474     /* process buffered data */
475     while (!got_frame) {
476         /* prepare the input data */
477         if (s->buffered_pkt.size <= 0) {
478             av_packet_unref(&s->buffered_pkt);
479
480             /* no more data */
481             if (av_fifo_size(s->fifo) < sizeof(AVPacket)) {
482                 AVPacket null_pkt = { 0 };
483                 if (is_eof) {
484                     ret = ff_mediacodec_dec_decode(avctx, s->ctx, frame,
485                                                    &got_frame, &null_pkt);
486                     if (ret < 0)
487                         return ret;
488                     else if (got_frame)
489                         return 0;
490                     else
491                         return AVERROR_EOF;
492                 }
493                 return AVERROR(EAGAIN);
494             }
495
496             av_fifo_generic_read(s->fifo, &s->buffered_pkt, sizeof(s->buffered_pkt), NULL);
497         }
498
499         ret = ff_mediacodec_dec_decode(avctx, s->ctx, frame, &got_frame, &s->buffered_pkt);
500         if (ret < 0)
501             return ret;
502
503         s->buffered_pkt.size -= ret;
504         s->buffered_pkt.data += ret;
505     }
506
507     return 0;
508 }
509
510 static void mediacodec_decode_flush(AVCodecContext *avctx)
511 {
512     MediaCodecH264DecContext *s = avctx->priv_data;
513
514     while (av_fifo_size(s->fifo)) {
515         AVPacket pkt;
516         av_fifo_generic_read(s->fifo, &pkt, sizeof(pkt), NULL);
517         av_packet_unref(&pkt);
518     }
519     av_fifo_reset(s->fifo);
520
521     av_packet_unref(&s->buffered_pkt);
522
523     ff_mediacodec_dec_flush(avctx, s->ctx);
524 }
525
526 static const AVCodecHWConfigInternal *mediacodec_hw_configs[] = {
527     &(const AVCodecHWConfigInternal) {
528         .public          = {
529             .pix_fmt     = AV_PIX_FMT_MEDIACODEC,
530             .methods     = AV_CODEC_HW_CONFIG_METHOD_AD_HOC |
531                            AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX,
532             .device_type = AV_HWDEVICE_TYPE_MEDIACODEC,
533         },
534         .hwaccel         = NULL,
535     },
536     NULL
537 };
538
539 #if CONFIG_H264_MEDIACODEC_DECODER
540 AVCodec ff_h264_mediacodec_decoder = {
541     .name           = "h264_mediacodec",
542     .long_name      = NULL_IF_CONFIG_SMALL("H.264 Android MediaCodec decoder"),
543     .type           = AVMEDIA_TYPE_VIDEO,
544     .id             = AV_CODEC_ID_H264,
545     .priv_data_size = sizeof(MediaCodecH264DecContext),
546     .init           = mediacodec_decode_init,
547     .receive_frame  = mediacodec_receive_frame,
548     .flush          = mediacodec_decode_flush,
549     .close          = mediacodec_decode_close,
550     .capabilities   = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE,
551     .caps_internal  = FF_CODEC_CAP_SETS_PKT_DTS,
552     .bsfs           = "h264_mp4toannexb",
553     .hw_configs     = mediacodec_hw_configs,
554     .wrapper_name   = "mediacodec",
555 };
556 #endif
557
558 #if CONFIG_HEVC_MEDIACODEC_DECODER
559 AVCodec ff_hevc_mediacodec_decoder = {
560     .name           = "hevc_mediacodec",
561     .long_name      = NULL_IF_CONFIG_SMALL("H.265 Android MediaCodec decoder"),
562     .type           = AVMEDIA_TYPE_VIDEO,
563     .id             = AV_CODEC_ID_HEVC,
564     .priv_data_size = sizeof(MediaCodecH264DecContext),
565     .init           = mediacodec_decode_init,
566     .receive_frame  = mediacodec_receive_frame,
567     .flush          = mediacodec_decode_flush,
568     .close          = mediacodec_decode_close,
569     .capabilities   = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE,
570     .caps_internal  = FF_CODEC_CAP_SETS_PKT_DTS,
571     .bsfs           = "hevc_mp4toannexb",
572     .hw_configs     = mediacodec_hw_configs,
573     .wrapper_name   = "mediacodec",
574 };
575 #endif
576
577 #if CONFIG_MPEG2_MEDIACODEC_DECODER
578 AVCodec ff_mpeg2_mediacodec_decoder = {
579     .name           = "mpeg2_mediacodec",
580     .long_name      = NULL_IF_CONFIG_SMALL("MPEG-2 Android MediaCodec decoder"),
581     .type           = AVMEDIA_TYPE_VIDEO,
582     .id             = AV_CODEC_ID_MPEG2VIDEO,
583     .priv_data_size = sizeof(MediaCodecH264DecContext),
584     .init           = mediacodec_decode_init,
585     .receive_frame  = mediacodec_receive_frame,
586     .flush          = mediacodec_decode_flush,
587     .close          = mediacodec_decode_close,
588     .capabilities   = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE,
589     .caps_internal  = FF_CODEC_CAP_SETS_PKT_DTS,
590     .hw_configs     = mediacodec_hw_configs,
591     .wrapper_name   = "mediacodec",
592 };
593 #endif
594
595 #if CONFIG_MPEG4_MEDIACODEC_DECODER
596 AVCodec ff_mpeg4_mediacodec_decoder = {
597     .name           = "mpeg4_mediacodec",
598     .long_name      = NULL_IF_CONFIG_SMALL("MPEG-4 Android MediaCodec decoder"),
599     .type           = AVMEDIA_TYPE_VIDEO,
600     .id             = AV_CODEC_ID_MPEG4,
601     .priv_data_size = sizeof(MediaCodecH264DecContext),
602     .init           = mediacodec_decode_init,
603     .receive_frame  = mediacodec_receive_frame,
604     .flush          = mediacodec_decode_flush,
605     .close          = mediacodec_decode_close,
606     .capabilities   = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE,
607     .caps_internal  = FF_CODEC_CAP_SETS_PKT_DTS,
608     .hw_configs     = mediacodec_hw_configs,
609     .wrapper_name   = "mediacodec",
610 };
611 #endif
612
613 #if CONFIG_VP8_MEDIACODEC_DECODER
614 AVCodec ff_vp8_mediacodec_decoder = {
615     .name           = "vp8_mediacodec",
616     .long_name      = NULL_IF_CONFIG_SMALL("VP8 Android MediaCodec decoder"),
617     .type           = AVMEDIA_TYPE_VIDEO,
618     .id             = AV_CODEC_ID_VP8,
619     .priv_data_size = sizeof(MediaCodecH264DecContext),
620     .init           = mediacodec_decode_init,
621     .receive_frame  = mediacodec_receive_frame,
622     .flush          = mediacodec_decode_flush,
623     .close          = mediacodec_decode_close,
624     .capabilities   = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE,
625     .caps_internal  = FF_CODEC_CAP_SETS_PKT_DTS,
626     .hw_configs     = mediacodec_hw_configs,
627     .wrapper_name   = "mediacodec",
628 };
629 #endif
630
631 #if CONFIG_VP9_MEDIACODEC_DECODER
632 AVCodec ff_vp9_mediacodec_decoder = {
633     .name           = "vp9_mediacodec",
634     .long_name      = NULL_IF_CONFIG_SMALL("VP9 Android MediaCodec decoder"),
635     .type           = AVMEDIA_TYPE_VIDEO,
636     .id             = AV_CODEC_ID_VP9,
637     .priv_data_size = sizeof(MediaCodecH264DecContext),
638     .init           = mediacodec_decode_init,
639     .receive_frame  = mediacodec_receive_frame,
640     .flush          = mediacodec_decode_flush,
641     .close          = mediacodec_decode_close,
642     .capabilities   = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE,
643     .caps_internal  = FF_CODEC_CAP_SETS_PKT_DTS,
644     .hw_configs     = mediacodec_hw_configs,
645     .wrapper_name   = "mediacodec",
646 };
647 #endif