On Mon, 27 Mar 2017 21:38:14 +0100
Mark Thompson <s...@jkqxz.net> wrote:

> ---
>  doc/APIchanges             |  3 +++
>  libavcodec/avcodec.h       | 14 ++++++++++++++
>  libavcodec/options_table.h |  1 +
>  3 files changed, 18 insertions(+)
> 
> diff --git a/doc/APIchanges b/doc/APIchanges
> index 649d35a08..677f5f7f1 100644
> --- a/doc/APIchanges
> +++ b/doc/APIchanges
> @@ -14,6 +14,9 @@ libavutil:     2017-03-23
>  API changes, most recent first:
>  
>  2017-04-xx - xxxxxxx - lavc 58.x+1.0 - avcodec.h
> +  Add AVCodecContext.extra_hw_frames.
> +
> +2017-04-xx - xxxxxxx - lavc 58.x+1.0 - avcodec.h
>    Add AVHWAccel.device_type and avcodec_probe_hw().
>  
>  2017-04-xx - xxxxxxx - lavc 58.x.y+1 - avcodec.h
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index 8f7293d02..0a50cd876 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -2724,6 +2724,20 @@ typedef struct AVCodecContext {
>       *             AVCodecContext.get_format callback)
>       */
>      int hwaccel_flags;
> +
> +    /**
> +     * Video decoding only.  Sets the number of extra hardware frames which
> +     * the decoder will allocate for use by the caller.  This is only used
> +     * if hw_device_ctx is set.
> +     *
> +     * Some hardware decoders require all frames that they will use for
> +     * output to be defined in advance before decoding starts.  For such
> +     * decoders, the hardware frame pool must therefore be of a fixed size.
> +     * The extra frames set here are on top of any number that the decoder
> +     * needs internally in order to operate normally (for example, frames
> +     * used as reference pictures).
> +     */
> +    int extra_hw_frames;
>  } AVCodecContext;
>  
>  /**
> diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
> index 925ef376f..ce871dccd 100644
> --- a/libavcodec/options_table.h
> +++ b/libavcodec/options_table.h
> @@ -419,6 +419,7 @@ static const AVOption avcodec_options[] = {
>  {"side_data_only_packets", NULL, OFFSET(side_data_only_packets), 
> AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, A|V|E },
>  #endif
>  {"apply_cropping", NULL, OFFSET(apply_cropping), AV_OPT_TYPE_INT, { .i64 = 1 
> }, 0, 1, V | D },
> +{"extra_hw_frames", "Number of extra hardware frames to allocate for the 
> user", OFFSET(extra_hw_frames), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, 
> V|D },
>  {NULL},
>  };
>  

What will it do for decoders which do not require pre-allocation? A
small note of this would be good. Otherwise LGTM.
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to