From patchwork Sat Feb 4 10:41:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 40272 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:5494:b0:bf:7b3a:fd32 with SMTP id i20csp1870510pzk; Sat, 4 Feb 2023 02:47:56 -0800 (PST) X-Google-Smtp-Source: AK7set8LmUI7BEnyia1ZqxO9LPh/3S+jtw3fsWugb8lP4WoPfwcdFQfo1+Z2NL1dg92pGQCEUGX0 X-Received: by 2002:a50:aa9e:0:b0:4a2:6ef0:5c5d with SMTP id q30-20020a50aa9e000000b004a26ef05c5dmr13753736edc.3.1675507676502; Sat, 04 Feb 2023 02:47:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675507676; cv=none; d=google.com; s=arc-20160816; b=GJ0HL4HJVFFLv4ugE0H8jzW2Hhd2yBDFATHV+Up5rdj/klu1hCzJVdmqBU7r/Ruqic DFCl9vH5D4qJa91AJJ5xS0RP1/dqL576KwxCr9t3WF2COrzLEdOj0IBubpUVBDyHZUGI +jeVgbr9h6udZe6WTLcYqiKRGa+yoO8DuZSHIxc2edzXGmLbROIS9vnOW8B0AnGF63qO LDj6uUXjrDwlQiBrN27mr156JzuWpu7Xe8mxZKbnm3YxGeuE9wcJIkrtkZ4qrPUX3Dw8 As3qdwi297T6YHRA63TAl64qiFXzrlXO8aEOeEWxcOEQS/6RLW2NTlXurMUI3eJhLqVZ RQSA== 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:delivered-to; bh=0nMcZsJNrN2DRL/dcLFR/Lcgp5rphDwJUkH2GG1HaiA=; b=cVD1UR0TsgXv14wLwwXgCh6DzIHjGaFUFIwv4pLdo+GXvt70epGIGXHAwhXw1LzzCA z+Xb4a2NrzGFuxtnGHZvBVIw+IWzK10eC360hKI8MSu7wOFi6toHjdgLAy3X9jCtLKVJ MY0TYls9RSGZ8NLpFZYGpAQzhJDJkrF3GGaLxDRxGZ2CQvkwEAWBnXWPx2i0vDFqJQRR OaU0Sf+vli8g0dkxfJkFdJMaP2+XzZPyWJShDCmIAzZUlekLrMzD5YL5nfZ30V2KGQy8 PJ1anApHNkuxds6iPYt7qps9vVa2qPw5OhxuXO72lMzd/DQcbpgGmz+W0kz+f429X36M 3J9w== ARC-Authentication-Results: i=1; mx.google.com; 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 ay8-20020a170907900800b0088f92a6d1dbsi5149124ejc.614.2023.02.04.02.47.56; Sat, 04 Feb 2023 02:47:56 -0800 (PST) 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; 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 4543E68BF3B; Sat, 4 Feb 2023 12:44:42 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 807E568BED7 for ; Sat, 4 Feb 2023 12:44:19 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 42B4F2404EE for ; Sat, 4 Feb 2023 11:44:19 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id il-dBYCV23or for ; Sat, 4 Feb 2023 11:44:18 +0100 (CET) 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 3D87B240D22 for ; Sat, 4 Feb 2023 11:44:07 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 042193A05C1 for ; Sat, 4 Feb 2023 11:44:06 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Sat, 4 Feb 2023 11:41:51 +0100 Message-Id: <20230204104204.20721-21-anton@khirnov.net> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230204104204.20721-1-anton@khirnov.net> References: <20230204104204.20721-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 20/33] avformat: remove FF_API_AVSTREAM_CLASS 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: Dk94Bno2z9gB From: James Almer Signed-off-by: James Almer --- fftools/ffmpeg_mux_init.c | 11 ----------- libavformat/avformat.h | 2 -- libavformat/options.c | 3 --- libavformat/version_major.h | 1 - 4 files changed, 17 deletions(-) diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c index f8ccf4a3e9b..34172406394 100644 --- a/fftools/ffmpeg_mux_init.c +++ b/fftools/ffmpeg_mux_init.c @@ -1983,18 +1983,7 @@ static int set_dispositions(Muxer *mux, const OptionsContext *o) if (!disp) continue; -#if LIBAVFORMAT_VERSION_MAJOR >= 60 ret = av_opt_set(ost->st, "disposition", disp, 0); -#else - { - const AVClass *class = av_stream_get_class(); - const AVOption *o = av_opt_find(&class, "disposition", NULL, 0, AV_OPT_SEARCH_FAKE_OBJ); - - av_assert0(o); - ret = av_opt_eval_flags(&class, o, disp, &ost->st->disposition); - } -#endif - if (ret < 0) goto finish; } diff --git a/libavformat/avformat.h b/libavformat/avformat.h index ac40e197f62..b986aacc785 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -838,12 +838,10 @@ const char *av_disposition_to_string(int disposition); * sizeof(AVStream) must not be used outside libav*. */ typedef struct AVStream { -#if FF_API_AVSTREAM_CLASS /** * A class for @ref avoptions. Set on stream creation. */ const AVClass *av_class; -#endif int index; /**< stream index in AVFormatContext */ /** diff --git a/libavformat/options.c b/libavformat/options.c index 0079a06d9a5..c7681122cd7 100644 --- a/libavformat/options.c +++ b/libavformat/options.c @@ -257,10 +257,7 @@ AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c) return NULL; st = &sti->pub; -#if FF_API_AVSTREAM_CLASS st->av_class = &stream_class; -#endif - st->codecpar = avcodec_parameters_alloc(); if (!st->codecpar) goto fail; diff --git a/libavformat/version_major.h b/libavformat/version_major.h index 057d1ac0fb0..1db8e7600eb 100644 --- a/libavformat/version_major.h +++ b/libavformat/version_major.h @@ -42,7 +42,6 @@ * */ #define FF_API_COMPUTE_PKT_FIELDS2 (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_AVIODIRCONTEXT (LIBAVFORMAT_VERSION_MAJOR < 60)