From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 63E6D492FE for ; Wed, 8 May 2024 06:04:31 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B2E8968D500; Wed, 8 May 2024 09:04:28 +0300 (EEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BFC9068D43F for ; Wed, 8 May 2024 09:04:21 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1715148267; x=1746684267; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=PmfxWIOzbyWkJoCr0th3cpIo5H0tDwfEgMICC42ET6M=; b=YjPMsTXlPecpGN6IM6fHaEUofNtkjhVfMYNjVX2c/l93Ej4P6+7/JhwA B175UFeGOCZXWqJahWrHvjZ06V49k6TLDXNjM3hUCugJBd69U4BlZBBkI 3c03/hm6517al8NsHdnG410lr52sbvDh+CCAcCivplEtp0fyJfZYbz36j qOQJ6Re9uj8gzuOK0zHT3P2kGvE3xWy/cFGqLycrHGWdYASSt4p8Rg2MI fLobofHwabdkpLjSjkPRI9zKqhFqiMtVeU2p6staTVQ8s9NrQs9Y0w0lY 2Ts61F4EoIRJo3llOcBspVT17Ytt574/e8i6ubrvMquv2jpWW9zpKwE/o Q==; X-CSE-ConnectionGUID: LAfU7sxZRFeS2lTkuH6kTg== X-CSE-MsgGUID: spGxSD3wRl2NIktFHsECTA== X-IronPort-AV: E=McAfee;i="6600,9927,11066"; a="10855337" X-IronPort-AV: E=Sophos;i="6.08,144,1712646000"; d="scan'208";a="10855337" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 May 2024 23:04:19 -0700 X-CSE-ConnectionGUID: 8LWpNJzgSxqOXO2ybHrzJA== X-CSE-MsgGUID: Ofc7HjPtQD+77rvcEk3A0A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,144,1712646000"; d="scan'208";a="28828774" Received: from unknown (HELO xhh-dg264.sh.intel.com) ([10.238.2.76]) by fmviesa006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 May 2024 23:04:17 -0700 From: "Xiang, Haihao" To: ffmpeg-devel@ffmpeg.org Date: Wed, 8 May 2024 14:03:08 +0800 Message-Id: <20240508060316.681114-1-haihao.xiang@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 1/9] lavu/hwcontext_qsv: update AVQSVFramesContext to support dynamic frame pool 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: From: Haihao Xiang Add AVQSVFramesContext.info and update the description. Signed-off-by: Haihao Xiang --- doc/APIchanges | 3 +++ libavutil/hwcontext_qsv.c | 4 ++-- libavutil/hwcontext_qsv.h | 27 +++++++++++++++++++++++++-- libavutil/version.h | 2 +- 4 files changed, 31 insertions(+), 5 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index 824beec9d3..fa281cec5c 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -2,6 +2,9 @@ The last version increases of all libraries were on 2024-03-07 API changes, most recent first: +2024-05-xx - xxxxxxxxxx - lavu 59.18.100 - hwcontext_qsv.h + Add AVQSVFramesContext.info + 2024-05-04 - xxxxxxxxxx - lavu 59.17.100 - opt.h Add AV_OPT_TYPE_UINT and av_opt_eval_uint(). diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c index c7c7878644..f552811346 100644 --- a/libavutil/hwcontext_qsv.c +++ b/libavutil/hwcontext_qsv.c @@ -627,7 +627,7 @@ static mfxStatus frame_alloc(mfxHDL pthis, mfxFrameAllocRequest *req, QSVFramesContext *s = ctx->hwctx; AVQSVFramesContext *hwctx = &s->p; mfxFrameInfo *i = &req->Info; - mfxFrameInfo *i1 = &hwctx->surfaces[0].Info; + mfxFrameInfo *i1 = hwctx->nb_surfaces ? &hwctx->surfaces[0].Info : hwctx->info; if (!(req->Type & MFX_MEMTYPE_VIDEO_MEMORY_PROCESSOR_TARGET) || !(req->Type & (MFX_MEMTYPE_FROM_VPPIN | MFX_MEMTYPE_FROM_VPPOUT)) || @@ -1207,7 +1207,7 @@ static int qsv_init_internal_session(AVHWFramesContext *ctx, MFX_IOPATTERN_OUT_SYSTEM_MEMORY; par.AsyncDepth = 1; - par.vpp.In = frames_hwctx->surfaces[0].Info; + par.vpp.In = frames_hwctx->nb_surfaces ? frames_hwctx->surfaces[0].Info : *frames_hwctx->info; /* Apparently VPP requires the frame rate to be set to some value, otherwise * init will fail (probably for the framerate conversion filter). Since we diff --git a/libavutil/hwcontext_qsv.h b/libavutil/hwcontext_qsv.h index e2dba8ad83..35530e4e93 100644 --- a/libavutil/hwcontext_qsv.h +++ b/libavutil/hwcontext_qsv.h @@ -25,8 +25,8 @@ * @file * An API-specific header for AV_HWDEVICE_TYPE_QSV. * - * This API does not support dynamic frame pools. AVHWFramesContext.pool must - * contain AVBufferRefs whose data pointer points to an mfxFrameSurface1 struct. + * AVHWFramesContext.pool must contain AVBufferRefs whose data pointer points + * to a mfxFrameSurface1 struct. */ /** @@ -51,13 +51,36 @@ typedef struct AVQSVDeviceContext { * This struct is allocated as AVHWFramesContext.hwctx */ typedef struct AVQSVFramesContext { + /** + * A pointer to a mfxFrameSurface1 struct + * + * It is available when nb_surfaces is non-zero. + */ mfxFrameSurface1 *surfaces; + + /** + * Number of frames in the pool + * + * It is 0 for dynamic frame pools or AVHWFramesContext.initial_pool_size + * for fixed frame pools. + * + * Note only oneVPL GPU runtime 2.9+ can support dynamic frame pools + * on d3d11va or vaapi + */ int nb_surfaces; /** * A combination of MFX_MEMTYPE_* describing the frame pool. */ int frame_type; + + /** + * A pointer to a mfxFrameInfo struct + * + * It is available when nb_surfaces is 0, all buffers allocated from the + * pool have the same mfxFrameInfo. + */ + mfxFrameInfo *info; } AVQSVFramesContext; #endif /* AVUTIL_HWCONTEXT_QSV_H */ diff --git a/libavutil/version.h b/libavutil/version.h index 3b5a2e7aaa..b9b9baf98c 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -79,7 +79,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 59 -#define LIBAVUTIL_VERSION_MINOR 17 +#define LIBAVUTIL_VERSION_MINOR 18 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ -- 2.34.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".