mfsourceobject: Store selected device path, name and index
authorSeungha Yang <seungha@centricular.com>
Fri, 1 May 2020 06:12:43 +0000 (15:12 +0900)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 20 May 2020 11:06:09 +0000 (11:06 +0000)
Update path, name and index with selected device so that checked by
get_property() after constructed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1236>

sys/mediafoundation/gstmfsourceobject.c

index 1a3ca33..aa3b1ff 100644 (file)
@@ -313,9 +313,18 @@ gst_mf_source_object_thread_func (GstMFSourceObject * self)
     }
   }
 
-  if (target)
+  if (target) {
     self->opend = klass->open (self, target->handle);
 
+    g_free (priv->device_path);
+    priv->device_path = g_strdup (target->path);
+
+    g_free (priv->device_name);
+    priv->device_name = g_strdup (target->name);
+
+    priv->device_index = target->index;
+  }
+
   if (activate_list)
     g_list_free_full (activate_list,
         (GDestroyNotify) gst_mf_device_activate_free);