GST_MESSAGE_DEVICE_ADDED never called
Olivier CrĂȘte
olivier.crete at collabora.com
Fri Jul 10 09:08:31 PDT 2015
Hi,
Is it a USB Webcam? Are you running a generic desktop distribution
(Fedora, Ubuntu, etc) or something strange?
When you connect the camera, does a /dev/video<X> device appear? Check
the return value of gst_device_monitor_start().
Olivier
On Fri, 2015-07-10 at 16:35 +0200, Luis Garcia wrote:
> Hi List,
> I am testing the new feature Device Monitor, and I have this small
> test:
>
> static gboolean message_func(GstBus *bus, GstMessage *message,
> gpointer user_data) {
> switch (GST_MESSAGE_TYPE (message)) {
> case GST_MESSAGE_DEVICE_ADDED:
> g_print("Device Added");
> break;
> case GST_MESSAGE_DEVICE_REMOVED:
> g_print("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_device_monitor_start (monitor);
> (..)
> GMainLoop *loop = g_main_loop_new (NULL, FALSE);
> g_main_loop_run (loop);
> /* Free resources */
> gst_object_unref (bus);
> gst_device_monitor_stop (monitor);
> gst_object_unref (monitor);
>
> The problem is that if a plug in a new camera, I never get the
> message GST_MESSAGE_DEVICE_ADDED.
> I am using gstreamer Version 1.4.0 and I am working in Linux.
>
> Am doing something wrong?
> Thanks!!
>
>
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
--
Olivier CrĂȘte
olivier.crete at collabora.com
More information about the gstreamer-devel
mailing list