[FFmpeg-devel] [PATCH 4/7] buffersink: add av_buffersink_get_frame_rate().

Stefano Sabatini stefasab at gmail.com
Wed Jun 6 00:26:07 CEST 2012


On date Tuesday 2012-06-05 13:23:04 +0200, Nicolas George encoded:
> 
> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
> ---
>  libavfilter/buffersink.h  |    5 +++++
>  libavfilter/sink_buffer.c |    5 +++++
>  2 files changed, 10 insertions(+)
> 
> diff --git a/libavfilter/buffersink.h b/libavfilter/buffersink.h
> index 46de82b..97729bc 100644
> --- a/libavfilter/buffersink.h
> +++ b/libavfilter/buffersink.h
> @@ -133,4 +133,9 @@ int av_buffersink_read(AVFilterContext *sink, AVFilterBufferRef **buf);
>  int av_buffersink_read_samples(AVFilterContext *ctx, AVFilterBufferRef **buf,
>                                 int nb_samples);
>  
> +/**
> + * Get the frame rate of the input.
> + */
> +AVRational av_buffersink_get_frame_rate(AVFilterContext *ctx);
> +
>  #endif /* AVFILTER_BUFFERSINK_H */
> diff --git a/libavfilter/sink_buffer.c b/libavfilter/sink_buffer.c
> index d83f21b..d1a72e4 100644
> --- a/libavfilter/sink_buffer.c
> +++ b/libavfilter/sink_buffer.c
> @@ -142,6 +142,11 @@ int av_buffersink_get_buffer_ref(AVFilterContext *ctx,
>      return 0;
>  }
>  
> +AVRational av_buffersink_get_frame_rate(AVFilterContext *ctx)
> +{
> +    return ctx->inputs[0]->frame_rate;
> +}
> +
>  int av_buffersink_poll_frame(AVFilterContext *ctx)
>  {
>      BufferSinkContext *buf = ctx->priv;
> -- 
> 1.7.10

LGTM.
-- 
FFmpeg = Free and Fabulous Magnificient Proud Enchanting Guru


More information about the ffmpeg-devel mailing list