Bus add watch not working properly for Device monitor

Alicia Romero alromor84 at gmail.com
Fri Jul 10 04:30:42 PDT 2015


Thanks for your answer.

I am actually running under Linux.

2015-07-10 13:25 GMT+02:00 Thornton, Keith <keith.thornton at zeiss.com>:

>  If you are running under windows with a different message loop e.g. QT,
> you need to call gst_bus_set_sync_handler instead.
>
>
>
> *Von:* gstreamer-devel [mailto:
> gstreamer-devel-bounces at lists.freedesktop.org] *Im Auftrag von *Alicia
> Romero
> *Gesendet:* Freitag, 10. Juli 2015 13:12
> *An:* Discussion of the development of and with GStreamer
> *Betreff:* Bus add watch not working properly for Device monitor
>
>
>
> 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!!
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150710/cdbb8766/attachment-0001.html>


More information about the gstreamer-devel mailing list