mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 16:26:39 +00:00
msdkallocator_d3d: add gst_msdk_frame_free callback function
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4088>
This commit is contained in:
parent
abe4d0046a
commit
123c8d14c1
1 changed files with 16 additions and 0 deletions
|
@ -191,6 +191,22 @@ error_alloc:
|
|||
mfxStatus
|
||||
gst_msdk_frame_free (mfxHDL pthis, mfxFrameAllocResponse * resp)
|
||||
{
|
||||
GstMsdkContext *context = (GstMsdkContext *) pthis;
|
||||
GstMsdkAllocResponse *cached = NULL;
|
||||
|
||||
cached = gst_msdk_context_get_cached_alloc_responses (context, resp);
|
||||
|
||||
if (cached) {
|
||||
if (!g_atomic_int_dec_and_test (&cached->refcount))
|
||||
return MFX_ERR_NONE;
|
||||
} else
|
||||
return MFX_ERR_NONE;
|
||||
|
||||
if (!gst_msdk_context_remove_alloc_response (context, resp))
|
||||
return MFX_ERR_NONE;
|
||||
|
||||
g_slice_free1 (resp->NumFrameActual * sizeof (mfxMemId), resp->mids);
|
||||
|
||||
return MFX_ERR_NONE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue