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>.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:
wm4 2017-12-12 11:03:43 +01:00 committed by Luca Barbato
parent 5083785566
commit 47687a2f8a
47 changed files with 96 additions and 15 deletions

View File

@ -885,6 +885,19 @@ typedef struct RcOverride{
*/
#define AV_CODEC_CAP_VARIABLE_FRAME_SIZE (1 << 16)
/**
* Codec is backed by a hardware implementation. Typically used to
* identify a non-hwaccel hardware decoder.
*/
#define AV_CODEC_CAP_HARDWARE (1 << 17)
/**
* 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 << 18)
/**
* Pan Scan area.
* This specifies the area which should be displayed.
@ -2770,6 +2783,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 decoder.
* 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

View File

@ -202,4 +202,5 @@ AVCodec ff_libdcadec_decoder = {
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_S16P,
AV_SAMPLE_FMT_NONE },
.profiles = NULL_IF_CONFIG_SMALL(profiles),
.wrapper_name = "libdcadec",
};

View File

@ -237,4 +237,5 @@ AVCodec ff_libfaac_encoder = {
AV_SAMPLE_FMT_NONE },
.profiles = NULL_IF_CONFIG_SMALL(profiles),
.channel_layouts = faac_channel_layouts,
.wrapper_name = "libfaac",
};

View File

@ -386,4 +386,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",
};

View File

@ -430,4 +430,5 @@ AVCodec ff_libfdk_aac_encoder = {
.profiles = profiles,
.supported_samplerates = aac_sample_rates,
.channel_layouts = aac_channel_layout,
.wrapper_name = "libfdk",
};

View File

@ -130,6 +130,7 @@ AVCodec ff_libgsm_decoder = {
.decode = libgsm_decode_frame,
.flush = libgsm_flush,
.capabilities = AV_CODEC_CAP_DR1,
.wrapper_name = "libgsm",
};
AVCodec ff_libgsm_ms_decoder = {
@ -143,4 +144,5 @@ AVCodec ff_libgsm_ms_decoder = {
.decode = libgsm_decode_frame,
.flush = libgsm_flush,
.capabilities = AV_CODEC_CAP_DR1,
.wrapper_name = "libgsm",
};

View File

@ -117,6 +117,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",
};
AVCodec ff_libgsm_ms_encoder = {
@ -129,4 +130,5 @@ 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",
};

View File

@ -197,4 +197,5 @@ AVCodec ff_libilbc_encoder = {
AV_SAMPLE_FMT_NONE },
.defaults = ilbc_encode_defaults,
.priv_class = &ilbc_enc_class,
.wrapper_name = "libbilbc",
};

View File

@ -301,4 +301,6 @@ AVCodec ff_libkvazaar_encoder = {
.close = libkvazaar_close,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
.wrapper_name = "libkvazaar",
};

View File

@ -315,4 +315,5 @@ AVCodec ff_libmp3lame_encoder = {
0 },
.priv_class = &libmp3lame_class,
.defaults = libmp3lame_defaults,
.wrapper_name = "libmp3lame",
};

View File

@ -379,6 +379,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 */

View File

@ -145,4 +145,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",
};

View 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",
};

View File

@ -438,4 +438,5 @@ AVCodec ff_libopenjpeg_decoder = {
.decode = libopenjpeg_decode_frame,
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
.priv_class = &class,
.wrapper_name = "libopenjpeg",
};

View File

@ -426,4 +426,5 @@ AVCodec ff_libopenjpeg_encoder = {
AV_PIX_FMT_NONE
},
.priv_class = &class,
.wrapper_name = "libopenjpeg",
};

View File

@ -177,4 +177,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",
};

View File

@ -422,4 +422,5 @@ AVCodec ff_libopus_encoder = {
.supported_samplerates = libopus_sample_rates,
.priv_class = &libopus_class,
.defaults = libopus_defaults,
.wrapper_name = "libopus",
};

View File

@ -393,4 +393,5 @@ AVCodec ff_libschroedinger_decoder = {
.decode = libschroedinger_decode_frame,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1,
.flush = libschroedinger_flush,
.wrapper_name = "libschroedinger",
};

View File

@ -481,4 +481,5 @@ AVCodec ff_libschroedinger_encoder = {
.pix_fmts = (const enum AVPixelFormat[]){
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_NONE
},
.wrapper_name = "libschroedinger",
};

View File

@ -179,4 +179,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",
};

View File

@ -366,4 +366,5 @@ AVCodec ff_libspeex_encoder = {
.supported_samplerates = (const int[]){ 8000, 16000, 32000, 0 },
.priv_class = &class,
.defaults = defaults,
.wrapper_name = "libspeex",
};

View File

@ -382,4 +382,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",
};

View File

@ -222,4 +222,5 @@ AVCodec ff_libtwolame_encoder = {
AV_CH_LAYOUT_STEREO,
0 },
.supported_samplerates = twolame_samplerates,
.wrapper_name = "libtwolame",
};

