From: Tong Wu Date: Fri, 26 Aug 2022 06:13:36 +0000 (+0800) Subject: msdkallocator_d3d: implement GetHDL callback function X-Git-Tag: 1.22.0~488 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7f18f11a90d5d10764cff6b47622da4452e29e50;p=platform%2Fupstream%2Fgstreamer.git 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: --- diff --git a/subprojects/gst-plugins-bad/sys/msdk/gstmsdkallocator_d3d.c b/subprojects/gst-plugins-bad/sys/msdk/gstmsdkallocator_d3d.c index 27e4572..791752e 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; }