From d0c8ca961d7d4a496f212283781ba74623bf8c3f Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 25 Jan 2023 16:39:01 +0100 Subject: lavc: add a private cap for fake-delay encoders Some encoders (ffv1, flac, adx) are marked with AV_CODEC_CAP_DELAY onky in order to be flushed at the end, otherwise they behave as no-delay encoders. Add a capability to mark these encoders. Use it for setting pts generically. --- libavcodec/codec_internal.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libavcodec/codec_internal.h') diff --git a/libavcodec/codec_internal.h b/libavcodec/codec_internal.h index e3b77e6dea..130a7dc3cd 100644 --- a/libavcodec/codec_internal.h +++ b/libavcodec/codec_internal.h @@ -80,6 +80,14 @@ * Codec supports embedded ICC profiles (AV_FRAME_DATA_ICC_PROFILE). */ #define FF_CODEC_CAP_ICC_PROFILES (1 << 9) +/** + * The encoder has AV_CODEC_CAP_DELAY set, but does not actually have delay - it + * only wants to be flushed at the end to update some context variables (e.g. + * 2pass stats) or produce a trailing packet. Besides that it immediately + * produces exactly one output packet per each input frame, just as no-delay + * encoders do. + */ +#define FF_CODEC_CAP_EOF_FLUSH (1 << 10) /** * FFCodec.codec_tags termination value -- cgit v1.2.3