Commit b945fed6 authored by wm4's avatar wm4

avcodec: add metadata to identify wrappers and hardware decoders

Explicitly identify decoder/encoder wrappers with a common name. This
saves API users from guessing by the name suffix. For example, they
don't have to guess that "h264_qsv" is the h264 QSV implementation, and
instead they can just check the AVCodec .codec and .wrapper_name fields.

Explicitly mark AVCodec entries that are hardware decoders or most
likely hardware decoders with new AV_CODEC_CAPs. The purpose is allowing
API users listing hardware decoders in a more generic way. The proposed
AVCodecHWConfig does not provide this information fully, because it's
concerned with decoder configuration, not information about the fact
whether the hardware is used or not.

AV_CODEC_CAP_HYBRID exists specifically for QSV, which can have software
implementations in case the hardware is not capable.

Based on a patch by Philip Langdale <philipl@overt.org>.

Merges Libav commit 47687a2f.
parent 2e391a57
......@@ -15,6 +15,10 @@ libavutil: 2017-10-21
API changes, most recent first:
2017-xx-xx - xxxxxxc - lavc 58.7.100 - avcodec.h
Add AV_CODEC_CAP_HARDWARE, AV_CODEC_CAP_HYBRID, and AVCodec.wrapper_name,
and mark all AVCodecs accordingly.
2017-xx-xx - xxxxxxx - lavu 56.4.100 / 56.7.0 - stereo3d.h
Add view field to AVStereo3D structure and AVStereo3DView enum.
......
......@@ -597,6 +597,7 @@ static av_cold int ffat_close_decoder(AVCodecContext *avctx)
.bsfs = bsf_name, \
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, \
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, \
.wrapper_name = "at", \
};
FFAT_DEC(aac, AV_CODEC_ID_AAC, "aac_adtstoasc")
......
......@@ -619,6 +619,7 @@ static const AVOption options[] = {
}, \
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, \
.profiles = PROFILES, \
.wrapper_name = "at", \
};
static const uint64_t aac_at_channel_layouts[] = {
......
......@@ -1045,6 +1045,20 @@ typedef struct RcOverride{
*/
#define AV_CODEC_CAP_LOSSLESS 0x80000000
/**
* Codec is backed by a hardware implementation. Typically used to
* identify a non-hwaccel hardware decoder. For information about hwaccels, use
* avcodec_get_hw_config() instead.
*/
#define AV_CODEC_CAP_HARDWARE (1 << 18)
/**
* Codec is potentially backed by a hardware implementation, but not
* necessarily. This is used instead of AV_CODEC_CAP_HARDWARE, if the
* implementation provides some sort of internal fallback.
*/
#define AV_CODEC_CAP_HYBRID (1 << 19)
/**
* Pan Scan area.
* This specifies the area which should be displayed.
......@@ -3377,6 +3391,18 @@ typedef struct AVCodec {
const AVClass *priv_class; ///< AVClass for the private context
const AVProfile *profiles; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN}
/**
* Group name of the codec implementation.
* This is a short symbolic name of the wrapper backing this codec. A
* wrapper uses some kind of external implementation for the codec, such
* as an external library, or a codec implementation provided by the OS or
* the hardware.
* If this field is NULL, this is a builtin, libavcodec native codec.
* If non-NULL, this will be the suffix in AVCodec.name in most cases
* (usually AVCodec.name will be of the form "<codec_name>_<wrapper_name>").
*/
const char *wrapper_name;
/*****************************************************************
* No fields below this line are part of the public API. They
* may not be used outside of libavcodec and can be changed and
......
......@@ -786,8 +786,9 @@ static int crystalhd_receive_frame(AVCodecContext *avctx, AVFrame *frame)
.receive_frame = crystalhd_receive_frame, \
.flush = flush, \
.bsfs = bsf_name, \
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING, \
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE, \
.pix_fmts = (const enum AVPixelFormat[]){AV_PIX_FMT_YUYV422, AV_PIX_FMT_NONE}, \
.wrapper_name = "crystalhd", \
};
#if CONFIG_H264_CRYSTALHD_DECODER
......
......@@ -1127,13 +1127,14 @@ static const AVCodecHWConfigInternal *cuvid_hw_configs[] = {
.decode = cuvid_decode_frame, \
.receive_frame = cuvid_output_frame, \
.flush = cuvid_flush, \
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING, \
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE, \
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_CUDA, \
AV_PIX_FMT_NV12, \
AV_PIX_FMT_P010, \
AV_PIX_FMT_P016, \
AV_PIX_FMT_NONE }, \
.hw_configs = cuvid_hw_configs, \
.wrapper_name = "cuvid", \
};
#if CONFIG_HEVC_CUVID_DECODER
......
......@@ -137,4 +137,5 @@ AVCodec ff_libcelt_decoder = {
.close = libcelt_dec_close,
.decode = libcelt_dec_decode,
.capabilities = AV_CODEC_CAP_DR1,
.wrapper_name = "libcelt",
};
......@@ -385,4 +385,5 @@ AVCodec ff_libfdk_aac_decoder = {
.priv_class = &fdk_aac_dec_class,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE |
FF_CODEC_CAP_INIT_CLEANUP,
.wrapper_name = "libfdk",
};
......@@ -428,4 +428,5 @@ AVCodec ff_libfdk_aac_encoder = {
.profiles = profiles,
.supported_samplerates = aac_sample_rates,
.channel_layouts = aac_channel_layout,
.wrapper_name = "libfdk",
};
......@@ -135,6 +135,7 @@ AVCodec ff_libgsm_decoder = {
.decode = libgsm_decode_frame,
.flush = libgsm_flush,
.capabilities = AV_CODEC_CAP_DR1,
.wrapper_name = "libgsm",
};
#endif
#if CONFIG_LIBGSM_MS_DECODER
......@@ -149,5 +150,6 @@ AVCodec ff_libgsm_ms_decoder = {
.decode = libgsm_decode_frame,
.flush = libgsm_flush,
.capabilities = AV_CODEC_CAP_DR1,
.wrapper_name = "libgsm",
};
#endif
......@@ -126,6 +126,7 @@ AVCodec ff_libgsm_encoder = {
.close = libgsm_encode_close,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE },
.wrapper_name = "libgsm",
};
#endif
#if CONFIG_LIBGSM_MS_ENCODER
......@@ -139,5 +140,6 @@ AVCodec ff_libgsm_ms_encoder = {
.close = libgsm_encode_close,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE },
.wrapper_name = "libgsm",
};
#endif
......@@ -193,4 +193,5 @@ AVCodec ff_libilbc_encoder = {
AV_SAMPLE_FMT_NONE },
.defaults = ilbc_encode_defaults,
.priv_class = &ilbc_enc_class,
.wrapper_name = "libbilbc",
};
......@@ -305,4 +305,6 @@ AVCodec ff_libkvazaar_encoder = {
.close = libkvazaar_close,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
.wrapper_name = "libkvazaar",
};
......@@ -349,4 +349,5 @@ AVCodec ff_libmp3lame_encoder = {
0 },
.priv_class = &libmp3lame_class,
.defaults = libmp3lame_defaults,
.wrapper_name = "libmp3lame",
};
......@@ -378,6 +378,7 @@ AVCodec ff_libopencore_amrwb_decoder = {
.close = amr_wb_decode_close,
.decode = amr_wb_decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
.wrapper_name = "libopencore_amrwb",
};
#endif /* CONFIG_LIBOPENCORE_AMRWB_DECODER */
......@@ -147,4 +147,5 @@ AVCodec ff_libopenh264_decoder = {
.caps_internal = FF_CODEC_CAP_SETS_PKT_DTS | FF_CODEC_CAP_INIT_THREADSAFE |
FF_CODEC_CAP_INIT_CLEANUP,
.bsfs = "h264_mp4toannexb",
.wrapper_name = "libopenh264",
};
......@@ -301,4 +301,5 @@ AVCodec ff_libopenh264_encoder = {
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P,
AV_PIX_FMT_NONE },
.priv_class = &class,
.wrapper_name = "libopenh264",
};
......@@ -512,4 +512,5 @@ AVCodec ff_libopenjpeg_decoder = {
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
.max_lowres = 31,
.priv_class = &openjpeg_class,
.wrapper_name = "libopenjpeg",
};
......@@ -778,4 +778,5 @@ AVCodec ff_libopenjpeg_encoder = {
AV_PIX_FMT_NONE
},
.priv_class = &openjpeg_class,
.wrapper_name = "libopenjpeg",
};
......@@ -223,4 +223,5 @@ AVCodec ff_libopus_decoder = {
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLT,
AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE },
.wrapper_name = "libopus",
};
......@@ -566,4 +566,5 @@ AVCodec ff_libopus_encoder = {
.supported_samplerates = libopus_sample_rates,
.priv_class = &libopus_class,
.defaults = libopus_defaults,
.wrapper_name = "libopus",
};
......@@ -124,4 +124,5 @@ AVCodec ff_librsvg_decoder = {
.decode = librsvg_decode_frame,
.priv_data_size = sizeof(LibRSVGContext),
.capabilities = AV_CODEC_CAP_LOSSLESS | AV_CODEC_CAP_DR1,
.wrapper_name = "librsvg",
};
......@@ -146,4 +146,5 @@ AVCodec ff_libshine_encoder = {
.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO,
AV_CH_LAYOUT_STEREO,
0 },
.wrapper_name = "libshine",
};
......@@ -200,4 +200,5 @@ AVCodec ff_libspeex_decoder = {
.decode = libspeex_decode_frame,
.flush = libspeex_decode_flush,
.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1,
.wrapper_name = "libspeex",
};
......@@ -365,4 +365,5 @@ AVCodec ff_libspeex_encoder = {
.supported_samplerates = (const int[]){ 8000, 16000, 32000, 0 },
.priv_class = &speex_class,
.defaults = defaults,
.wrapper_name = "libspeex",
};
......@@ -385,4 +385,5 @@ AVCodec ff_libtheora_encoder = {
.pix_fmts = (const enum AVPixelFormat[]){
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_NONE
},
.wrapper_name = "libtheora",
};
......@@ -226,4 +226,5 @@ AVCodec ff_libtwolame_encoder = {
AV_CH_LAYOUT_STEREO,
0 },
.supported_samplerates = twolame_samplerates,
.wrapper_name = "libtwolame",
};
......@@ -152,4 +152,5 @@ AVCodec ff_libvo_amrwbenc_encoder = {
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE },
.priv_class = &amrwb_class,
.wrapper_name = "libvo_amrwbenc",
};
......@@ -377,4 +377,5 @@ AVCodec ff_libvorbis_encoder = {
AV_SAMPLE_FMT_NONE },
.priv_class = &vorbis_class,
.defaults = defaults,
.wrapper_name = "libvorbis",
};
......@@ -289,6 +289,7 @@ AVCodec ff_libvpx_vp8_decoder = {
.close = vpx_free,
.decode = vpx_decode,
.capabilities = AV_CODEC_CAP_AUTO_THREADS | AV_CODEC_CAP_DR1,
.wrapper_name = "libvpx",
};
#endif /* CONFIG_LIBVPX_VP8_DECODER */
......@@ -310,5 +311,6 @@ AVCodec ff_libvpx_vp9_decoder = {
.capabilities = AV_CODEC_CAP_AUTO_THREADS | AV_CODEC_CAP_DR1,
.init_static_data = ff_vp9_init_static,
.profiles = NULL_IF_CONFIG_SMALL(ff_vp9_profiles),
.wrapper_name = "libvpx",
};
#endif /* CONFIG_LIBVPX_VP9_DECODER */
......@@ -1199,6 +1199,7 @@ AVCodec ff_libvpx_vp8_encoder = {
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_NONE },
.priv_class = &class_vp8,
.defaults = defaults,
.wrapper_name = "libvpx",
};
#endif /* CONFIG_LIBVPX_VP8_ENCODER */
......@@ -1229,5 +1230,6 @@ AVCodec ff_libvpx_vp9_encoder = {
.priv_class = &class_vp9,
.defaults = defaults,
.init_static_data = ff_vp9_init_static,
.wrapper_name = "libvpx",
};
#endif /* CONFIG_LIBVPX_VP9_ENCODER */
......@@ -191,4 +191,5 @@ AVCodec ff_libwavpack_encoder = {
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SMALL_LAST_FRAME,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32,
AV_SAMPLE_FMT_NONE },
.wrapper_name = "libwavpack",
};
......@@ -109,4 +109,5 @@ AVCodec ff_libwebp_encoder = {
},
.priv_class = &class,
.defaults = libwebp_defaults,
.wrapper_name = "libwebp",
};
......@@ -148,4 +148,5 @@ AVCodec ff_libwebp_anim_encoder = {
},
.priv_class = &class,
.defaults = libwebp_defaults,
.wrapper_name = "libwebp",
};
......@@ -1026,6 +1026,7 @@ AVCodec ff_libx264_encoder = {
.init_static_data = X264_init_static,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE |
FF_CODEC_CAP_INIT_CLEANUP,
.wrapper_name = "libx264",
};
#endif
......@@ -1050,6 +1051,7 @@ AVCodec ff_libx264rgb_encoder = {
.priv_class = &rgbclass,
.defaults = x264_defaults,
.pix_fmts = pix_fmts_8bit_rgb,
.wrapper_name = "libx264",
};
#endif
......@@ -1076,5 +1078,6 @@ AVCodec ff_libx262_encoder = {
.pix_fmts = pix_fmts_8bit,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE |
FF_CODEC_CAP_INIT_CLEANUP,
.wrapper_name = "libx264",
};
#endif
......@@ -442,4 +442,5 @@ AVCodec ff_libx265_encoder = {
.priv_class = &class,
.defaults = x265_defaults,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AUTO_THREADS,
.wrapper_name = "libx265",
};
......@@ -478,4 +478,5 @@ AVCodec ff_libxavs_encoder = {
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
.priv_class = &xavs_class,
.defaults = xavs_defaults,
.wrapper_name = "libxavs",
};
......@@ -934,4 +934,5 @@ AVCodec ff_libxvid_encoder = {
.priv_class = &xvid_class,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE |
FF_CODEC_CAP_INIT_CLEANUP,
.wrapper_name = "libxvid",
};
......@@ -573,4 +573,5 @@ AVCodec ff_libzvbi_teletext_decoder = {
.capabilities = AV_CODEC_CAP_DELAY,
.flush = teletext_flush,
.priv_class= &teletext_class,
.wrapper_name = "libzvbi",
};
......@@ -539,10 +539,11 @@ AVCodec ff_h264_mediacodec_decoder = {
.decode = mediacodec_decode_frame,
.flush = mediacodec_decode_flush,
.close = mediacodec_decode_close,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE,
.caps_internal = FF_CODEC_CAP_SETS_PKT_DTS,
.bsfs = "h264_mp4toannexb",
.hw_configs = mediacodec_hw_configs,
.wrapper_name = "mediacodec",
};
#endif
......@@ -557,10 +558,11 @@ AVCodec ff_hevc_mediacodec_decoder = {
.decode = mediacodec_decode_frame,
.flush = mediacodec_decode_flush,
.close = mediacodec_decode_close,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE,
.caps_internal = FF_CODEC_CAP_SETS_PKT_DTS,
.bsfs = "hevc_mp4toannexb",
.hw_configs = mediacodec_hw_configs,
.wrapper_name = "mediacodec",
};
#endif
......@@ -575,9 +577,10 @@ AVCodec ff_mpeg2_mediacodec_decoder = {
.decode = mediacodec_decode_frame,
.flush = mediacodec_decode_flush,
.close = mediacodec_decode_close,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE,
.caps_internal = FF_CODEC_CAP_SETS_PKT_DTS,
.hw_configs = mediacodec_hw_configs,
.wrapper_name = "mediacodec",
};
#endif
......@@ -592,9 +595,10 @@ AVCodec ff_mpeg4_mediacodec_decoder = {
.decode = mediacodec_decode_frame,
.flush = mediacodec_decode_flush,
.close = mediacodec_decode_close,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE,
.caps_internal = FF_CODEC_CAP_SETS_PKT_DTS,
.hw_configs = mediacodec_hw_configs,
.wrapper_name = "mediacodec",
};
#endif
......@@ -609,9 +613,10 @@ AVCodec ff_vp8_mediacodec_decoder = {
.decode = mediacodec_decode_frame,
.flush = mediacodec_decode_flush,
.close = mediacodec_decode_close,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE,
.caps_internal = FF_CODEC_CAP_SETS_PKT_DTS,
.hw_configs = mediacodec_hw_configs,
.wrapper_name = "mediacodec",
};
#endif
......@@ -626,8 +631,9 @@ AVCodec ff_vp9_mediacodec_decoder = {
.decode = mediacodec_decode_frame,
.flush = mediacodec_decode_flush,
.close = mediacodec_decode_close,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE,
.caps_internal = FF_CODEC_CAP_SETS_PKT_DTS,
.hw_configs = mediacodec_hw_configs,
.wrapper_name = "mediacodec",
};
#endif
......@@ -840,12 +840,13 @@ static const AVOption options[]={
.decode = ffmmal_decode, \
.flush = ffmmal_flush, \
.priv_class = &ffmmal_##NAME##_dec_class, \
.capabilities = AV_CODEC_CAP_DELAY, \
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE, \
.caps_internal = FF_CODEC_CAP_SETS_PKT_DTS, \
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_MMAL, \
AV_PIX_FMT_YUV420P, \
AV_PIX_FMT_NONE}, \
.hw_configs = mmal_hw_configs, \
.wrapper_name = "mmal", \
};
FFMMAL_DEC(h264, AV_CODEC_ID_H264)
......
......@@ -171,9 +171,10 @@ AVCodec ff_nvenc_encoder = {
.priv_data_size = sizeof(NvencContext),
.priv_class = &nvenc_class,
.defaults = defaults,
.capabilities = AV_CODEC_CAP_DELAY,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.pix_fmts = ff_nvenc_pix_fmts,
.wrapper_name = "nvenc",
};
#endif
......@@ -199,9 +200,10 @@ AVCodec ff_nvenc_h264_encoder = {
.priv_data_size = sizeof(NvencContext),
.priv_class = &nvenc_h264_class,
.defaults = defaults,
.capabilities = AV_CODEC_CAP_DELAY,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.pix_fmts = ff_nvenc_pix_fmts,
.wrapper_name = "nvenc",
};
#endif
......@@ -227,7 +229,8 @@ AVCodec ff_h264_nvenc_encoder = {
.priv_data_size = sizeof(NvencContext),
.priv_class = &h264_nvenc_class,
.defaults = defaults,
.capabilities = AV_CODEC_CAP_DELAY,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.pix_fmts = ff_nvenc_pix_fmts,
.wrapper_name = "nvenc",
};
......@@ -161,8 +161,9 @@ AVCodec ff_nvenc_hevc_encoder = {
.priv_class = &nvenc_hevc_class,
.defaults = defaults,
.pix_fmts = ff_nvenc_pix_fmts,
.capabilities = AV_CODEC_CAP_DELAY,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.wrapper_name = "nvenc",
};
#endif
......@@ -188,6 +189,7 @@ AVCodec ff_hevc_nvenc_encoder = {
.priv_class = &hevc_nvenc_class,
.defaults = defaults,
.pix_fmts = ff_nvenc_pix_fmts,
.capabilities = AV_CODEC_CAP_DELAY,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.wrapper_name = "nvenc",
};
......@@ -211,7 +211,7 @@ AVCodec ff_hevc_qsv_decoder = {
.decode = qsv_decode_frame,
.flush = qsv_decode_flush,
.close = qsv_decode_close,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_AVOID_PROBING,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HYBRID,
.priv_class = &hevc_class,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12,
AV_PIX_FMT_P010,
......@@ -219,6 +219,7 @@ AVCodec ff_hevc_qsv_decoder = {
AV_PIX_FMT_NONE },
.hw_configs = ff_qsv_hw_configs,
.bsfs = "hevc_mp4toannexb",
.wrapper_name = "qsv",
};
#endif
......@@ -245,7 +246,7 @@ AVCodec ff_h264_qsv_decoder = {
.decode = qsv_decode_frame,
.flush = qsv_decode_flush,
.close = qsv_decode_close,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_AVOID_PROBING,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HYBRID,
.priv_class = &class,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12,
AV_PIX_FMT_P010,
......@@ -253,5 +254,6 @@ AVCodec ff_h264_qsv_decoder = {
AV_PIX_FMT_NONE },
.hw_configs = ff_qsv_hw_configs,
.bsfs = "h264_mp4toannexb",
.wrapper_name = "qsv",
};
#endif
......@@ -176,12 +176,13 @@ AVCodec ff_mpeg2_qsv_decoder = {
.decode = qsv_decode_frame,
.flush = qsv_decode_flush,
.close = qsv_decode_close,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_AVOID_PROBING,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HYBRID,
.priv_class = &mpeg2_qsv_class,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12,
AV_PIX_FMT_QSV,
AV_PIX_FMT_NONE },
.hw_configs = ff_qsv_hw_configs,
.wrapper_name = "qsv",
};
#endif
......@@ -203,12 +204,13 @@ AVCodec ff_vc1_qsv_decoder = {
.decode = qsv_decode_frame,
.flush = qsv_decode_flush,
.close = qsv_decode_close,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_AVOID_PROBING,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HYBRID,
.priv_class = &vc1_qsv_class,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12,
AV_PIX_FMT_QSV,
AV_PIX_FMT_NONE },
.hw_configs = ff_qsv_hw_configs,
.wrapper_name = "qsv",
};
#endif
......@@ -230,11 +232,12 @@ AVCodec ff_vp8_qsv_decoder = {
.decode = qsv_decode_frame,
.flush = qsv_decode_flush,
.close = qsv_decode_close,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_AVOID_PROBING,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HYBRID,
.priv_class = &vp8_qsv_class,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12,
AV_PIX_FMT_QSV,
AV_PIX_FMT_NONE },
.hw_configs = ff_qsv_hw_configs,
.wrapper_name = "qsv",
};
#endif
......@@ -175,7 +175,7 @@ AVCodec ff_h264_qsv_encoder = {
.init = qsv_enc_init,
.encode2 = qsv_enc_frame,
.close = qsv_enc_close,
.capabilities = AV_CODEC_CAP_DELAY,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HYBRID,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12,
AV_PIX_FMT_P010,
AV_PIX_FMT_QSV,
......@@ -183,4 +183,5 @@ AVCodec ff_h264_qsv_encoder = {
.priv_class = &class,
.defaults = qsv_enc_defaults,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.wrapper_name = "qsv",
};
......@@ -277,7 +277,7 @@ AVCodec ff_hevc_qsv_encoder = {
.init = qsv_enc_init,
.encode2 = qsv_enc_frame,
.close = qsv_enc_close,
.capabilities = AV_CODEC_CAP_DELAY,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HYBRID,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12,
AV_PIX_FMT_P010,
AV_PIX_FMT_QSV,
......@@ -285,4 +285,5 @@ AVCodec ff_hevc_qsv_encoder = {
.priv_class = &class,
.defaults = qsv_enc_defaults,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.wrapper_name = "qsv",
};
......@@ -83,9 +83,10 @@ AVCodec ff_mjpeg_qsv_encoder = {
.init = qsv_enc_init,
.encode2 = qsv_enc_frame,
.close = qsv_enc_close,
.capabilities = AV_CODEC_CAP_DELAY,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HYBRID,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12,
AV_PIX_FMT_QSV,
AV_PIX_FMT_NONE },
.priv_class = &class,
.wrapper_name = "qsv",
};
......@@ -104,11 +104,12 @@ AVCodec ff_mpeg2_qsv_encoder = {
.init = qsv_enc_init,
.encode2 = qsv_enc_frame,
.close = qsv_enc_close,
.capabilities = AV_CODEC_CAP_DELAY,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HYBRID,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12,
AV_PIX_FMT_QSV,
AV_PIX_FMT_NONE },
.priv_class = &class,
.defaults = qsv_enc_defaults,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.wrapper_name = "qsv",
};
......@@ -588,12 +588,13 @@ static const AVCodecHWConfigInternal *rkmpp_hw_configs[] = {
.receive_frame = rkmpp_receive_frame, \
.flush = rkmpp_flush, \
.priv_class = &rkmpp_##NAME##_dec_class, \
.capabilities = AV_CODEC_CAP_DELAY, \
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE, \
.caps_internal = AV_CODEC_CAP_AVOID_PROBING, \
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_DRM_PRIME, \
AV_PIX_FMT_NONE}, \
.hw_configs = rkmpp_hw_configs, \
.bsfs = BSFS, \
.wrapper_name = "rkmpp", \
};
RKMPP_DEC(h264, AV_CODEC_ID_H264, "h264_mp4toannexb")
......
......@@ -215,6 +215,8 @@ AVCodec ff_ ## NAME ## _v4l2m2m_decoder = { \
.receive_frame = v4l2_receive_frame,\
.close = ff_v4l2_m2m_codec_end,\
.bsfs = bsf_name, \
.capabilities = AV_CODEC_CAP_HARDWARE, \
.wrapper_name = "v4l2m2m", \
};
M2MDEC(h264, "H.264", AV_CODEC_ID_H264, "h264_mp4toannexb");
......
......@@ -335,6 +335,8 @@ AVCodec ff_ ## NAME ## _v4l2m2m_encoder = { \
.send_frame = v4l2_send_frame,\
.receive_packet = v4l2_receive_packet,\
.close = ff_v4l2_m2m_codec_end,\
.capabilities = AV_CODEC_CAP_HARDWARE, \
.wrapper_name = "v4l2m2m", \
};
M2MENC(mpeg4,"MPEG4", AV_CODEC_ID_MPEG4);
......
......@@ -1089,10 +1089,11 @@ AVCodec ff_h264_vaapi_encoder = {
.encode2 = &ff_vaapi_encode2,
.close = &vaapi_encode_h264_close,
.priv_class = &vaapi_encode_h264_class,
.capabilities = AV_CODEC_CAP_DELAY,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE,
.defaults = vaapi_encode_h264_defaults,
.pix_fmts = (const enum AVPixelFormat[]) {
AV_PIX_FMT_VAAPI,
AV_PIX_FMT_NONE,
},
.wrapper_name = "vaapi",
};
......@@ -1018,10 +1018,11 @@ AVCodec ff_hevc_vaapi_encoder = {
.encode2 = &ff_vaapi_encode2,
.close = &vaapi_encode_h265_close,
.priv_class = &vaapi_encode_h265_class,
.capabilities = AV_CODEC_CAP_DELAY,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE,
.defaults = vaapi_encode_h265_defaults,
.pix_fmts = (const enum AVPixelFormat[]) {
AV_PIX_FMT_VAAPI,
AV_PIX_FMT_NONE,
},
.wrapper_name = "vaapi",
};
......@@ -422,9 +422,11 @@ AVCodec ff_mjpeg_vaapi_encoder = {
.encode2 = &ff_vaapi_encode2,
.close = &ff_vaapi_encode_close,
.priv_class = &vaapi_encode_mjpeg_class,
.capabilities = AV_CODEC_CAP_HARDWARE,
.defaults = vaapi_encode_mjpeg_defaults,
.pix_fmts = (const enum AVPixelFormat[]) {
AV_PIX_FMT_VAAPI,
AV_PIX_FMT_NONE,
},
.wrapper_name = "vaapi",
};
......@@ -669,10 +669,11 @@ AVCodec ff_mpeg2_vaapi_encoder = {
.init = &vaapi_encode_mpeg2_init,
.encode2 = &ff_vaapi_encode2,
.close = &vaapi_encode_mpeg2_close,
.capabilities = AV_CODEC_CAP_DELAY,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE,
.defaults = vaapi_encode_mpeg2_defaults,
.pix_fmts = (const enum AVPixelFormat[]) {
AV_PIX_FMT_VAAPI,
AV_PIX_FMT_NONE,
},
.wrapper_name = "vaapi",
};
......@@ -260,10 +260,11 @@ AVCodec ff_vp8_vaapi_encoder = {
.encode2 = &ff_vaapi_encode2,
.close = &ff_vaapi_encode_close,
.priv_class = &vaapi_encode_vp8_class,
.capabilities = AV_CODEC_CAP_DELAY,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE,
.defaults = vaapi_encode_vp8_defaults,
.pix_fmts = (const enum AVPixelFormat[]) {
AV_PIX_FMT_VAAPI,
AV_PIX_FMT_NONE,
},
.wrapper_name = "vaapi",
};
......@@ -304,10 +304,11 @@ AVCodec ff_vp9_vaapi_encoder = {
.encode2 = &ff_vaapi_encode2,
.close = &ff_vaapi_encode_close,
.priv_class = &vaapi_encode_vp9_class,
.capabilities = AV_CODEC_CAP_DELAY,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE,
.defaults = vaapi_encode_vp9_defaults,
.pix_fmts = (const enum AVPixelFormat[]) {
AV_PIX_FMT_VAAPI,
AV_PIX_FMT_NONE,
},
.wrapper_name = "vaapi",
};
......@@ -28,8 +28,8 @@
#include "libavutil/version.h"
#define LIBAVCODEC_VERSION_MAJOR 58
#define LIBAVCODEC_VERSION_MINOR 6
#define LIBAVCODEC_VERSION_MICRO 103
#define LIBAVCODEC_VERSION_MINOR 7
#define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
......
......@@ -2599,8 +2599,9 @@ AVCodec ff_hevc_videotoolbox_encoder = {
.init = vtenc_init,
.encode2 = vtenc_frame,
.close = vtenc_close,
.capabilities = AV_CODEC_CAP_DELAY,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE,
.priv_class = &hevc_videotoolbox_class,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE |
FF_CODEC_CAP_INIT_CLEANUP,
.wrapper_name = "videotoolbox",
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment