Bus add watch not working properly for Device monitor

Alicia Romero alromor84 at gmail.com
Fri Jul 10 04:12:23 PDT 2015


Hi List,
I add a watch to the bus of a device monitor:


gboolean message_func(GstBus *bus, GstMessage *message, gpointer user_data)
{
    GstDevice *device = NULL;
    gchar *name = NULL;

    switch (GST_MESSAGE_TYPE (message)) {
    case GST_MESSAGE_DEVICE_ADDED:
       [...]
        break;
    case GST_MESSAGE_DEVICE_REMOVED:
        [...]
        break;
    default:
        break;
    }
    return G_SOURCE_CONTINUE;
}

GstDeviceMonitor *monitor = gst_device_monitor_new();
GstBus *bus = gst_device_monitor_get_bus(monitor);
gst_bus_add_watch(bus, message_func, NULL);
gst_object_unref(bus);

But it is not working for me. I add a new video device, but it never enters
message_func.
Any idea why is this happening?

Thanks!!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150710/206e4b92/attachment.html>


More information about the gstreamer-devel mailing list