From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 9862B4006B for ; Thu, 18 Aug 2022 13:46:42 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 75DEF68B9A8; Thu, 18 Aug 2022 16:46:23 +0300 (EEST) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9E65D68B969 for ; Thu, 18 Aug 2022 16:46:15 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id C1B1F240511 for ; Thu, 18 Aug 2022 15:46:14 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id ivvKAeMDKbvk for ; Thu, 18 Aug 2022 15:46:12 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 5F639240506 for ; Thu, 18 Aug 2022 15:46:12 +0200 (CEST) Received: by libav.khirnov.net (Postfix, from userid 1000) id 48E803A160B; Thu, 18 Aug 2022 15:46:06 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Thu, 18 Aug 2022 15:46:02 +0200 Message-Id: <20220818134605.12583-1-anton@khirnov.net> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/4] lavf: deprecate av_stream_get_end_pts() X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: According to its documentation it returns "pts of the last muxed packet + its duration", but the value it actually returns right now is (possibly guessed) dts after muxer-internal bitstream filtering (if any). This function was added for ffmpeg.c, but it is not used there anymore. Since the value it returns is ill-defined and so inappropriate for any serious use, deprecate it. --- doc/APIchanges | 3 +++ libavformat/avformat.h | 3 +++ libavformat/mux_utils.c | 2 ++ libavformat/version_major.h | 1 + 4 files changed, 9 insertions(+) diff --git a/doc/APIchanges b/doc/APIchanges index b3ba07ee7c..bc355b59ed 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -14,6 +14,9 @@ libavutil: 2021-04-27 API changes, most recent first: +2022-08-xx - xxxxxxxxxx - lavf 59 - avformat.h + Deprecate av_stream_get_end_pts() without replacement. + 2022-08-07 - e95b08a7dd - lavu 57.33.101 - pixfmt.h Add AV_PIX_FMT_RGBAF16{BE,LE} pixel formats. diff --git a/libavformat/avformat.h b/libavformat/avformat.h index f12fa7d904..9d46875cce 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -1121,12 +1121,15 @@ typedef struct AVStream { struct AVCodecParserContext *av_stream_get_parser(const AVStream *s); +#if FF_API_GET_END_PTS /** * Returns the pts of the last muxed packet + its duration * * the retuned value is undefined when used with a demuxer. */ +attribute_deprecated int64_t av_stream_get_end_pts(const AVStream *st); +#endif #define AV_PROGRAM_RUNNING 1 diff --git a/libavformat/mux_utils.c b/libavformat/mux_utils.c index 2fa2ab5b0f..8b95fc5e7e 100644 --- a/libavformat/mux_utils.c +++ b/libavformat/mux_utils.c @@ -29,6 +29,7 @@ #include "internal.h" #include "mux.h" +#if FF_API_GET_END_PTS int64_t av_stream_get_end_pts(const AVStream *st) { if (cffstream(st)->priv_pts) { @@ -36,6 +37,7 @@ int64_t av_stream_get_end_pts(const AVStream *st) } else return AV_NOPTS_VALUE; } +#endif int avformat_query_codec(const AVOutputFormat *ofmt, enum AVCodecID codec_id, int std_compliance) diff --git a/libavformat/version_major.h b/libavformat/version_major.h index 5f71298bcc..099a17873f 100644 --- a/libavformat/version_major.h +++ b/libavformat/version_major.h @@ -46,6 +46,7 @@ #define FF_API_AVIOCONTEXT_WRITTEN (LIBAVFORMAT_VERSION_MAJOR < 60) #define FF_HLS_TS_OPTIONS (LIBAVFORMAT_VERSION_MAJOR < 60) #define FF_API_AVSTREAM_CLASS (LIBAVFORMAT_VERSION_MAJOR > 59) +#define FF_API_GET_END_PTS (LIBAVFORMAT_VERSION_MAJOR < 60) #define FF_API_R_FRAME_RATE 1 -- 2.35.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".