buffersink: add av_buffersink_get_frame_rate().
authorNicolas George <nicolas.george@normalesup.org>
Tue, 5 Jun 2012 10:40:37 +0000 (12:40 +0200)
committerNicolas George <nicolas.george@normalesup.org>
Sat, 9 Jun 2012 06:42:50 +0000 (08:42 +0200)
libavfilter/buffersink.h
libavfilter/sink_buffer.c

index 46de82b..97729bc 100644 (file)
@@ -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 */
index d83f21b..d1a72e4 100644 (file)
@@ -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;