d3d11memory: Inform subresource index via GstMapInfo::user_data
authorSeungha Yang <seungha@centricular.com>
Tue, 7 Dec 2021 12:29:05 +0000 (21:29 +0900)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 8 Feb 2022 10:05:35 +0000 (10:05 +0000)
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>

subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11memory.cpp

index 417015f..f1f55ab 100644 (file)
@@ -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 */