From patchwork Tue Oct 1 10:54:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51966 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:cb8a:0:b0:48e:c0f8:d0de with SMTP id d10csp192162vqv; Tue, 1 Oct 2024 04:21:21 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXjbZzezN+mW0YvpFaEhJcX+4xM7nxHibwr5CnGuhBFjbZc2fXWXDE3LSm9uYLywxXoBKHSZdgbIa7t6xJOjNGu@gmail.com X-Google-Smtp-Source: AGHT+IFMKPYfA58J7obTGf1aGRZq4fHiTXKnIWXq8H2IUV9ZUOkMdFDBIFdaysVad5YVFDoRHUZz X-Received: by 2002:a05:6402:42d6:b0:5c5:b84a:8156 with SMTP id 4fb4d7f45d1cf-5c8824e7174mr14467079a12.17.1727781680929; Tue, 01 Oct 2024 04:21:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727781680; cv=none; d=google.com; s=arc-20240605; b=TnFa7OOyOnvVPzW6wAMG7Ayr3M1Na8wSGtdjLKMGUi+ToZpYELGvjOHP5pERbAGBQe yD9IQWCnvkL+YAOepAoj2JytEOKz/PVyrPklZkgMi9tusjp5PFRjE7rZbpyoc9GYvMN8 fuKL8LvBzdb0ZIr0gZ4PTxdBi5uBofY7DpnI2mF77wGIy7H+T4c3iMy5EGJbJTOryNEO MAnKQVfqSEJ3HA7o+LvdKII0dlSI14t/cOldE408zLKMfqECARpG2Udar3ZpEwT5XUGX XXJ0Ni3fvwHi1GvqONGij1Rs6Wx/5C7aq1+F+WGvDzENWX9TmTRa7gBJkb064AfYtO12 K6Mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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:message-id:date:to:from :dkim-signature:delivered-to; bh=WxrloP/moBLACJujvSXHVvEMPlS1DV75DRHK51tQuY0=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=XZUOY0TY2ICgVCXgCllc8p83aNwIp0QpPGePR1nPNRhInWEV/yIzotUnRjVcU+AZoP MSPw+5+OfING1V57bqRq4O1wpBkFt8o7akSv9X9WSfBztzyP0DEsq8YUO0rPhW5T7PBx gGhwmxXrmpi7tcA+Vmdd4spYvTwvNa8ch6tRgYp2YYW/jOqLU6kxIKNgdBoiEVwmV5ht 2hW5nb+AkqfrrOA2J8ChWFYKMWjFRxlOqo4xy9wUYBfaJIJXW76+oJpdNNQffa1/Nsqn mdNHYWjuMVGRislZ+ef30Sjt3c+4CijoVzRc2bUCWPvOXhICYcEk8dF6Q0ViGJYHVdKC 2gDQ==; 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=YLGMmA3R; 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 4fb4d7f45d1cf-5c883510ac6si6765520a12.186.2024.10.01.04.21.20; Tue, 01 Oct 2024 04:21:20 -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=YLGMmA3R; 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 84C0268DC4F; Tue, 1 Oct 2024 13:54:51 +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 E8AAF68DB8F for ; Tue, 1 Oct 2024 13:54:44 +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=YLGMmA3R; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id C4C194E1E for ; Tue, 1 Oct 2024 12:54:36 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id bKG3qH33sv_u for ; Tue, 1 Oct 2024 12:54:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1727780073; bh=GdsGa9XZpJLeipKUkwdDjxlYHrRRCCYflG/UlVLDPC0=; h=From:To:Subject:Date:From; b=YLGMmA3RMuo5uwsrmQWSRMm8vKUAfsu4RURVSjjIl3cKpOADKWdwG0fiKxEThg0GG B/JsWX2104WecVdw6wcYkQ0myeeuZ2PSEVAcIGiXqI9wQ80etL1h7WeEbt26x5yk1I i/ypeC9IOJgdiLmTxb0Ocgt8AEVO9n4WgSolaPDp7AQQu13VxOO3KFmT0MHGLxHe+f yvwqV8NMkeYCc0Hv4utHy11m6K2GSP4c/z+6r2kUZtOxwHHShbn7vxGXGJbXpTE3wE t/3IxOR/D5uvl29XK66H5Q0IiThgBs3uuMQw5aB9ZcLB8/FRHVsJE0FRfp5xFu+NO4 meQ5LaBfH3Zog== 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 8ECE14E2B for ; Tue, 1 Oct 2024 12:54:33 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id B95E83A03CA for ; Tue, 01 Oct 2024 12:54:25 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Tue, 1 Oct 2024 12:54:06 +0200 Message-ID: <20241001105421.28967-1-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 01/16] lavfi/buffersink: move the option sanity check to init 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: Q68NLvhFhTEZ Options are set before init, so that is the appropriate place to validate them. --- libavfilter/buffersink.c | 60 +++++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 25 deletions(-) diff --git a/libavfilter/buffersink.c b/libavfilter/buffersink.c index 0cfac2abd5..95cb605712 100644 --- a/libavfilter/buffersink.c +++ b/libavfilter/buffersink.c @@ -155,6 +155,41 @@ static av_cold int common_init(AVFilterContext *ctx) { BufferSinkContext *buf = ctx->priv; +#if FF_API_BUFFERSINK_OPTS + +#define CHECK_LIST_SIZE(field) \ + if (buf->field ## _size % sizeof(*buf->field)) { \ + av_log(ctx, AV_LOG_ERROR, "Invalid size for " #field ": %d, " \ + "should be multiple of %d\n", \ + buf->field ## _size, (int)sizeof(*buf->field)); \ + return AVERROR(EINVAL); \ + } + + if (ctx->input_pads[0].type == AVMEDIA_TYPE_VIDEO) { + if ((buf->pixel_fmts_size || buf->color_spaces_size || buf->color_ranges_size) && + (buf->nb_pixel_formats || buf->nb_colorspaces || buf->nb_colorranges)) { + av_log(ctx, AV_LOG_ERROR, "Cannot combine old and new format lists\n"); + return AVERROR(EINVAL); + } + + CHECK_LIST_SIZE(pixel_fmts) + CHECK_LIST_SIZE(color_spaces) + CHECK_LIST_SIZE(color_ranges) + } else { + if ((buf->sample_fmts_size || buf->channel_layouts_str || buf->sample_rates_size) && + (buf->nb_sample_formats || buf->nb_samplerates || buf->nb_channel_layouts)) { + av_log(ctx, AV_LOG_ERROR, "Cannot combine old and new format lists\n"); + return AVERROR(EINVAL); + } + + CHECK_LIST_SIZE(sample_fmts) + CHECK_LIST_SIZE(sample_rates) + } + +#undef CHECK_LIST_SIZE + +#endif + buf->warning_limit = 100; return 0; } @@ -291,14 +326,6 @@ int av_buffersink_get_ch_layout(const AVFilterContext *ctx, AVChannelLayout *out #if FF_API_BUFFERSINK_OPTS #define NB_ITEMS(list) (list ## _size / sizeof(*list)) - -#define CHECK_LIST_SIZE(field) \ - if (buf->field ## _size % sizeof(*buf->field)) { \ - av_log(ctx, AV_LOG_ERROR, "Invalid size for " #field ": %d, " \ - "should be multiple of %d\n", \ - buf->field ## _size, (int)sizeof(*buf->field)); \ - return AVERROR(EINVAL); \ - } #endif static int vsink_query_formats(AVFilterContext *ctx) @@ -307,12 +334,6 @@ static int vsink_query_formats(AVFilterContext *ctx) int ret; #if FF_API_BUFFERSINK_OPTS - if ((buf->pixel_fmts_size || buf->color_spaces_size || buf->color_ranges_size) && - (buf->nb_pixel_formats || buf->nb_colorspaces || buf->nb_colorranges)) { - av_log(ctx, AV_LOG_ERROR, "Cannot combine old and new format lists\n"); - return AVERROR(EINVAL); - } - if (buf->nb_pixel_formats || buf->nb_colorspaces || buf->nb_colorranges) { #endif if (buf->nb_pixel_formats) { @@ -333,9 +354,6 @@ static int vsink_query_formats(AVFilterContext *ctx) #if FF_API_BUFFERSINK_OPTS } else { unsigned i; - CHECK_LIST_SIZE(pixel_fmts) - CHECK_LIST_SIZE(color_spaces) - CHECK_LIST_SIZE(color_ranges) if (buf->pixel_fmts_size) { AVFilterFormats *formats = NULL; for (i = 0; i < NB_ITEMS(buf->pixel_fmts); i++) @@ -374,12 +392,6 @@ static int asink_query_formats(AVFilterContext *ctx) int ret; #if FF_API_BUFFERSINK_OPTS - if ((buf->sample_fmts_size || buf->channel_layouts_str || buf->sample_rates_size) && - (buf->nb_sample_formats || buf->nb_samplerates || buf->nb_channel_layouts)) { - av_log(ctx, AV_LOG_ERROR, "Cannot combine old and new format lists\n"); - return AVERROR(EINVAL); - } - if (buf->nb_sample_formats || buf->nb_samplerates || buf->nb_channel_layouts) { #endif if (buf->nb_sample_formats) { @@ -403,8 +415,6 @@ static int asink_query_formats(AVFilterContext *ctx) AVChannelLayout layout = { 0 }; AVFilterChannelLayouts *layouts = NULL; unsigned i; - CHECK_LIST_SIZE(sample_fmts) - CHECK_LIST_SIZE(sample_rates) if (buf->sample_fmts_size) { for (i = 0; i < NB_ITEMS(buf->sample_fmts); i++) From patchwork Tue Oct 1 10:54:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51963 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:cb8a:0:b0:48e:c0f8:d0de with SMTP id d10csp192079vqv; Tue, 1 Oct 2024 04:21:14 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWJAr1z+NSGvWW3FM6mowMGWF689GlthgsxUZaFHkxc/4kmEelwuHyoYKC15qyOTNca+ZvM8dsE5umURXpRLLWI@gmail.com X-Google-Smtp-Source: AGHT+IFb9rEZJm2/pdq8FQ5HDYD2VpOGN3CLeNVON2Tp8qG+vDsA6Gk1RjQxOASEdVrMN4fRwBRe X-Received: by 2002:a05:6402:2687:b0:5c3:cc7d:c29d with SMTP id 4fb4d7f45d1cf-5c8824d381cmr12584904a12.6.1727781674185; Tue, 01 Oct 2024 04:21:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727781674; cv=none; d=google.com; s=arc-20240605; b=jov95odpmukyNN0/Vr2zejODtMv/Tll4RzMCmfbxpgvdNvF8NHljRPxZ9WHoWaFNfN kzfOJI35/Lm1v6JpX5vBE/m6VC4Q9AxTTJYelnTMaBLiIc4ajJlulRWF0RZnmJ2mDriz YX6tml+iFTF6LHVTprVTeb6ium/bEl+Zw46oXZl+o5XkX6gPCx8/9eqLb/W+7v3HJXYh 9JLKia3OOlodNXKP4nUhw5856WR9aUw32KGjPcSLyUdrUuQt77ZL4F14IRQCFzl4Rszg kScq+Ppb4h1bPasDg6ZQhJRo2qzxLVb8PWCC7vs96L8WEbs5ECG1LuRqxJskkscdUvH1 actw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=VOe0kpjU1W+qxjsCD/KR/POpq0zGkxyygxAiBUJtO7I=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=MOWtVX24g0+Q4XONJEbrPHjv4iHjS2WHs8rBJRxAehuA853E2fGE1m2g6FFM71oniL tcCtkHvulA+BpUuhMF8PkWhmatHag3KVFWUp11Inw6Kmg3Afk67BdF8/VY9YYrxpt/a2 nYysMaHNA+zUgKvoVMzxX1nn5/MkP7awXpENNLU3W8gF2hTjsPCqooUu8VcIXsfzj3qC tq28BNwEnZhO6bTA0fHVxmcWmmnKhf1QHr0SCzed12MnCCVKa9LZp95IFJXm5K4wnfOv 8HRMPisfBBpJomZgXBt9QqT6U+DzlWTdfZ572CHrgBlhZIWb2nRP2Ybu+3GOuENEwQyd +/dw==; 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=jaVrMgju; 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 4fb4d7f45d1cf-5c8824a7144si7478284a12.593.2024.10.01.04.21.13; Tue, 01 Oct 2024 04:21: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=@khirnov.net header.s=mail header.b=jaVrMgju; 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 5585568DCC3; Tue, 1 Oct 2024 13:54:57 +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 888BE68DBEE for ; Tue, 1 Oct 2024 13:54:41 +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=jaVrMgju; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 6DAB44E27 for ; Tue, 1 Oct 2024 12:54:36 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id CP8Dg6or7C8L for ; Tue, 1 Oct 2024 12:54:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1727780073; bh=boHK35CVrAajXhMbNJO0R/6x/ckzy0bLcRbmIw/xSBo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=jaVrMgju3mU0AXxUyo8nUa/hMaAXfG8bY41E1KJVeaq4auL/BAmxP2f04ZI0bT2sT our1ZQfLH7/5Y2/Gc6cDsPiR5WCpGrd8a1WrexlKkE0XP/jyxIxAcspAdRid7I1GP7 QHl1MMRiasSsv9WGVaVibGPT/D1z9jF61skJCe2XE1iSJRkzTPG0GBh5qvPPm6mjYa uN2XvrJ2LCcJ3ykQ4WfGiaT3Nn72m79/JSu2DfNznEvUq4cRtmDFPEMPXL3RtRCMVi JH2gEM9e69pC7DbyfEWWYchzO6h6CqcGEf980mjzSXO6oF2KPVOxFjIi+NScSX7Xzq lrADKde8jWEvA== 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 1C4264E2A for ; Tue, 1 Oct 2024 12:54:33 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id C657B3A0F02 for ; Tue, 01 Oct 2024 12:54:25 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Tue, 1 Oct 2024 12:54:07 +0200 Message-ID: <20241001105421.28967-2-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241001105421.28967-1-anton@khirnov.net> References: <20241001105421.28967-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 02/16] lavfi/buffersink: move channel layout parsing to init 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: 9ODbwQKCi36d That is a more appropriate place for this, and will also be useful in future commits. --- libavfilter/buffersink.c | 75 ++++++++++++++++++++++------------------ 1 file changed, 42 insertions(+), 33 deletions(-) diff --git a/libavfilter/buffersink.c b/libavfilter/buffersink.c index 95cb605712..0eded68b55 100644 --- a/libavfilter/buffersink.c +++ b/libavfilter/buffersink.c @@ -154,6 +154,7 @@ int attribute_align_arg av_buffersink_get_samples(AVFilterContext *ctx, static av_cold int common_init(AVFilterContext *ctx) { BufferSinkContext *buf = ctx->priv; + int ret = 0; #if FF_API_BUFFERSINK_OPTS @@ -184,6 +185,44 @@ static av_cold int common_init(AVFilterContext *ctx) CHECK_LIST_SIZE(sample_fmts) CHECK_LIST_SIZE(sample_rates) + + if (buf->channel_layouts_str) { + const char *cur = buf->channel_layouts_str; + + if (buf->all_channel_counts) + av_log(ctx, AV_LOG_WARNING, + "Conflicting all_channel_counts and list in options\n"); + + while (cur) { + void *tmp; + char *next = strchr(cur, '|'); + if (next) + *next++ = 0; + + // +2 for the new element and terminator + tmp = av_realloc_array(buf->channel_layouts, buf->nb_channel_layouts + 2, + sizeof(*buf->channel_layouts)); + if (!tmp) + return AVERROR(ENOMEM); + + memset(&buf->channel_layouts[buf->nb_channel_layouts], 0, + sizeof(*buf->channel_layouts)); + buf->nb_channel_layouts++; + + ret = av_channel_layout_from_string(&buf->channel_layouts[buf->nb_channel_layouts - 1], cur); + if (ret < 0) { + av_log(ctx, AV_LOG_ERROR, "Error parsing channel layout: %s.\n", cur); + return ret; + } + if (ret < 0) + return ret; + + cur = next; + } + + if (buf->nb_channel_layouts) + buf->channel_layouts[buf->nb_channel_layouts] = (AVChannelLayout){ 0 }; + } } #undef CHECK_LIST_SIZE @@ -412,8 +451,6 @@ static int asink_query_formats(AVFilterContext *ctx) #if FF_API_BUFFERSINK_OPTS } else { AVFilterFormats *formats = NULL; - AVChannelLayout layout = { 0 }; - AVFilterChannelLayouts *layouts = NULL; unsigned i; if (buf->sample_fmts_size) { @@ -424,37 +461,9 @@ static int asink_query_formats(AVFilterContext *ctx) return ret; } - if (buf->channel_layouts_str || buf->all_channel_counts) { - if (buf->channel_layouts_str) { - const char *cur = buf->channel_layouts_str; - - while (cur) { - char *next = strchr(cur, '|'); - if (next) - *next++ = 0; - - ret = av_channel_layout_from_string(&layout, cur); - if (ret < 0) { - av_log(ctx, AV_LOG_ERROR, "Error parsing channel layout: %s.\n", cur); - return ret; - } - ret = ff_add_channel_layout(&layouts, &layout); - av_channel_layout_uninit(&layout); - if (ret < 0) - return ret; - - cur = next; - } - } - - if (buf->all_channel_counts) { - if (layouts) - av_log(ctx, AV_LOG_WARNING, - "Conflicting all_channel_counts and list in options\n"); - else if (!(layouts = ff_all_channel_counts())) - return AVERROR(ENOMEM); - } - if ((ret = ff_set_common_channel_layouts(ctx, layouts)) < 0) + if (buf->nb_channel_layouts) { + ret = ff_set_common_channel_layouts_from_list(ctx, buf->channel_layouts); + if (ret < 0) return ret; } From patchwork Tue Oct 1 10:54:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51969 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:cb8a:0:b0:48e:c0f8:d0de with SMTP id d10csp208768vqv; Tue, 1 Oct 2024 04:51:20 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVL+/8eKt7US/kAQvlKg7rBGCm80rB3TYFoTC9DsvteH28EgJVaCfb8J1o4Y3syCGwF2BJejO/WYYp+2zL3ai73@gmail.com X-Google-Smtp-Source: AGHT+IHAyEgW6Bxy478Aol45hJeRDQaCTNySmrmyMxNOwBgKJHbAoDu6qU+Uue2bsKnlO9oeO/S+ X-Received: by 2002:a05:6512:280e:b0:533:d3e:16fe with SMTP id 2adb3069b0e04-5389fc774b4mr7995257e87.38.1727783480356; Tue, 01 Oct 2024 04:51:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727783480; cv=none; d=google.com; s=arc-20240605; b=FI0cqXNB217Bc0upnpedcPCzwaRugxGryeJvGO+0UghJK9iTwWKni1j5e3k2UTyCDO dcuugymjST6UsplwU6nwqiWF8XquKqn5Z0JdyJns/r29xY2O5ncynvVbhTsc8znx1Lvr MIa1e5Js9YEnipIIs2Ge4Egsgxq31eMLs3oRr8CIJycrY1Z5Cx1r64RNDJwWsjhx+zJa MCjLo0x7xodahytWIPVto/RaudnSZ98jBj0YT0d+cE7+iRi3QybKwUVdsqcTNqacc3uw xPML+wjuA7cFRdYGUHMe7r1tr4DDNDQS9+lX8fAZAesXlC04mtV0oQfwjsZKAEmbUGxJ M5Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=mB7nx/GlIN1PysGSTqOjV06jrAhBK0UdQxg6OZ0+6bY=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=EooW0/6TFlLSZO6YOEIhe/Jen7iXwUAcXWXREyUAgek1h1+boKnhAjfEVW5V9JhuT1 zbUdwXKiytEA6pucbyzFd9w3eHqOCD063/Iw/iSjE+bxgIOcIb1pzycJ8qD8YwhLPilb JQj6ukKVLcPWL+ngAvhZbJ0BOTSXSzcjpKc5q2IK2ZjFQE1LzPCHInbrsvsAxkWshf2H I9FPttxIH+98jVHyP0R7aBEwc/BkA099i3CLq7p34WMVtFA5EpmWMsXZwXa2AGU9gyme FgDQ5y+E6OTfDKlXmGNxVjnkMRu0RGnNcixN+lJ0KuFcklkwcFXitPyRZJYs0nISQ/un TmzQ==; 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=AX6e+tpV; 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 2adb3069b0e04-5389fd521b7si3423566e87.116.2024.10.01.04.51.17; Tue, 01 Oct 2024 04:51:20 -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=AX6e+tpV; 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 C336568DCD2; Tue, 1 Oct 2024 13:54:58 +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 8D8EB68DBB2 for ; Tue, 1 Oct 2024 13:54:41 +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=AX6e+tpV; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 789244E1B for ; Tue, 1 Oct 2024 12:54:36 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id 1GGRoIBOg0Rg for ; Tue, 1 Oct 2024 12:54:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1727780073; bh=ByBgU5ps1mvB8xqPQdJ95cJy+1HcvvBkBY9S/vWTrpg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=AX6e+tpVJVCgXQcXJ46nancKSBgx6sOME9C5/bM/9rGo1sgN/1wUwPO7M+YxEYraD C4Zz7XErZktYdtjn6iDkkmhVu1DeXr5LIkvm1GyBlsjaDwyJoMUnovFw8YCGsnMBOS sMmwSxWLAtqfqYWn5+0RHyFr9vFOXYknZ+xx83sQosg9WxqqlYoQwKB50XQen1EIU9 4SkDdj+kLxybU/k0gCPC9a4m2wehy9EwZtJWOfYYrhj4caIg3FzELrj4NNohDptUrE e4jPX7dbMQELpavvnyYXXjkvnpx/l9PJ4Ub+CcsfdvVHbnVauDIyPeTguiF48FV7gr MYL+dLP89vzeg== 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 060894E29 for ; Tue, 1 Oct 2024 12:54:33 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id D15633A0F41 for ; Tue, 01 Oct 2024 12:54:25 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Tue, 1 Oct 2024 12:54:08 +0200 Message-ID: <20241001105421.28967-3-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241001105421.28967-1-anton@khirnov.net> References: <20241001105421.28967-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 03/16] lavfi/buffersink: switch to query_func2() 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: 2LJT0Uu7VdCW --- libavfilter/buffersink.c | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/libavfilter/buffersink.c b/libavfilter/buffersink.c index 0eded68b55..b0bcc26432 100644 --- a/libavfilter/buffersink.c +++ b/libavfilter/buffersink.c @@ -367,26 +367,28 @@ int av_buffersink_get_ch_layout(const AVFilterContext *ctx, AVChannelLayout *out #define NB_ITEMS(list) (list ## _size / sizeof(*list)) #endif -static int vsink_query_formats(AVFilterContext *ctx) +static int vsink_query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { - BufferSinkContext *buf = ctx->priv; + const BufferSinkContext *buf = ctx->priv; int ret; #if FF_API_BUFFERSINK_OPTS if (buf->nb_pixel_formats || buf->nb_colorspaces || buf->nb_colorranges) { #endif if (buf->nb_pixel_formats) { - ret = ff_set_common_formats_from_list(ctx, buf->pixel_formats); + ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, buf->pixel_formats); if (ret < 0) return ret; } if (buf->nb_colorspaces) { - ret = ff_set_common_color_spaces_from_list(ctx, buf->colorspaces); + ret = ff_set_common_color_spaces_from_list2(ctx, cfg_in, cfg_out, buf->colorspaces); if (ret < 0) return ret; } if (buf->nb_colorranges) { - ret = ff_set_common_color_ranges_from_list(ctx, buf->colorranges); + ret = ff_set_common_color_ranges_from_list2(ctx, cfg_in, cfg_out, buf->colorranges); if (ret < 0) return ret; } @@ -398,7 +400,7 @@ static int vsink_query_formats(AVFilterContext *ctx) for (i = 0; i < NB_ITEMS(buf->pixel_fmts); i++) if ((ret = ff_add_format(&formats, buf->pixel_fmts[i])) < 0) return ret; - if ((ret = ff_set_common_formats(ctx, formats)) < 0) + if ((ret = ff_set_common_formats2(ctx, cfg_in, cfg_out, formats)) < 0) return ret; } @@ -407,7 +409,7 @@ static int vsink_query_formats(AVFilterContext *ctx) for (i = 0; i < NB_ITEMS(buf->color_spaces); i++) if ((ret = ff_add_format(&formats, buf->color_spaces[i])) < 0) return ret; - if ((ret = ff_set_common_color_spaces(ctx, formats)) < 0) + if ((ret = ff_set_common_color_spaces2(ctx, cfg_in, cfg_out, formats)) < 0) return ret; } @@ -416,7 +418,7 @@ static int vsink_query_formats(AVFilterContext *ctx) for (i = 0; i < NB_ITEMS(buf->color_ranges); i++) if ((ret = ff_add_format(&formats, buf->color_ranges[i])) < 0) return ret; - if ((ret = ff_set_common_color_ranges(ctx, formats)) < 0) + if ((ret = ff_set_common_color_ranges2(ctx, cfg_in, cfg_out, formats)) < 0) return ret; } } @@ -425,26 +427,28 @@ static int vsink_query_formats(AVFilterContext *ctx) return 0; } -static int asink_query_formats(AVFilterContext *ctx) +static int asink_query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { - BufferSinkContext *buf = ctx->priv; + const BufferSinkContext *buf = ctx->priv; int ret; #if FF_API_BUFFERSINK_OPTS if (buf->nb_sample_formats || buf->nb_samplerates || buf->nb_channel_layouts) { #endif if (buf->nb_sample_formats) { - ret = ff_set_common_formats_from_list(ctx, buf->sample_formats); + ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, buf->sample_formats); if (ret < 0) return ret; } if (buf->nb_samplerates) { - ret = ff_set_common_samplerates_from_list(ctx, buf->samplerates); + ret = ff_set_common_samplerates_from_list2(ctx, cfg_in, cfg_out, buf->samplerates); if (ret < 0) return ret; } if (buf->nb_channel_layouts) { - ret = ff_set_common_channel_layouts_from_list(ctx, buf->channel_layouts); + ret = ff_set_common_channel_layouts_from_list2(ctx, cfg_in, cfg_out, buf->channel_layouts); if (ret < 0) return ret; } @@ -457,12 +461,12 @@ static int asink_query_formats(AVFilterContext *ctx) for (i = 0; i < NB_ITEMS(buf->sample_fmts); i++) if ((ret = ff_add_format(&formats, buf->sample_fmts[i])) < 0) return ret; - if ((ret = ff_set_common_formats(ctx, formats)) < 0) + if ((ret = ff_set_common_formats2(ctx, cfg_in, cfg_out, formats)) < 0) return ret; } if (buf->nb_channel_layouts) { - ret = ff_set_common_channel_layouts_from_list(ctx, buf->channel_layouts); + ret = ff_set_common_channel_layouts_from_list2(ctx, cfg_in, cfg_out, buf->channel_layouts); if (ret < 0) return ret; } @@ -472,7 +476,7 @@ static int asink_query_formats(AVFilterContext *ctx) for (i = 0; i < NB_ITEMS(buf->sample_rates); i++) if ((ret = ff_add_format(&formats, buf->sample_rates[i])) < 0) return ret; - if ((ret = ff_set_common_samplerates(ctx, formats)) < 0) + if ((ret = ff_set_common_samplerates2(ctx, cfg_in, cfg_out, formats)) < 0) return ret; } } @@ -533,7 +537,7 @@ const AVFilter ff_vsink_buffer = { .activate = activate, FILTER_INPUTS(ff_video_default_filterpad), .outputs = NULL, - FILTER_QUERY_FUNC(vsink_query_formats), + FILTER_QUERY_FUNC2(vsink_query_formats), }; static const AVFilterPad inputs_audio[] = { @@ -554,5 +558,5 @@ const AVFilter ff_asink_abuffer = { .activate = activate, FILTER_INPUTS(inputs_audio), .outputs = NULL, - FILTER_QUERY_FUNC(asink_query_formats), + FILTER_QUERY_FUNC2(asink_query_formats), }; From patchwork Tue Oct 1 10:54:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51965 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:cb8a:0:b0:48e:c0f8:d0de with SMTP id d10csp192159vqv; Tue, 1 Oct 2024 04:21:21 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXDcm1Y4go6+iV+sD9RliviNsCsteXiJH3tELv8DKVi+5SRjAPOWyb8FfijbRcInWCtA0qYLt0g2awl3RSD62o5@gmail.com X-Google-Smtp-Source: AGHT+IGKl/jSOsl6Ou79soYkAQCA0DthHY5hjMKHjmEKRepOZGtLc99OAjhxar9wURNYHACHow5K X-Received: by 2002:a05:651c:1546:b0:2fa:ddb5:77f4 with SMTP id 38308e7fff4ca-2faddb57b93mr6043231fa.38.1727781680867; Tue, 01 Oct 2024 04:21:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727781680; cv=none; d=google.com; s=arc-20240605; b=F4h2l4PZk1aH1zr7SPyvdgoJqyR4ZLjNo2/uojW2daSSGoo8PoPLC7vcsvDQc0vDL6 XlYfDQd6mo1+oDb6BqsvdbBjqRS5Bdc8J4RfJrrvLG9SBqo30A34fp8qcZ+O/w+ntehu qEWTU8AU7DLjHQB3MsAHxsM4vwEq79THkO55AoPOHSe14/suhl6ov4r8IiER5NOHK51S dAAenDqf94uZ9YJaI4bsGPo/Hn7ZlRQNl3gPJepAJhpqR2P56Ivs8uTn/VkvfmRvRmpg +1hhgcfaKwBvgJGDi5OtWtIQH//VsZMy/p8FyWXBk2P7gHfH0Nd0f/F7AEL1qsoYdf2w MNzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=S3E1UJXtd7TB90zT6pMf5FEeKsRTbhpgwQS/G7Hvis8=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=JP308jx+6l3xtKG2GHb+Kb72JOiGWTFyQ/OSbMSWX51Gh/rIMmm/6ntWw7V+J9RGa2 fhIJ1hXLaHa4dWo1JwS08UV8PAVhvPPk6lPySvbzbE2Dp55LcgMu9PbIb61hNeiDy7qX Wb31RrPKovXaQ59s8br8AYPfeQ/bjku8Z1v4n0zDSLZkSZfrH1EwMVx8j+yfHyPhjweP EZRvSBmCJiu7iUcRk112mO1yi/hzzy3YcLSWDLB8KEZtbbfnH0eou0KLHWuRizOUwANa tAyMHdqgn57hC3Lx0+Q5tgnFzFpZXfnuqcMyjpdjC50/8jJPTb+qJ8ABTl6o5R/Z433o tvWg==; 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=bGh+xdma; 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-2f9d46290d4si31274441fa.488.2024.10.01.04.21.20; Tue, 01 Oct 2024 04:21:20 -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=bGh+xdma; 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 0766E68DCB1; Tue, 1 Oct 2024 13:54:55 +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 82FAA68DB32 for ; Tue, 1 Oct 2024 13:54:41 +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=bGh+xdma; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 17CE94E18 for ; Tue, 1 Oct 2024 12:54:36 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id AWbPB-Zx58xy for ; Tue, 1 Oct 2024 12:54:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1727780073; bh=DqEqOOHlUCMe5iDeq+YG2dslH7SyONCyWp5mT/OZCmQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=bGh+xdmaFZjZZYI/KlsvZuQhPVFJbwCJw0vbChA0H+c0J7ez/V6Tsh2yAEsXFLrFy uOacupl7SXwj0pfL0Q0MAAEYao+JKkc1uIAnSERtawn+mU8eG9BDE3q38iGho3tvRt Fc9J13dpC4ejqj6hVb6FP4LGwUpDe2jqeq2IMWK2PLZTMXpgpxSLTisuhxvHKrKtnQ QopViPxN5BOttHw4gDkgD9YS8+gLrJfe3pmFHP3dLo9jkPElcmbMcwN3I9eH0gg+eu 5VV36oDUUEhQxzM9B3E3Z4gMEOgF47dT+KrdKrDYAU5VdeP70sLdcO7mo6WSgiBtHr rencxNzHcbrmg== 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 F1EA64E27 for ; Tue, 1 Oct 2024 12:54:32 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id DD5663A1A1B for ; Tue, 01 Oct 2024 12:54:25 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Tue, 1 Oct 2024 12:54:09 +0200 Message-ID: <20241001105421.28967-4-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241001105421.28967-1-anton@khirnov.net> References: <20241001105421.28967-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 04/16] lavfi/buffersrc: validate hw context presence in video_init() 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: DTQX49bJX+8I That is the more appropriate place for it than query_formats(). --- libavfilter/buffersrc.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c index b5682006f0..3d679cad53 100644 --- a/libavfilter/buffersrc.c +++ b/libavfilter/buffersrc.c @@ -291,6 +291,13 @@ static av_cold int init_video(AVFilterContext *ctx) av_log(ctx, AV_LOG_ERROR, "Unspecified pixel format\n"); return AVERROR(EINVAL); } + if (av_pix_fmt_desc_get(c->pix_fmt)->flags & AV_PIX_FMT_FLAG_HWACCEL) { + if (!c->hw_frames_ctx) { + av_log(ctx, AV_LOG_ERROR, "Setting BufferSourceContext.pix_fmt " + "to a HW format requires hw_frames_ctx to be non-NULL!\n"); + return AVERROR(EINVAL); + } + } if (c->w <= 0 || c->h <= 0) { av_log(ctx, AV_LOG_ERROR, "Invalid size %dx%d\n", c->w, c->h); return AVERROR(EINVAL); @@ -445,14 +452,8 @@ static int query_formats(AVFilterContext *ctx) switch (ctx->outputs[0]->type) { case AVMEDIA_TYPE_VIDEO: { enum AVPixelFormat swfmt = c->pix_fmt; - if (av_pix_fmt_desc_get(swfmt)->flags & AV_PIX_FMT_FLAG_HWACCEL) { - if (!c->hw_frames_ctx) { - av_log(ctx, AV_LOG_ERROR, "Setting BufferSourceContext.pix_fmt " - "to a HW format requires hw_frames_ctx to be non-NULL!\n"); - return AVERROR(EINVAL); - } + if (av_pix_fmt_desc_get(swfmt)->flags & AV_PIX_FMT_FLAG_HWACCEL) swfmt = ((AVHWFramesContext *) c->hw_frames_ctx->data)->sw_format; - } if ((ret = ff_add_format (&formats, c->pix_fmt)) < 0 || (ret = ff_set_common_formats (ctx , formats )) < 0) return ret; From patchwork Tue Oct 1 10:54:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51958 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:cb8a:0:b0:48e:c0f8:d0de with SMTP id d10csp175272vqv; Tue, 1 Oct 2024 03:55:27 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX0JgbfGxwe1zpyXDhVBxzDuXBf8W2rFVUp0Jf4VOiSZzw7OzUd6LpxtCU3PzKehhTAuyH8HJIccrozdKCE0JGi@gmail.com X-Google-Smtp-Source: AGHT+IFDe279y0+GEZSsHnHjjmtt5fvq3n0jEFinBgVlydGyz1P+UvV7FcXikJGpppaZlVWQOb1M X-Received: by 2002:a17:907:e93:b0:a91:7af:d3f2 with SMTP id a640c23a62f3a-a93c4c272ecmr1420030266b.63.1727780127373; Tue, 01 Oct 2024 03:55:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727780127; cv=none; d=google.com; s=arc-20240605; b=Hy4TEgmkor1NGmP6cD0W3T/7TXEWFGPqHNNcaVy4Lb+stw3PBrPfc5pgK6urCuP5rl uRik2Ym+TS6N1K7SbmTVsBtQN16GtFYUmQ1xeZnO2eZ3YF3zdA8cuxNZ/UJL0v4ZgQzb 0hn58yKunDqNPenB2GokQO/77a6ax/KeEFzTL0QJOTSN04bK2FiVmdSZA2BWWB83SxAm mOnJmXsmDMkIStW1ZSsXikiu5/Nr3zmvylN9TJyRm9EBa3vIXfLxHR9IEJTW4vyYL+VN dBpDHfZBdc//C/Ek4GKpLnlpFUf1kkuHAaTPnCmJLaIJCStk2ol/sKzfcfDHyfnpy5dp I4vQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=IqN6Po5DWaaYtEXgXy3WbSBPg26lxH4/CoTH3hm+mCM=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=AgwoJGVamVG8XaOgwRkg0/MCbAaOolat3m8z4oujFNzOlkfAye+2w7S0FxWcCMC47G uZQsxwKD7T4J9UQaZ0wtldYrZ88PkZzCuz9GPS9LyvE/9RjhI94fjTD3kxLmUyyXXWP9 iqaE7SFG3pnn8oEEJoKJ2k7HhTfoxfrbhxH/JuO7CRhei0xriL67Ib+DdWu8wM521qUr 2wVsOlBe+dK/D07WS8kMnWTqi95oea4R5j9G3R0y10x+uf02orEzIvl6EWqg9e1aMR2w gjzV2rM2Q5/+O3nzsqBI5y++WvRvoiOS2osBDKHh+ZSA7J3YkV664/2C/Y7BbUDbC9Fo rI2A==; 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=X4c49vnV; 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 a640c23a62f3a-a93c29ee5adsi736943066b.530.2024.10.01.03.55.25; Tue, 01 Oct 2024 03:55:27 -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=X4c49vnV; 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 5658E68DB92; Tue, 1 Oct 2024 13:54:45 +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 2B07468DB2F for ; Tue, 1 Oct 2024 13:54:36 +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=X4c49vnV; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id C27F64E23 for ; Tue, 1 Oct 2024 12:54:34 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id QIUiQHfe9_tU for ; Tue, 1 Oct 2024 12:54:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1727780072; bh=5pyKIUKF+e9tkvYEPBPkUVyFHC+aUS2FRblEuKcUg+E=; h=From:To:Subject:Date:In-Reply-To:References:From; b=X4c49vnVB/R6j2A9xEzkqiT5QKPrJCF6VFaXE//21PMceLQt5b8pxus6fH6eT8QaW BZ7pCcYf1Tr9SnbAsp00Hz01bWn317Ic+zfFMFqE7ESFMkOnQOQDIgGdgbwei9O/fp 4ZZEDe/4kyySgfz6ag6MqN6AYEPDvNkL+cvTgqVg64Q9rlWPMv3ZR6EiSeLUK2DQkk oR5zDEJJxWSfqjgahOAGmW2+eMDbaX+jBfds7Q+uq8P/4Cs2OJZ88Im0zmO8yJnUyv iqb7YLnRcj8tuqpZcaHrC18FDo/H/hxIpWU3KRTuhkeRtu1IlIxyl6VMN0og+HhgBe lffjH7ZQMr1rQ== 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 AF8B1EE9 for ; Tue, 1 Oct 2024 12:54:32 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id E91213A1A81 for ; Tue, 01 Oct 2024 12:54:25 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Tue, 1 Oct 2024 12:54:10 +0200 Message-ID: <20241001105421.28967-5-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241001105421.28967-1-anton@khirnov.net> References: <20241001105421.28967-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 05/16] lavfi/buffersrc: switch to query_func2() 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: 6eEVXNTPhZgR --- libavfilter/buffersrc.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c index 3d679cad53..bdf8b14451 100644 --- a/libavfilter/buffersrc.c +++ b/libavfilter/buffersrc.c @@ -439,9 +439,11 @@ static av_cold void uninit(AVFilterContext *ctx) av_channel_layout_uninit(&s->ch_layout); } -static int query_formats(AVFilterContext *ctx) +static int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { - BufferSourceContext *c = ctx->priv; + const BufferSourceContext *c = ctx->priv; AVFilterChannelLayouts *channel_layouts = NULL; AVFilterFormats *formats = NULL; AVFilterFormats *samplerates = NULL; @@ -455,12 +457,12 @@ static int query_formats(AVFilterContext *ctx) if (av_pix_fmt_desc_get(swfmt)->flags & AV_PIX_FMT_FLAG_HWACCEL) swfmt = ((AVHWFramesContext *) c->hw_frames_ctx->data)->sw_format; if ((ret = ff_add_format (&formats, c->pix_fmt)) < 0 || - (ret = ff_set_common_formats (ctx , formats )) < 0) + (ret = ff_set_common_formats2(ctx, cfg_in, cfg_out, formats)) < 0) return ret; /* force specific colorspace/range downstream only for ordinary YUV */ if (ff_fmt_is_regular_yuv(swfmt)) { if ((ret = ff_add_format(&color_spaces, c->color_space)) < 0 || - (ret = ff_set_common_color_spaces(ctx, color_spaces)) < 0) + (ret = ff_set_common_color_spaces2(ctx, cfg_in, cfg_out, color_spaces)) < 0) return ret; if (ff_fmt_is_forced_full_range(swfmt)) { if ((ret = ff_add_format(&color_ranges, AVCOL_RANGE_JPEG)) < 0) @@ -474,21 +476,21 @@ static int query_formats(AVFilterContext *ctx) return ret; } } - if ((ret = ff_set_common_color_ranges(ctx, color_ranges)) < 0) + if ((ret = ff_set_common_color_ranges2(ctx, cfg_in, cfg_out, color_ranges)) < 0) return ret; } break; } case AVMEDIA_TYPE_AUDIO: if ((ret = ff_add_format (&formats , c->sample_fmt )) < 0 || - (ret = ff_set_common_formats (ctx , formats )) < 0 || + (ret = ff_set_common_formats2 (ctx, cfg_in, cfg_out, formats)) < 0 || (ret = ff_add_format (&samplerates, c->sample_rate)) < 0 || - (ret = ff_set_common_samplerates (ctx , samplerates )) < 0) + (ret = ff_set_common_samplerates2(ctx, cfg_in, cfg_out, samplerates)) < 0) return ret; if ((ret = ff_add_channel_layout(&channel_layouts, &c->ch_layout)) < 0) return ret; - if ((ret = ff_set_common_channel_layouts(ctx, channel_layouts)) < 0) + if ((ret = ff_set_common_channel_layouts2(ctx, cfg_in, cfg_out, channel_layouts)) < 0) return ret; break; default: @@ -567,7 +569,7 @@ const AVFilter ff_vsrc_buffer = { .inputs = NULL, FILTER_OUTPUTS(avfilter_vsrc_buffer_outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .priv_class = &buffer_class, }; @@ -589,6 +591,6 @@ const AVFilter ff_asrc_abuffer = { .inputs = NULL, FILTER_OUTPUTS(avfilter_asrc_abuffer_outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .priv_class = &abuffer_class, }; From patchwork Tue Oct 1 10:54:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51962 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:cb8a:0:b0:48e:c0f8:d0de with SMTP id d10csp186118vqv; Tue, 1 Oct 2024 04:11:14 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWzrfa/Tyb94Hed+uhrtBX757frOMXvkxgSCqgobH0bkdw+sShK53cV6lxZ6UBN+NzGVGu5nZTk8U0pBtNdZ/bK@gmail.com X-Google-Smtp-Source: AGHT+IGnf0XOoGZ+fwkRh0eqGsJaeJcGr8psMuIvxGtYs/ejS2cPehxANpQy2Nhh0W76hubD4HnZ X-Received: by 2002:a2e:742:0:b0:2f7:6277:f2be with SMTP id 38308e7fff4ca-2fad86d5689mr7359431fa.22.1727781074560; Tue, 01 Oct 2024 04:11:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727781074; cv=none; d=google.com; s=arc-20240605; b=Q7By5qwZK/O2TlS9Agmhr92garcs/hGoTyfHowmjHlpOpEgMkog7vcMDiozLh43gvW UbNUiPBShUETBuBf1smdLt0fBmCU+H8IC0vN5h+Mk+lxhGzRWG0TQiNsSJfOxeuEmvwt CSr7MMgXyDjkrUf+/HxQKv6yIzsGIeF2KTMBAEsgUzl0zyPo4jmFCo6tDcawDee2LHj9 GG1Ss3JRDfxdXN8+ohsUttQDAlRP5fytA7e+j1n239JoX6dPiT09p4aLB3MiNQnrdUJD VVPtBJ1Bh7mYtNzmCyld7YW8ZhAzreMcTInWh1R3RAMqw4AXevGvNdf2TDdlKiBoMczI JeYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=FHWdVsdDXFBx9BKMUZhEjMQs4xBpZEMlOkwSKc+MsWk=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=HbFNkt1Wu3lMtt1S/K8jPeTw/+AVjm/GOBTWVXpQdBgYdi89m9autQfWxntryUsXln qXGK/4Zqw1qEAZOTHEnVPk9D0pzWV3qXdugUUyq9z4jm6dU+TJMn/ItP3TayQq7LHToC OZbLR1LyxRzJ+nMyJWNSjSC7Ab5bglj/p+FzZtntEIz9ZawfmKsgpwV/Y9S6FFrUp2Ch kgOkDaXJSu/Dspu2djQlsfvMRovtXCs7Ws5UAvE14V+gj+JNKSybvLderilTg+43GXD1 0zcKwg5z0u/YLwgnxhkqBG3MUEU1LIXaAyhKyYFYUdv4hrkTbZgmjLvC+dnCbgE3uEAY /dgw==; 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=Ii15dMBm; 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-2f9d4603454si31794851fa.237.2024.10.01.04.11.12; Tue, 01 Oct 2024 04:11: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=@khirnov.net header.s=mail header.b=Ii15dMBm; 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 5A11E68DB1A; Tue, 1 Oct 2024 13:54:40 +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 5C5CC68D9B9 for ; Tue, 1 Oct 2024 13:54:34 +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=Ii15dMBm; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id AA0184E25 for ; Tue, 1 Oct 2024 12:54:33 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id 2-pvgXp9NX0Z for ; Tue, 1 Oct 2024 12:54:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1727780072; bh=7eR03R+7kiJmsFhHQRFa1I9MH2yJJNyzn7ErvaCs8rE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Ii15dMBmU7hTwzn9TmzhKDWyX4vZxyEt6x4udzNvZEQtULIKyfWK1bKybjBQAQ/7s fuONY2uWU/ywXEvcPT1G87SADq3vKOL9TrKfG5XJ0pFU1Z6ev9AWO/eBwA9LJ4ElFY OMCVYYgO+Cx8hiCx9RoDfOW/i31B5FiuyPIIN0nnstO8M4VRKAWmn1GoL+SX/+ZtwE AJUys3geWvu0u1rVTLIle2CqnTYxD9pzGUPU75nmbLUQ+P1NjxpFGh+rHwiDjOq10f ZVC1hNYwL46Jm+u9gyxVneZ8mjX0NErUZ7xshkwtNGi0rN9pypmgWXJOrRIYA9Pwzx VvuEbZ8qfX7AQ== 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 C498D4E02 for ; Tue, 1 Oct 2024 12:54:32 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 004B53A1DFD for ; Tue, 01 Oct 2024 12:54:26 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Tue, 1 Oct 2024 12:54:11 +0200 Message-ID: <20241001105421.28967-6-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241001105421.28967-1-anton@khirnov.net> References: <20241001105421.28967-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 06/16] lavfi/f_drawgraph: switch to query_func2() 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: f/SpFesH3m5T --- libavfilter/f_drawgraph.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libavfilter/f_drawgraph.c b/libavfilter/f_drawgraph.c index 7c6a83be7d..24288a1175 100644 --- a/libavfilter/f_drawgraph.c +++ b/libavfilter/f_drawgraph.c @@ -127,9 +127,10 @@ static av_cold int init(AVFilterContext *ctx) return 0; } -static int query_formats(AVFilterContext *ctx) +static int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { - AVFilterLink *outlink = ctx->outputs[0]; static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_RGBA, AV_PIX_FMT_NONE @@ -137,7 +138,7 @@ static int query_formats(AVFilterContext *ctx) int ret; AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); - if ((ret = ff_formats_ref(fmts_list, &outlink->incfg.formats)) < 0) + if ((ret = ff_formats_ref(fmts_list, &cfg_out[0]->formats)) < 0) return ret; return 0; @@ -482,7 +483,7 @@ const AVFilter ff_vf_drawgraph = { .uninit = uninit, FILTER_INPUTS(drawgraph_inputs), FILTER_OUTPUTS(drawgraph_outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), }; #endif // CONFIG_DRAWGRAPH_FILTER @@ -506,6 +507,6 @@ const AVFilter ff_avf_adrawgraph = { .uninit = uninit, FILTER_INPUTS(adrawgraph_inputs), FILTER_OUTPUTS(drawgraph_outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), }; #endif // CONFIG_ADRAWGRAPH_FILTER From patchwork Tue Oct 1 10:54:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51960 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:cb8a:0:b0:48e:c0f8:d0de with SMTP id d10csp178505vqv; Tue, 1 Oct 2024 04:01:15 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU48p3beFSeJzEKLaHirRpBX8O2LeKTanGhIZc5Z1k4ow6rUlVf3JBOu6Sjzvt0IN/UfmmmSTXqCuLQzoyK8rVI@gmail.com X-Google-Smtp-Source: AGHT+IEh+rLu7LwGUaPzpN/ihdk1M71OSmyqLl/8OZKDiirjrNz5psTbuYvzWIemcUWFoS9/gfQa X-Received: by 2002:a05:6402:2552:b0:5c2:609d:397e with SMTP id 4fb4d7f45d1cf-5c8825fe1eemr12710644a12.15.1727780474809; Tue, 01 Oct 2024 04:01:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727780474; cv=none; d=google.com; s=arc-20240605; b=cWCfDLLFymH94cGfGr/xubqhuVI3lqovNtm0Ru7jRqLAJwxn7l7fHZxyScAyiV6JUW FKbpdvEQ40+1xCHb5VD1+bsaVPa1jJDIpOhXuLa7jLcuXEydt7wBX3bkDozrF8D8wRr3 iwvfGdt/bP2Jej9mlW9FhE04hyzdw6OzK6xNPLo+OSmDwrpkHT3DE52955R+P2h7I+18 c1WsM87YK4d+WC7WxzlM5iTK5WAEY0KPEc6tj6NqKKucJsuQBSiZqOQg3SrdXEmXkcwQ kDhwsvA80rU+1P3J8hzt9pqr65LygDeT3dns+AK6/dYmY7NW9HprFzQmr3bUBVVl5w5M wtAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=Xgke2hc1ATsbj9BoUTxgWxPyz+ZnZVrHK0jv6ESI6BU=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=PIoHNxbAKjnygvEOkSnDd48mzjrUpEVlmNeVPzlg2x0cW2TIL9gjtydw/Sj6wnpIA0 Dhnnji+gYxXoAJsUQvfJ6X5p9ah7bbKX3AGDvVd+7ZF2eomOXUK3xS2BMHh+ax0BtjbP Dsi+whB/wCu8PEMSE9n8QopIt15L7BO58QmDXHb8o83dRRi6q9nGfl7NrO6JqPPSMuDf aVSakDZgLscBZVrn8wDIrKH7cj2M6fksDpgY1XfNfxQS6S6WDs8zirn3lHWv/bdyA942 hdn4GugJQ64VAs31Q+W95eKjQnall8Okl/MiRjDOu/V4NRDcF/5IaMORPY94y06t/ka4 zvOw==; 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=Dtz0kbBg; 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 4fb4d7f45d1cf-5c88249000csi6955974a12.307.2024.10.01.04.01.14; Tue, 01 Oct 2024 04:01: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=@khirnov.net header.s=mail header.b=Dtz0kbBg; 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 1206768DB63; Tue, 1 Oct 2024 13:54:43 +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 0639868DA91 for ; Tue, 1 Oct 2024 13:54:36 +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=Dtz0kbBg; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 664774E0C for ; Tue, 1 Oct 2024 12:54:34 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id a4t7QKDSNPch for ; Tue, 1 Oct 2024 12:54:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1727780072; bh=Yu/hFvRC1INexuNpv1Md8VCneFu0+6TfXqAiTikJlto=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Dtz0kbBgOT+NySSg+e+iX6+USSCcVyAUpsS2ur13t2mQ5Q+E6EdMZCgcUIatp/ULG ciZfi9Dema2VMIZXenogZQyXRxNkJp3ibvklyxC4ttPnqn4+vGGEnClwDu3VljC3tJ JbTgZmSgGkpXmAeB6yLZxcvHxF6CTptGLSXnr+4aaT6m9EHXSyI1rz8lmyrzRE3jZ9 6dKJI7+YpQ2xMYblLFPrL6RorlMNRZab4Si+vmSPssmh1D0ZJWho+DuajEewvxDKZo xzUULxW/uymC3NbZKPQzxJGLmekoYGfPOJkHbJ+0im/8xge8ZZXPTs34KzFlnnntA5 FeUZj1TnIJy6A== 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 CEF2B4E0F for ; Tue, 1 Oct 2024 12:54:32 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 0B02A3A1E08 for ; Tue, 01 Oct 2024 12:54:26 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Tue, 1 Oct 2024 12:54:12 +0200 Message-ID: <20241001105421.28967-7-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241001105421.28967-1-anton@khirnov.net> References: <20241001105421.28967-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 07/16] lavfi/f_ebur128: switch to query_func2() 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: wuLWpxDrWZTN Also, drop redundant calls that also happen implicitly in generic code. --- libavfilter/f_ebur128.c | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/libavfilter/f_ebur128.c b/libavfilter/f_ebur128.c index f71c230b45..8760c74f78 100644 --- a/libavfilter/f_ebur128.c +++ b/libavfilter/f_ebur128.c @@ -1005,13 +1005,13 @@ static int activate(AVFilterContext *ctx) return ret; } -static int query_formats(AVFilterContext *ctx) +static int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { - EBUR128Context *ebur128 = ctx->priv; + const EBUR128Context *ebur128 = ctx->priv; AVFilterFormats *formats; - AVFilterChannelLayouts *layouts; - AVFilterLink *inlink = ctx->inputs[0]; - AVFilterLink *outlink = ctx->outputs[0]; + int out_idx = 0; int ret; static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_NONE }; @@ -1020,27 +1020,17 @@ static int query_formats(AVFilterContext *ctx) /* set optional output video format */ if (ebur128->do_video) { formats = ff_make_format_list(pix_fmts); - if ((ret = ff_formats_ref(formats, &outlink->incfg.formats)) < 0) + if ((ret = ff_formats_ref(formats, &cfg_out[0]->formats)) < 0) return ret; - outlink = ctx->outputs[1]; + out_idx = 1; } /* set input and output audio formats * Note: ff_set_common_* functions are not used because they affect all the * links, and thus break the video format negotiation */ formats = ff_make_format_list(sample_fmts); - if ((ret = ff_formats_ref(formats, &inlink->outcfg.formats)) < 0 || - (ret = ff_formats_ref(formats, &outlink->incfg.formats)) < 0) - return ret; - - layouts = ff_all_channel_layouts(); - if ((ret = ff_channel_layouts_ref(layouts, &inlink->outcfg.channel_layouts)) < 0 || - (ret = ff_channel_layouts_ref(layouts, &outlink->incfg.channel_layouts)) < 0) - return ret; - - formats = ff_all_samplerates(); - if ((ret = ff_formats_ref(formats, &inlink->outcfg.samplerates)) < 0 || - (ret = ff_formats_ref(formats, &outlink->incfg.samplerates)) < 0) + if ((ret = ff_formats_ref(formats, &cfg_in[0]->formats)) < 0 || + (ret = ff_formats_ref(formats, &cfg_out[out_idx]->formats)) < 0) return ret; return 0; @@ -1128,7 +1118,7 @@ const AVFilter ff_af_ebur128 = { .activate = activate, FILTER_INPUTS(ebur128_inputs), .outputs = NULL, - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .priv_class = &ebur128_class, .flags = AVFILTER_FLAG_DYNAMIC_OUTPUTS, }; From patchwork Tue Oct 1 10:54:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51956 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:cb8a:0:b0:48e:c0f8:d0de with SMTP id d10csp175028vqv; Tue, 1 Oct 2024 03:54:56 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVMj2IFyNNxTXi40z9eXBdartnWulL2+jDoIdR8eZFt4eQRlDbw9+PhCviTmgfq/QraUuOuDSfVjVpNGX794k4g@gmail.com X-Google-Smtp-Source: AGHT+IHJzMx/M7Il6lrzKstNUQ0ZEPv6gReSts5ehzT0Gh2sLyA7vEBXBhhzJvZQhnAgtb47Fapb X-Received: by 2002:a50:cb87:0:b0:5c8:7915:4c7e with SMTP id 4fb4d7f45d1cf-5c88260f0b3mr17802204a12.36.1727780095709; Tue, 01 Oct 2024 03:54:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727780095; cv=none; d=google.com; s=arc-20240605; b=kXklTPo2BztP1hF553Q1T2Wn0beaiALBYACMlrxfH+zcoa/9xBsF3V+iEgU9gg1zrk u1ZwxBRVjaez/DdwbNf8VwtggwAkMb92/sTOnAV0ZIDPHK6ZYqErYBVkLVz/lSWf31UR ydOO2lJI7Dksyi/ikhufoqJkOeUQHGWzk5DZ34Rn/iJfKk+r9ykVAmrDH7g1Tzw3MRMz 7vKcPTjdlqGrm5QBmpfN+SdjJVkZrA0quHV0V9OkcbItjfI3dL7JMzY8r05E+oWRaYpX 7xYMIBJki0BYPC9Vzw1bGO0R2d3UOjKtYQuzgOa6ce/rJaYv+kg/fU50k0WK9jkM/Abs 31VQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=qRe+MSjhtqFlntnyE8RfCwEu1BZuSwNIAUx+J86WX14=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=Y993MEOgo2dxeUS/8ufXz0ya5cjzyBy+cQADbQpsIqt1U6Y7arThphFAHb8N+nJs4M XZ4Equr2FDuNHZIYNCbe+S3Ln99pJl9jdO/O7JK86de9QIsq/4GVgJSn4WucgDOEaRUG 60EQgZ2CzaBcraK/O6+eY1iXM03qmLZQzQycS+FEuAiw+AGxjw81NH6C0ODHQ/wFrv/s TY47eNzl1CcJC4EIFhK76KPioZ7k4SP04bBK/1QA5WOpZY0elLzm4CSthnmgDJ/n5AwM G2SjOKXJePhdTBMqvLMG2v6835VXT1a2tntrYIx4Vxh92t3UMorvtG9b2/3o0ThKbfrA MVAg==; 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=A+1YHZkz; 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 4fb4d7f45d1cf-5c882490001si7290917a12.233.2024.10.01.03.54.55; Tue, 01 Oct 2024 03:54:55 -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=A+1YHZkz; 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 BB26068DB35; Tue, 1 Oct 2024 13:54:41 +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 81B3168DA28 for ; Tue, 1 Oct 2024 13:54:34 +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=A+1YHZkz; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 15D594E02 for ; Tue, 1 Oct 2024 12:54:34 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id dJCy1L_FVT-t for ; Tue, 1 Oct 2024 12:54:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1727780072; bh=W90oDqBVt0RR0WOybVa4lqwN1y6DOzdYuE/VlvTgdYQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=A+1YHZkz0ysy0ZJTXHQ/Xd19/3TTE0q1ooGthT3ylWMy14OkzhyaEHfALjsdHIc+Q yCfwqZ+vDhwa6xvOW2kudwMIEIQReBAF+fJcEpHg6D8m1RIPzGp7p0CNB54TcmFbml c/NhHd5ZckXE2rb7+SJz8aKMQm0VJrPzf26eGKGllj0Lrf+F6E4xR4tIpbEx37Mrat N1I9pocCXJClKMQ9qq3la81ifuNoZiMosqhppfjhHWhbeltvWmSSi2Ew0pDqf/49bI l1f1MRnxBYEQgwBXz95aFyNxabG9Cl+8szyFWSL5xt9h6Wi0hAFcwDEJWX2yzlImQ7 mnOB7KLLhFmiQ== 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 CC7F04E0C for ; Tue, 1 Oct 2024 12:54:32 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 161E43A1E5F for ; Tue, 01 Oct 2024 12:54:26 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Tue, 1 Oct 2024 12:54:13 +0200 Message-ID: <20241001105421.28967-8-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241001105421.28967-1-anton@khirnov.net> References: <20241001105421.28967-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 08/16] lavfi/f_graphmonitor: switch to query_func2() 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: Vg6qCvZgC46i --- libavfilter/f_graphmonitor.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libavfilter/f_graphmonitor.c b/libavfilter/f_graphmonitor.c index 0ed1085610..453d1e82de 100644 --- a/libavfilter/f_graphmonitor.c +++ b/libavfilter/f_graphmonitor.c @@ -146,9 +146,10 @@ static av_cold int init(AVFilterContext *ctx) return 0; } -static int query_formats(AVFilterContext *ctx) +static int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { - AVFilterLink *outlink = ctx->outputs[0]; static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_RGBA, AV_PIX_FMT_NONE @@ -156,7 +157,7 @@ static int query_formats(AVFilterContext *ctx) int ret; AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); - if ((ret = ff_formats_ref(fmts_list, &outlink->incfg.formats)) < 0) + if ((ret = ff_formats_ref(fmts_list, &cfg_out[0]->formats)) < 0) return ret; return 0; @@ -587,7 +588,7 @@ const AVFilter ff_vf_graphmonitor = { .activate = activate, FILTER_INPUTS(ff_video_default_filterpad), FILTER_OUTPUTS(graphmonitor_outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .process_command = ff_filter_process_command, }; @@ -605,7 +606,7 @@ const AVFilter ff_avf_agraphmonitor = { .activate = activate, FILTER_INPUTS(ff_audio_default_filterpad), FILTER_OUTPUTS(graphmonitor_outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .process_command = ff_filter_process_command, }; #endif // CONFIG_AGRAPHMONITOR_FILTER From patchwork Tue Oct 1 10:54:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51957 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:cb8a:0:b0:48e:c0f8:d0de with SMTP id d10csp175205vqv; Tue, 1 Oct 2024 03:55:17 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW939/EQu/pf9enR9OyAOlFi0GLsyN5lpzqQdid7SD5xPHNsyCSlrtalwkZkrEVx5fbB2IiH1oLKcUReRwe7Y1M@gmail.com X-Google-Smtp-Source: AGHT+IFA8rWQ08E29ECqe1P7g8nTgNbXpeNKpo7G4nortHThRnqpGVf2BGRdJpis0yBIMH3TXfDN X-Received: by 2002:a2e:f1a:0:b0:2fa:bd19:b821 with SMTP id 38308e7fff4ca-2fabd19ba48mr54092261fa.9.1727780117475; Tue, 01 Oct 2024 03:55:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727780117; cv=none; d=google.com; s=arc-20240605; b=fPkuT1DJa2mwNHcpMWHGWdQzRxzjUFpPGS0HfmxfJ8U3rUbd30KEDzqK3d1rRhWy5K fNbbMIEV5Y1RUSsDE9WYjEdiLDPWREpVxfmFxAeDI+4DQaxPbDWI/Dgao/YYgwvxGr6o gywmXaQwca9S5N+EfF3jiWp03pDXGcwXDf+3xLNbAGDSd5ML5SDfA1ZxLb7L3uyeFnx3 B35N7PbwrgapoApqRqd73sRLnLY+qnBWLz5PRnJqvbUcxmLL0retapnXGvehDD3BwBB7 34gOuykbLUOGUnRS8AA8rJ6ERMzDOM0w5zOnpYgsnbY15vizaj1GZ4QEHJPSk1viJh14 SbjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=uHIOm6vu0rhqQ9fTGts4hoThMxSy2nIa7ieaQtQrvWI=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=Qr+OJgqF74rTdxbL/tiAAQTPd1lDOxdWgOEXlbUgtWawNELfVUu4TxOpTo45u43yks f7zsLxu1a+oobrCGcomtvmLvEotRQEObBp2twqncynQ0ACsFOwoz3nfZXV1Tgl3nd60P eN2O7YsT8lbyL7u/NrUKSZe5tiQgjIqL30HzN06Cdc2XAm5jpMM8ETRv8pXY1p9AUWZo pOeuRX8FszZ+eqheQrsnoZLcaW9TGeHd4yCILeGYXkFXhLi5mxGD0/j7PBglIQ77SCnY PshtLCfprOSPy6/a9sJkzOKyIAXMpN/jEIpsk+B/7XqLXNO/fSOWrw9qv7jMtYDsFlZs T0IA==; 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=KqDKx8uF; 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-2f9d4625decsi31975911fa.445.2024.10.01.03.55.16; Tue, 01 Oct 2024 03:55:17 -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=KqDKx8uF; 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 1874868DA28; Tue, 1 Oct 2024 13:54:44 +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 281FA68DB16 for ; Tue, 1 Oct 2024 13:54:36 +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=KqDKx8uF; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id AE5FD4E0F for ; Tue, 1 Oct 2024 12:54:34 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id B3yJ7ZDjk_iF for ; Tue, 1 Oct 2024 12:54:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1727780072; bh=/utqs2FZnyrjF5p2mKHqb/hfKTT4Gtnd2+fizdaEtqY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=KqDKx8uFQn2kH/a8Ogz6fNeaT2Zl/GlDf33YMKmUQpCCVf7VC46+l4vHpxRmhtH0S 2oHwMfgogikzUScMhXWmleka6mq+b9Ss2Zfn5wuX5Vw/Zo6cCN/qM8nXQolAdud/T3 R/gqA+wN6+t78XNTu2hnYQj4LRwAbw6KpbmuHUOp8h0dmdzyoyCBj7hwZMzLkMEv1E IVe0dmS9fvJv4p1RHFzs9rAG2+vDZI0bO1UaANJUcocXljznZBu7oyxfJ63rq+8pKQ LMZiQEq9/8kftt0046ZXaGnuNae2QAF+IlhSwk9Mwb14EuSCxe+mm2PEi2UpD0AHRy FfS7c0Ie0q/Aw== 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 D57514E13 for ; Tue, 1 Oct 2024 12:54:32 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 21D403A20DC for ; Tue, 01 Oct 2024 12:54:26 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Tue, 1 Oct 2024 12:54:14 +0200 Message-ID: <20241001105421.28967-9-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241001105421.28967-1-anton@khirnov.net> References: <20241001105421.28967-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 09/16] lavfi/f_select: switch to query_func2() 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: Bvq7MM1bZlk4 Also, drop redundant calls that also happen implicitly in generic code. --- libavfilter/f_select.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/libavfilter/f_select.c b/libavfilter/f_select.c index ba0ae31f1b..744fef6906 100644 --- a/libavfilter/f_select.c +++ b/libavfilter/f_select.c @@ -515,13 +515,13 @@ const AVFilter ff_af_aselect = { #if CONFIG_SELECT_FILTER -static int query_formats(AVFilterContext *ctx) +static int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { - SelectContext *select = ctx->priv; + const SelectContext *select = ctx->priv; - if (!select->do_scene_detect) { - return ff_default_query_formats(ctx); - } else { + if (select->do_scene_detect) { static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24, AV_PIX_FMT_RGBA, AV_PIX_FMT_ABGR, AV_PIX_FMT_BGRA, AV_PIX_FMT_GRAY8, @@ -530,8 +530,9 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_YUV420P10, AV_PIX_FMT_NONE }; - return ff_set_common_formats_from_list(ctx, pix_fmts); + return ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, pix_fmts); } + return 0; } DEFINE_OPTIONS(select, AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM); @@ -564,7 +565,7 @@ const AVFilter ff_vf_select = { .priv_size = sizeof(SelectContext), .priv_class = &select_class, FILTER_INPUTS(avfilter_vf_select_inputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .flags = AVFILTER_FLAG_DYNAMIC_OUTPUTS | AVFILTER_FLAG_METADATA_ONLY, }; #endif /* CONFIG_SELECT_FILTER */ From patchwork Tue Oct 1 10:54:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51964 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:cb8a:0:b0:48e:c0f8:d0de with SMTP id d10csp192109vqv; Tue, 1 Oct 2024 04:21:17 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUeMpd8kCY1RInlrUy7/fEHO9LaFZM/TSVbxs/EbbCZdPAjLz2RQYY9tqwcZubRLX1NQJgxhma0bI6rG2vXOLmt@gmail.com X-Google-Smtp-Source: AGHT+IH3GsFxGAx6t1JXyOtdP4Bxw+z5MyQD5y+XOc7wVLI8AZU+WkkPTMfwJrZPGXFuEaIxPFPB X-Received: by 2002:a05:6512:6503:b0:539:88f7:d3cc with SMTP id 2adb3069b0e04-53988f7d737mr5684536e87.22.1727781677120; Tue, 01 Oct 2024 04:21:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727781677; cv=none; d=google.com; s=arc-20240605; b=G3Tms6+8s5Nj8oT48moICxA6mll5PA9HFqXRfGP9fbWr1OIw8OwaYGU3FVXANEy5Qu cDxTlmbVVIKxjt/PJ53Og18VZD+TzPn/PWfbRFWJPOeDsi76deLD0MaijzJDCj8zx/9s 3EFfte3H2sYReHHQHDru3IWkTjiY5rGmnM8vB/3mTYd7IhtqqeWNQQqrDAPsQJm8aHKu Ijud5UzH8H1OS8hJE/HS7Q2+WfuLAFiuTB7jg7ic5GY/HzTzZZ3SkCy76r64XyR9+SeZ Zi9nwiz+yzgIoVCzkKBXcQSNCh+RTWygE52xxXKN9Cix6NZHiYYIP+rFydgGv2Rs/2zj OI+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=KH8IZGW7IPAb2IzueGgH/NA5jz9hraL6wYME9irHp6Y=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=bBRl+pu4sTpSsXnhePUc3Zj60/4NWWOKqkH4YWVyNsCsamgF2D5yP71fIcuvB+bVQZ jfuiQZf/SfFz6KtiyhtiDS3D44MfkXOubdahQ2CiARlCiUSMaHMD5+SR5n5+QCIjwM99 BJ7GIQTAL9KUAkJ1HGTPzglL6vcgnoDmMa0sm9tXA5NnJNqMehlfzARmXLlL+enr9lF7 iPFXUXiHSCT8nhKezI6R3O0lGavtors2YAlvDYv0rWqHgJf9xFQ/557dlAbl9pZq4NmT Y4flnUgpzibXMw8FOzh3TKYAIfRaoKN7SbmdTIUy5IrFfrtcLN+zkxJbBfmPd1TyCtJu oHqQ==; 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=cmJYpwrV; 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 2adb3069b0e04-538a043ac51si3385686e87.366.2024.10.01.04.21.16; Tue, 01 Oct 2024 04:21:17 -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=cmJYpwrV; 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 AD15A68DB32; Tue, 1 Oct 2024 13:54:46 +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 BB34C68DB7C for ; Tue, 1 Oct 2024 13:54: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=cmJYpwrV; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 14C42EE9 for ; Tue, 1 Oct 2024 12:54:35 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id 74Qwo6-iOk-l for ; Tue, 1 Oct 2024 12:54:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1727780072; bh=xWB+MiHxDhyxbjgYxZPnmf80GjLWeV0Azb9wu4Ly/2E=; h=From:To:Subject:Date:In-Reply-To:References:From; b=cmJYpwrVOjOkitZxDdReNkw1fhW22qbd2DlSKkBptNfzMSeVz/E0W/puDFFUtKvSn 82WajfklRVZl4MpkeO1yTVvhd90yucLl3SraabHwv23PsaN7e+3vY5pONE83/bcwr3 6N/Te7e8dLNLqNaB/HdOjPhyxzBMhjwNUvHEAlUzZBIEGG6dYMw5N2YvxeXrbpJAuX wJPggnKFzJNsixjCxeud4BB3DjpdZcmzoCacq8PpO4d2E4ZSNd5cfwAS2qbJto5oCY KOmsBZ7X1cqg+ScFDCqAEJcjTDTHiiCpU6aM0rW0Ki9TRHeVW5rodGwcylxl4A3YCe knBQp/k04VASQ== 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 D30854E11 for ; Tue, 1 Oct 2024 12:54:32 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 2D81A3A2137 for ; Tue, 01 Oct 2024 12:54:26 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Tue, 1 Oct 2024 12:54:15 +0200 Message-ID: <20241001105421.28967-10-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241001105421.28967-1-anton@khirnov.net> References: <20241001105421.28967-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 10/16] lavfi/f_streamselect: drop useless query_formats() callback 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: uZYZ4voF+3FY It achieves the same effect as ff_default_query_formats(), which gets called implicitly. --- libavfilter/f_streamselect.c | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/libavfilter/f_streamselect.c b/libavfilter/f_streamselect.c index 4ff4e856ea..2afd22d4a3 100644 --- a/libavfilter/f_streamselect.c +++ b/libavfilter/f_streamselect.c @@ -296,31 +296,10 @@ static av_cold void uninit(AVFilterContext *ctx) ff_framesync_uninit(&s->fs); } -static int query_formats(AVFilterContext *ctx) -{ - AVFilterFormats *formats; - int ret, i; - - for (i = 0; i < ctx->nb_inputs; i++) { - formats = ff_all_formats(ctx->inputs[i]->type); - if ((ret = ff_set_common_formats(ctx, formats)) < 0) - return ret; - - if (ctx->inputs[i]->type == AVMEDIA_TYPE_AUDIO) { - if ((ret = ff_set_common_all_samplerates (ctx)) < 0 || - (ret = ff_set_common_all_channel_counts(ctx)) < 0) - return ret; - } - } - - return 0; -} - const AVFilter ff_vf_streamselect = { .name = "streamselect", .description = NULL_IF_CONFIG_SMALL("Select video streams"), .init = init, - FILTER_QUERY_FUNC(query_formats), .process_command = process_command, .uninit = uninit, .activate = activate, @@ -334,7 +313,6 @@ const AVFilter ff_af_astreamselect = { .description = NULL_IF_CONFIG_SMALL("Select audio streams"), .priv_class = &streamselect_class, .init = init, - FILTER_QUERY_FUNC(query_formats), .process_command = process_command, .uninit = uninit, .activate = activate, From patchwork Tue Oct 1 10:54:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51961 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:cb8a:0:b0:48e:c0f8:d0de with SMTP id d10csp182689vqv; Tue, 1 Oct 2024 04:06:14 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU1dwMNmc4IFcVuufT2dPdIbaQabjIJZo4+AkI6YH3TrVTESUdPDIPGPJygBUBvyomKVKdPYu4ECa3EbA9nDixB@gmail.com X-Google-Smtp-Source: AGHT+IEMrEO8a1ap2RRVR4gdw5ijTrq/aIb26cOUoPTuWxPdipPBV8bte36ZssYMLksREI+FYzYe X-Received: by 2002:a17:907:3e9f:b0:a86:80ef:4fe5 with SMTP id a640c23a62f3a-a93c4ae8ef8mr1501924966b.47.1727780774421; Tue, 01 Oct 2024 04:06:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727780774; cv=none; d=google.com; s=arc-20240605; b=DE+Pv8cf7QZIxbNQ9DcstisVKKXCJ7Z7kGEA64GGrv7JvHYSy4pFBiZjlf79xP8fEa e9bHVt9raKuRkstcExJQxWbgQ4zHNpNrX4ZJpvsJr1kr8WXoR9lCAJJbIQmCFkiuy/wk cGeO5smppFuEvsD+Ao6BvXr45Y5Bods421JkdSe3wb9geudqfmAj+/R+W4tgqtorqQ/4 X2lC2F0axgO+nAqZ28JtWkFhiBPxvczXRVBSBz0w62vL7V1bbqhmjZpguiVVJB5+SPIp U+wAd9PBV7SacUwPtlZmrzPTaHPu3/PkIuVAuusPHd+fixQnS90ybot1dRLxoiK9xL22 jHcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=V8QpVdV0MEHK7EGp/GJqzILo0VvW9U+Lf3mGzOWSzso=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=LbE+UW9NZBTFNGZaCe/aegyR2w4oXe1PElrufxplQ1x9A1YYofFefBxDpw8lNSHKFo C7OE6GSpBP/cQG0Cx2w37/3t9TvViMJDpFRTmJq3fnRW6lP8t0YRl7zG4LB+zm+bKNTc YNbDeKfSeuRVo+1UcSW0UD2zBsozEjFGZo03nk+HcwNkL5p+cidRN7/qspB7NJQF8WcA HK9C3VTAYpj+uHkdft8WtSKTjiX4C+cBoRTBZd00b3T4pWicltsYkp7ogNL5tT+DnwlU gaxQ/0M1D/cEtdw5ELohNdh1Qd8BSs9kk9ihSnbDHfTVcLqE/ZlnocFq5jjf7Stiz7kI WuvA==; 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="QT7vlC/h"; 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 a640c23a62f3a-a93c2aacff5si749100866b.963.2024.10.01.04.06.13; Tue, 01 Oct 2024 04:06: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=@khirnov.net header.s=mail header.b="QT7vlC/h"; 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 906F968DC37; Tue, 1 Oct 2024 13:54: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 E85C468DB89 for ; Tue, 1 Oct 2024 13:54: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=QT7vlC/h; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 61E044E11 for ; Tue, 1 Oct 2024 12:54:35 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id HrBZxCG44uMV for ; Tue, 1 Oct 2024 12:54:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1727780072; bh=dBnD8CPhsu+/d17qhofIWfkkxh0WRxCo4fUemJ/RAkE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=QT7vlC/h48496T+3UTjWR7kmGojuxRAlF6mM799AuthEbrQSGArcz8PTDrdlG/HfY 01Hg2sRRXs5JOR5cHk0BzcnqWoAAqRF4DmJe4D/zK5kv99o1UyxyD/hVp5V6erQci4 Bo5nIKxFQp3Udfp3vLdSsTW5qnsWlW0/s5KnS6d8dVsIjwmyjBORmhze/Ipigm6LN+ UCkjE+tNeltwU+IagDqNYr7K+Ks669cGIiOf1OQSi/ectm2f0EMAmJJRP9pDztg/JP faYgD99jPWohhlrCkFnm8qKKMoXay2th3WXZPbDmzDoJs3TfswceLYcj+mHWeVXu1s UAgqBkGCoeSTg== 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 DD79D4E18 for ; Tue, 1 Oct 2024 12:54:32 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 394AE3A21B3 for ; Tue, 01 Oct 2024 12:54:26 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Tue, 1 Oct 2024 12:54:16 +0200 Message-ID: <20241001105421.28967-11-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241001105421.28967-1-anton@khirnov.net> References: <20241001105421.28967-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 11/16] lavfi/qrencode: switch to query_func2() 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: jjpPKrCBJUFO --- libavfilter/qrencode.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/libavfilter/qrencode.c b/libavfilter/qrencode.c index dae169b57f..d3f55013d3 100644 --- a/libavfilter/qrencode.c +++ b/libavfilter/qrencode.c @@ -671,7 +671,9 @@ static int request_frame(AVFilterLink *outlink) return ff_filter_frame(outlink, frame); } -static int qrencodesrc_query_formats(AVFilterContext *ctx) +static int qrencodesrc_query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { enum AVPixelFormat pix_fmt; FFDrawContext draw; @@ -686,7 +688,7 @@ static int qrencodesrc_query_formats(AVFilterContext *ctx) (ret = ff_add_format(&fmts, pix_fmt)) < 0) return ret; - return ff_set_common_formats(ctx, fmts); + return ff_set_common_formats2(ctx, cfg_in, cfg_out, fmts); } static const AVFilterPad qrencodesrc_outputs[] = { @@ -707,7 +709,7 @@ const AVFilter ff_vsrc_qrencodesrc = { .uninit = uninit, .inputs = NULL, FILTER_OUTPUTS(qrencodesrc_outputs), - FILTER_QUERY_FUNC(qrencodesrc_query_formats), + FILTER_QUERY_FUNC2(qrencodesrc_query_formats), }; #endif // CONFIG_QRENCODESRC_FILTER @@ -772,9 +774,11 @@ static int qrencode_config_input(AVFilterLink *inlink) return 0; } -static int qrencode_query_formats(AVFilterContext *ctx) +static int qrencode_query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { - return ff_set_common_formats(ctx, ff_draw_supported_pixel_formats(0)); + return ff_set_common_formats2(ctx, cfg_in, cfg_out, ff_draw_supported_pixel_formats(0)); } static int filter_frame(AVFilterLink *inlink, AVFrame *frame) @@ -818,7 +822,7 @@ const AVFilter ff_vf_qrencode = { .uninit = uninit, FILTER_INPUTS(avfilter_vf_qrencode_inputs), FILTER_OUTPUTS(ff_video_default_filterpad), - FILTER_QUERY_FUNC(qrencode_query_formats), + FILTER_QUERY_FUNC2(qrencode_query_formats), .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, }; From patchwork Tue Oct 1 10:54:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51968 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:cb8a:0:b0:48e:c0f8:d0de with SMTP id d10csp208741vqv; Tue, 1 Oct 2024 04:51:17 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXWADg+n6DQ9zxx+rKSlH6fWXM1/iELvxz14WdYZhumIwPCeGxdcxm2ohR/FzryAwLyauX4lGWVtK6gn2NuURNd@gmail.com X-Google-Smtp-Source: AGHT+IEbchFx/A05KZztnt7hVrRS1ZKYrc5T6blNDjw3ornJLP72eiu29U6SwnjHRaj0g2bkCHeA X-Received: by 2002:a05:6512:3351:b0:52e:8161:4ce6 with SMTP id 2adb3069b0e04-5399a27a13emr714885e87.25.1727783476721; Tue, 01 Oct 2024 04:51:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727783476; cv=none; d=google.com; s=arc-20240605; b=VhrQnZUYS7mfgVqHINvysbfWPR1D1/DlHUwK4OPXeN/00a2oOGF44bdrGI7xnbGfoN JH/lmAXJAlYxufJv6A09uZ7AiYV1RPJAjZtmM4aHxDs3u1n+iiFbreei0/neE38Gfc1b zytmbKm351n29i5TqBSRZ8Qa7DYHqhTUNLXdlCR74pOM1L79u0c9GIv50ls0UhyAQT1M Jf5AwCwAFksMsJ/UitFmP5UFnaj3AV2KG8eGdm3OaKUB+eK+xdvEgd9kBbJva6fJzrGn VkQwqITg6Eh1iZxDcIlX9M629SdN/wqDZa/feIRmBUBEEyok3aj4rBuLucntdjHa03CF Ue+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=KKCg1pLest2ApCXIIxyzWtMmdrgRKIHSNB66c5F8uTI=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=d7flO1trN3bgH8rg+mIax4Lcv0W3ye3M8862uat0mTkl+X8i3mgPkzGeYXzUit1IUB kUP1WcSI9zDkIt1iRy+YERBeuqVvBQQo04JnvpiSuwId9ljVdERfAojw4YWE40Ebetel WrZMq2nxmvppNCXHps3+PmEKNQqa181+ICwaXIUwbZbZd5g2WC450rvi3TLeBvsQK+yS lyG7n6SzYpViV6zEZwt3cVSoaZ4T7fsyMBCVXSWUGFY11JX/0r531vPrmvUqzB4T0tmV fqm5JVHUMm9AYjHJfHZAIgylqr257U/j/Rwb2vLqDINKugrPSKiMZJWohkJCihJBKbkq HBQA==; 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=Ha4eJHhZ; 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 2adb3069b0e04-538a0461c89si3348788e87.634.2024.10.01.04.51.13; Tue, 01 Oct 2024 04:51:16 -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=Ha4eJHhZ; 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 18ADC68DBEE; Tue, 1 Oct 2024 13:54:48 +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 DADE068DB83 for ; Tue, 1 Oct 2024 13:54: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=Ha4eJHhZ; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 1DAD84E19 for ; Tue, 1 Oct 2024 12:54:35 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id sTY9PZcHa6P6 for ; Tue, 1 Oct 2024 12:54:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1727780072; bh=3D0mia7JZWF0P3fRU+iP1vspEq7122GS2dLrPqrZd3k=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Ha4eJHhZgdTYMlQnqeXmGVG0M1AZKpc9RVRs/6aXzlgAOtfKHDCSSobe9No7uQ4KX CRXnOuEadibPEz++D/RfRPZBYG8zcJ+sqXJ6sPzjDAcCWO42a7HL2I99+mZbnWACG9 ueK0BEPOlWBRr4PHgSIKd6+9HGO8D0t8/voZQRi5R12/ZrUIl3jBuLcvb3tpcNwSkx xs+F32JC95CjKa57Rmrifmha/WCC65KdWyw/GsZGhYNsZvTrkQRLxy3BON9SFfmy4x iF4QC1M8MfJXqIGpLD5FHp5ClZGaQ0QwnwYOc92GVzBErOaLu2Msk8fxNeA3/sCynx rozfqzbYWgwjA== 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 D7D0C4E16 for ; Tue, 1 Oct 2024 12:54:32 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 44F213A25F9 for ; Tue, 01 Oct 2024 12:54:26 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Tue, 1 Oct 2024 12:54:17 +0200 Message-ID: <20241001105421.28967-12-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241001105421.28967-1-anton@khirnov.net> References: <20241001105421.28967-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 12/16] lavfi/src_avsynctest: switch to query_func2() 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: tTcDTopyFBLa --- libavfilter/src_avsynctest.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/libavfilter/src_avsynctest.c b/libavfilter/src_avsynctest.c index f78cdd1dec..c46281c72b 100644 --- a/libavfilter/src_avsynctest.c +++ b/libavfilter/src_avsynctest.c @@ -93,39 +93,39 @@ static const AVOption avsynctest_options[] = { AVFILTER_DEFINE_CLASS(avsynctest); -static av_cold int query_formats(AVFilterContext *ctx) +static av_cold int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { - AVSyncTestContext *s = ctx->priv; - AVFilterChannelLayouts *chlayout = NULL; + const AVSyncTestContext *s = ctx->priv; int sample_rates[] = { s->sample_rate, -1 }; static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE }; + static const AVChannelLayout layouts[] = { + AV_CHANNEL_LAYOUT_MONO, + { .nb_channels = 0 }, + }; AVFilterFormats *formats; int ret; formats = ff_make_format_list(sample_fmts); if (!formats) return AVERROR(ENOMEM); - if ((ret = ff_formats_ref(formats, &ctx->outputs[0]->incfg.formats)) < 0) + if ((ret = ff_formats_ref(formats, &cfg_out[0]->formats)) < 0) return ret; formats = ff_draw_supported_pixel_formats(0); if (!formats) return AVERROR(ENOMEM); - if ((ret = ff_formats_ref(formats, &ctx->outputs[1]->incfg.formats)) < 0) + if ((ret = ff_formats_ref(formats, &cfg_out[1]->formats)) < 0) return ret; - if ((ret = ff_add_channel_layout(&chlayout, &(AVChannelLayout)AV_CHANNEL_LAYOUT_MONO)) < 0) - return ret; - ret = ff_set_common_channel_layouts(ctx, chlayout); + ret = ff_set_common_channel_layouts_from_list2(ctx, cfg_in, cfg_out, layouts); if (ret < 0) return ret; - formats = ff_make_format_list(sample_rates); - if (!formats) - return AVERROR(ENOMEM); - return ff_set_common_samplerates(ctx, formats); + return ff_set_common_samplerates_from_list2(ctx, cfg_in, cfg_out, sample_rates); } static av_cold int aconfig_props(AVFilterLink *outlink) @@ -404,6 +404,6 @@ const AVFilter ff_avsrc_avsynctest = { .inputs = NULL, .activate = activate, FILTER_OUTPUTS(avsynctest_outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .process_command = ff_filter_process_command, }; From patchwork Tue Oct 1 10:54:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51976 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:cb8a:0:b0:48e:c0f8:d0de with SMTP id d10csp296430vqv; Tue, 1 Oct 2024 07:01:18 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXtCeyslbpMTzrvtl0NLJBnO7eKbawPsy7f/FwJWWSiexazZ4j8/BW8zh2AX8Zzf4tDMAWgTt+no7+TqLbjv9BO@gmail.com X-Google-Smtp-Source: AGHT+IFJ0zbGJ9RxcAPTSDU69IoLFd9AeGsBNyHXopG0ovLqgZ2rgy19F0gPvExa6KagMiwg6Pnj X-Received: by 2002:a05:6402:1599:b0:5c3:d8fb:df6a with SMTP id 4fb4d7f45d1cf-5c8a2a3199bmr3524471a12.14.1727791278306; Tue, 01 Oct 2024 07:01:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727791278; cv=none; d=google.com; s=arc-20240605; b=Kwtdkr9fE0zazH86r05gf5JD8QZdjd7eA/Rg/tean8L9G4klg5euH9w51Mdj3qlIDN dlTIJa2EpZPNnjXpDhTUQo5qjrglyPo4v0upRlCxrrKARgrWUE9nw+Rb0mys2z350Il/ 1XgBGHz0GAHsIA4NaUBYlUa8X3pK/AxX+5si/yKCL0cf9AgsmW1CMkFMi6xRyxqSLxF8 tGyOpPA3CtHogjSteXryJf+BNsNyBMc5chqxMAse0mUgMziGWVkEwZ767QwbyLlpNKEr BbhOD4CQKjQE5sTA8ctpEBo0NUq0m/ViOtQ+AoILvkzpWN7ZVGs6aS9OpxA7xQgWLOnj D9dA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=Ib7dn75pyPYYZ8l08ZZO/XbmIqa4pLNV+gYc8S9qah4=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=AtSNN/r4ciOxmM6tSibubHwlrY0l4gMXmZKVMtyGIP0NDP3UnV0oXDeYbWqYciBK+O x9YeG8AEVa+hA0ZL4Vy9yPlv5x8Eq2hGJ/bIvaC9yMN9yoP+0N51wXWVu4PAWrA5fJFC /DsLFx9QlwxVZdzWjH7OPyX1TbVIVME0sIZ8LXFs9c4jdXuLxvRxQxw09L7kYcVkFMnV dabZ2S6yOM4LQkCoAAQCsNq5lZWyR+/as33PvZPbVIlECbEE/nZWcNsDakaL8g5gGarA yDEyPwTs3q4x7+yxism8xgChj8ohR+Ra7XKq4lExOoRWVL0vHb9mkU4Mokf9fZIZFxDh I00A==; 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=FMvP2NAU; 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 4fb4d7f45d1cf-5c882407fe1si7468924a12.44.2024.10.01.07.01.17; Tue, 01 Oct 2024 07:01:18 -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=FMvP2NAU; 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 D4DF668DB16; Tue, 1 Oct 2024 13:54:53 +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 642AD68DBCD for ; Tue, 1 Oct 2024 13:54:41 +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=FMvP2NAU; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id B438C4E1A for ; Tue, 1 Oct 2024 12:54:35 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id 3SU_drc2CeDN for ; Tue, 1 Oct 2024 12:54:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1727780072; bh=MLmb6oiYIP5wqiH2wh1N2OeOeLV1DDDCzXYCnLf70tw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=FMvP2NAUgQwcrvvZyGtmTF2qj9IHxtFrFh/43aM8hKiB/ST2rQzcexRayHTf/djqr rAc9o2ogDQwHXxQN2BHtFcwKWlFfVx3sJ0oQ2c/trfIV4hVEPQ3Q31NzHmjHkC7Omk gvoXqniOA2f8yaDH7AuMgcJgqHrpPIRH0jn2d3TwDTqHhJxa29V4zxrvlG6nJYUbpK gsIcNNwk78A34z5CtI1jzBaeqr/QMxpsITuOH9+Gpcp5MmkmA+QKqiOtqfPpDuiAOT zHgWJgVXN0FMBfVujv89f3SD+Xmjdz3PrxrcypBM/Bmv++iSVA0i55Jdy4gzvjqvhz agu18StSjFiLw== 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 E2BD74E1E for ; Tue, 1 Oct 2024 12:54:32 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 50A6F3A2668 for ; Tue, 01 Oct 2024 12:54:26 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Tue, 1 Oct 2024 12:54:18 +0200 Message-ID: <20241001105421.28967-13-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241001105421.28967-1-anton@khirnov.net> References: <20241001105421.28967-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 13/16] lavfi/src_movie: switch to query_func2() 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: qMxvyR+xG9Vk --- libavfilter/src_movie.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/libavfilter/src_movie.c b/libavfilter/src_movie.c index e7817c7ee7..65091b65f0 100644 --- a/libavfilter/src_movie.c +++ b/libavfilter/src_movie.c @@ -411,34 +411,36 @@ static av_cold void movie_uninit(AVFilterContext *ctx) avformat_close_input(&movie->format_ctx); } -static int movie_query_formats(AVFilterContext *ctx) +static int movie_query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { - MovieContext *movie = ctx->priv; + const MovieContext *movie = ctx->priv; int list[] = { 0, -1 }; AVChannelLayout list64[] = { { 0 }, { 0 } }; int i, ret; for (i = 0; i < ctx->nb_outputs; i++) { - MovieStream *st = &movie->st[i]; - AVCodecParameters *c = st->st->codecpar; - AVFilterLink *outlink = ctx->outputs[i]; + const MovieStream *st = &movie->st[i]; + const AVCodecParameters *c = st->st->codecpar; + AVFilterFormatsConfig *cfg = cfg_out[i]; switch (c->codec_type) { case AVMEDIA_TYPE_VIDEO: list[0] = c->format; - if ((ret = ff_formats_ref(ff_make_format_list(list), &outlink->incfg.formats)) < 0) + if ((ret = ff_formats_ref(ff_make_format_list(list), &cfg->formats)) < 0) return ret; break; case AVMEDIA_TYPE_AUDIO: list[0] = c->format; - if ((ret = ff_formats_ref(ff_make_format_list(list), &outlink->incfg.formats)) < 0) + if ((ret = ff_formats_ref(ff_make_format_list(list), &cfg->formats)) < 0) return ret; list[0] = c->sample_rate; - if ((ret = ff_formats_ref(ff_make_format_list(list), &outlink->incfg.samplerates)) < 0) + if ((ret = ff_formats_ref(ff_make_format_list(list), &cfg->samplerates)) < 0) return ret; list64[0] = c->ch_layout; if ((ret = ff_channel_layouts_ref(ff_make_channel_layout_list(list64), - &outlink->incfg.channel_layouts)) < 0) + &cfg->channel_layouts)) < 0) return ret; break; } @@ -681,7 +683,7 @@ const AVFilter ff_avsrc_movie = { .init = movie_common_init, .activate = activate, .uninit = movie_uninit, - FILTER_QUERY_FUNC(movie_query_formats), + FILTER_QUERY_FUNC2(movie_query_formats), .inputs = NULL, .outputs = NULL, @@ -701,7 +703,7 @@ const AVFilter ff_avsrc_amovie = { .init = movie_common_init, .activate = activate, .uninit = movie_uninit, - FILTER_QUERY_FUNC(movie_query_formats), + FILTER_QUERY_FUNC2(movie_query_formats), .inputs = NULL, .outputs = NULL, From patchwork Tue Oct 1 10:54:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51975 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:cb8a:0:b0:48e:c0f8:d0de with SMTP id d10csp296409vqv; Tue, 1 Oct 2024 07:01:17 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVaKSgatebCOkGpy9rLu1fZUby+GgHzKmuPdQkQEWqfalxJ3M9AnlLF+N9spyfCh8fVyDdYv0FBvnpyaTL6y0S5@gmail.com X-Google-Smtp-Source: AGHT+IHlZf7oJntiFSqoNmgncU2z0FgBOqqkh3TT2M6B7FeVvR6fEXUKZ8SKsY2Iy8N7PvGS22IJ X-Received: by 2002:a17:907:26ce:b0:a8d:6921:e17d with SMTP id a640c23a62f3a-a93c492d4ecmr1863265766b.33.1727791277368; Tue, 01 Oct 2024 07:01:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727791277; cv=none; d=google.com; s=arc-20240605; b=AUimrA9yvJJ1KdDUWbxf6VUTz3YADzhTSbLKIPyQYp7oEmejj85gKqk0BILLm3nARE b7QXMwJPQ9G0PK76y0ulan63Bv/PPjGLw1Q9SLX94qV5tILaXBw90iF67a5N4F8XEDG+ OeXAvYuZF5n4iEeJgxGKnjtzwGZZKuiWvFOhZZx4HKss3tUUXUv6BDxswxCiRWK69Xiq KOIsVLwb5nhEZ/Nu00n3LJXAgD4lM/IkWZljg7Udx6PFWXNVIhwJliQw29N+SyVFmLJB CkeEVsjzfmyJf0QwTZra7N9koGMsRyYZqMiUnmgE9468xMcmUqa5hjmb6o986vWiF3Ch jLWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=FqqpjRvXXL6YDhqQSa/W90W2RSj6EA5+FGR3wl08o6A=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=ayH6an6+ZCZqRY5MIXQLRQDy0LgX/VX5G2jAcGVzjdszZ9nnqs6MXOWBCsl10akYFC inam2X0S0OrsAYOiULNWRw0nHBOuzBSDbQWG9o4EsyF+F+NTgVG0u1UdkRq/KNREnuzn VWHVAjkAJbl0ir5Jgc5MHzGiZaftiXXKDQwNIu3kW8Lp/prTzpHo1IQqhAJOFExehq2b HybLKmG7ll/IJ0Z1qr6OjHI6fFkzORHTo5YWSJXIxtMAFilglO9ojeM/JrNGQ8m7msXQ yWGWEPt8f97bywpY5NKo9/In6IZC1PyIDYlWNh26S93orqHyvBZDSmDLfFRQcMT1VOAV lEyg==; 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=VDyoxOYf; 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 a640c23a62f3a-a93c29e6437si765896566b.523.2024.10.01.07.01.16; Tue, 01 Oct 2024 07:01:17 -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=VDyoxOYf; 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 6BE0868DC1A; Tue, 1 Oct 2024 13:54:49 +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 DD45468DB84 for ; Tue, 1 Oct 2024 13:54: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=VDyoxOYf; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 6799F4E16 for ; Tue, 1 Oct 2024 12:54:35 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id Ll_APwGacljL for ; Tue, 1 Oct 2024 12:54:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1727780072; bh=zUgYtvnm4zxwmsH5Qc2AgYwG5429k6aQeQBimGNqQZU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=VDyoxOYfItr9Geg4ATvB70wxiYANIYfOiGuC2WkTbLu/b5bGDBpkxRHopsxin2BQc 4Sz/0CiDdjhU1YCQZ/AsAtImGCF4eXDAC8oJ/+S6XNOU5oxYl1efeqjKh8vFpxAqI7 lTDuK7eDWmm0WlYNFYruqxcdxZrBfkiHwVAKsDXeMYZlqedmAAEX+f3xR8p4G6Fum/ cKQCKqHIj6MphYphCRRoFD3AUChHDFVQNIacB6xo/PqTkv4TKhf4XHkWynSMZgszOM NINy5Ebscd7dHKtPG3NQDZf8S5YyJuPiGIkTNKKNDjsxKZj/cM8mITs6VH7ehy2Qir NH5FGfCA6zXRA== 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 DEDAC4E1A for ; Tue, 1 Oct 2024 12:54:32 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 5C6FB3A2690 for ; Tue, 01 Oct 2024 12:54:26 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Tue, 1 Oct 2024 12:54:19 +0200 Message-ID: <20241001105421.28967-14-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241001105421.28967-1-anton@khirnov.net> References: <20241001105421.28967-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 14/16] lavfi/vf_stack_{vaapi, qsv}: replace query_formats with a pixfmt list 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: AawtqrX0di9F --- libavfilter/stack_internal.c | 2 +- libavfilter/vf_stack_qsv.c | 17 ++++++----------- libavfilter/vf_stack_vaapi.c | 13 ++++--------- 3 files changed, 11 insertions(+), 21 deletions(-) diff --git a/libavfilter/stack_internal.c b/libavfilter/stack_internal.c index b473fa982d..fcec119bac 100644 --- a/libavfilter/stack_internal.c +++ b/libavfilter/stack_internal.c @@ -350,7 +350,7 @@ static const AVFilterPad stack_outputs[] = { .init = api##_stack_init, \ .uninit = api##_stack_uninit, \ .activate = stack_activate, \ - FILTER_QUERY_FUNC(api##_stack_query_formats), \ + FILTER_PIXFMTS_ARRAY(api ## _stack_pix_fmts), \ FILTER_OUTPUTS(stack_outputs), \ .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE, \ .flags = AVFILTER_FLAG_DYNAMIC_INPUTS | filter_flags, \ diff --git a/libavfilter/vf_stack_qsv.c b/libavfilter/vf_stack_qsv.c index 9c4ca4abd2..82fb3c09a3 100644 --- a/libavfilter/vf_stack_qsv.c +++ b/libavfilter/vf_stack_qsv.c @@ -223,17 +223,12 @@ static av_cold void qsv_stack_uninit(AVFilterContext *ctx) av_freep(&sctx->qsv_param.ext_buf); } -static int qsv_stack_query_formats(AVFilterContext *ctx) -{ - static const enum AVPixelFormat pixel_formats[] = { - AV_PIX_FMT_NV12, - AV_PIX_FMT_P010, - AV_PIX_FMT_QSV, - AV_PIX_FMT_NONE, - }; - - return ff_set_common_formats_from_list(ctx, pixel_formats); -} +static const enum AVPixelFormat qsv_stack_pix_fmts[] = { + AV_PIX_FMT_NV12, + AV_PIX_FMT_P010, + AV_PIX_FMT_QSV, + AV_PIX_FMT_NONE, +}; #include "stack_internal.c" diff --git a/libavfilter/vf_stack_vaapi.c b/libavfilter/vf_stack_vaapi.c index 602a7825a3..9ab4d8ab5b 100644 --- a/libavfilter/vf_stack_vaapi.c +++ b/libavfilter/vf_stack_vaapi.c @@ -220,15 +220,10 @@ static av_cold void vaapi_stack_uninit(AVFilterContext *avctx) av_freep(&sctx->rects); } -static int vaapi_stack_query_formats(AVFilterContext *avctx) -{ - static const enum AVPixelFormat pixel_formats[] = { - AV_PIX_FMT_VAAPI, - AV_PIX_FMT_NONE, - }; - - return ff_set_common_formats_from_list(avctx, pixel_formats); -} +static const enum AVPixelFormat vaapi_stack_pix_fmts[] = { + AV_PIX_FMT_VAAPI, + AV_PIX_FMT_NONE, +}; #include "stack_internal.c" From patchwork Tue Oct 1 10:54:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51967 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:cb8a:0:b0:48e:c0f8:d0de with SMTP id d10csp192178vqv; Tue, 1 Oct 2024 04:21:23 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXmdvFUoOzy/yB+BVKb5EhXcUT8VjW4aCYU0UUX9nv731yXdEs2+RBwY+aa/wifb9SBtfVOEO+1GJrPM5NW7KEf@gmail.com X-Google-Smtp-Source: AGHT+IEsAoa6gaZJLi84OYgxbu6wKuppXGID0fnFOv/W1ltxZB0CKuA/qI1sTm6czNXBwzxfIuzK X-Received: by 2002:a17:907:1c9d:b0:a8b:6ee7:ba12 with SMTP id a640c23a62f3a-a93c492f900mr1498958566b.27.1727781683586; Tue, 01 Oct 2024 04:21:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727781683; cv=none; d=google.com; s=arc-20240605; b=V9++l+e9lE59NovaqFeIixqX2BCM3MoAnh9Mgfq4hOxXR5gp5LkuTDWSTChJL1dRrE +/uP4fntI/Y4tbsym80TFgbKkf1V+PFsT0gJa+/vpGQNrQGgU3EQrJRscmHpX+Nqr0wf KUKpXIBswyik6i7634p6eUm0VHYiHWOgpHM5Zx6o0kIBqZMfoeW4hnty71Wfczv1k2PQ j+CNHs6MCnP6jqcpohtboN5Kr5FLlVkSaXIJ7XpGCMESUMX6Odzb3HezYzfcjtj7hu0w K2VqYBWqvalttFlgdcMA6hCj2QiLDDXpalkC9n2DkM4RwxLKmI7w2NfQ9UfF1PLV+9gv YW/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=ezwvILSft72JKdUEr0xymjCXITFFFCRBhsF+RVspFGs=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=YD3R4YKWvXAA93n04JOgbzd0DC53PSDD7lbH4zOO9Qdc7J4YEAy6lovFdkk2p0uIDL TSljD5YT+ur8qll3e2Edg3i9SCun22xl+S0JpYkg9u04Mkbf/QnwAeaOA9LDZV//JoLU WQJU4QHnUS9pFOOhH09VM8FGNC/pHAG2RIDSz8CWQSw93DDPsADQsk9/jiPljToteYCS Tx1FGPjgy1uz829mTd63wXaQvU//6gGD6lOjevOcw7oasZNi1OLXFYhbUTtdoU97hwHv BCpjw+Vabcu7vv2owTQe5pm2ws0jkeOqMvZwVkcBrCfsGc3Y8UUyGIbzSZlBI4WRoJMk jv7w==; 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=detIXLE9; 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 a640c23a62f3a-a93c29ee46csi742521966b.630.2024.10.01.04.21.21; Tue, 01 Oct 2024 04:21:23 -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=detIXLE9; 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 C2F2E68D9B9; Tue, 1 Oct 2024 13:54:52 +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 5C82D68DBB2 for ; Tue, 1 Oct 2024 13:54:41 +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=detIXLE9; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id B1CB74E13 for ; Tue, 1 Oct 2024 12:54:35 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id HgoAEJZDsnxH for ; Tue, 1 Oct 2024 12:54:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1727780072; bh=skzg0mxYZwbJgP02YU0Mk4/RtOiz+LVYbd3nmtExv4g=; h=From:To:Subject:Date:In-Reply-To:References:From; b=detIXLE9p92I5wekQO4fsk3EuQJ4h3yT2cRPBw4SdU10Pd7VQiV2CqT64khom+uz8 vegXd8G8s5FrZNLg6i6Vw2guNkxHDY9EW21674qaMLEOnTzlaFFeu1fYDAFeCv1MVi 3RYvNN8bIKE/wKwogBF683vVBXz5OwocVXjkr77WZBnKhdgsbSWYnUFXO+AXUk40l7 6IkKWvAJQDJbj+47hC+zyBAsCjfiz0cGqRwacn1b66TJppNtyrIjhWfbgpmLyJaif7 7QXs50frY9WOyyzP9HfC4Sym+fJDdLcHcp946VkkpwvlfmIfpxebQ3CnbT89OuDh5G A2/Fee3/vcczQ== 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 E792B4E20 for ; Tue, 1 Oct 2024 12:54:32 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 682883A272A for ; Tue, 01 Oct 2024 12:54:26 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Tue, 1 Oct 2024 12:54:20 +0200 Message-ID: <20241001105421.28967-15-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241001105421.28967-1-anton@khirnov.net> References: <20241001105421.28967-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 15/16] lavfi/vaf_spectrumsynth: switch to query_func2() 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: U4CAKUWUG4BW --- libavfilter/vaf_spectrumsynth.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/libavfilter/vaf_spectrumsynth.c b/libavfilter/vaf_spectrumsynth.c index a62151aa4f..c8d3525b7b 100644 --- a/libavfilter/vaf_spectrumsynth.c +++ b/libavfilter/vaf_spectrumsynth.c @@ -93,14 +93,18 @@ static const AVOption spectrumsynth_options[] = { AVFILTER_DEFINE_CLASS(spectrumsynth); -static int query_formats(AVFilterContext *ctx) +enum { + MAGNITUDE = 0, + PHASE = 1, +}; + +static int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { - SpectrumSynthContext *s = ctx->priv; + const SpectrumSynthContext *s = ctx->priv; AVFilterFormats *formats = NULL; AVFilterChannelLayouts *layout = NULL; - AVFilterLink *magnitude = ctx->inputs[0]; - AVFilterLink *phase = ctx->inputs[1]; - AVFilterLink *outlink = ctx->outputs[0]; static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }; static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVJ444P, @@ -108,28 +112,28 @@ static int query_formats(AVFilterContext *ctx) int ret, sample_rates[] = { 48000, -1 }; formats = ff_make_format_list(sample_fmts); - if ((ret = ff_formats_ref (formats, &outlink->incfg.formats )) < 0 || + if ((ret = ff_formats_ref (formats, &cfg_out[0]->formats )) < 0 || (ret = ff_add_channel_layout (&layout, &FF_COUNT2LAYOUT(s->channels))) < 0 || - (ret = ff_channel_layouts_ref (layout , &outlink->incfg.channel_layouts)) < 0) + (ret = ff_channel_layouts_ref (layout , &cfg_out[0]->channel_layouts)) < 0) return ret; sample_rates[0] = s->sample_rate; formats = ff_make_format_list(sample_rates); if (!formats) return AVERROR(ENOMEM); - if ((ret = ff_formats_ref(formats, &outlink->incfg.samplerates)) < 0) + if ((ret = ff_formats_ref(formats, &cfg_out[0]->samplerates)) < 0) return ret; formats = ff_make_format_list(pix_fmts); if (!formats) return AVERROR(ENOMEM); - if ((ret = ff_formats_ref(formats, &magnitude->outcfg.formats)) < 0) + if ((ret = ff_formats_ref(formats, &cfg_in[MAGNITUDE]->formats)) < 0) return ret; formats = ff_make_format_list(pix_fmts); if (!formats) return AVERROR(ENOMEM); - if ((ret = ff_formats_ref(formats, &phase->outcfg.formats)) < 0) + if ((ret = ff_formats_ref(formats, &cfg_in[PHASE]->formats)) < 0) return ret; return 0; @@ -543,6 +547,6 @@ const AVFilter ff_vaf_spectrumsynth = { .priv_size = sizeof(SpectrumSynthContext), FILTER_INPUTS(spectrumsynth_inputs), FILTER_OUTPUTS(spectrumsynth_outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .priv_class = &spectrumsynth_class, }; From patchwork Tue Oct 1 10:54:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51959 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:cb8a:0:b0:48e:c0f8:d0de with SMTP id d10csp182680vqv; Tue, 1 Oct 2024 04:06:13 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXywfLgup4Mb46sGra2wAnCIHuUMfK3Vv2vmGehYO2nQHx06yQjzKsOs24FvUzsI4V/BjDxYKjklAaAAWYQ28cm@gmail.com X-Google-Smtp-Source: AGHT+IH1ljB/6LuJkh7fCtO7p+cMAMkXZCCCG+vCBIT2WrlUCCZah14WlLw9uIoIFma5B+6KWtXD X-Received: by 2002:a17:906:4fcb:b0:a8d:5d28:8e0d with SMTP id a640c23a62f3a-a93c4a84fe1mr1585572466b.45.1727780773141; Tue, 01 Oct 2024 04:06:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727780773; cv=none; d=google.com; s=arc-20240605; b=gyP6XPeJiGT+R5U6VkwaT4anekYQSwaEvB+C0IDEpV6kjxmB4XMHQvx5wj/GXB1kda e6X3Iz10Cr9qr8Wz6o6eR+CCuFmHGrxlAtWW0O9v7XrDSlu429tObq6vxseEp1nlHNNH 8JkypLy4PpkgOXR44Y3zbPtAR/cihojYDURpPkdjjTgpyng1x4iRwpkf0OKtBOEGOK6U zeqdtIg+V8gyYzhtU+MmdQEtAI3AMM7/icEu0dAU95Hs8wkwcSc7lQj/2B2xVPyAo05M EnQymEyNy9vnxKlOaZtc8IhBqLyzTwF1MQWs7WzFMKrqNutFuG+vNbA7fA5HtHoiElVH cwJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=6J2yO6QlQ61y2gm+43iik6KrWKA88BJsVlV57i2kFr8=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=QeYj+imhhhskHFnr81y1sZoE9JB7qKYJVoTYCUOYZfRlxOd/NWEgs2kXrEY8GsH+Tu wTasFzqichOyDvYkt8VJPm9IQcbDtUm4VPTmzH303ByP3h4escywLEOaXAEFok9OevTC 2CWqcuLi9YgND0lVdzAZB0c5WqUjfdnLOuwRo5l1sdD0LDEd5JwT5bCdsaGeUVKJvn74 vL7yleAx+luGB9YmUQWE8SgwxrelhtQbue2METspj6cFs3/g1/TV7Ui4F8DvKR+DkmC9 PE90ON3uYT0N6eIikFKkNb8DmqCQ5e51uSAm80E64xup5Pt970qyNjmP9tNUEEufxFvw tLKA==; 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=hY1JDtuf; 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 a640c23a62f3a-a93c2a2c437si736051866b.857.2024.10.01.04.06.12; Tue, 01 Oct 2024 04:06:13 -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=hY1JDtuf; 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 24FFA68DCB7; Tue, 1 Oct 2024 13:54:56 +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 847F668DBEC for ; Tue, 1 Oct 2024 13:54:41 +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=hY1JDtuf; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 1ABE64E14 for ; Tue, 1 Oct 2024 12:54:36 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id fOtcD_hbtar9 for ; Tue, 1 Oct 2024 12:54:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1727780072; bh=I66CMqQw7bmgrCOZBzl5Ywydquvsaq5Jz0bA4v/YFdY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=hY1JDtufFGjmO9JX1+vvg8QBpTVAk61Eh/A3Aj7D5x39VYE3YNxLxfvYzi0ANjDjY SrWgUkfp3G+B//uyl110U3POjMqUIuMBkT+cizbrVuhNyGu2BUvz5KHLnIbOV1BGEK BlOt/GfaLRGVIbQ8XG6E6Xm72My/6zblPcbNzr9EMyRv6Nf7wVypSgEttZffYaM68J BuOinOj8GUHuxEe1aO9SXp02+cG9A/Wv14U8GDwLO1THBw+VkxLpDQ68cFkaDHTYI+ USIIXAcLGqmi6DlaPYPumkpuA11R3uFgAXJFyAK7Aaf0Cy19QXjczqxZCSVMe06l8T KNJZZXytmnHNQ== 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 E14764E1B for ; Tue, 1 Oct 2024 12:54:32 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 73DC73A275A for ; Tue, 01 Oct 2024 12:54:26 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Tue, 1 Oct 2024 12:54:21 +0200 Message-ID: <20241001105421.28967-16-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241001105421.28967-1-anton@khirnov.net> References: <20241001105421.28967-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 16/16] lavfi/vsrc_testsrc: switch to query_func2() 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: L53+b2cLdUH3 --- libavfilter/vsrc_testsrc.c | 47 +++++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/libavfilter/vsrc_testsrc.c b/libavfilter/vsrc_testsrc.c index f14e36a95b..b004d2d0e0 100644 --- a/libavfilter/vsrc_testsrc.c +++ b/libavfilter/vsrc_testsrc.c @@ -246,9 +246,11 @@ static av_cold int color_init(AVFilterContext *ctx) return init(ctx); } -static int color_query_formats(AVFilterContext *ctx) +static int color_query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { - return ff_set_common_formats(ctx, ff_draw_supported_pixel_formats(0)); + return ff_set_common_formats2(ctx, cfg_in, cfg_out, ff_draw_supported_pixel_formats(0)); } static int color_config_props(AVFilterLink *inlink) @@ -303,7 +305,7 @@ const AVFilter ff_vsrc_color = { .activate = activate, .inputs = NULL, FILTER_OUTPUTS(color_outputs), - FILTER_QUERY_FUNC(color_query_formats), + FILTER_QUERY_FUNC2(color_query_formats), .process_command = color_process_command, }; @@ -927,9 +929,11 @@ static av_cold int test2_init(AVFilterContext *ctx) return init(ctx); } -static int test2_query_formats(AVFilterContext *ctx) +static int test2_query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { - return ff_set_common_formats(ctx, ff_draw_supported_pixel_formats(0)); + return ff_set_common_formats2(ctx, cfg_in, cfg_out, ff_draw_supported_pixel_formats(0)); } static int test2_config_props(AVFilterLink *inlink) @@ -964,7 +968,7 @@ const AVFilter ff_vsrc_testsrc2 = { .activate = activate, .inputs = NULL, FILTER_OUTPUTS(avfilter_vsrc_testsrc2_outputs), - FILTER_QUERY_FUNC(test2_query_formats), + FILTER_QUERY_FUNC2(test2_query_formats), }; #endif /* CONFIG_TESTSRC2_FILTER */ @@ -1410,7 +1414,9 @@ static const enum AVPixelFormat smptebars_pix_fmts[] = { AV_PIX_FMT_NONE, }; -static int smptebars_query_formats(AVFilterContext *ctx) +static int smptebars_query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { enum AVColorSpace csp; int ret; @@ -1421,11 +1427,13 @@ static int smptebars_query_formats(AVFilterContext *ctx) csp = AVCOL_SPC_BT470BG; } - if ((ret = ff_set_common_color_spaces(ctx, ff_make_formats_list_singleton(csp)))) + if ((ret = ff_set_common_color_spaces2(ctx, cfg_in, cfg_out, + ff_make_formats_list_singleton(csp)))) return ret; - if ((ret = ff_set_common_color_ranges(ctx, ff_make_formats_list_singleton(AVCOL_RANGE_MPEG)))) + if ((ret = ff_set_common_color_ranges2(ctx, cfg_in, cfg_out, + ff_make_formats_list_singleton(AVCOL_RANGE_MPEG)))) return ret; - return ff_set_common_formats_from_list(ctx, smptebars_pix_fmts); + return ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, smptebars_pix_fmts); } AVFILTER_DEFINE_CLASS_EXT(palbars, "pal(75|100)bars", options); @@ -1468,7 +1476,7 @@ const AVFilter ff_vsrc_pal75bars = { .activate = activate, .inputs = NULL, FILTER_OUTPUTS(outputs), - FILTER_QUERY_FUNC(smptebars_query_formats), + FILTER_QUERY_FUNC2(smptebars_query_formats), }; #endif /* CONFIG_PAL75BARS_FILTER */ @@ -1509,7 +1517,7 @@ const AVFilter ff_vsrc_pal100bars = { .activate = activate, .inputs = NULL, FILTER_OUTPUTS(outputs), - FILTER_QUERY_FUNC(smptebars_query_formats), + FILTER_QUERY_FUNC2(smptebars_query_formats), }; #endif /* CONFIG_PAL100BARS_FILTER */ @@ -1574,7 +1582,7 @@ const AVFilter ff_vsrc_smptebars = { .activate = activate, .inputs = NULL, FILTER_OUTPUTS(outputs), - FILTER_QUERY_FUNC(smptebars_query_formats), + FILTER_QUERY_FUNC2(smptebars_query_formats), }; #endif /* CONFIG_SMPTEBARS_FILTER */ @@ -1675,7 +1683,7 @@ const AVFilter ff_vsrc_smptehdbars = { .activate = activate, .inputs = NULL, FILTER_OUTPUTS(outputs), - FILTER_QUERY_FUNC(smptebars_query_formats), + FILTER_QUERY_FUNC2(smptebars_query_formats), }; #endif /* CONFIG_SMPTEHDBARS_FILTER */ @@ -2193,12 +2201,15 @@ static const enum AVPixelFormat zoneplate_pix_fmts[] = { AV_PIX_FMT_NONE, }; -static int zoneplate_query_formats(AVFilterContext *ctx) +static int zoneplate_query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { int ret; - if ((ret = ff_set_common_color_ranges(ctx, ff_make_formats_list_singleton(AVCOL_RANGE_JPEG)))) + if ((ret = ff_set_common_color_ranges2(ctx, cfg_in, cfg_out, + ff_make_formats_list_singleton(AVCOL_RANGE_JPEG)))) return ret; - return ff_set_common_formats_from_list(ctx, zoneplate_pix_fmts); + return ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, zoneplate_pix_fmts); } static const AVFilterPad avfilter_vsrc_zoneplate_outputs[] = { @@ -2219,7 +2230,7 @@ const AVFilter ff_vsrc_zoneplate = { .activate = activate, .inputs = NULL, FILTER_OUTPUTS(avfilter_vsrc_zoneplate_outputs), - FILTER_QUERY_FUNC(zoneplate_query_formats), + FILTER_QUERY_FUNC2(zoneplate_query_formats), .flags = AVFILTER_FLAG_SLICE_THREADS, .process_command = ff_filter_process_command, };