diff options
author | Mark Thompson <sw@jkqxz.net> | 2017-10-26 00:18:43 +0100 |
---|---|---|
committer | Mark Thompson <sw@jkqxz.net> | 2017-11-26 21:35:53 +0000 |
commit | 67e81d79ccfc6713c797ddb19a3b8aea476c947b (patch) | |
tree | 2e9791f724f1baadd939b595ef0dc447b826dffd /libavcodec/internal.h | |
parent | 758fbc54fef2f31957b5c5f22e05e5fd9b04f631 (diff) | |
download | ffmpeg-67e81d79ccfc6713c797ddb19a3b8aea476c947b.tar.gz |
lavc: Use hardware config information in ff_get_format()
This removes the dependency that hardware pixel formats previously had on
AVHWAccel instances, meaning only those which actually do something need
exist after this patch.
Also updates avcodec_default_get_format() to be able to choose hardware
formats if either a matching device has been supplied or no additional
external configuration is required, and avcodec_get_hw_frames_parameters()
to use the hardware config rather than searching the old hwaccel list.
The FF_CODEC_CAP_HWACCEL_REQUIRE_CLASS mechanism is deleted because it
no longer does anything (the codec already contains the pointers to the
matching hwaccels).
Diffstat (limited to 'libavcodec/internal.h')
-rw-r--r-- | libavcodec/internal.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libavcodec/internal.h b/libavcodec/internal.h index 1c54966f37..6deaf1d204 100644 --- a/libavcodec/internal.h +++ b/libavcodec/internal.h @@ -69,11 +69,6 @@ */ #define FF_CODEC_CAP_SLICE_THREAD_HAS_MF (1 << 5) -/** - * Allow only AVHWAccels which have a matching decoder_class field. - */ -#define FF_CODEC_CAP_HWACCEL_REQUIRE_CLASS (1 << 6) - #ifdef TRACE # define ff_tlog(ctx, ...) av_log(ctx, AV_LOG_TRACE, __VA_ARGS__) #else @@ -377,6 +372,12 @@ int ff_side_data_update_matrix_encoding(AVFrame *frame, * Select the (possibly hardware accelerated) pixel format. * This is a wrapper around AVCodecContext.get_format() and should be used * instead of calling get_format() directly. + * + * The list of pixel formats must contain at least one valid entry, and is + * terminated with AV_PIX_FMT_NONE. If it is possible to decode to software, + * the last entry in the list must be the most accurate software format. + * If it is not possible to decode to software, AVCodecContext.sw_pix_fmt + * must be set before calling this function. */ int ff_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt); |