From patchwork Thu Nov 4 05:44:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenbin Chen X-Patchwork-Id: 31292 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a5e:a610:0:0:0:0:0 with SMTP id q16csp146084ioi; Wed, 3 Nov 2021 22:48:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZ9WO1C5gw0nVwbMlO0vOucvLaaoBwF02bvfWDGo0NBP4zbga+c88lmpEUoM+yE5FuyzkC X-Received: by 2002:a17:906:edce:: with SMTP id sb14mr44586194ejb.25.1636004914176; Wed, 03 Nov 2021 22:48:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636004914; cv=none; d=google.com; s=arc-20160816; b=AuRNwRDXueyA5V0aq9p3Rrhkr/mgLmwMzeVl8XQQv16jun3WhNbziwANrAxKEOSiCo //JoxsJTHwcMmKgStOmgrZL+fS+J8DdkZKaTsRPEUwSL0Ycu3EtGLy9AxZJquZehnWv8 8fdM6YawqMX0A6p7tBut+mmxauO4QoXavBmEhudbjY6WrT5qgK88GFY5lvokG/IMRNdh SLiGJJhdj0fqpjihxDLyCEaaux7UsnJCBGXeWi6AHcN3B0tDkBzsdI38erhMlvTj3ILG N4QCKc/8IsKxxG31gRJfy86MNkxwG0skIrRZB8Ftlkom7dQBifsoHBZkCiWjcDWxZqEF 7JjQ== 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:message-id:date:to:from :delivered-to; bh=3Na9adASDRsn9gr8dEYOs/TT6fRIQmTPO3tf9PjkndQ=; b=sQ/quBLAAK1V/Gst0qJbHhbEUa1oMR2mfvpGLBZLMxwXAV2Px2jZVuY5QNMNjr7gw2 EhUL8r4YP02dg1UUrYeVhm975ljupZYGL56Z1FuQwAqeO5GIp8fY0XgLrxNMTXbsSet6 pMJa1orK5eL0lCiZM5viATR1Anh4UrKqDzeAID/J8P20oytgXCByfwnrIo59IVSoaOPp aYpZ/tQNx0CE4qHiBT87QFYWF0sBiKLyhwuGGjfzh40ZPqoTVDo0URiRPGbp0l1KbTyi tm6sHG9ReDV75MSqKXyY6Hee0fQmviYqIp6W6z6Um/HXfr4YFO2S/v2dV3c/Xe4l65Ss j4Rw== 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 y5si7817587edp.88.2021.11.03.22.48.32; Wed, 03 Nov 2021 22:48:34 -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 E322B68ACA5; Thu, 4 Nov 2021 07:48:27 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6020968A993 for ; Thu, 4 Nov 2021 07:48:20 +0200 (EET) X-IronPort-AV: E=McAfee;i="6200,9189,10157"; a="212398282" X-IronPort-AV: E=Sophos;i="5.87,208,1631602800"; d="scan'208";a="212398282" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Nov 2021 22:48:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,208,1631602800"; d="scan'208";a="639158169" Received: from chenwenbin-z390-aorus-ultra.sh.intel.com ([10.239.35.110]) by fmsmga001.fm.intel.com with ESMTP; 03 Nov 2021 22:48:15 -0700 From: Wenbin Chen To: ffmpeg-devel@ffmpeg.org Date: Thu, 4 Nov 2021 13:44:00 +0800 Message-Id: <20211104054403.1251208-1-wenbin.chen@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/4] libavutil/hwcontext_d3d11va: Add nb_surfaces to AVD3D11VAFramesContext 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: Wenbin Chen Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: hm+mFxK8kQE/ Adding nb_surfaces in AVD3D11VAFramesContext in the end of the structure to support flexible size of this arrays and align to AVDXVA2FramesContext and AVVAAPIFramesContext. Signed-off-by Wenbin Chen --- libavutil/hwcontext_d3d11va.c | 3 +-- libavutil/hwcontext_d3d11va.h | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libavutil/hwcontext_d3d11va.c b/libavutil/hwcontext_d3d11va.c index 8ab96bad25..086e7b9daa 100644 --- a/libavutil/hwcontext_d3d11va.c +++ b/libavutil/hwcontext_d3d11va.c @@ -72,7 +72,6 @@ static av_cold void load_functions(void) } typedef struct D3D11VAFramesContext { - int nb_surfaces; int nb_surfaces_used; DXGI_FORMAT format; @@ -287,7 +286,7 @@ static int d3d11va_frames_init(AVHWFramesContext *ctx) hwctx->texture_infos = av_calloc(ctx->initial_pool_size, sizeof(*hwctx->texture_infos)); if (!hwctx->texture_infos) return AVERROR(ENOMEM); - s->nb_surfaces = ctx->initial_pool_size; + hwctx->nb_surfaces = ctx->initial_pool_size; ctx->internal->pool_internal = av_buffer_pool_init2(sizeof(AVD3D11FrameDescriptor), ctx, d3d11va_pool_alloc, NULL); diff --git a/libavutil/hwcontext_d3d11va.h b/libavutil/hwcontext_d3d11va.h index 77d2d72f1b..b0df470190 100644 --- a/libavutil/hwcontext_d3d11va.h +++ b/libavutil/hwcontext_d3d11va.h @@ -173,6 +173,8 @@ typedef struct AVD3D11VAFramesContext { * This field is ignored/invalid if a user-allocated texture is provided. */ AVD3D11FrameDescriptor *texture_infos; + + int nb_surfaces; } AVD3D11VAFramesContext; #endif /* AVUTIL_HWCONTEXT_D3D11VA_H */