From 7f18f11a90d5d10764cff6b47622da4452e29e50 Mon Sep 17 00:00:00 2001 From: Tong Wu Date: Fri, 26 Aug 2022 14:13:36 +0800 Subject: [PATCH] msdkallocator_d3d: implement GetHDL callback function During encoding process, oneVPL runtime will call GetHDL callback function. This patch implements this function for the use of msdk. Part-of: --- .../gst-plugins-bad/sys/msdk/gstmsdkallocator_d3d.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/subprojects/gst-plugins-bad/sys/msdk/gstmsdkallocator_d3d.c b/subprojects/gst-plugins-bad/sys/msdk/gstmsdkallocator_d3d.c index 27e457288b..791752e6e5 100644 --- a/subprojects/gst-plugins-bad/sys/msdk/gstmsdkallocator_d3d.c +++ b/subprojects/gst-plugins-bad/sys/msdk/gstmsdkallocator_d3d.c @@ -60,6 +60,17 @@ gst_msdk_frame_unlock (mfxHDL pthis, mfxMemId mid, mfxFrameData * ptr) mfxStatus gst_msdk_frame_get_hdl (mfxHDL pthis, mfxMemId mid, mfxHDL * hdl) { + GstMsdkMemoryID *mem_id; + mfxHDLPair *pair; + + if (!hdl || !mid) + return MFX_ERR_INVALID_HANDLE; + + mem_id = (GstMsdkMemoryID *) mid; + pair = (mfxHDLPair *) hdl; + pair->first = (mfxHDL) mem_id->texture; + pair->second = (mfxHDL) GUINT_TO_POINTER (mem_id->subresource_index); + return MFX_ERR_NONE; }