From patchwork Fri Jul 5 10:42:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 50366 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:cc64:0:b0:482:c625:d099 with SMTP id k4csp4215036vqv; Fri, 5 Jul 2024 03:43:05 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUeUxkPGAhn7EpTJuH6RIUJEwCYqUOKOs8a/nFg6jBaL9xtBJ/EVRg/D/ICbokK/C+n1sc6YGq9aGylZGFcuWxJjJriP3PfeHa+fA== X-Google-Smtp-Source: AGHT+IE4vnFbcwOiHa9Rge0wsq+GvbRzoKcHcwma7Y2FdH3fylU+fcsCWw+WnV8Tl+JtlfnPsr/m X-Received: by 2002:a2e:b173:0:b0:2ec:eee:f19e with SMTP id 38308e7fff4ca-2ee8edd3ff3mr27228921fa.37.1720176184786; Fri, 05 Jul 2024 03:43:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720176184; cv=none; d=google.com; s=arc-20160816; b=z9cGN0KbW0JzMbcuHl4pZjPT9uJKrhRuY4+yM3xToRt+3DwjwnmcNP9UbLGUXphqfr voJlcTg+tAK9UH/7pIMeMtNYyN6F6w3Hdd1o80qq6LxysWjVmzbYmGaJZjEKp9OKRU3N tiw8H9rjdxfPhrpTUaEM/vwbIohDEW9dutmk3vd0fMGS9/JL5rn7Ka11s3dqpuHp8UZ5 zWnwf/GudSCuV3hTe/tTXaT2iWg0u+HYmX85yCyeqq5FPzlEC5qTyvH2ba49M0NpAUyp 3pTr/+qZCGmuYWrI368HJuUZ+r505yG5/iK2ZRdFvy6DELwITvGNn95AMg4nTbH0FS4h D19Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=WQXbb41Q/zK4sZCX9Ty97PeFPSUz7TJzt5+BG/bYM6g=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=yIcgX/9w7v4zXPzjADTfaGPB//nvuaXCXB5U9UNCXm66ji80OxbQVJ5dKp252PfmEn 0tVFMwnEX4kEal/lXwr5fv1R/vV38LRRtV32XhgGrv+MaD9R63qx4N1OZKknpsBodGxd T9cyH0ppJN2SFV4nX7QDRwIhi+KbDXT7W1rKF+8tFmcfKO1v355lmG3vxeeUOtEzBIEb YWIT8ZBRFG7MtVtkGnemVKztCI95cmYF9vDM9gFu9U+lOUKV9G0lkV+UioHSNYKJ6tnG FvK+yej2cX0uzGZsV8QLbe/A+Y9qcphj3cPIl57swI6w0Zk/Drv3UNvrJaAMhL33vsB+ /f4Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@khirnov.net header.s=mail header.b=EpQeLfqR; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 38308e7fff4ca-2ee91ac7114si7449361fa.475.2024.07.05.03.43.04; Fri, 05 Jul 2024 03:43:04 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@khirnov.net header.s=mail header.b=EpQeLfqR; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B4E2D68DB41; Fri, 5 Jul 2024 13:42:50 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A7D8668DAFE for ; Fri, 5 Jul 2024 13:42:39 +0300 (EEST) Authentication-Results: mail1.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=EpQeLfqR; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id C360D4D76 for ; Fri, 5 Jul 2024 12:42:38 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id e_yBdpwesZy1 for ; Fri, 5 Jul 2024 12:42:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1720176157; bh=8ZAvP2ff1O5Ck00/mdc1/Jr4K+GdMTpE/OTb8N8XjOs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=EpQeLfqRpJKAr8L4mM1LzLoLQPXrd/oOrrbtM//u9loKIDQ0YmI+PL93NIWzSGpO5 VmW2sxSL7Gh+pLJAxHLFd9+PVn+wH1OWi51ZvkzolWCsv8CXBUcdFIZBmz12WDUKe1 qFn0U6MzPkrxyv23HPqKz0O6UfKEIHjjEr3eWfHGE/GQj5wluEEleB4v6x3bDhXJiU Ixjn+FlKBOFfMByIkwKEO83jJ6biouiFGOfxNTkyKGnSEBNyJrifjCFW2QP64PJmmH a91/FWtmLZUCDWPlgfdU+nhCGpC6m66K0Vws/+28hAUUlblsRyKeplS6gb9vezSEUW YHFrzmjI5eOcg== 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 mail1.khirnov.net (Postfix) with ESMTPS id E89254D9D for ; Fri, 5 Jul 2024 12:42:36 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id C99783A083A for ; Fri, 05 Jul 2024 12:42:36 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Fri, 5 Jul 2024 12:42:33 +0200 Message-ID: <20240705104233.6703-3-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240705104233.6703-1-anton@khirnov.net> References: <20240705104233.6703-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/3] lavf: deprecate avformat_transfer_internal_stream_timing_info() 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: E/ujkPs2IOw4 And av_stream_get_codec_timebase(). They were both added for ffmpeg CLI, which no longer calls either of them. Furthermore the notion of "internal stream timing info" that needs to be transferred with a special magic API function is fundamentally flawed and should be removed. --- doc/APIchanges | 4 ++++ libavformat/avformat.c | 2 ++ libavformat/avformat.h | 18 +++++++----------- libavformat/internal.h | 2 ++ libavformat/options.c | 2 ++ libavformat/version_major.h | 1 + 6 files changed, 18 insertions(+), 11 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index ac7953a49c..0dcb17eb35 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -2,6 +2,10 @@ The last version increases of all libraries were on 2024-03-07 API changes, most recent first: +2024-07-xx - xxxxxxxxxx - lavf 61 - avformat.h + Deprecate avformat_transfer_internal_stream_timing_info() + and av_stream_get_codec_timebase() without replacement. + 2024-07-02 - xxxxxxxxxx - lavu 59.28.100 - hwcontext_d3d12va.h Add AVD3D12VAFramesContext.flags diff --git a/libavformat/avformat.c b/libavformat/avformat.c index 140fb5b6aa..b4f20502fb 100644 --- a/libavformat/avformat.c +++ b/libavformat/avformat.c @@ -770,6 +770,7 @@ AVRational av_guess_frame_rate(AVFormatContext *format, AVStream *st, AVFrame *f return fr; } +#if FF_API_INTERNAL_TIMING int avformat_transfer_internal_stream_timing_info(const AVOutputFormat *ofmt, AVStream *ost, const AVStream *ist, enum AVTimebaseSource copy_tb) @@ -849,6 +850,7 @@ AVRational av_stream_get_codec_timebase(const AVStream *st) { return cffstream(st)->avctx ? cffstream(st)->avctx->time_base : cffstream(st)->transferred_mux_tb; } +#endif void avpriv_set_pts_info(AVStream *st, int pts_wrap_bits, unsigned int pts_num, unsigned int pts_den) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 8afdcd9fd0..90920072aa 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -3042,6 +3042,7 @@ int avformat_match_stream_specifier(AVFormatContext *s, AVStream *st, int avformat_queue_attached_pictures(AVFormatContext *s); +#if FF_API_INTERNAL_TIMING enum AVTimebaseSource { AVFMT_TBCF_AUTO = -1, AVFMT_TBCF_DECODER, @@ -3052,25 +3053,20 @@ enum AVTimebaseSource { }; /** - * Transfer internal timing information from one stream to another. - * - * This function is useful when doing stream copy. - * - * @param ofmt target output format for ost - * @param ost output stream which needs timings copy and adjustments - * @param ist reference input stream to copy timings from - * @param copy_tb define from where the stream codec timebase needs to be imported + * @deprecated do not call this function */ +attribute_deprecated int avformat_transfer_internal_stream_timing_info(const AVOutputFormat *ofmt, AVStream *ost, const AVStream *ist, enum AVTimebaseSource copy_tb); /** - * Get the internal codec timebase from a stream. - * - * @param st input stream to extract the timebase from + * @deprecated do not call this function */ +attribute_deprecated AVRational av_stream_get_codec_timebase(const AVStream *st); +#endif + /** * @} diff --git a/libavformat/internal.h b/libavformat/internal.h index 6bad4fd119..8e8971bfeb 100644 --- a/libavformat/internal.h +++ b/libavformat/internal.h @@ -411,7 +411,9 @@ typedef struct FFStream { const struct AVCodecDescriptor *codec_desc; +#if FF_API_INTERNAL_TIMING AVRational transferred_mux_tb; +#endif } FFStream; static av_always_inline FFStream *ffstream(AVStream *st) diff --git a/libavformat/options.c b/libavformat/options.c index 60a73d79b9..2f3f8e0c96 100644 --- a/libavformat/options.c +++ b/libavformat/options.c @@ -317,7 +317,9 @@ AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c) sti->pts_buffer[i] = AV_NOPTS_VALUE; st->sample_aspect_ratio = (AVRational) { 0, 1 }; +#if FF_API_INTERNAL_TIMING sti->transferred_mux_tb = (AVRational) { 0, 1 };; +#endif #if FF_API_AVSTREAM_SIDE_DATA sti->inject_global_side_data = si->inject_global_side_data; diff --git a/libavformat/version_major.h b/libavformat/version_major.h index 44ad23c6b6..7a9b06703d 100644 --- a/libavformat/version_major.h +++ b/libavformat/version_major.h @@ -47,6 +47,7 @@ #define FF_API_AVSTREAM_SIDE_DATA (LIBAVFORMAT_VERSION_MAJOR < 62) #define FF_API_GET_DUR_ESTIMATE_METHOD (LIBAVFORMAT_VERSION_MAJOR < 62) +#define FF_API_INTERNAL_TIMING (LIBAVFORMAT_VERSION_MAJOR < 62) #define FF_API_R_FRAME_RATE 1