<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"><div><div style="font-size: 12pt; ">Hi,</div><div style="font-size: 12pt; "><br></div><div style="background-color: transparent; font-size: 16px; ">I'm developing softphone using QtGStreamer and libnice for NAT traversal.</div><div style="background-color: transparent; font-size: 16px; "><font face="arial, helvetica, sans-serif">Libnice have nicesrc and nicesink element for RTP transmission.</font></div><div style="background-color: transparent; font-size: 16px; "><font face="arial, helvetica, sans-serif">I'm now having problem when setting "agent" property for nicesrc Element in QtGstreamer</font></div><div style="background-color: transparent; font-size: 16px; ">Here is my code</div><div style="background-color: transparent; font-size: 16px; "><br></div><div style="background-color: transparent; font-size: 16px; "><pre
 style="font-family: arial, helvetica, sans-serif; margin-top: 0px; margin-bottom: 0px; "><span style="color: rgb(128, 128, 0); ">int</span><span style="color: rgb(192, 192, 192); "> </span>channel_rx(<span style="color: rgb(128, 0, 128); ">NiceAgent</span><span style="color: rgb(192, 192, 192); "> </span>*v_agent,<span style="color: rgb(128, 128, 0); ">int</span><span style="color: rgb(192, 192, 192); "> </span>v_stream_id){</pre><pre style="font-family: 'Courier New'; margin-top: 0px; margin-bottom: 0px; "><pre style="font-family: arial, helvetica, sans-serif; margin-top: 0px; margin-bottom: 0px; ">    <span style="color: rgb(128, 0, 128); ">QGst</span>::<span style="color: rgb(128, 0, 128); ">PipelinePtr</span><span style="color: rgb(192, 192, 192); "> </span>m_pipeline;</pre><span style="font-family: arial, helvetica, sans-serif; ">
</span><pre style="font-family: arial, helvetica, sans-serif; margin-top: 0px; margin-bottom: 0px; "><span style="color: rgb(192, 192, 192); ">    </span><span style="color: rgb(128, 0, 128); ">QGst</span>::<span style="color: rgb(128, 0, 128); ">ElementPtr</span><span style="color: rgb(192, 192, 192); "> </span>vudpsrc,<span style="color: rgb(192, 192, 192); "> </span>videofilter,<span style="color: rgb(192, 192, 192); "> </span>videofilter_rx,<span style="color: rgb(192, 192, 192); "> </span>vdecoder,<span style="color: rgb(192, 192, 192); "> </span>vdepayload,<span style="color: rgb(192, 192, 192); "> </span>ffcolor,<span style="color: rgb(192, 192, 192); "> </span>videosink;</pre><span style="font-family: arial, helvetica, sans-serif; ">
</span><pre style="font-family: arial, helvetica, sans-serif; margin-top: 0px; margin-bottom: 0px; "><span style="color: rgb(192, 192, 192); ">    </span><span style="color: rgb(128, 0, 128); ">QGst</span>::<span style="color: rgb(128, 0, 128); ">CapsPtr</span><span style="color: rgb(192, 192, 192); "> </span>vcaps,<span style="color: rgb(192, 192, 192); "> </span>rxcaps;</pre><span style="font-family: arial, helvetica, sans-serif; ">
</span><pre style="font-family: arial, helvetica, sans-serif; margin-top: 0px; margin-bottom: 0px; "><span style="color: rgb(192, 192, 192); ">    </span><span style="color: rgb(128, 0, 128); ">QGst</span>::<span style="color: rgb(128, 0, 128); ">BinPtr</span><span style="color: rgb(192, 192, 192); "> </span>rxBin;</pre><span style="font-family: arial, helvetica, sans-serif; ">
</span><pre style="font-family: arial, helvetica, sans-serif; margin-top: 0px; margin-bottom: 0px; "><span style="background-color: transparent; ">  </span><span style="background-color: transparent; ">rxBin</span><span style="background-color: transparent; color: rgb(192, 192, 192); "> </span><span style="background-color: transparent; ">=</span><span style="background-color: transparent; color: rgb(192, 192, 192); "> </span><span style="background-color: transparent; color: rgb(128, 0, 128); ">QGst</span><span style="background-color: transparent; ">::</span><span style="background-color: transparent; color: rgb(128, 0, 128); ">Bin</span><span style="background-color: transparent; ">::</span><span style="background-color: transparent; ">create</span><span style="background-color: transparent; ">();</span><br></pre><span style="font-family: arial, helvetica, sans-serif; ">
</span><pre style="font-family: arial, helvetica, sans-serif; margin-top: 0px; margin-bottom: 0px; "><span style="color: rgb(192, 192, 192); ">    </span>m_pipeline<span style="color: rgb(192, 192, 192); "> </span>=<span style="color: rgb(192, 192, 192); "> </span><span style="color: rgb(128, 0, 128); ">QGst</span>::<span style="color: rgb(128, 0, 128); ">Pipeline</span>::create();</pre><pre style="font-family: arial, helvetica, sans-serif; margin-top: 0px; margin-bottom: 0px; "><br></pre><pre style="font-family: arial, helvetica, sans-serif; margin-top: 0px; margin-bottom: 0px; "><span style="color: rgb(192, 192, 192); ">    </span>vudpsrc<span style="color: rgb(192, 192, 192); "> </span>=<span style="color: rgb(192, 192, 192); "> </span><span style="color: rgb(128, 0, 128); ">QGst</span>::<span style="color: rgb(128, 0, 128); ">ElementFactory</span>::make(<span style="color: rgb(0, 128, 0); ">"nicesrc"</span>);</pre><span style="font-family: arial,
 helvetica, sans-serif; ">
</span><pre style="font-family: arial, helvetica, sans-serif; margin-top: 0px; margin-bottom: 0px; "><span style="color: rgb(192, 192, 192); ">    </span>vudpsrc->setProperty(<span style="color: rgb(0, 128, 0); ">"stream"</span>,<span style="color: rgb(192, 192, 192); "> </span>v_stream_id);</pre><span style="font-family: arial, helvetica, sans-serif; ">
</span><pre style="font-family: arial, helvetica, sans-serif; margin-top: 0px; margin-bottom: 0px; "><span style="color: rgb(192, 192, 192); ">    </span>vudpsrc->setProperty(<span style="color: rgb(0, 128, 0); ">"component"</span>,<span style="color: rgb(192, 192, 192); "> </span><span style="color: rgb(0, 0, 128); ">1</span>);</pre><span style="font-family: arial, helvetica, sans-serif; ">
</span><pre style="font-family: arial, helvetica, sans-serif; margin-top: 0px; margin-bottom: 0px; "><span style="background-color: transparent; color: rgb(192, 192, 192); ">    </span><span style="background-color: transparent; color: rgb(128, 0, 128); ">QGlib</span><span style="background-color: transparent; ">::</span><span style="background-color: transparent; color: rgb(128, 0, 128); ">Type</span><span style="background-color: transparent; color: rgb(192, 192, 192); "> </span><span style="background-color: transparent; ">type</span><span style="background-color: transparent; color: rgb(192, 192, 192); "> </span><span style="background-color: transparent; ">=</span><span style="background-color: transparent; color: rgb(192, 192, 192); "> </span><span style="background-color: transparent; color: rgb(128, 0, 128); ">QGlib</span><span style="background-color: transparent; ">::</span><span style="background-color: transparent; color: rgb(128, 0, 128);
 ">Type</span><span style="background-color: transparent; ">::</span><span style="background-color: transparent; ">fromInstance</span><span style="background-color: transparent; ">(</span><span style="background-color: transparent; ">v_agent</span><span style="background-color: transparent; ">);</span><br></pre><pre style="font-family: arial, helvetica, sans-serif; margin-top: 0px; margin-bottom: 0px; "><span style="color: rgb(192, 192, 192); "><br></span></pre><pre style="font-family: arial, helvetica, sans-serif; margin-top: 0px; margin-bottom: 0px; "><span style="color: rgb(192, 192, 192); ">    </span><span style="color: rgb(128, 0, 128); ">QGlib</span>::<span style="color: rgb(128, 0, 128); ">Value</span><span style="color: rgb(192, 192, 192); "> </span>agent_type<span style="color: rgb(192, 192, 192); "> </span>=<span style="color: rgb(192, 192, 192); ">
 </span>vudpsrc->property(<span style="color: rgb(0, 128, 0); ">"agent"</span>);</pre><span style="font-family: arial, helvetica, sans-serif; ">
</span><pre style="font-family: arial, helvetica, sans-serif; margin-top: 0px; margin-bottom: 0px; "><span style="color: rgb(192, 192, 192); ">    </span>agent_type<span style="color: rgb(192, 192, 192); "> </span>=<span style="color: rgb(192, 192, 192); "> </span><span style="color: rgb(128, 0, 128); ">QGlib</span>::<span style="color: rgb(128, 0, 128); ">Value</span>::create(type);</pre><span style="font-family: arial, helvetica, sans-serif; ">
</span><pre style="font-family: arial, helvetica, sans-serif; margin-top: 0px; margin-bottom: 0px; "><span style="background-color: transparent; color: rgb(192, 192, 192); ">    </span><span style="background-color: transparent; ">vudpsrc</span><span style="background-color: transparent; ">-></span><span style="background-color: transparent; ">setProperty</span><span style="background-color: transparent; ">(</span><span style="background-color: transparent; color: rgb(0, 128, 0); ">"agent"</span><span style="background-color: transparent; ">,</span><span style="background-color: transparent; color: rgb(192, 192, 192); "> </span><span style="background-color: transparent; ">agent_type</span><span style="background-color: transparent; ">);  //compile OK but have the following error when run</span><br></pre><pre style="font-family: 'Courier New'; margin-top: 0px; margin-bottom: 0px; "><span style="background-color: transparent; "><div><span
 class="yiv640112029Apple-tab-span">                       </span><span style="font-size: 13px; ">//(SIPPhoneGUI:8513): GLib-GObject-WARNING **: unable to set property `agent' </span></div><div><span style="font-size: 13px; "><span class="yiv640112029Apple-tab-span">                           </span>//of type `NiceAgent' from value of type `GType'</span></div></span></pre><span style="font-family: arial, helvetica, sans-serif; "><pre style="font-family: arial, helvetica, sans-serif; margin-top: 0px; margin-bottom: 0px; "><span style="background-color: transparent; ">    vudpsrc</span><span style="background-color: transparent; ">-></span><span style="background-color: transparent; ">setProperty</span><span style="background-color: transparent; ">(</span><span style="background-color: transparent; color: rgb(0, 128, 0); ">"agent"</span><span style="background-color: transparent; ">,</span><span style="background-color: transparent; color: rgb(192, 192, 192); "> </span><span
 style="background-color: transparent; ">v_agent</span><span style="background-color: transparent; ">);  // cannot compile because of </span></pre><pre style="font-family: arial, helvetica, sans-serif; margin-top: 0px; margin-bottom: 0px; "><span style="background-color: transparent; "><span class="yiv640112029Apple-tab-span">                            </span>/usr/include/QtGStreamer/QGst/../QGlib/type.h:182: error: could not convert 'QGlib::GetTypeImpl<_NiceAgent*>()' </span></pre><pre style="font-family: arial, helvetica, sans-serif; margin-top: 0px; margin-bottom: 0px; "><span style="background-color: transparent; "><span class="yiv640112029Apple-tab-span">                          </span>from 'QGlib::GetTypeImpl<_NiceAgent*>' to 'QGlib::Type'</span></pre>
</span><pre style="font-family: arial, helvetica, sans-serif; margin-top: 0px; margin-bottom: 0px; "><br></pre><span style="font-family: arial, helvetica, sans-serif; ">Can you help me how to set the "agent" property ?</span></pre><pre style="font-family: 'Courier New'; margin-top: 0px; margin-bottom: 0px; "><span style="font-family: arial, helvetica, sans-serif; "><br></span></pre><pre style="font-family: 'Courier New'; margin-top: 0px; margin-bottom: 0px; "><span style="font-family: arial, helvetica, sans-serif; ">Thanks.</span></pre></div></div></div></body></html>