* the application has set.
*
*
- * The basic use pattern of an iterator is as follows:
+ * The basic use pattern of a device monitor is as follows:
* |[
* static gboolean
* my_bus_func (GstBus * bus, GstMessage * message, gpointer user_data)
if (monitor->priv->filters->len == 0) {
GST_OBJECT_UNLOCK (monitor);
- GST_WARNING_OBJECT (monitor, "No filters have been set");
- return FALSE;
+ GST_WARNING_OBJECT (monitor, "No filters have been set, will expose all "
+ "devices found");
+ gst_device_monitor_add_filter (monitor, NULL, NULL);
+ GST_OBJECT_LOCK (monitor);
}
if (monitor->priv->providers->len == 0) {
mon = gst_device_monitor_new ();
- fail_if (gst_device_monitor_start (mon));
-
devices = g_list_append (NULL, test_device_new ());
devs = gst_device_monitor_get_devices (mon);
gst_object_unref (dp);
gst_object_unref (dp2);
g_list_free_full (devices, (GDestroyNotify) gst_object_unref);
+
+ /* should work fine without any filters */
+ mon = gst_device_monitor_new ();
+ fail_unless (gst_device_monitor_start (mon));
+ gst_device_monitor_stop (mon);
+ gst_object_unref (mon);
}
GST_END_TEST;