From af9b9be76dce11e701db55abc6523d87dc5e4d41 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Tue, 7 Dec 2021 21:29:05 +0900 Subject: [PATCH] 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: --- subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11memory.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11memory.cpp b/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11memory.cpp index 417015f..f1f55ab 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11memory.cpp +++ b/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11memory.cpp @@ -381,6 +381,9 @@ gst_d3d11_memory_map_full (GstMemory * mem, GstMapInfo * info, gsize maxsize) gst_d3d11_device_lock (dmem->device); 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 (priv->native_type == GST_D3D11_MEMORY_NATIVE_TYPE_BUFFER) { /* FIXME: handle non-staging buffer */ -- 2.7.4