d3d11memory: Inform subresource index via GstMapInfo::user_data

By using this way, caller does not need to call another method
gst_d3d11_memory_get_subresource_index()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1408>
This commit is contained in:
Seungha Yang 2021-12-07 21:29:05 +09:00 committed by GStreamer Marge Bot
parent a37da515f4
commit af9b9be76d

View file

@ -381,6 +381,9 @@ gst_d3d11_memory_map_full (GstMemory * mem, GstMapInfo * info, gsize maxsize)
gst_d3d11_device_lock (dmem->device); gst_d3d11_device_lock (dmem->device);
GST_D3D11_MEMORY_LOCK (dmem); GST_D3D11_MEMORY_LOCK (dmem);
memset (info->user_data, 0, sizeof (info->user_data));
info->user_data[0] = GUINT_TO_POINTER (dmem->priv->subresource_index);
if ((flags & GST_MAP_D3D11) == GST_MAP_D3D11) { if ((flags & GST_MAP_D3D11) == GST_MAP_D3D11) {
if (priv->native_type == GST_D3D11_MEMORY_NATIVE_TYPE_BUFFER) { if (priv->native_type == GST_D3D11_MEMORY_NATIVE_TYPE_BUFFER) {
/* FIXME: handle non-staging buffer */ /* FIXME: handle non-staging buffer */