[FFmpeg-devel] [PATCH] avutil/hwcontext: add flags field to AVHWFramesContext

Mark Thompson sw at jkqxz.net
Mon May 7 23:45:12 EEST 2018


On 07/05/18 19:39, Timo Rothenpieler wrote:
> ---
>  doc/APIchanges        | 3 +++
>  libavutil/hwcontext.h | 7 +++++++
>  libavutil/version.h   | 2 +-
>  3 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/doc/APIchanges b/doc/APIchanges
> index ede5b186ae..307c7a51ee 100644
> --- a/doc/APIchanges
> +++ b/doc/APIchanges
> @@ -15,6 +15,9 @@ libavutil:     2017-10-21
>  
>  API changes, most recent first:
>  
> +2018-05-xx - xxxxxxxxxx - lavu 56.19.100 - hwcontext.h
> +  Add AVHWFramesContext.flags.
> +
>  2018-04-xx - xxxxxxxxxx - lavu 56.18.100 - pixdesc.h
>    Add AV_PIX_FMT_FLAG_ALPHA to AV_PIX_FMT_PAL8.
>  
> diff --git a/libavutil/hwcontext.h b/libavutil/hwcontext.h
> index f5a4b62387..23e2d335a5 100644
> --- a/libavutil/hwcontext.h
> +++ b/libavutil/hwcontext.h
> @@ -226,6 +226,13 @@ typedef struct AVHWFramesContext {
>       * Must be set by the user before calling av_hwframe_ctx_init().
>       */
>      int width, height;
> +
> +    /**
> +     * Special implementation-specific flags.
> +     *
> +     * Must be set by the user before calling av_hwframe_ctx_init().
> +     */
> +    int flags;
>  } AVHWFramesContext;
>  
>  /**
> diff --git a/libavutil/version.h b/libavutil/version.h
> index 5185454d9b..84409b1d69 100644
> --- a/libavutil/version.h
> +++ b/libavutil/version.h
> @@ -79,7 +79,7 @@
>   */
>  
>  #define LIBAVUTIL_VERSION_MAJOR  56
> -#define LIBAVUTIL_VERSION_MINOR  18
> +#define LIBAVUTIL_VERSION_MINOR  19
>  #define LIBAVUTIL_VERSION_MICRO 100
>  
>  #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
> 

Nack.  Implementation-specific details go in the implementation-specific structure (AVHWFramesContext.hwctx).

What are you actually thining of using this for?  If you want to add flags which are in common between multiple different implementations then maybe it would be suitable to put it here, but something implementation-specific really shouldn't be.

- Mark


More information about the ffmpeg-devel mailing list