From patchwork Wed Dec 8 01:06:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 32132 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp7047488iog; Tue, 7 Dec 2021 17:12:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJzmQjxs1M8iXz+fA7TN28CtqYM2xrcdFmwy8hKmeCoegC1i5jS0nLLcYoApPrbtquYqJS6r X-Received: by 2002:aa7:c30e:: with SMTP id l14mr14433945edq.370.1638925943203; Tue, 07 Dec 2021 17:12:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1638925943; cv=none; d=google.com; s=arc-20160816; b=Jvnp0zdMKiG6FW5CgDzSEQvFI7WLdU3r1jUzSILwF6J/Gs7bQVUz7CDf++Y8YjC8g8 Cl5RpZROIacOSz4bvWfyLYdEFXjHxUdpkmZl15i0yLDUDzzFvDYVDkInpC5SKKYY3CmP raTUvlSQKeONy1jkd4++Nzul/kIST46ngoPyZE5YVZiOX44Gvrg5RQyFxgkWS/kxjiGV CW7o23RbIbhIuCQMKMCwmQa4INc1/zjml6qpofXX51mryHRaYkNP3jFjd5KkRwe9He++ Du1DgYiBXHXzx8hRJObc/ayjMjjuE8foVhkQHX8wPF76ZTJZEBxgU/qn3uzbTv/GW+SJ m94g== 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=XUdi668tbU34I/lDpf/UEGRHjjG9O8+kkv2ySyeqEuE=; b=0ML087nTr6wjtssTfe59FpvFQ1gqDG9ZBfht7fmhuJCvd+LX94W2Se5pHpet2W/iTz GcLAYl24tpt/MwQVorCSl8ystfMcYJs52OLpMIDZqpv9glRoETZW20nb3BxZoAj+JASH Srs4Ybyp8Gy8FsFrvT7jE1Arf31z+f7/9dha19R2VmWk40Gu+8j3ybIEHJRwjDxE0fCW Ab/yDd/o4j3ymev2aJGwJo65udab1SBFgUxz8lLuFg58T2AdohCrDxesZfThTiJWCrwt I3jHFFdES/xMRrtW/x4h9yO97V+ptz7uwfSPS+FobZjIBlZCl0xOTGNmQz0+VbjvdTz1 KtBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=DSRbBE7y; 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 c14si2002802edn.629.2021.12.07.17.12.20; Tue, 07 Dec 2021 17:12:23 -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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=DSRbBE7y; 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 56F6E68AF7A; Wed, 8 Dec 2021 03:08:09 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ua1-f45.google.com (mail-ua1-f45.google.com [209.85.222.45]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1921D68AF3B for ; Wed, 8 Dec 2021 03:08:01 +0200 (EET) Received: by mail-ua1-f45.google.com with SMTP id l24so1954029uak.2 for ; Tue, 07 Dec 2021 17:08:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=Brudn/FkW7HNIRG/9terOp7dJBjp5wkNgR0a0HuWl64=; b=DSRbBE7yTaZi1HuuXxV1u3ut9UkveVBnZvx/q9ar4c2Ryrt5JqmLRtadJJwvQL5chJ u0IIzyaixhykj2ZmlnypHZar6FqBnYt70TsQl/QhqJ2jzgm2Z0+lpjStVuuNrcOXYRZ1 v/LhUPe1jQ4OzdI0KVEHfYLXnb0wsUBAel92OSKR7ZkbT4e4vD1MLTUgjl9pL7JEivbb ucJx8xddMQIB1AEA+UVspuMtvabIZGfo1HZcjtLqBjxAh+ZeGnM0LGK+ltw3Jwj1WHVA zv+pTuNe/fnPECywqUQMmb30Rn0BmOS4m3Zw23g3SZya7+e21Bi9KB3Zoz7rK+NYWX14 7XRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Brudn/FkW7HNIRG/9terOp7dJBjp5wkNgR0a0HuWl64=; b=AAA9Ldsa4IicLIzT8I4D7ALtI72i3EFCkKb/TuJIbu7ICne4UgFSED3KmU/Cc0NaU3 YYnTAqW+VUHVwfz4fns5cICNlOtBMkXSwe7zZ5lPTQnzyAXFKrz3ZBQO/8X6vbbdlwsj 9R8nDUAr5b/Rvh1RU7tg6Ld5TuWicdpea4Uxp8Jg/FfLHvFgoDOf1rpjw80NHsyfmoId LEYjhoU1L2DoaOT16DSX2q9eQ4K96xHoEm/FNhV3Edik4linSHreVavbXROoS9/HCWZE AaAYFXFl9iqKZ6xMcpRLx0wbdKNwCDhguF+6AFi8pwFKr+ommmV0Pw9tW8UiPtIF4sVm TOpA== X-Gm-Message-State: AOAM533JVKYyJ8M3xUH7bTOvnhGmW/u6A1+649IFXTIO3wglbLm2tl9q VxTn8EQ0Hfenxf6Nq1f4+vHCmGzD8+MO0SYx X-Received: by 2002:a05:6102:c4d:: with SMTP id y13mr49833086vss.43.1638925679469; Tue, 07 Dec 2021 17:07:59 -0800 (PST) Received: from localhost.localdomain ([181.170.250.138]) by smtp.gmail.com with ESMTPSA id b8sm949898vsl.19.2021.12.07.17.07.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Dec 2021 17:07:59 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Tue, 7 Dec 2021 22:06:41 -0300 Message-Id: <20211208010649.381-26-jamrial@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211208010649.381-1-jamrial@gmail.com> References: <20211208010649.381-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 271/279] lavc: drop temporary compat wrappers for channel layout API change 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: w2/LVyF927iq From: Anton Khirnov Signed-off-by: James Almer --- libavcodec/aacdec_template.c | 7 ------- libavcodec/avcodec.c | 29 ----------------------------- libavcodec/dca_lbr.c | 7 ------- libavcodec/dcadec.c | 8 -------- libavcodec/decode.c | 20 -------------------- libavcodec/encode.c | 15 --------------- 6 files changed, 86 deletions(-) diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c index 387a4acfce..349ecdefb3 100644 --- a/libavcodec/aacdec_template.c +++ b/libavcodec/aacdec_template.c @@ -592,13 +592,6 @@ FF_ENABLE_DEPRECATION_WARNINGS } av_channel_layout_copy(&avctx->ch_layout, &ac->oc[1].ch_layout); -#if FF_API_OLD_CHANNEL_LAYOUT -FF_DISABLE_DEPRECATION_WARNINGS - avctx->channels = avctx->ch_layout.nb_channels; - avctx->channel_layout = avctx->ch_layout.order == AV_CHANNEL_ORDER_NATIVE ? - avctx->ch_layout.u.mask : 0; -FF_ENABLE_DEPRECATION_WARNINGS -#endif ac->oc[1].status = oc_type; if (get_new_frame) { diff --git a/libavcodec/avcodec.c b/libavcodec/avcodec.c index 4c576a848c..35a6bf9bfe 100644 --- a/libavcodec/avcodec.c +++ b/libavcodec/avcodec.c @@ -137,8 +137,6 @@ static int64_t get_bit_rate(AVCodecContext *ctx) int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options) { int ret = 0; - int orig_channels; - uint64_t orig_channel_layout; AVCodecInternal *avci; if (avcodec_is_open(avctx)) @@ -275,14 +273,6 @@ FF_DISABLE_DEPRECATION_WARNINGS avctx->ch_layout.nb_channels = avctx->channels; } } - - /* temporary compat wrapper for new-style callers and old-style codecs; - * to be removed once all the codecs have been converted */ - if (avctx->ch_layout.nb_channels) { - avctx->channels = avctx->ch_layout.nb_channels; - avctx->channel_layout = avctx->ch_layout.order == AV_CHANNEL_ORDER_NATIVE ? - avctx->ch_layout.u.mask : 0; - } FF_ENABLE_DEPRECATION_WARNINGS #endif @@ -345,13 +335,6 @@ FF_ENABLE_DEPRECATION_WARNINGS if (!HAVE_THREADS && !(codec->caps_internal & FF_CODEC_CAP_AUTO_THREADS)) avctx->thread_count = 1; -#if FF_API_OLD_CHANNEL_LAYOUT -FF_DISABLE_DEPRECATION_WARNINGS - orig_channels = avctx->channels; - orig_channel_layout = avctx->channel_layout; -FF_ENABLE_DEPRECATION_WARNINGS -#endif - if (!(avctx->active_thread_type & FF_THREAD_FRAME) || avci->frame_thread_encoder) { if (avctx->codec->init) { @@ -372,18 +355,6 @@ FF_ENABLE_DEPRECATION_WARNINGS #if FF_API_OLD_CHANNEL_LAYOUT FF_DISABLE_DEPRECATION_WARNINGS - /* decoder setting the old-style fields */ - if (avctx->channels != orig_channels || - avctx->channel_layout != orig_channel_layout) { - av_channel_layout_uninit(&avctx->ch_layout); - if (avctx->channel_layout) { - av_channel_layout_from_mask(&avctx->ch_layout, avctx->channel_layout); - } else { - avctx->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; - avctx->ch_layout.nb_channels = avctx->channels; - } - } - /* update the deprecated fields for old-style callers */ avctx->channels = avctx->ch_layout.nb_channels; avctx->channel_layout = avctx->ch_layout.order == AV_CHANNEL_ORDER_NATIVE ? diff --git a/libavcodec/dca_lbr.c b/libavcodec/dca_lbr.c index c11f2f7e18..527bc8b7c0 100644 --- a/libavcodec/dca_lbr.c +++ b/libavcodec/dca_lbr.c @@ -1744,13 +1744,6 @@ int ff_dca_lbr_filter_frame(DCALbrDecoder *s, AVFrame *frame) av_channel_layout_uninit(&avctx->ch_layout); av_channel_layout_from_mask(&avctx->ch_layout, channel_mask); -#if FF_API_OLD_CHANNEL_LAYOUT -FF_DISABLE_DEPRECATION_WARNINGS - avctx->channels = avctx->ch_layout.nb_channels; - avctx->channel_layout = avctx->ch_layout.order == AV_CHANNEL_ORDER_NATIVE ? - avctx->ch_layout.u.mask : 0; -FF_ENABLE_DEPRECATION_WARNINGS -#endif frame->nb_samples = 1024 << s->freq_range; if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c index 239ed9ac91..9f40da20fc 100644 --- a/libavcodec/dcadec.c +++ b/libavcodec/dcadec.c @@ -78,14 +78,6 @@ int ff_dca_set_channel_layout(AVCodecContext *avctx, int *ch_remap, int dca_mask av_channel_layout_from_mask(&avctx->ch_layout, wav_mask); } -#if FF_API_OLD_CHANNEL_LAYOUT -FF_DISABLE_DEPRECATION_WARNINGS - avctx->channels = avctx->ch_layout.nb_channels; - avctx->channel_layout = avctx->ch_layout.order == AV_CHANNEL_ORDER_NATIVE ? - avctx->ch_layout.u.mask : 0; -FF_ENABLE_DEPRECATION_WARNINGS -#endif - return nchannels; } diff --git a/libavcodec/decode.c b/libavcodec/decode.c index aa74c677ef..24357a4d09 100644 --- a/libavcodec/decode.c +++ b/libavcodec/decode.c @@ -1690,26 +1690,6 @@ int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags) } else if (avctx->codec_type == AVMEDIA_TYPE_AUDIO) { #if FF_API_OLD_CHANNEL_LAYOUT FF_DISABLE_DEPRECATION_WARNINGS - /* temporary compat layer for decoders setting the old-style channel - * layout fields; shall be removed after all the decoders are converted - * to the new API */ - if ((avctx->channels > 0 && avctx->ch_layout.nb_channels != avctx->channels) || - (avctx->channel_layout && (avctx->ch_layout.order != AV_CHANNEL_ORDER_NATIVE || - avctx->ch_layout.u.mask != avctx->channel_layout))) { - av_channel_layout_uninit(&avctx->ch_layout); - if (avctx->channel_layout) { - if (av_popcount64(avctx->channel_layout) != avctx->channels) { - av_log(avctx, AV_LOG_ERROR, "Inconsistent channel layout/channels\n"); - ret = AVERROR(EINVAL); - goto fail; - } - av_channel_layout_from_mask(&avctx->ch_layout, avctx->channel_layout); - } else { - avctx->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; - avctx->ch_layout.nb_channels = avctx->channels; - } - } - /* compat layer for old-style get_buffer() implementations */ avctx->channels = avctx->ch_layout.nb_channels; avctx->channel_layout = (avctx->ch_layout.order == AV_CHANNEL_ORDER_NATIVE) ? diff --git a/libavcodec/encode.c b/libavcodec/encode.c index 0dd5e3fdd1..af274a5cc5 100644 --- a/libavcodec/encode.c +++ b/libavcodec/encode.c @@ -490,21 +490,6 @@ int ff_encode_preinit(AVCodecContext *avctx) FF_DISABLE_DEPRECATION_WARNINGS } #if FF_API_OLD_CHANNEL_LAYOUT - else if (avctx->codec->channel_layouts) { - if (!avctx->channel_layout) { - av_log(avctx, AV_LOG_WARNING, "Channel layout not specified\n"); - } else { - for (i = 0; avctx->codec->channel_layouts[i] != 0; i++) - if (avctx->channel_layout == avctx->codec->channel_layouts[i]) - break; - if (avctx->codec->channel_layouts[i] == 0) { - char buf[512]; - av_get_channel_layout_string(buf, sizeof(buf), -1, avctx->channel_layout); - av_log(avctx, AV_LOG_ERROR, "Specified channel layout '%s' is not supported\n", buf); - return AVERROR(EINVAL); - } - } - } if (avctx->channel_layout && avctx->channels) { int channels = av_get_channel_layout_nb_channels(avctx->channel_layout); if (channels != avctx->channels) {