avcodec: add metadata to identify wrappers and hardware decoders
authorwm4 <nfxjfg@googlemail.com>
Mon, 11 Dec 2017 15:18:44 +0000 (16:18 +0100)
committerwm4 <nfxjfg@googlemail.com>
Thu, 14 Dec 2017 18:37:56 +0000 (19:37 +0100)
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 47687a2f8aca3f65b6fdd117b1cb66a7409a7fd1.

60 files changed:
doc/APIchanges
libavcodec/audiotoolboxdec.c
libavcodec/audiotoolboxenc.c
libavcodec/avcodec.h
libavcodec/crystalhd.c
libavcodec/cuviddec.c
libavcodec/libcelt_dec.c
libavcodec/libfdk-aacdec.c
libavcodec/libfdk-aacenc.c
libavcodec/libgsmdec.c
libavcodec/libgsmenc.c
libavcodec/libilbc.c
libavcodec/libkvazaar.c
libavcodec/libmp3lame.c
libavcodec/libopencore-amr.c
libavcodec/libopenh264dec.c
libavcodec/libopenh264enc.c
libavcodec/libopenjpegdec.c
libavcodec/libopenjpegenc.c
libavcodec/libopusdec.c
libavcodec/libopusenc.c
libavcodec/librsvgdec.c
libavcodec/libshine.c
libavcodec/libspeexdec.c
libavcodec/libspeexenc.c
libavcodec/libtheoraenc.c
libavcodec/libtwolame.c
libavcodec/libvo-amrwbenc.c
libavcodec/libvorbisenc.c
libavcodec/libvpxdec.c
libavcodec/libvpxenc.c
libavcodec/libwavpackenc.c
libavcodec/libwebpenc.c
libavcodec/libwebpenc_animencoder.c
libavcodec/libx264.c
libavcodec/libx265.c
libavcodec/libxavs.c
libavcodec/libxvid.c
libavcodec/libzvbi-teletextdec.c
libavcodec/mediacodecdec.c
libavcodec/mmaldec.c
libavcodec/nvenc_h264.c
libavcodec/nvenc_hevc.c
libavcodec/qsvdec_h2645.c
libavcodec/qsvdec_other.c
libavcodec/qsvenc_h264.c
libavcodec/qsvenc_hevc.c
libavcodec/qsvenc_jpeg.c
libavcodec/qsvenc_mpeg2.c
libavcodec/rkmppdec.c
libavcodec/v4l2_m2m_dec.c
libavcodec/v4l2_m2m_enc.c
libavcodec/vaapi_encode_h264.c
libavcodec/vaapi_encode_h265.c
libavcodec/vaapi_encode_mjpeg.c
libavcodec/vaapi_encode_mpeg2.c
libavcodec/vaapi_encode_vp8.c
libavcodec/vaapi_encode_vp9.c
libavcodec/version.h
libavcodec/videotoolboxenc.c

index 4af69c6..b4451ab 100644 (file)
@@ -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.
 
index 3711665..5c0a9de 100644 (file)
@@ -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")
index c47fbd1..71885d1 100644 (file)
@@ -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[] = {
index 5db6a81..ce089b7 100644 (file)
@@ -1046,6 +1046,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.
  * Note there may be multiple such areas for one frame.
@@ -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
index 83bc8bf..e3c5955 100644 (file)
@@ -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
index 96d56f4..c23033c 100644 (file)
@@ -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
index 878e4cc..75b438b 100644 (file)
@@ -137,4 +137,5 @@ AVCodec ff_libcelt_decoder = {
     .close          = libcelt_dec_close,
     .decode         = libcelt_dec_decode,
     .capabilities   = AV_CODEC_CAP_DR1,
+    .wrapper_name   = "libcelt",
 };
index a0110da..677b110 100644 (file)
@@ -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",
 };
index ca0f4bf..d47137b 100644 (file)
@@ -428,4 +428,5 @@ AVCodec ff_libfdk_aac_encoder = {
     .profiles              = profiles,
     .supported_samplerates = aac_sample_rates,
     .channel_layouts       = aac_channel_layout,
+    .wrapper_name          = "libfdk",
 };
index a503215..89e1de0 100644 (file)
@@ -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
index e25db95..c9e7ba0 100644 (file)
@@ -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
index c4c054f..9a56cc8 100644 (file)
@@ -193,4 +193,5 @@ AVCodec ff_libilbc_encoder = {
                                                      AV_SAMPLE_FMT_NONE },
     .defaults       = ilbc_encode_defaults,
     .priv_class     = &ilbc_enc_class,
+    .wrapper_name   = "libbilbc",
 };
index 25e7b32..41a1bbb 100644 (file)
@@ -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",
 };
index 5e26743..ecdd2e3 100644 (file)
@@ -349,4 +349,5 @@ AVCodec ff_libmp3lame_encoder = {
                                                   0 },
     .priv_class            = &libmp3lame_class,
     .defaults              = libmp3lame_defaults,
+    .wrapper_name          = "libmp3lame",
 };
