From patchwork Thu Jul 7 03:12:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Chen, Wenbin" X-Patchwork-Id: 36698 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:8b27:b0:88:1bbf:7fd2 with SMTP id l39csp4607221pzh; Wed, 6 Jul 2022 20:18:28 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uV3QTmiwSoU2T7yqaMW82KA079CIcz7OKgNN6c88jGEkFsHSbexEdR0l6j+9jLAVyOhQw8 X-Received: by 2002:a17:907:9687:b0:726:3afa:fc7b with SMTP id hd7-20020a170907968700b007263afafc7bmr43010592ejc.82.1657163908164; Wed, 06 Jul 2022 20:18:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657163908; cv=none; d=google.com; s=arc-20160816; b=wxuKt94AqADVZy7F1EKrANfvxnNCvn+9CxIPUpgeao2hQB5pBtZ52xMd8k+dQScgc6 ndknQ78jpoagg/Xhwf28jCYazQXjhfKbMLwTA3Hm3M+gsUorOadU+xQivQjSCQ7JOScd EKFq9YG3q/tpDOKlnA6fz0/y7A48E93Mp6WLQ+RIRIhJv3dyLR0qbk8V12VJGxx8hqDC cJo6u+dKelWdton4qpU3WlZkBCszHkHbQNeKQ4IVMFd9DnUBjXPuXt+fjtfObVDxUnMw kiaQXYTXRXFc5ixIWcd/6tlc/lWPaUrb3B1ROwwOAhpyLXAeu4dF3FnBWeRzmh0G+63A aFNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=g5fU1px7cn79icazCV6PelBS0po+6Nvz2v5mHDjg5vg=; b=DBr5H2fZopc/avVNdE1stsl4r+TGaP2zcM2c1iERZeDE38UpbmiD6hZQtYTEL/5YKW SQKtqwZA7tja4Ex2HrZHPd4QnEV+qoLzyMxsbMUX7P67oYYV5s+HBsjuGkaMx85fuR8J kvp3yOqJ3rxbhSjX1n9k3T3Oe9YNZ1ZdEzMTqK59kG41X9Qe+IeMYQmyUV4Bhp0+Bn4B KLCv1xc/easRc/x/I/kHLKAm1e01ofj1U2m9rfflByGbC4PNFhrKlAqGypnZcwUCQqAI PJQ0ZDPUtNWLP2hNKTMA23h6IgHdioujih00G9TlG5qZquEHmMI6nncNNB81vIioASUV CZcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel.com header.s=Intel header.b=Y2mziXSZ; 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 js21-20020a17090797d500b0072b01ae9c69si2935682ejc.694.2022.07.06.20.18.27; Wed, 06 Jul 2022 20:18:28 -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; dkim=neutral (body hash did not verify) header.i=@intel.com header.s=Intel header.b=Y2mziXSZ; 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 BA16568BA2B; Thu, 7 Jul 2022 06:18:23 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 14B9E68B7A0 for ; Thu, 7 Jul 2022 06:18:16 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657163902; x=1688699902; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=qxqSZjxX5LUaU2SKHgmdiGgRvNGj9EOhWtqJkS/N4Vg=; b=Y2mziXSZSjeHZYnwiE+FHufD8Tj3MMKKJmTQBcWp4rargmcH6RoW31/i LQmEnXdqawqSCJD45WGRoYVpe9ZJk0fsufYx/Bi+62aAdN/jGVabypOAl IT8LWARthqdqLZyl1rG1vDoeu3dsXnyDfTKE1HHjI5nXRCKdmTR9iZDEY LtEVDaots9vgfNrcjmeYQSbJTOtzT09dsyVVzqghErizFs33ueTF3sDKX OZ1jwLjzcvgurPdhWqTjBBtFG/lnQHbCbqteKCp2pK/4a/ulfKv63rI7S 32a7DMI5gv+qeQGtwjc/N9xSK2PHsPRMTntaVItT162Ymf0OzP8PqT68Q g==; X-IronPort-AV: E=McAfee;i="6400,9594,10400"; a="284659350" X-IronPort-AV: E=Sophos;i="5.92,251,1650956400"; d="scan'208";a="284659350" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jul 2022 20:18:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,251,1650956400"; d="scan'208";a="650940850" Received: from wenbin-z390-aorus-ultra.sh.intel.com ([10.239.35.4]) by fmsmga008.fm.intel.com with ESMTP; 06 Jul 2022 20:18:13 -0700 From: Wenbin Chen To: ffmpeg-devel@ffmpeg.org Date: Thu, 7 Jul 2022 11:12:52 +0800 Message-Id: <20220707031252.76494-1-wenbin.chen@intel.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2] libavfilter/vf_overlay_qsv: Use format of first input to set output format for overlay_qsv 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: EWUTma260MCw overlay_qsv hard coded to use nv12 as output format. Now use the format of the first input to set output format. For detailed information of supported format on different platform, please see the "composition" rows in "Video Processing Features" at below link: https://www.intel.com/content/www/us/en/develop/documentation/media-capabilities-of-intel-hardware/top.html Signed-off-by: Wenbin Chen --- libavfilter/vf_overlay_qsv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavfilter/vf_overlay_qsv.c b/libavfilter/vf_overlay_qsv.c index 7e76b39aa9..d947a1faa1 100644 --- a/libavfilter/vf_overlay_qsv.c +++ b/libavfilter/vf_overlay_qsv.c @@ -276,6 +276,7 @@ static int config_output(AVFilterLink *outlink) int ret; av_log(ctx, AV_LOG_DEBUG, "Output is of %s.\n", av_get_pix_fmt_name(outlink->format)); + vpp->qsv_param.out_sw_format = in0->format; if ((in0->format == AV_PIX_FMT_QSV && in1->format != AV_PIX_FMT_QSV) || (in0->format != AV_PIX_FMT_QSV && in1->format == AV_PIX_FMT_QSV)) { av_log(ctx, AV_LOG_ERROR, "Mixing hardware and software pixel formats is not supported.\n"); @@ -288,6 +289,7 @@ static int config_output(AVFilterLink *outlink) av_log(ctx, AV_LOG_ERROR, "Inputs with different underlying QSV devices are forbidden.\n"); return AVERROR(EINVAL); } + vpp->qsv_param.out_sw_format = hw_frame0->sw_format; } outlink->w = vpp->var_values[VAR_MW];