From patchwork Tue Oct 8 11:28:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul B Mahol X-Patchwork-Id: 15571 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 5CCCD44A989 for ; Tue, 8 Oct 2019 14:35:14 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 490BD688050; Tue, 8 Oct 2019 14:35:14 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2403C687F68 for ; Tue, 8 Oct 2019 14:35:08 +0300 (EEST) Received: by mail-wm1-f68.google.com with SMTP id f22so2757737wmc.2 for ; Tue, 08 Oct 2019 04:35:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=La0/rlcv7zTOg7Tw9skShqMBgaDW8LUMi30CursrcFw=; b=Kzxn7ATzWkTx3iWsu7ARJSV6WJuJgt7mXFEhWoJAIDUUhGAHfKr1z3g1GcUYuDbW04 9eol3EeQDg3c5hKkz8JtwRZjWbe/cdmNKgUvS6K4dw1U8OdFbiAB3BeaZ8TUE5aQZv8n Ncwc6iuYwTtXlEUjIz+Toxb82htuGoo6xmNuElWhljOrlPOLgbMe6GQ/2b0QnMAFufNO tp3u74k7oxGq5gPu6oZQ/SEr5j9i1DweExrZarhylTU2XfEX1nfzC2BopikA79N8+yeA jEKjL5iGBFjlTNtzlODorzEdpCHni0UAbTCc93axWYrS7sUc6/DAUj7IIzCHnhzHKhSC e5KA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=La0/rlcv7zTOg7Tw9skShqMBgaDW8LUMi30CursrcFw=; b=OEVclvNV6VAj14vztKPPJqx6k02UNZD8nMvdfDliLZ2lkdsYA7AAlG1xECPGtw0FwT m+cJlG1Bq2IM4KQW+yiAN1C8cBNqqTD5P7dGDLE9qjLLNt1CH6llVzN/XQl0Hipt8c9P o2ebLiq+f0wDFYVfqJzQ51SC7EnhiDX9VbaLnq4Jlo1nQR5YGr52qw60yIn+OHwhSyEO TPivjHVDvoNpEStFV3y2CHcuu0ZI7uq0mFheRMx8/ojn9dPjdi/pedxV8/4RXneLULcx ni7QDMRv5ozurwugfYgknsl1yeFATRwR2Owxp86a8M57nnlzjNXS7/cpR94yE2+UpEu1 PguA== X-Gm-Message-State: APjAAAWXTajfeMXsrlLWkk7FV797PWKgqNDUWlZj1svJnEI6S3ZK6FDE V4m+h87wzy9xlvtuT5dThiXdFC2R X-Google-Smtp-Source: APXvYqxNjkKmqA3tUQk64KQMsDB2q9Iux0fGoEMBwZw2NfblAw8NXcHjVQtSK1TWi76vr3oHWIfi0A== X-Received: by 2002:a7b:cc97:: with SMTP id p23mr3495419wma.111.1570534140686; Tue, 08 Oct 2019 04:29:00 -0700 (PDT) Received: from localhost.localdomain ([109.227.61.240]) by smtp.gmail.com with ESMTPSA id r2sm17198024wrm.3.2019.10.08.04.28.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Oct 2019 04:29:00 -0700 (PDT) From: Paul B Mahol To: ffmpeg-devel@ffmpeg.org Date: Tue, 8 Oct 2019 13:28:41 +0200 Message-Id: <20191008112843.6875-6-onemda@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191008112843.6875-1-onemda@gmail.com> References: <20191008112843.6875-1-onemda@gmail.com> Subject: [FFmpeg-devel] [PATCH 6/8] avfilter/vf_avgblur: switch to ff_filter_process_command() X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Paul B Mahol --- libavfilter/vf_avgblur.c | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/libavfilter/vf_avgblur.c b/libavfilter/vf_avgblur.c index a1f6c9b80e..0857d11878 100644 --- a/libavfilter/vf_avgblur.c +++ b/libavfilter/vf_avgblur.c @@ -46,7 +46,7 @@ typedef struct AverageBlurContext { } AverageBlurContext; #define OFFSET(x) offsetof(AverageBlurContext, x) -#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM +#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_COMMAND_PARAM static const AVOption avgblur_options[] = { { "sizeX", "set horizontal size", OFFSET(radius), AV_OPT_TYPE_INT, {.i64=1}, 1, 1024, FLAGS }, @@ -287,22 +287,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) return ff_filter_frame(outlink, out); } -static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, - char *res, int res_len, int flags) -{ - AverageBlurContext *s = ctx->priv; - int ret = 0; - - if ( !strcmp(cmd, "sizeX") || !strcmp(cmd, "sizeY") - || !strcmp(cmd, "planes")) { - av_opt_set(s, cmd, args, 0); - } else { - ret = AVERROR(ENOSYS); - } - - return ret; -} - static av_cold void uninit(AVFilterContext *ctx) { AverageBlurContext *s = ctx->priv; @@ -338,5 +322,5 @@ AVFilter ff_vf_avgblur = { .inputs = avgblur_inputs, .outputs = avgblur_outputs, .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS, - .process_command = process_command, + .process_command = ff_filter_process_command, };