[FFmpeg-devel] [PATCH 08/17] lavfi: add helpers to consume frames from link FIFOs.

Michael Niedermayer michael at niedermayer.cc
Sun Dec 25 02:53:35 EET 2016


On Sat, Dec 24, 2016 at 06:41:40PM +0100, Nicolas George wrote:
> Signed-off-by: Nicolas George <george at nsup.org>
> ---
>  libavfilter/avfilter.c | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++
>  libavfilter/internal.h | 47 +++++++++++++++++++++++++++++++++++++
>  2 files changed, 110 insertions(+)
[...]

> +/**
> + * Take a frame from the link's FIFO and update the link's stats.
> + * Must only be called if a frame is available (assert1).
> + * @note  May trigger process_command() and/or update is_disabled.
> + */
> +int ff_link_consume_frame_sure(AVFilterLink *link, AVFrame **rframe);
> +
> +/**
> + * Take samples from the link's FIFO and update the link's stats.
> + * Must only be called if samples are available (assert1).
> + * @note  May trigger process_command() and/or update is_disabled.
> + */
> +int ff_link_consume_samples_sure(AVFilterLink *link, unsigned min, unsigned max,
> +                                 AVFrame **rframe);
> +
> +/**
> + * Take a frame from the link's FIFO and update the link's stats.
> + * @note  May trigger process_command() and/or update is_disabled.
> + * @return  >0 if a frame is available,
> + *          0 and sets rframe to NULL if no frame available,
> + *          or AVERROR code
> + */
> +int ff_link_consume_frame(AVFilterLink *link, AVFrame **rframe);
> +
> +/**
> + * Take samples from the link's FIFO and update the link's stats.
> + * @note  May trigger process_command() and/or update is_disabled.
> + * @return  >0 if a frame is available,
> + *          0 and sets rframe to NULL if no frame available,
> + *          or AVERROR code
> + */
> +int ff_link_consume_samples(AVFilterLink *link, unsigned min, unsigned max,
> +                            AVFrame **rframe);
> +

Why do these functions exist twice ?
the API would be simpler with just one set

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

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact
-------------- 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/20161225/857f43aa/attachment.sig>


More information about the ffmpeg-devel mailing list