[FFmpeg-devel] [PATCH 1/3] lavfi/buffersink: add av_buffersink_get_pts().
Nicolas George
george at nsup.org
Thu Jun 25 21:35:16 EEST 2020
TODO APIChange & bump
Signed-off-by: Nicolas George <george at nsup.org>
---
libavfilter/buffersink.c | 5 +++++
libavfilter/buffersink.h | 5 +++++
2 files changed, 10 insertions(+)
diff --git a/libavfilter/buffersink.c b/libavfilter/buffersink.c
index 76a46f6678..c65a5051a4 100644
--- a/libavfilter/buffersink.c
+++ b/libavfilter/buffersink.c
@@ -125,6 +125,11 @@ int attribute_align_arg av_buffersink_get_samples(AVFilterContext *ctx,
return get_frame_internal(ctx, frame, 0, nb_samples);
}
+int64_t av_buffersink_get_pts(AVFilterContext *ctx)
+{
+ return ctx->inputs[0]->current_pts;
+}
+
#if FF_API_NEXT
AVBufferSinkParams *av_buffersink_params_alloc(void)
{
diff --git a/libavfilter/buffersink.h b/libavfilter/buffersink.h
index 2ec821c685..b3e3cc0f29 100644
--- a/libavfilter/buffersink.h
+++ b/libavfilter/buffersink.h
@@ -59,6 +59,11 @@ int av_buffersink_get_frame_flags(AVFilterContext *ctx, AVFrame *frame, int flag
*/
#define AV_BUFFERSINK_FLAG_NO_REQUEST 2
+/**
+ * Get the current PTS, i.e. the PTS of the last frame or the end of stream.
+ */
+int64_t av_buffersink_get_pts(AVFilterContext *ctx);
+
#if FF_API_NEXT
/**
* Struct to use for initializing a buffersink context.
--
2.27.0
More information about the ffmpeg-devel
mailing list