[FFmpeg-devel] [PATCH 13/17] lavfi: add ff_inlink_set_frame_wanted().

Michael Niedermayer michael at niedermayer.cc
Sat Dec 31 04:42:54 EET 2016


On Thu, Dec 29, 2016 at 03:33:59PM +0100, Nicolas George wrote:
> Signed-off-by: Nicolas George <george at nsup.org>
> ---
>  libavfilter/avfilter.c | 8 ++++++++
>  libavfilter/filters.h  | 8 ++++++++
>  2 files changed, 16 insertions(+)
> 
> 
> Changes in this commit: rename ff_link -> ff_inlink and move to filters.h.
> 
> 
> diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
> index 7e02d9ca8b..d7677d5f23 100644
> --- a/libavfilter/avfilter.c
> +++ b/libavfilter/avfilter.c
> @@ -1634,6 +1634,14 @@ void ff_inlink_process_timeline(AVFilterLink *link, const AVFrame *frame)
>      dstctx->is_disabled = fabs(av_expr_eval(dstctx->enable, dstctx->var_values, NULL)) < 0.5;
>  }
>  
> +void ff_inlink_set_frame_wanted(AVFilterLink *link)
> +{
> +    av_assert1(!link->status_in);
> +    av_assert1(!link->status_out);
> +    link->frame_wanted_out = 1;
> +    ff_filter_set_ready(link->src, 100);
> +}
> +
>  const AVClass *avfilter_get_class(void)
>  {
>      return &avfilter_class;
> diff --git a/libavfilter/filters.h b/libavfilter/filters.h
> index 95df86c911..4ffddf117f 100644
> --- a/libavfilter/filters.h
> +++ b/libavfilter/filters.h
> @@ -100,4 +100,12 @@ int ff_inlink_make_frame_writable(AVFilterLink *link, AVFrame **rframe);
>   */
>  int ff_inlink_acknowledge_status(AVFilterLink *link, int *rstatus);
>  
> +/**
> + * Mark that a frame is wanted on the link.
> + * Unlike ff_filter_frame(), it must not be called when the link has a
> + * non-zero status, and thus does not acknowledge it.
> + * Also it cannot fail.
> + */
> +void ff_inlink_set_frame_wanted(AVFilterLink *link);

iam tempted to suggest to call this
ff_inlink_request_frame()

it would be the better name if ff_request_frame() didnt exist.


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The greatest way to live with honor in this world is to be what we pretend
to be. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20161231/24a41cc7/attachment.sig>


More information about the ffmpeg-devel mailing list