index d509804..516f625 100644 (file)
@@ -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 */
index d12e715..b7ed85d 100644 (file)
@@ -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",
 };
index 1152d00..fdadb10 100644 (file)
@@ -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",
 };
index daf0a1c..5e66cd9 100644 (file)
@@ -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",
 };
index 59fe52d..7c7d0aa 100644 (file)
@@ -778,4 +778,5 @@ AVCodec ff_libopenjpeg_encoder = {
         AV_PIX_FMT_NONE
     },
     .priv_class     = &openjpeg_class,
+    .wrapper_name   = "libopenjpeg",
 };
index 9b1e002..4f7f475 100644 (file)
@@ -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",
 };
index 3d88c29..b449497 100644 (file)
@@ -566,4 +566,5 @@ AVCodec ff_libopus_encoder = {
     .supported_samplerates = libopus_sample_rates,
     .priv_class      = &libopus_class,
     .defaults        = libopus_defaults,
+    .wrapper_name    = "libopus",
 };
index 77c7710..e57070f 100644 (file)
@@ -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",
 };
index f4cf598..7056fcd 100644 (file)
@@ -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",
 };
index 044883a..d67c68c 100644 (file)
@@ -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",
 };
index 5264899..6a37dbc 100644 (file)
@@ -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",
 };
index d4c3928..16966ed 100644 (file)
@@ -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",
 };
index 12d71e7..030f888 100644 (file)
@@ -226,4 +226,5 @@ AVCodec ff_libtwolame_encoder = {
         AV_CH_LAYOUT_STEREO,
         0 },
     .supported_samplerates = twolame_samplerates,
+    .wrapper_name   = "libtwolame",
 };
index f756940..77d0cce 100644 (file)
@@ -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",
 };
index 3ca5b55..f78f872 100644 (file)
@@ -377,4 +377,5 @@ AVCodec ff_libvorbis_encoder = {
                                                       AV_SAMPLE_FMT_NONE },
     .priv_class     = &vorbis_class,
     .defaults       = defaults,
+    .wrapper_name   = "libvorbis",
 };
index 2ae29d2..04f27d3 100644 (file)
@@ -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 */
index 9861e9d..d0bd1e9 100644 (file)
@@ -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 */
index 6d57089..e84b074 100644 (file)
@@ -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",
 };
index 0bcf628..48f45b6 100644 (file)
@@ -109,4 +109,5 @@ AVCodec ff_libwebp_encoder = {
     },
     .priv_class     = &class,
     .defaults       = libwebp_defaults,
+    .wrapper_name   = "libwebp",
 };
index 91bf64c..7f35a0b 100644 (file)
@@ -148,4 +148,5 @@ AVCodec ff_libwebp_anim_encoder = {
     },
     .priv_class     = &class,
     .defaults       = libwebp_defaults,
+    .wrapper_name   = "libwebp",
 };
index 9c67c91..e2455e1 100644 (file)
@@ -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
index 25ccb02..52ad231 100644 (file)
@@ -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",
 };
index 865b5f6..801a05d 100644 (file)
@@ -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",
 };
index 5c05fa6..cdaae20 100644 (file)
@@ -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",
 };
index 687b6af..30d0593 100644 (file)
@@ -573,4 +573,5 @@ AVCodec ff_libzvbi_teletext_decoder = {
     .capabilities = AV_CODEC_CAP_DELAY,
     .flush     = teletext_flush,
     .priv_class= &teletext_class,
+    .wrapper_name = "libzvbi",
 };
index 39f5cbc..1b5ae4a 100644 (file)
@@ -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
index b3f0cca..647a22e 100644 (file)
@@ -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)
index c3b4bac..bc7bbcd 100644 (file)
@@ -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",
 };
index 89e8c3e..0df7eab 100644 (file)
@@ -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",
 };
index 6b4fc5e..5e00673 100644 (file)
@@ -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
index f7691f9..416e4c8 100644 (file)
@@ -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
index 3242062..77fb282 100644 (file)
@@ -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",
 };
index f132a26..4339b31 100644 (file)
@@ -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",
 };
index 731ec9a..c18fe91 100644 (file)
@@ -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",
 };
index 5b583fb..a7427d8 100644 (file)
@@ -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",
 };
index 4ec61cb..fa522ce 100644 (file)
@@ -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")
index 958cdc5..c4ea20e 100644 (file)
@@ -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");
index 76ce85f..f62ce7c 100644 (file)
@@ -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);
index 6940823..a7f9a60 100644 (file)
@@ -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",
 };
index 8e98b02..f3b4f6c 100644 (file)
@@ -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",
 };
index 2cbf792..c949e89 100644 (file)
@@ -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",
 };
index 02eca30..4537955 100644 (file)
@@ -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",
 };
index 423f748..b4c5521 100644 (file)
@@ -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",
 };
index a987d1c..9108699 100644 (file)
@@ -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",
 };
index 3b5c300..b529f00 100644 (file)
@@ -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, \
index 086beb4..7796a68 100644 (file)
@@ -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",
 };