From patchwork Tue Nov 16 08:16:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenbin Chen X-Patchwork-Id: 31439 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:d206:0:0:0:0:0 with SMTP id q6csp7038100iob; Tue, 16 Nov 2021 00:20:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJzDemdCxBH4U8SAvu8wCA+tw8yBmP9emG2K7kaV8v0h/6CNN+8fd+20JVcSNOK5BKJh/fTU X-Received: by 2002:a05:6402:5216:: with SMTP id s22mr7720715edd.291.1637050828101; Tue, 16 Nov 2021 00:20:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637050828; cv=none; d=google.com; s=arc-20160816; b=XgADVwGYDNziUe7MvaOAB5AfgSZAPuVF3FLsfxysvK1lD4e34DlwBVT+MKe3/oVAPI l6tnSovB+qzooHlfQg0L70o9o5t0NiAzQBEDTyxE7grjj0xdZvL5sc9slIX/ST93ebz+ 7uxTlDRhFHyhVzQQAmyMEQcf9W231hpzCCuhhwJCkbLKkksgeJZic2j+8ikZpn2u0HoA XNrwGoVpAT2vIs1f8lODU0TkFqDCbgzIACU1bBZBTAZ24s40IBOy3UZv/0bMjFd+1+Xy N3VPPklk/ZXG9QS1kuJq82GhC0NTqhu8EJYNLnXhKop5TIsUZf10RBLVUBi+iZlvRhSg wBiA== 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 :delivered-to; bh=LRXGlpjjHvBrX/DWO8HYzt8WvMi9GMXIuVSD8VgmwHE=; b=leAEyl5rfU5cEXbKEZifPnTEDv442u2xdNddKBQJz3KxDDhYd7e1RCziMdNOQGVA7R eIvCL/WSa0B98ZzeFKgr9CfIvDRpFfrJ6YkO4+JusQZmVO427+R4KFryt46PvxUDUMBH LvwFiuAAVKVp4pG1xDhMiW+4VWo9VPMRfGvtsNQLpV6isOfxBUjfWW2DxQ+dKfpWmp1G Rxqiy//fQSEtV5YAZvgN0kRipr/NH0dj3eA4rMzd5QoeIIYMaTSh7ue9XYwA/3nKipy4 j0aM/Ru0Qzms4KjAaS7JiFIBXGM4SKoOoz7mmeQawINNXmZg2kS2pOpjHdGMUW87Kwfh nxuw== 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 z21si10966910edd.365.2021.11.16.00.20.27; Tue, 16 Nov 2021 00:20:28 -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; 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 361B268AD93; Tue, 16 Nov 2021 10:20:24 +0200 (EET) 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 DE91F689D0A for ; Tue, 16 Nov 2021 10:20:16 +0200 (EET) X-IronPort-AV: E=McAfee;i="6200,9189,10169"; a="233482527" X-IronPort-AV: E=Sophos;i="5.87,238,1631602800"; d="scan'208";a="233482527" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Nov 2021 00:20:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,238,1631602800"; d="scan'208";a="454362219" Received: from chenwenbin-z390-aorus-ultra.sh.intel.com ([10.239.35.110]) by orsmga006.jf.intel.com with ESMTP; 16 Nov 2021 00:20:13 -0800 From: Wenbin Chen To: ffmpeg-devel@ffmpeg.org Date: Tue, 16 Nov 2021 16:16:21 +0800 Message-Id: <20211116081623.3081766-1-wenbin.chen@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/3] libavcodec/vaapi_decode: fix the problem that init_pool_size < nb_surface 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: hzbTmpFNUWLl For vaapi if the init_pool_size is not zero, the pool size is fixed. This means max surfaces is init_pool_size, but when mapping vaapi frame to qsv frame, the init_pool_size < nb_surface. The cause is that vaapi_decode_make_config() config the init_pool_size and it is called twice. The first time is to init frame_context and the second time is to init codec. On the second time the init_pool_size is changed to original value so the init_pool_size is lower than the reall size because pool_size used to initialize frame_context need to plus thread_count and 3 (guarantee 4 base work surfaces). Now add code to make sure init_pool_size is only set once. Now the following commandline works: ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 \ -hwaccel_output_format vaapi -i input.264 \ -vf "hwmap=derive_device=qsv,format=qsv" \ -c:v h264_qsv output.264 Signed-off-by: Wenbin Chen --- libavcodec/vaapi_decode.c | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c index 665af370ed..aab8162989 100644 --- a/libavcodec/vaapi_decode.c +++ b/libavcodec/vaapi_decode.c @@ -572,22 +572,24 @@ static int vaapi_decode_make_config(AVCodecContext *avctx, if (err < 0) goto fail; - frames->initial_pool_size = 1; - // Add per-codec number of surfaces used for storing reference frames. - switch (avctx->codec_id) { - case AV_CODEC_ID_H264: - case AV_CODEC_ID_HEVC: - case AV_CODEC_ID_AV1: - frames->initial_pool_size += 16; - break; - case AV_CODEC_ID_VP9: - frames->initial_pool_size += 8; - break; - case AV_CODEC_ID_VP8: - frames->initial_pool_size += 3; - break; - default: - frames->initial_pool_size += 2; + if (!frames->initial_pool_size) { + frames->initial_pool_size = 1; + // Add per-codec number of surfaces used for storing reference frames. + switch (avctx->codec_id) { + case AV_CODEC_ID_H264: + case AV_CODEC_ID_HEVC: + case AV_CODEC_ID_AV1: + frames->initial_pool_size += 16; + break; + case AV_CODEC_ID_VP9: + frames->initial_pool_size += 8; + break; + case AV_CODEC_ID_VP8: + frames->initial_pool_size += 3; + break; + default: + frames->initial_pool_size += 2; + } } } From patchwork Tue Nov 16 08:16:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenbin Chen X-Patchwork-Id: 31441 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:d206:0:0:0:0:0 with SMTP id q6csp7038280iob; Tue, 16 Nov 2021 00:20:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJxwluAY5UzHQTgOl+EJIlVbT3c8SVfrBvlwnYc0qAfjtDv2k7ARfg8a+ZGSEl+VH09Uuwzl X-Received: by 2002:a17:906:a14a:: with SMTP id bu10mr7508374ejb.540.1637050837567; Tue, 16 Nov 2021 00:20:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637050837; cv=none; d=google.com; s=arc-20160816; b=nJBPok4DKtIWNrBLGkmH4qL8Qww/2wBc38JccUmTyBiqWiXzi8eclfm2GSUAGM3eQd VawRtDB1sFgQjhm/nOlYAYkGVoL1jhjDO+lFoGneTNlcT/XecCAlwrOm3a2lKBKrS8VQ f8Ew56UI3EuARknPtWM1ytPVPmlYTfO1J68lfeMhO3z64zPvhekPZ18uw4M+wsQAEK5j NaKW3ite8kIT9QLgQBPHQND9Ga+02T1AootmFEXhxwcxcYEF8pQGbsOixaZD/aGVNcLQ nQHVdD+HRusTM4gM+E3okbVWXQkKTvrV2Ki1zGS6yk1cyxQvD8EBupIPj9SwFh8NHyyz sMag== 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:references:in-reply-to:message-id :date:to:from:delivered-to; bh=2RMMfbrn59hkM0xxLM/w+2DWEaviSQ8D/6YtHMxSN7Q=; b=NjElOdRJvAL8GrDewAWzuzIyAa1C0DrKG24Gh9/YD3kKw0rW6k1nbwhJWzWiVY26ry 2VdUlE/ijFLn+bgVXgd01TztIeQDTTWk8lkkoEnLlvbE7PrxWXUZ9iLVdp6sQt42/+Jy 3UOvGNyQaq2C03TciyuHY2TpL0bA02YN2I8/t3lf2ba+Ec8y763ARKZTnTiL0SZuiLX4 RDH99HLofEU2KTeDMePp71/FrGntfNHTbFgbcv3yuM2jd+BVkQZHOvcz38MK8CO0fuFy AGsS10l3FQJuAmi2bHZvaToq2iBBFXj4tfWjbePSfdciIsxDPoS6oIYpCJC0plKOJmal TbUQ== 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 fy1si13423082ejc.556.2021.11.16.00.20.37; Tue, 16 Nov 2021 00:20:37 -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; 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 3BEA06801E6; Tue, 16 Nov 2021 10:20:30 +0200 (EET) 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 D38C168ABD1 for ; Tue, 16 Nov 2021 10:20:22 +0200 (EET) X-IronPort-AV: E=McAfee;i="6200,9189,10169"; a="233482531" X-IronPort-AV: E=Sophos;i="5.87,238,1631602800"; d="scan'208";a="233482531" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Nov 2021 00:20:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,238,1631602800"; d="scan'208";a="454362230" Received: from chenwenbin-z390-aorus-ultra.sh.intel.com ([10.239.35.110]) by orsmga006.jf.intel.com with ESMTP; 16 Nov 2021 00:20:14 -0800 From: Wenbin Chen To: ffmpeg-devel@ffmpeg.org Date: Tue, 16 Nov 2021 16:16:22 +0800 Message-Id: <20211116081623.3081766-2-wenbin.chen@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211116081623.3081766-1-wenbin.chen@intel.com> References: <20211116081623.3081766-1-wenbin.chen@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/3] libavutil/hwcontext_qsv: fix a bug for mapping vaapi frame to 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: RxirUlFHYYxf From: nyanmisaka The data stored in data[3] in VAAPI AVFrame is VASurfaceID while the data stored in pair->first is the pointer of VASurfaceID, so we need to do cast to make following commandline works: ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 \ -hwaccel_output_format vaapi -i input.264 \ -vf "hwmap=derive_device=qsv,format=qsv" -c:v h264_qsv output.264 Signed-off-by: nyanmisaka Signed-off-by: Wenbin Chen --- libavutil/hwcontext_qsv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c index c18747f7eb..d83754193a 100644 --- a/libavutil/hwcontext_qsv.c +++ b/libavutil/hwcontext_qsv.c @@ -1220,7 +1220,7 @@ static int qsv_map_to(AVHWFramesContext *dst_ctx, case AV_PIX_FMT_VAAPI: { mfxHDLPair *pair = (mfxHDLPair*)hwctx->surfaces[i].Data.MemId; - if (pair->first == src->data[3]) { + if (*(VASurfaceID*)pair->first == (VASurfaceID)src->data[3]) { index = i; break; } From patchwork Tue Nov 16 08:16:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenbin Chen X-Patchwork-Id: 31440 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:d206:0:0:0:0:0 with SMTP id q6csp7038455iob; Tue, 16 Nov 2021 00:20:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJz5XFaUbKaX2xheg/WKIXc0bzH7PMdxzO6LazRmBxBBQm6DMwFaj0/d01LPNW2kU/xNCo9y X-Received: by 2002:a17:906:730b:: with SMTP id di11mr7439371ejc.97.1637050847537; Tue, 16 Nov 2021 00:20:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637050847; cv=none; d=google.com; s=arc-20160816; b=k8i8//XMI5eDqFFjZ+sgJUb8j86aznYXA4PcyVkadDPiGqDJ1xlzAwbiecZmjvrPpZ 4MbrdbfCIqA+kwUs1Rde7pItBr0rI0pTKajNzW5DmGvmRlo8fbgZj8WUdmliKZLqM25a NbXYHNCNlc07ZfjHBsxnL6qgXip4PrJhe5lZ64OuoOiObL5OhOrWfsL4WWF79+5g2jF4 iD6gZdnTts5k26ZV3cONqItokp3eQAz6Qc+5MOgmXM2ebkTGjMGdMWjBVCUyU11uQF6P Gg9yCBiS8D6eddwZ8NSHvb4wkM/TqBma5EyWdAFIsH/f90/boDQe/W6Y2IFYRbnifyv8 3jpQ== 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:references:in-reply-to:message-id :date:to:from:delivered-to; bh=kPZPPdpH5v6lW50leFe99JgWwLkHcvxUKfLcFnVaw3o=; b=D/bANrzIOGTHyAVfhZRvL1+PGbF84cBYCKckatiP7P9aRzYqbVK4PkiTZL3HylXKoC G0CB4HmtwCMM/QnL8+rbmkybjfPLU6VezFb4A4tDm1R8RuUbAboIXz3ST+2bOrGaR8sI xC0N8g/6UovWiG0dQaAnNhow/DqDJ9oq44wQZQRznCRCTr0w1pun6kZGpCur9qh9dbjX Wq8En//eK3ZIh3CqLR2cbQiP0sJoB7SYqxhDZxyAAiYzNA08I3it7SG8wrV1hhCAWD+H KsM45pga3lcME/yHcoC7AW1URnv4HLNY5t+rHY3PYeBhId0wL/w77vAQTEiCRfklk5vd qcuw== 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 kb28si31053604ejc.439.2021.11.16.00.20.47; Tue, 16 Nov 2021 00:20:47 -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; 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 32F3A68AE6F; Tue, 16 Nov 2021 10:20:32 +0200 (EET) 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 37D3868011E for ; Tue, 16 Nov 2021 10:20:24 +0200 (EET) X-IronPort-AV: E=McAfee;i="6200,9189,10169"; a="233482536" X-IronPort-AV: E=Sophos;i="5.87,238,1631602800"; d="scan'208";a="233482536" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Nov 2021 00:20:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,238,1631602800"; d="scan'208";a="454362238" Received: from chenwenbin-z390-aorus-ultra.sh.intel.com ([10.239.35.110]) by orsmga006.jf.intel.com with ESMTP; 16 Nov 2021 00:20:15 -0800 From: Wenbin Chen To: ffmpeg-devel@ffmpeg.org Date: Tue, 16 Nov 2021 16:16:23 +0800 Message-Id: <20211116081623.3081766-3-wenbin.chen@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211116081623.3081766-1-wenbin.chen@intel.com> References: <20211116081623.3081766-1-wenbin.chen@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/3] libavutil/hwcontext_opencl: fix a bug for mapping qsv frame to opencl 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: 5oL1Q6e8I5Ap From: nyanmisaka mfxHDLPair was added to qsv, so modify qsv->opencl map function as well. Now the following commandline works: ffmpeg -v verbose -init_hw_device vaapi=va:/dev/dri/renderD128 \ -init_hw_device qsv=qs@va -init_hw_device opencl=ocl@va -filter_hw_device ocl \ -hwaccel qsv -hwaccel_output_format qsv -hwaccel_device qs -c:v h264_qsv \ -i input.264 -vf "hwmap=derive_device=opencl,format=opencl,avgblur_opencl, \ hwmap=derive_device=qsv:reverse=1:extra_hw_frames=32,format=qsv" \ -c:v h264_qsv output.264 Signed-off-by: nyanmisaka Signed-off-by: Wenbin Chen --- libavutil/hwcontext_opencl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavutil/hwcontext_opencl.c b/libavutil/hwcontext_opencl.c index 26a3a24593..4b6e74ff6f 100644 --- a/libavutil/hwcontext_opencl.c +++ b/libavutil/hwcontext_opencl.c @@ -2249,7 +2249,8 @@ static int opencl_map_from_qsv(AVHWFramesContext *dst_fc, AVFrame *dst, #if CONFIG_LIBMFX if (src->format == AV_PIX_FMT_QSV) { mfxFrameSurface1 *mfx_surface = (mfxFrameSurface1*)src->data[3]; - va_surface = *(VASurfaceID*)mfx_surface->Data.MemId; + mfxHDLPair *pair = (mfxHDLPair*)mfx_surface->Data.MemId; + va_surface = *(VASurfaceID*)pair->first; } else #endif if (src->format == AV_PIX_FMT_VAAPI) {