From patchwork Fri May 14 04:53:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xiang, Haihao" X-Patchwork-Id: 27752 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:b214:0:0:0:0:0 with SMTP id b20csp120335iof; Thu, 13 May 2021 21:55:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJznNb+IBPSI8TGF3T6T8uEGHBgoPplYMhmEmXT6JunkdqGwh1tavJ5HuOMrd/DphzfL8rUm X-Received: by 2002:a17:906:6d43:: with SMTP id a3mr47222858ejt.142.1620968140141; Thu, 13 May 2021 21:55:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620968140; cv=none; d=google.com; s=arc-20160816; b=VpUK2DSnP8xwcQ+MGOr2WoKi6z8J3S/I66PhHgsBSPIKZ7ZjmUXMpDCI4oifkzW0fg iKW85Oj65FGUmeZcdzn+SE8/wXylv7wp1lsWlOHgwhu8TYMYmLsaIDKRWykePsTRNpAT iCEwFyOsNPeYKqQkbuGNqFZf6CXep024NQjU7kjnt+M3DYon2WjQoD8orfONL3VLetIn QZSf6I1FGS4/3CxVJjYVKPLf5lje8zttDF+XQRZzIKF03Ep6jfF5rFO3mdev8coio+2y 5fd2oNDnQFIDDQC1dPJAX3lLFr1GlD2hSgFsIyOXHTR/c5BjD69HNNpM0IQs6Fixhdh8 Y9og== 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=ORgZ6UAbcsrXOHN85NoFQj73ov317rvfixlx3OkeSKJMj/aCG5W5Wj/n/mZOdzN7wt 2n3WyvGgiGKPgd35TvGoZvt74kjOZtYd6XWrLeVsCb9ELyHlliwZ7fOM4YjaTjDgoQBU EJiuCIPh31+YN7QTsRFueryu9tukK8C+vtKncshYDH7grTMwvc+remBKT65vcuFsMXMY xBS8KjY26OGQoXnH1trS6N+BIm68gFggvk0HBF+EKKAJf6HYMWYNOHrVEWDsTKMBO0BD qBGyITMBLlXdGxZ7BsYXoERTZx6SkJDpOQZie0bT1aNGWTkx0ubPEstDfSznvE8oDcEp Hk6w== 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 y7si4922766ejq.725.2021.05.13.21.55.39; Thu, 13 May 2021 21:55:40 -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 EC51D6881C5; Fri, 14 May 2021 07:54:45 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BEC81688169 for ; Fri, 14 May 2021 07:54:42 +0300 (EEST) IronPort-SDR: txCoQvOyXoRdv+aSHEZtIbmEpNiA1lqMo4t8n0Xd+MdyQmdWkwnsAy/ev/koPr9c4GZFB9eZXG c6860bpVeqZw== X-IronPort-AV: E=McAfee;i="6200,9189,9983"; a="179711903" X-IronPort-AV: E=Sophos;i="5.82,299,1613462400"; d="scan'208";a="179711903" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2021 21:54:39 -0700 IronPort-SDR: 7Vaw3LIyHdJvm+e9sjVunBUq9fOEM2z5GTDWdLKahHMmA71aVYlO2v0Je3ketcpC/dB1Qsg2y1 LOJqe2HjFHZQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,299,1613462400"; d="scan'208";a="626673094" Received: from xhh-tgl64.sh.intel.com ([10.239.159.130]) by fmsmga005.fm.intel.com with ESMTP; 13 May 2021 21:54:32 -0700 From: Haihao Xiang To: ffmpeg-devel@ffmpeg.org Date: Fri, 14 May 2021 12:53:47 +0800 Message-Id: <20210514045400.3277256-10-haihao.xiang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210514045400.3277256-1-haihao.xiang@intel.com> References: <20210514045400.3277256-1-haihao.xiang@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 09/22] lavf/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: gRoDaOgRcCcI 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,