The options are live from AVHWaccel.init() to AVHWAccel.uninit(). As such, they are specific to an active hwaccel and have a meaning to that hwaccel only during initialization. Options can be initialized by the user during AVCodecContext.get_format() with hwaccel-specific (public) helper functions.
This is an internal infrastructure change/addition only. Signed-off-by: Gwenole Beauchesne <gwenole.beauche...@intel.com> --- libavcodec/internal.h | 14 ++++++++++++++ libavcodec/utils.c | 2 ++ 2 files changed, 16 insertions(+) diff --git a/libavcodec/internal.h b/libavcodec/internal.h index f93a196..413e49b 100644 --- a/libavcodec/internal.h +++ b/libavcodec/internal.h @@ -157,6 +157,20 @@ typedef struct AVCodecInternal { * hwaccel-specific private data */ void *hwaccel_priv_data; + + /** + * Hardware acceleration config options. + * + * Those options are live from AVHWAccel.init() to AVHWAccel.uninit(). + * As such, they are specific to an active hwaccel and have a meaning + * to that specific hwaccel only during initialization. Initialization + * occurs during AVCodecContext.get_format() through hwaccel-specific + * helper functions. + * + * Options are written by the user and read by the hwaccel. Exposing + * hwaccel options to the user is not permitted. + */ + AVDictionary *hwaccel_config; } AVCodecInternal; struct AVCodecDefault { diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 4da16ee..d6be93d 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -1231,6 +1231,7 @@ int ff_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt) if (avctx->hwaccel && avctx->hwaccel->uninit) avctx->hwaccel->uninit(avctx); av_freep(&avctx->internal->hwaccel_priv_data); + av_dict_free(&avctx->internal->hwaccel_config); avctx->hwaccel = NULL; ret = avctx->get_format(avctx, choices); @@ -2923,6 +2924,7 @@ av_cold int avcodec_close(AVCodecContext *avctx) if (avctx->hwaccel && avctx->hwaccel->uninit) avctx->hwaccel->uninit(avctx); av_freep(&avctx->internal->hwaccel_priv_data); + av_dict_free(&avctx->internal->hwaccel_config); av_freep(&avctx->internal); } -- 1.9.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel