[FFmpeg-devel] [PATCH 3/4] lavfi/timeline: add passthrough callback.
Michael Niedermayer
michaelni at gmx.at
Tue Apr 16 00:33:58 CEST 2013
On Mon, Apr 15, 2013 at 06:56:37PM +0200, Clément Bœsch wrote:
> ---
> libavfilter/avfilter.c | 3 ++-
> libavfilter/avfilter.h | 13 +++++++++++++
> 2 files changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
> index 8a5292d..65e04e7 100644
> --- a/libavfilter/avfilter.c
> +++ b/libavfilter/avfilter.c
> @@ -959,7 +959,8 @@ static int ff_filter_frame_framed(AVFilterLink *link, AVFrame *frame)
> dstctx->var_values[VAR_N] = link->frame_count;
> dstctx->var_values[VAR_T] = pts == AV_NOPTS_VALUE ? NAN : pts * av_q2d(link->time_base);
> if (!((int)av_expr_eval(dstctx->enable, dstctx->var_values, NULL)))
> - filter_frame = default_filter_frame;
> + filter_frame = dst->passthrough_filter_frame ? dst->passthrough_filter_frame
> + : default_filter_name;
> }
> ret = filter_frame(link, out);
> link->frame_count++;
> diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
> index a5518f7..a092ad2 100644
> --- a/libavfilter/avfilter.h
> +++ b/libavfilter/avfilter.h
> @@ -336,6 +336,19 @@ struct AVFilterPad {
> int (*filter_frame)(AVFilterLink *link, AVFrame *frame);
>
> /**
> + * Passthrough filtering callback.
> + *
> + * If a filter support timeline editing (AVFILTER_FLAG_SUPPORT_TIMELINE)
> + * then it can implement a custom passthrough callback to update its local
> + * context (for example to keep a frame reference, or simply send the
> + * filter to a custom outlink). The filter is obviously not supposed to do
> + * any change to the frame in this callback.
> + *
> + * Input pads only.
> + */
> + int (*passthrough_filter_frame)(AVFilterLink *link, AVFrame *frame);
> +
> + /**
> * Frame poll callback. This returns the number of immediately available
shouldnt new fields be added at the end of the structure ?
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
He who knows, does not speak. He who speaks, does not know. -- Lao Tsu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130416/c389897f/attachment.asc>
More information about the ffmpeg-devel
mailing list