diff options
author | Mark Thompson <sw@jkqxz.net> | 2017-10-26 00:18:40 +0100 |
---|---|---|
committer | Mark Thompson <sw@jkqxz.net> | 2017-11-26 21:35:53 +0000 |
commit | 758fbc54fef2f31957b5c5f22e05e5fd9b04f631 (patch) | |
tree | 45b66ac7797cec7968add561498acf75cc4871c2 /libavcodec/mediacodecdec.c | |
parent | 24cc0a53e99e281b0ff502e82e7cf857111eca3f (diff) | |
download | ffmpeg-758fbc54fef2f31957b5c5f22e05e5fd9b04f631.tar.gz |
lavc: Add hardware config metadata for decoders supporting hardware output
This includes a pointer to the associated hwaccel for decoders using
hwaccels - these will be used later to implement the hwaccel setup
without needing a global list.
Also added is a new file listing all hwaccels as external declarations -
this will be used later to generate the hwaccel list at configure time.
Diffstat (limited to 'libavcodec/mediacodecdec.c')
-rw-r--r-- | libavcodec/mediacodecdec.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/libavcodec/mediacodecdec.c b/libavcodec/mediacodecdec.c index 0cf9419ea3..6d392adb3a 100644 --- a/libavcodec/mediacodecdec.c +++ b/libavcodec/mediacodecdec.c @@ -515,6 +515,18 @@ static void mediacodec_decode_flush(AVCodecContext *avctx) ff_mediacodec_dec_flush(avctx, s->ctx); } +static const AVCodecHWConfigInternal *mediacodec_hw_configs[] = { + &(const AVCodecHWConfigInternal) { + .public = { + .pix_fmt = AV_PIX_FMT_MEDIACODEC, + .methods = AV_CODEC_HW_CONFIG_METHOD_AD_HOC, + .device_type = AV_HWDEVICE_TYPE_NONE, + }, + .hwaccel = NULL, + }, + NULL +}; + #if CONFIG_H264_MEDIACODEC_DECODER AVCodec ff_h264_mediacodec_decoder = { .name = "h264_mediacodec", @@ -529,6 +541,7 @@ AVCodec ff_h264_mediacodec_decoder = { .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING, .caps_internal = FF_CODEC_CAP_SETS_PKT_DTS, .bsfs = "h264_mp4toannexb", + .hw_configs = mediacodec_hw_configs, }; #endif @@ -546,6 +559,7 @@ AVCodec ff_hevc_mediacodec_decoder = { .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING, .caps_internal = FF_CODEC_CAP_SETS_PKT_DTS, .bsfs = "hevc_mp4toannexb", + .hw_configs = mediacodec_hw_configs, }; #endif @@ -562,6 +576,7 @@ AVCodec ff_mpeg2_mediacodec_decoder = { .close = mediacodec_decode_close, .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING, .caps_internal = FF_CODEC_CAP_SETS_PKT_DTS, + .hw_configs = mediacodec_hw_configs, }; #endif @@ -578,6 +593,7 @@ AVCodec ff_mpeg4_mediacodec_decoder = { .close = mediacodec_decode_close, .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING, .caps_internal = FF_CODEC_CAP_SETS_PKT_DTS, + .hw_configs = mediacodec_hw_configs, }; #endif @@ -594,6 +610,7 @@ AVCodec ff_vp8_mediacodec_decoder = { .close = mediacodec_decode_close, .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING, .caps_internal = FF_CODEC_CAP_SETS_PKT_DTS, + .hw_configs = mediacodec_hw_configs, }; #endif @@ -610,5 +627,6 @@ AVCodec ff_vp9_mediacodec_decoder = { .close = mediacodec_decode_close, .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING, .caps_internal = FF_CODEC_CAP_SETS_PKT_DTS, + .hw_configs = mediacodec_hw_configs, }; #endif |