<html><head><meta http-equiv="Content-Type" content="text/html charset=koi8-r"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Sorry I have this more complicated than it needs to be. Please do the following instead:<div><br></div><div><pre style="margin-top: 0px; margin-bottom: 12px; padding: 10px 15px !important; border: 1px solid rgb(202, 201, 201) !important; font: inherit; vertical-align: baseline; border-bottom-left-radius: 8px; background-color: rgb(250, 250, 250); overflow-x: auto; overflow-y: hidden; text-align: left; "><span style="line-height: 18px; color: rgb(85, 85, 85); font-family: 'Courier New', Courier, monospace; ">Glib::ustring sURL(argv[1]);
</span><span style="line-height: 18px; color: rgb(85, 85, 85); font-family: 'Courier New', Courier, monospace; ">refPlay->set_property("uri", sURL);</span></pre><div><br></div><div>Tested OK with your test program on Ubuntu.</div><div><br></div><div>Cedric</div><div><br></div><div><div>On Sep 4, 2012, at 8:36 AM, ζΑΝΙΜΙΡ ιΝΡ <<a href="mailto:kangaba@yandex.ru">kangaba@yandex.ru</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div> Thanks, unfortunately I get a segmentation fault, here's a snippet that compiles:</div><div> </div><div>#include <gstreamermm.h><br>#include <iostream><br><br>static Glib::RefPtr<Glib::MainLoop> refLoop;</div><div> </div><div>gint<br>main(gint argc, gchar *argv[]) {<br><br>    if (!Glib::thread_supported()) {<br>        Glib::thread_init();<br>    }<br><br>    Gst::init(argc, argv);<br><br>    if (argc != 2) {<br>        g_print("Usage: %s <URI>\n", argv[0]);<br>        return -1;<br>    }<br><br>    Glib::RefPtr<Gst::Element> refPlay = Gst::ElementFactory::create_element("playbin", "play");<br>    //g_object_set(G_OBJECT(refPlay->gobj()), "uri", argv[1], NULL);<br>    <br>    Glib::RefPtr< Gst::ElementInterfaced<Gst::URIHandler> > handler =<br>            Gst::Interface::cast<Gst::URIHandler>(refPlay);<br>    Glib::ustring sURL(argv[1]);<br>    handler->set_uri(sURL);<br><br>    refPlay->set_state(Gst::STATE_PLAYING);<br><br>    refLoop = Glib::MainLoop::create(false);<br>    refLoop->run();<br>    refPlay->set_state(Gst::STATE_NULL);<br>    return 0;<br>}</div><div> </div><div> </div><div>04.09.2012, 09:27, "Cedric Hombourger" <<a href="mailto:chombourger@gmail.com">chombourger@gmail.com</a>>:</div><blockquote type="cite"><div>Please try the following:</div><span style="color:#555555;font-family:Courier New,Courier,monospace;"><span style="line-height:18px;">Glib::RefPtr<Gst::ElementInterfaced<Gst::URIHandler></span></span><pre style="margin-top:0px;margin-bottom:12px;padding:10px 15px !important;border:1px solid #cac9c9 !important;font:inherit;vertical-align:baseline;border-bottom-left-radius:8px;background-color:#fafafa;overflow-x:auto;overflow-y:hidden;text-align:left;"><span style="line-height:18px;color:#555555;font-family:"Courier New",Courier,monospace;">> handler = </span><span style="line-height:18px;color:#555555;font-family:"Courier New",Courier,monospace;">Gst::Interface::cast<Gst::URIHandler>(refPlay);</span></pre><div><span style="line-height:18px;color:#555555;font-family:"Courier New",Courier,monospace;">handler->set_uri(</span><span style="line-height:18px;color:#555555;font-family:"Courier New",Courier,monospace;">"<a href="file:///path/to/file.mp3">file:///path/to/file.mp3</a>"</span><span style="line-height:18px;color:#555555;font-family:"Courier New",Courier,monospace;">);</span></div><div><div>On Sep 4, 2012, at 8:21 AM, ζΑΝΙΜΙΡ ιΝΡ <<a href="mailto:kangaba@yandex.ru">kangaba@yandex.ru</a>> wrote:</div><br><blockquote type="cite">btw, refPlay is a playbin var created this way:<br>Glib::RefPtr<Gst::Element> refPlay = Gst::ElementFactory::create_element("playbin", "play");<br><br>04.09.2012, 09:19, "ζΑΝΙΜΙΡ ιΝΡ" <<a href="mailto:kangaba@yandex.ru">kangaba@yandex.ru</a>>:<br><blockquote type="cite">I'm using the (standard) C++ bindings available on Ubuntu (12.04) by installing libgstreamermm-0.10-dev<br><br>04.09.2012, 09:11, "Cedric Hombourger" <<a href="mailto:chombourger@gmail.com">chombourger@gmail.com</a>>:<br><br><blockquote type="cite">  Hi,<br><br>  Are you using the C API or some sort of C++ bindings to GStreamer?<br><br>  Cedric<br><br>  On Sep 4, 2012, at 7:47 AM, ζΑΝΙΜΙΡ ιΝΡ <<a href="mailto:kangaba@yandex.ru">kangaba@yandex.ru</a>> wrote:<br><blockquote type="cite">   Hi,<br>   Sorry if it's the wrong place,<br>   What would be the C++ version of setting the "uri" of the Gst::Element:<br>   g_object_set(G_OBJECT(refElement->gobj()), "uri", "<a href="file:///path/to/file.mp3">file:///path/to/file.mp3</a>", NULL);<br><br>   _______________________________________________<br>   gstreamer-devel mailing list<br>   <a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>   <a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a></blockquote>  _______________________________________________<br>  gstreamer-devel mailing list<br>  <a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>  <a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a></blockquote></blockquote>_______________________________________________<br>gstreamer-devel mailing list<br><a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br><a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a></blockquote></div><br><p>_______________________________________________<br>gstreamer-devel mailing list<br><a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br><a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a></p></blockquote>_______________________________________________<br>gstreamer-devel mailing list<br><a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel<br></blockquote></div><br></div></body></html>