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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3231>
This commit is contained in:
Tong Wu 2022-08-26 14:13:36 +08:00 committed by GStreamer Marge Bot
parent 86d22b2e38
commit 7f18f11a90

View file

@ -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;
}