From patchwork Mon Apr 19 14:08:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 27079 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:5014:0:0:0:0:0 with SMTP id e20csp568775iob; Mon, 19 Apr 2021 07:27:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkA+zTubyDKEIjW6K0hT4Q5jTgr5N6AH7e3lY4GVnsk+i0uV/3j3wf+BddRo+PmWbyNqjC X-Received: by 2002:a05:6402:441:: with SMTP id p1mr26039578edw.298.1618842434344; Mon, 19 Apr 2021 07:27:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618842434; cv=none; d=google.com; s=arc-20160816; b=tRxSNMI13mTv4xjCzide7MaDzQ9ysuQb99a4BzdDhz8/4HmJrPyWJH2rGXT7/vrSoX eXfL3AzqRvZypXmj0ePRGb0TsxLTGH6jNyW85znOo4Dybd+P3GXoV1UXze1+zu6wrx3n 0VcQrLW2aLdWxowmSRou+mViIMdzWayjaBVY8OhLoR3IoDblipdxTmVo92JHaChYHGxm PkGGg4hogZeqcWhL6xlO0Wjm6Usvp0dACa7u4w/HhR2qLcCrK+9QvEGfkUp5TwBguJMi BG3vRX0WrKlnNb4mwa1AFk53R2OhzY0X2U4Sx6FtaagFdqkZFCXsE8A9r71JoVk3bhAz NwAg== 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=bg+mX0LIML4em2/O6FO9iikYF2N9/AVCSzeI5JEZxds=; b=pt5ZWVqV1xDwYRtV/bXUCjZJtdFZwKyX4OdVtujQzvhPl6C2mKWv6MG+iJGMCtiY9C d+Qf0uks4wgGB0Me7alYmt4JPMRPuYf6XXqQzk8InXo7ajk/Qshw42t3/6/xEeU1KioS 8LRC7DxFTqJQrFQcKUqw/dZb++FzV659RnSixRkAre2Qydh/NuxUUHaKcLT3nYAvNySG mc8SCKJ3XwQDtTyp32U3zZwn9lN8Dil3fdA2r8kdJQFGP68/oUDqdBdeh6WDV6iPs52p A857bEDWibn6NK5tfYbdZZTJPk6nbmnHZqiQBwq3fTGDiVZJyOCwPr/kMF3AdlPnoUZ0 RQAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=RR4d7phM; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id a1si8990862edr.67.2021.04.19.07.27.13; Mon, 19 Apr 2021 07:27:14 -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=@gmail.com header.s=20161025 header.b=RR4d7phM; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 93892680BD2; Mon, 19 Apr 2021 17:18:05 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C6D9668A202 for ; Mon, 19 Apr 2021 17:18:03 +0300 (EEST) Received: by mail-qk1-f173.google.com with SMTP id y136so3782006qkb.1 for ; Mon, 19 Apr 2021 07:18:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=JBh9NkHM92EUCYvqpap9WuB+51u4132JuWLSgOgw8mQ=; b=RR4d7phMqTldGjxLGO55XynhoCGLeLfVQXiPFMDuf1yY9L2U06ksuBKzPXYGeZypey 7tGDdLnqujNrDxEFoUWKXIJIqdwfz17vzA0wr7DegjXJfgI/A41gfNqfNeVn+68korxW asDPBpvJDAq1yhG7ztrzXXFkkSuHIyd9LW3rbjwn9eHEO6pFWsmwG0UBkIeEBRlMX6rr DiKgHGqhgeX+xZ9lJbLkFZzZvThcmWaFg7nsKKncIM6SzKN0pYWZ9mv3MsVtnEauUUOz w6BCFgyEeLs8j2SglYorc8OHzzSPIsEw9U7X59qCHpxYM2SImDQCoKW7z1U2PK0/4jyS wz6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JBh9NkHM92EUCYvqpap9WuB+51u4132JuWLSgOgw8mQ=; b=JxYpSTeQ6OQdKvqiaZf+CgWSyFuESFdyuUcu+xFnawg9+tob+DdoZcqP/OFT0/LJJ8 rPocxx+tD0/tEdH6iFeIe89A1I81+YZjHyrBoqGz4pxhAI88eGomMjxTr7VH3X9XEdnj cvk+mdPtqZ+VOrHa1Jmm+iFbc8Q6WFbFgtP8/OebrYpYejnXU4NpwF8Ay6cKs1f5vITv pW0yoA4VHtZJ/y58B5UfVtUh9PDJGQfhL8LnR5ZaJmSzqbO4VHclb1+lERwH2uH5r1ds 02Fws6uEVsTmLat/+j5MIQDsrUsgnPo75CA2otLRJGhZinVacre9yWetFLZ4klJbsuk+ coRQ== X-Gm-Message-State: AOAM532fBNrEmKrVGh7dlj4NO29mQnc8Zp0oFxCN5basAZxtEk7U+wr1 jyZMYl2b9hM4LRe+uZr1ht+1d0jSWqw= X-Received: by 2002:a37:dce:: with SMTP id 197mr12049569qkn.180.1618841464982; Mon, 19 Apr 2021 07:11:04 -0700 (PDT) Received: from localhost.localdomain ([191.83.209.133]) by smtp.gmail.com with ESMTPSA id f7sm2049494qtv.53.2021.04.19.07.11.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Apr 2021 07:11:04 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Mon, 19 Apr 2021 11:08:59 -0300 Message-Id: <20210419141024.8174-3-jamrial@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210419141024.8174-1-jamrial@gmail.com> References: <20210419141024.8174-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 02/87] avformat: Remove next API for AV(In|Out)putFormat 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: gn0sZK4Z8D0D From: Andreas Rheinhardt Signed-off-by: Andreas Rheinhardt --- libavformat/allformats.c | 98 ---------------------------------------- libavformat/avformat.h | 43 ------------------ libavformat/version.h | 3 -- 3 files changed, 144 deletions(-) diff --git a/libavformat/allformats.c b/libavformat/allformats.c index fa093c7ac2..f450c1709b 100644 --- a/libavformat/allformats.c +++ b/libavformat/allformats.c @@ -22,10 +22,6 @@ #include "libavutil/thread.h" #include "libavformat/internal.h" #include "avformat.h" -#include "rtp.h" -#include "rdt.h" -#include "url.h" -#include "version.h" /* (de)muxers */ extern AVOutputFormat ff_a64_muxer; @@ -573,104 +569,10 @@ const AVInputFormat *av_demuxer_iterate(void **opaque) static AVMutex avpriv_register_devices_mutex = AV_MUTEX_INITIALIZER; -#if FF_API_NEXT -FF_DISABLE_DEPRECATION_WARNINGS -static AVOnce av_format_next_init = AV_ONCE_INIT; - -static void av_format_init_next(void) -{ - AVOutputFormat *prevout = NULL, *out; - AVInputFormat *previn = NULL, *in; - - ff_mutex_lock(&avpriv_register_devices_mutex); - - for (int i = 0; (out = (AVOutputFormat*)muxer_list[i]); i++) { - if (prevout) - prevout->next = out; - prevout = out; - } - - if (outdev_list) { - for (int i = 0; (out = (AVOutputFormat*)outdev_list[i]); i++) { - if (prevout) - prevout->next = out; - prevout = out; - } - } - - for (int i = 0; (in = (AVInputFormat*)demuxer_list[i]); i++) { - if (previn) - previn->next = in; - previn = in; - } - - if (indev_list) { - for (int i = 0; (in = (AVInputFormat*)indev_list[i]); i++) { - if (previn) - previn->next = in; - previn = in; - } - } - - ff_mutex_unlock(&avpriv_register_devices_mutex); -} - -AVInputFormat *av_iformat_next(const AVInputFormat *f) -{ - ff_thread_once(&av_format_next_init, av_format_init_next); - - if (f) -#if FF_API_AVIOFORMAT - return f->next; -#else - return (AVInputFormat *) f->next; -#endif - else { - void *opaque = NULL; - return (AVInputFormat *)av_demuxer_iterate(&opaque); - } -} - -AVOutputFormat *av_oformat_next(const AVOutputFormat *f) -{ - ff_thread_once(&av_format_next_init, av_format_init_next); - - if (f) -#if FF_API_AVIOFORMAT - return f->next; -#else - return (AVOutputFormat *) f->next; -#endif - else { - void *opaque = NULL; - return (AVOutputFormat *)av_muxer_iterate(&opaque); - } -} - -void av_register_all(void) -{ - ff_thread_once(&av_format_next_init, av_format_init_next); -} - -void av_register_input_format(AVInputFormat *format) -{ - ff_thread_once(&av_format_next_init, av_format_init_next); -} - -void av_register_output_format(AVOutputFormat *format) -{ - ff_thread_once(&av_format_next_init, av_format_init_next); -} -FF_ENABLE_DEPRECATION_WARNINGS -#endif - void avpriv_register_devices(const AVOutputFormat * const o[], const AVInputFormat * const i[]) { ff_mutex_lock(&avpriv_register_devices_mutex); outdev_list = o; indev_list = i; ff_mutex_unlock(&avpriv_register_devices_mutex); -#if FF_API_NEXT - av_format_init_next(); -#endif } diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 8600ee1bf7..6c97aff423 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -533,9 +533,6 @@ typedef struct AVOutputFormat { #define ff_const59 #else #define ff_const59 const -#endif -#if FF_API_NEXT - ff_const59 struct AVOutputFormat *next; #endif /** * size of private data so that it can be allocated in the wrapper @@ -683,10 +680,6 @@ typedef struct AVInputFormat { * New public fields should be added right above. ***************************************************************** */ -#if FF_API_NEXT - ff_const59 struct AVInputFormat *next; -#endif - /** * Raw demuxers store their codec ID here. */ @@ -1941,24 +1934,6 @@ const char *avformat_configuration(void); */ const char *avformat_license(void); -#if FF_API_NEXT -/** - * Initialize libavformat and register all the muxers, demuxers and - * protocols. If you do not call this function, then you can select - * exactly which formats you want to support. - * - * @see av_register_input_format() - * @see av_register_output_format() - */ -attribute_deprecated -void av_register_all(void); - -attribute_deprecated -void av_register_input_format(AVInputFormat *format); -attribute_deprecated -void av_register_output_format(AVOutputFormat *format); -#endif - /** * Do global initialization of network libraries. This is optional, * and not recommended anymore. @@ -1981,24 +1956,6 @@ int avformat_network_init(void); */ int avformat_network_deinit(void); -#if FF_API_NEXT -/** - * If f is NULL, returns the first registered input format, - * if f is non-NULL, returns the next registered input format after f - * or NULL if f is the last one. - */ -attribute_deprecated -AVInputFormat *av_iformat_next(const AVInputFormat *f); - -/** - * If f is NULL, returns the first registered output format, - * if f is non-NULL, returns the next registered output format after f - * or NULL if f is the last one. - */ -attribute_deprecated -AVOutputFormat *av_oformat_next(const AVOutputFormat *f); -#endif - /** * Iterate over all registered muxers. * diff --git a/libavformat/version.h b/libavformat/version.h index 66068d4d56..d82adba668 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -91,9 +91,6 @@ #ifndef FF_API_OLD_RTSP_OPTIONS #define FF_API_OLD_RTSP_OPTIONS (LIBAVFORMAT_VERSION_MAJOR < 59) #endif -#ifndef FF_API_NEXT -#define FF_API_NEXT (LIBAVFORMAT_VERSION_MAJOR < 59) -#endif #ifndef FF_API_DASH_MIN_SEG_DURATION #define FF_API_DASH_MIN_SEG_DURATION (LIBAVFORMAT_VERSION_MAJOR < 59) #endif