From patchwork Mon Jan 9 07:12:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xiang, Haihao" X-Patchwork-Id: 39932 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:bc95:b0:ad:ade2:bfd2 with SMTP id fx21csp2884243pzb; Sun, 8 Jan 2023 23:13:11 -0800 (PST) X-Google-Smtp-Source: AMrXdXut/pAiHkx396cD/w2I6+ABWgSGQ2QwVVYXtOVaZI33BtQydtidp/20N2cMzDleCwHnXach X-Received: by 2002:a17:907:6d13:b0:7c0:db53:c599 with SMTP id sa19-20020a1709076d1300b007c0db53c599mr63269775ejc.22.1673248391200; Sun, 08 Jan 2023 23:13:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673248391; cv=none; d=google.com; s=arc-20160816; b=p++zJYUlMWx0BUbu6UyQGH/V3NDcRtPhNUlz0t3jnhwQmua+ubeVeEH5yKQPpf2//N Y3MhE4evwwtNX4LrFlQc8WDizZHyNs7tVVlvZTALELRTpn+06z+W0evvhQ2n1D8mkjod y2Kb+F91ZN5k7lUld0W2oXj613jOHclHoEuJ0yMqYgdP0NdjCmt4u0snEN4W8qMC0Z47 NnpaXHpKhUmTMEZu8MqcXAFHlLgMjIvldFDPmcZ4w2BzZYE5mnUmqdPIO5Z8cTUSsNBq rJn0fAlKM3pTqEEWAGWJmdNfa6lrm70rC//5RXNnTfy4y1Y/91dcbs4vgsuhPPW+JCcY VuIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc: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=ypBbY7cis09mJMUyBsne5mnXXp6hHp6RGumVrZbI/0A=; b=CiLiipdi3QnajX6sUxvvprN0DlQMwHWSoPCcmCK5EGiHu5VR+0bk1YfATssFy6nG9E TprA6TX/6uZ/AxPUHFA4nkkzRXDLYV2P21D2ZPcVrncaKatyQS9my9tMizs6opJBcNio N4ezDV2mWilnDAxTQzbgN5e+wY/2/dL2otoCyYcSvJp9+5auBCiXE6zCglvCVM7bx7bN qg5S6D0v1FwihTCpIAY+M9VUUebcb9dK2RtR+nRt+CcRziTn06q30LoLlaQIV8CnljO8 1ATwi6sz2lTGokRzneqdhADhI7GBgnOJCsM7KpnnjFAhXYvB4G2Qcz3F8OZQS5ou2Bx7 +fnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel.com header.s=Intel header.b=A99verBJ; 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 wz7-20020a170906fe4700b00829cbd5f6f2si7183653ejb.498.2023.01.08.23.13.09; Sun, 08 Jan 2023 23:13:11 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel.com header.s=Intel header.b=A99verBJ; 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 0BAEC68BC2A; Mon, 9 Jan 2023 09:12:43 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 804B568BBA3 for ; Mon, 9 Jan 2023 09:12:35 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673248360; x=1704784360; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vDjfcHGK7PRH3s+oPg5+sd9llDzE9Y6OGGraCdIE4tw=; b=A99verBJacbndonfSY5PjxD8QXRsYnKGBeNYwdGPAZ7NUdCCp5PUKFbe 314g8EZZMbI/SaGDNfUd9yvTd9LaId+JL4zikphGVBv1c54yTotHVXOIL rW0w6AAN+fpsoBLCGZ+koQQLHTV5ALlRGQbmODQg6vP8bexso4cZtW5Ss vfkP4LU9Uz4jEZHqi+tuUm2TKnNIU5DwaqY9QS6CWwSn1LEdwmQQI6X4H QUs48Hdy6+dg+OCHP9IaD4xhytsuTDR5oXew96aB10KbMVMesJUKk98/R OtS2ZXP2Tu89hcGryEmUIXz7h5id1X8o7mZNDCB+NzWU+9DArc1rC4pzm g==; X-IronPort-AV: E=McAfee;i="6500,9779,10584"; a="385110843" X-IronPort-AV: E=Sophos;i="5.96,311,1665471600"; d="scan'208";a="385110843" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jan 2023 23:12:29 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10584"; a="745262802" X-IronPort-AV: E=Sophos;i="5.96,311,1665471600"; d="scan'208";a="745262802" Received: from xhh-tgl64.sh.intel.com ([10.238.2.19]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jan 2023 23:12:28 -0800 From: "Xiang, Haihao" To: ffmpeg-devel@ffmpeg.org Date: Mon, 9 Jan 2023 15:12:06 +0800 Message-Id: <20230109071210.1829699-4-haihao.xiang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230109071210.1829699-1-haihao.xiang@intel.com> References: <20230109071210.1829699-1-haihao.xiang@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/8] lavfi/vf_vpp_qsv: add vpp_preinit 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 Cc: Haihao Xiang Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: W+EkD52dqo5W From: Haihao Xiang Set the expected default value for options in this callback, hence we have the right values even if these options are not included in the option arrray. This is in preparation for reusing the code for other QSV filters. Signed-off-by: Haihao Xiang --- libavfilter/vf_vpp_qsv.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c index cf11cd7fdc..2a7b06fa33 100644 --- a/libavfilter/vf_vpp_qsv.c +++ b/libavfilter/vf_vpp_qsv.c @@ -259,6 +259,19 @@ release: return ret; } +static av_cold int vpp_preinit(AVFilterContext *ctx) +{ + VPPContext *vpp = ctx->priv; + /* For AV_OPT_TYPE_STRING options, NULL is handled in other way so + * we needn't set default value here + */ + vpp->saturation = 1.0; + vpp->contrast = 1.0; + vpp->transpose = -1; + + return 0; +} + static av_cold int vpp_init(AVFilterContext *ctx) { VPPContext *vpp = ctx->priv; @@ -683,6 +696,7 @@ const AVFilter ff_vf_vpp_qsv = { .name = "vpp_qsv", .description = NULL_IF_CONFIG_SMALL("Quick Sync Video VPP."), .priv_size = sizeof(VPPContext), + .preinit = vpp_preinit, .init = vpp_init, .uninit = vpp_uninit, FILTER_INPUTS(vpp_inputs),