<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"\@SimSun";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.E-MailFormatvorlage17
        {mso-style-type:personal-reply;
        font-family:"Arial","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial","sans-serif"">If you are running under windows with a different message loop e.g. QT, you need to call gst_bus_set_sync_handler instead.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">Von:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> gstreamer-devel [mailto:gstreamer-devel-bounces@lists.freedesktop.org]
<b>Im Auftrag von </b>Alicia Romero<br>
<b>Gesendet:</b> Freitag, 10. Juli 2015 13:12<br>
<b>An:</b> Discussion of the development of and with GStreamer<br>
<b>Betreff:</b> Bus add watch not working properly for Device monitor<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal">Hi List,<o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">I add a watch to the bus of a device monitor:
<br>
<br>
<br>
gboolean message_func(GstBus *bus, GstMessage *message, gpointer user_data) {<br>
    GstDevice *device = NULL;<br>
    gchar *name = NULL;<br>
<br>
    switch (GST_MESSAGE_TYPE (message)) {<br>
    case GST_MESSAGE_DEVICE_ADDED:<br>
       [...]<br>
        break;<br>
    case GST_MESSAGE_DEVICE_REMOVED:<br>
        [...]<br>
        break;<br>
    default:<br>
        break;<br>
    }<br>
    return G_SOURCE_CONTINUE;<br>
}<br>
<br>
GstDeviceMonitor *monitor = gst_device_monitor_new();<br>
GstBus *bus = gst_device_monitor_get_bus(monitor);<br>
gst_bus_add_watch(bus, message_func, NULL);<br>
gst_object_unref(bus);<o:p></o:p></p>
</div>
<p class="MsoNormal">But it is not working for me. I add a new video device, but it never enters message_func.<o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Any idea why is this happening?<o:p></o:p></p>
</div>
<p class="MsoNormal">Thanks!!<o:p></o:p></p>
</div>
</div>
</body>
</html>