From patchwork Thu Jul 29 05:24:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xiang, Haihao" X-Patchwork-Id: 29125 Delivered-To: andriy.gelman@gmail.com Received: by 2002:a05:6902:1243:0:0:0:0 with SMTP id t3csp144604ybu; Wed, 28 Jul 2021 22:29:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOG7JDcYIJCdI/auNpqdWHj3mjc6dsp4xJJdlTBk+/HcmLl9hUdvQmoiqfPDA24/dQ/p6F X-Received: by 2002:a05:6402:1d0d:: with SMTP id dg13mr4008484edb.312.1627536557822; Wed, 28 Jul 2021 22:29:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627536557; cv=none; d=google.com; s=arc-20160816; b=P0n9h1L0Tc/FYveRiYdpTzZ+kuizEBNf+oUaGL5bOCTv4/bJtFG87HaQ7GnwjWCIp5 rtNyF/VPhNqMi9mT1f+/r2iR7N1FfzFMh+hN4v2HphUgklWdt6zRGZ5i24CegrgZwQgg NzmO+QsYxbHpgnn85mxm274uIVYY2D+kM2eCaex1tqm2HF/MCcBGAMSFEFbSA9OasPHi LoYYwEG7vHF98ElruTW6+p3h7sdDOU1Kh2j48GVrRrklNdejxpRg8UHmsX4XzWNYEs/m dNHuqFnE6ejDno7nI3RL4QndA9jzp5eKSM3UB7ywizvZHsMff4O2miqPZ/sUaqfs81Dh Ichg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:delivered-to; bh=mZaPQYmMflsB2DOLdDJMQvH0LaeX2n4rv1Ul9e2CrvA=; b=yEolwAI+VrZICdnhaRpvp/qN1SRkAgv8qOMGZNme0I9jVgdwBPEyxqtXSIDXJn1IpM R3PL4J0QnyTmuIDbKHqWZTgyeC3NTAQe44btuT8JOhjSOBHzDM8qjAjUGSR4Ymtph29X orD4ro7JtxmucDMSvQX1iV4JMmMiJQ5P4eKopuPcZdpb1HQ7Wr8NHyZQlaDMvmzu48D+ m5YMBnGXgK6+deJJPfO5yF2ECukGaACTwqqTMw5T7CgBtufHtxk/rEMq6FXiuV1sE8eY /R7v8nfNqbFgt711HKA4X4jpd+Jl504IJnSN03Sqx42HtiyVu9l/5Rqm3Ute2eLIhBC5 fKaA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id h23si1849638ejq.337.2021.07.28.22.29.17; Wed, 28 Jul 2021 22:29: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; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4FB5E68A5C2; Thu, 29 Jul 2021 08:26:29 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2910768A4B0 for ; Thu, 29 Jul 2021 08:26:17 +0300 (EEST) X-IronPort-AV: E=McAfee;i="6200,9189,10059"; a="200023645" X-IronPort-AV: E=Sophos;i="5.84,278,1620716400"; d="scan'208";a="200023645" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jul 2021 22:25:55 -0700 X-IronPort-AV: E=Sophos;i="5.84,278,1620716400"; d="scan'208";a="456730109" Received: from xhh-dg164.sh.intel.com ([10.239.159.167]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jul 2021 22:25:54 -0700 From: Haihao Xiang To: ffmpeg-devel@ffmpeg.org Date: Thu, 29 Jul 2021 13:24:57 +0800 Message-Id: <20210729052509.30992-10-haihao.xiang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210729052509.30992-1-haihao.xiang@intel.com> References: <20210729052509.30992-1-haihao.xiang@intel.com> Subject: [FFmpeg-devel] [PATCH v4 09/21] lavfi/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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 0oi3JQIuRe/4 Content-Length: 1563 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 re-using VPPContext but with a different option array for other QSV filters --- 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 96908556f9..8b18cc296c 100644 --- a/libavfilter/vf_vpp_qsv.c +++ b/libavfilter/vf_vpp_qsv.c @@ -255,6 +255,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; @@ -636,6 +649,7 @@ const AVFilter ff_vf_vpp_qsv = { .description = NULL_IF_CONFIG_SMALL("Quick Sync Video VPP."), .priv_size = sizeof(VPPContext), .query_formats = query_formats, + .preinit = vpp_preinit, .init = vpp_init, .uninit = vpp_uninit, .inputs = vpp_inputs,