From patchwork Mon May 17 03:24:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xiang, Haihao" X-Patchwork-Id: 27801 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:b214:0:0:0:0:0 with SMTP id b20csp2457499iof; Sun, 16 May 2021 20:29:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9kWO3/sbiOZTubzv8smDzijCdi1/XaUyVeyeVsBMQOc4Jo/+eYktU6YYsUj6CoK4U61D8 X-Received: by 2002:a05:6402:12cf:: with SMTP id k15mr69078239edx.130.1621222175757; Sun, 16 May 2021 20:29:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621222175; cv=none; d=google.com; s=arc-20160816; b=gkSpjAlwfXw4F/Rpaj5Zq7yb5eiDXZeEUlmpfgmCk1S1B7bY4Opt3SK4inzNpp2r6X fiGvKhmqNqgf945UiUJwySpiXC5CU4OUHCJUNVdO9ym95xPvmTJDILpNmp/Upa2XCDHY hyL68mUp0s8tLpv/mTTRENTF3YhxMn6QHrjbkwejkvD1UVQ1y8ISZkPBbBRHEopnwyhS aVFlJl7VBD+WYRPWosptBSWOe/HTimrHJeD6cDi1915B9api260PPV1cTzWpx+ChZ5ZV Bj4fJp6OjmxydYCcxG+pdMtHiQ9m0wcsFZgiuuZpSRaegUGe2rimn8pR+8XSGQO50WQ3 ilFg== 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:ironport-sdr:ironport-sdr:delivered-to; bh=Z2YgO9VBeiW4AQYjIzia+71C4ItfNoltX7EIHz4gr7c=; b=sw+zdU4dOcHYGcIo6PB+/LLAKsXX1vsqKLi9gzyDV5ccg4j8kDYXfBrv+kKYfwA5Hq qzkNx62JPFvtXLOgK460r2wthJBkNVaBw4fy2KgbUdjUxAHkInuqnjY88VY/e9aUXnNZ kRuZEIqTj2rduXi1nTIFXlgqM91OQ3OrvqDFCa8xXT4Ojilpb4oE3v2QNqTayEP7RU44 lCTP7qKrIMPvZP5s1Fs+a4oijTy1eu107lzE76tCeCZdsYy27PPJ3b5WVpEqZB38mZEI m4uYx99qujhEAQnXFLBQdfy7jxKaO7pyYCla7LlAMHX7oo8WQ0c15lhXopQXOztzUTNO ogGw== 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 o6si15228876edi.18.2021.05.16.20.29.35; Sun, 16 May 2021 20:29:35 -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 33C4C6897BB; Mon, 17 May 2021 06:28:30 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CE5016897E8 for ; Mon, 17 May 2021 06:28:26 +0300 (EEST) IronPort-SDR: FedbemoFdP9wu3WwO0S/yqn0WHRdDlcxMVCbilzHLgFF2zcTi1SEZ45uobxI+emJfF7eoiZX4R NhM1UP2UOHkg== X-IronPort-AV: E=McAfee;i="6200,9189,9986"; a="187498239" X-IronPort-AV: E=Sophos;i="5.82,306,1613462400"; d="scan'208";a="187498239" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 May 2021 20:28:12 -0700 IronPort-SDR: Scksvzy/J+0cSEXpWvh0KzjzRPjDc6F+kyU9Sd3ypuIRUsevOgUMwIdovCl8+isoSUtDEBHp7e 0y2jGys5WL6Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,306,1613462400"; d="scan'208";a="626277652" Received: from xhh-tgl64.sh.intel.com ([10.239.159.130]) by fmsmga006.fm.intel.com with ESMTP; 16 May 2021 20:28:12 -0700 From: Haihao Xiang To: ffmpeg-devel@ffmpeg.org Date: Mon, 17 May 2021 11:24:13 +0800 Message-Id: <20210517032426.3376661-10-haihao.xiang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210517032426.3376661-1-haihao.xiang@intel.com> References: <20210517032426.3376661-1-haihao.xiang@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 09/22] 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: CrxPXrY0QWG4 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 fd45c4f352..fb950001c0 100644 --- a/libavfilter/vf_vpp_qsv.c +++ b/libavfilter/vf_vpp_qsv.c @@ -256,6 +256,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; @@ -637,6 +650,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,