View File

@ -191,4 +191,5 @@ AVCodec ff_libvo_aacenc_encoder = {
.capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_DELAY,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE },
.wrapper_name = "libvo_aacenc",
};

View File

@ -154,4 +154,5 @@ AVCodec ff_libvo_amrwbenc_encoder = {
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE },
.priv_class = &class,
.wrapper_name = "libvo_amrwbenc",
};

View File

@ -356,4 +356,5 @@ AVCodec ff_libvorbis_encoder = {
AV_SAMPLE_FMT_NONE },
.priv_class = &class,
.defaults = defaults,
.wrapper_name = "libvorbis",
};

View File

@ -137,6 +137,7 @@ AVCodec ff_libvpx_vp8_decoder = {
.close = vp8_free,
.decode = vp8_decode,
.capabilities = AV_CODEC_CAP_AUTO_THREADS | AV_CODEC_CAP_DR1,
.wrapper_name = "libvpx",
};
#endif /* CONFIG_LIBVPX_VP8_DECODER */
@ -156,5 +157,6 @@ AVCodec ff_libvpx_vp9_decoder = {
.close = vp8_free,
.decode = vp8_decode,
.capabilities = AV_CODEC_CAP_AUTO_THREADS,
.wrapper_name = "libvpx",
};
#endif /* CONFIG_LIBVPX_VP9_DECODER */

View File

@ -649,6 +649,7 @@ AVCodec ff_libvpx_vp8_encoder = {
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
.priv_class = &class_vp8,
.defaults = defaults,
.wrapper_name = "libvpx",
};
#endif /* CONFIG_LIBVPX_VP8_ENCODER */
@ -695,5 +696,6 @@ AVCodec ff_libvpx_vp9_encoder = {
.profiles = NULL_IF_CONFIG_SMALL(profiles),
.priv_class = &class_vp9,
.defaults = defaults,
.wrapper_name = "libvpx",
};
#endif /* CONFIG_LIBVPX_VP9_ENCODER */

View 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",
};

View File

@ -286,4 +286,5 @@ AVCodec ff_libwebp_encoder = {
},
.priv_class = &class,
.defaults = libwebp_defaults,
.wrapper_name = "libwebp",
};

View File

@ -826,6 +826,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
@ -852,5 +853,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

View File

@ -382,4 +382,5 @@ AVCodec ff_libx265_encoder = {
.priv_class = &class,
.defaults = x265_defaults,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AUTO_THREADS,
.wrapper_name = "libx265",
};

View File

@ -480,4 +480,5 @@ AVCodec ff_libxavs_encoder = {
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
.priv_class = &class,
.defaults = xavs_defaults,
.wrapper_name = "libxavs",
};

View File

@ -925,4 +925,5 @@ AVCodec ff_libxvid_encoder = {
.priv_class = &xvid_class,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE |
FF_CODEC_CAP_INIT_CLEANUP,
.wrapper_name = "libxvid",
};

View File

@ -835,11 +835,12 @@ 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}, \
.wrapper_name = "mmal", \
};
FFMMAL_DEC(h264, AV_CODEC_ID_H264)

View File

@ -220,13 +220,14 @@ 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,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_HYBRID,
.priv_class = &hevc_class,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12,
AV_PIX_FMT_P010,
AV_PIX_FMT_QSV,
AV_PIX_FMT_NONE },
.bsfs = "hevc_mp4toannexb",
.wrapper_name = "qsv",
};
#endif
@ -262,12 +263,13 @@ 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,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_HYBRID,
.priv_class = &class,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12,
AV_PIX_FMT_P010,
AV_PIX_FMT_QSV,
AV_PIX_FMT_NONE },
.bsfs = "h264_mp4toannexb",
.wrapper_name = "qsv",
};
#endif

View File

@ -190,11 +190,12 @@ 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,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1 | 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 },
.wrapper_name = "qsv",
};
#endif
@ -225,11 +226,12 @@ 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,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1 | 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 },
.wrapper_name = "qsv",
};
#endif
@ -260,10 +262,11 @@ 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,
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1 | 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 },
.wrapper_name = "qsv",
};
#endif

View File

@ -127,7 +127,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,
@ -135,4 +135,5 @@ AVCodec ff_h264_qsv_encoder = {
.priv_class = &class,
.defaults = qsv_enc_defaults,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.wrapper_name = "qsv",
};

View File

@ -272,7 +272,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,
@ -280,4 +280,5 @@ AVCodec ff_hevc_qsv_encoder = {
.priv_class = &class,
.defaults = qsv_enc_defaults,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.wrapper_name = "qsv",
};

View 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",
};

View 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",
};

View File

@ -1074,10 +1074,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",
};

View 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",
};

View 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",
};

View 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",
};

View File

@ -259,10 +259,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",
};

View File

@ -302,10 +302,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",
};