<html>
    <head>
        <title></title>
        <style type="text/css" media="screen">
body {font-family: verdana, arial, helvetica, sans-serif;font-size: 12px;padding: 5px;margin: 0;background-color: #FFF;}
p, ul, li {margin-top: 0;margin-bottom: 0;}
blockquote {margin-left: 5px;}
div.signature {color: #666;font-family: monospace; font-size: 0.9em;}
</style>
    </head>
    <body>
        Hi guys,<br /><br />first thing, thanks for this greate multimedia framework. :)<br /><br />I have a problem: <br />I can't play a URL (URI). I use playbin and decodebin.<br /><br />The technical description:<br /><br />I initialize first the gstreamer with gst_init( &amp;argc, &amp;argv ). It works fine. <br />After this i create a new pipeline with function gstt_pipeline_new( &quot;name&quot; );<br />All ok. Now i create an output binary with convert, resample, volume and sink elements. Thats fine. So i add bin, link and add pad to this.<br /><br />&nbsp;&nbsp;&nbsp; GstElement *outputConvert&nbsp;&nbsp; = gst_element_factory_make (&quot;audioconvert&quot;, &quot;audioconvert&quot; );<br />&nbsp;&nbsp;&nbsp; GstElement *outputResample&nbsp; = gst_element_factory_make (&quot;audioresample&quot;, &quot;audioresample&quot; );<br />&nbsp;&nbsp;&nbsp; GstElement *outputVolume&nbsp;&nbsp;&nbsp; = gst_element_factory_make (&quot;volume&quot;, &quot;volume&quot; );<br />&nbsp;&nbsp;&nbsp; GstElement *outputSink&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = PSGstHelper::audioSink(); // gives me the correct audio from systemx<br /><br />&nbsp;&nbsp;&nbsp; gst_bin_add_many( GST_BIN( m_gstBinary[ OUTPUT ] ), outputConvert, outputResample, outputVolume, outputSink, NULL );<br />&nbsp;&nbsp;&nbsp; gst_element_link_many( outputConvert, outputResample, outputVolume, outputSink, NULL );<br /><br />&nbsp;&nbsp;&nbsp; GstPad *outputPad = gst_element_get_static_pad( outputConvert, &quot;sink&quot; );<br />&nbsp;&nbsp;&nbsp; gst_element_add_pad( m_gstBinary[ OUTPUT ], gst_ghost_pad_new( &quot;sink&quot;, outputPad ) );<br />&nbsp;&nbsp;&nbsp; gst_object_unref( outputPad );<br />&nbsp;&nbsp;&nbsp; gst_object_ref( m_gstBinary[ OUTPUT ] );<br />&nbsp;&nbsp;&nbsp; <br />After creating this binary, i create a new binary for &quot;filesrc&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; GstElement *fileSource&nbsp;&nbsp;&nbsp; = gst_element_factory_make( &quot;filesrc&quot;, &quot;filesrc&quot; );<br />&nbsp;&nbsp;&nbsp; GstElement *fileDecoder&nbsp;&nbsp; = gst_element_factory_make( &quot;decodebin&quot;, &quot;decodebin&quot; );<br />&nbsp;&nbsp;&nbsp; GstElement *fileIdentity&nbsp; = gst_element_factory_make( &quot;identity&quot;, &quot;identity&quot; );<br /><br />&nbsp;&nbsp;&nbsp; if( fileSource &amp;&amp; fileDecoder &amp;&amp; fileIdentity) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gst_bin_add_many( GST_BIN( m_gstBinary[ FILE ] ), fileSource, fileDecoder, fileIdentity, NULL );<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gst_element_link_many( fileSource, fileDecoder, NULL );<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; g_signal_connect( G_OBJECT(fileDecoder), &quot;new-decoded-pad&quot;, G_CALLBACK(gstPadLink), fileIdentity );<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GstPad * pad = gst_element_get_static_pad (fileIdentity, &quot;src&quot;);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gst_element_add_pad( m_gstBinary[ FILE ], gst_ghost_pad_new(&quot;src&quot;, pad) );<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gst_object_unref(pad);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gst_object_ref( m_gstBinary[ FILE ] );<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //g_timeout_add( 200, (GSourceFunc)gstQueryTimePosition, fileSource );<br />&nbsp;&nbsp;&nbsp; }<br /><br />After creating this binary, i create a new binary for &quot;playbin&quot;<br /><br />&nbsp;&nbsp;&nbsp; GstElement *httpSource&nbsp;&nbsp;&nbsp; = gst_element_factory_make( &quot;playbin&quot;, &quot;playbin&quot; );<br />&nbsp;&nbsp;&nbsp; GstElement *httpDecoder&nbsp;&nbsp; = gst_element_factory_make( &quot;decodebin&quot;, &quot;decodebin&quot; );<br />&nbsp;&nbsp;&nbsp; GstElement *httpIdentity&nbsp; = gst_element_factory_make( &quot;identity&quot;, &quot;identity&quot; );<br /><br />&nbsp;&nbsp;&nbsp; if( httpSource &amp;&amp; httpDecoder &amp;&amp; httpIdentity ) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gst_bin_add_many( GST_BIN( m_gstBinary[ HTTP ] ), httpSource, httpDecoder, httpIdentity, NULL );<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gst_element_link_many( httpSource, httpDecoder, httpIdentity, NULL );<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; g_signal_connect( G_OBJECT(httpDecoder), &quot;new-decoded-pad&quot;, G_CALLBACK(gstPadLink), httpIdentity );<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GstPad *httpPad = gst_element_get_static_pad( httpIdentity, &quot;src&quot; );<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gst_element_add_pad( m_gstBinary[ HTTP ], gst_ghost_pad_new( &quot;src&quot;, httpPad ) );<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gst_object_unref( httpPad );<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gst_object_ref( m_gstBinary[ HTTP ] );<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; g_timeout_add( 200, (GSourceFunc)gstQueryTimePosition, httpSource );<br />&nbsp;&nbsp;&nbsp; }<br />&nbsp;<br />At end i set the state to ready:<br /><br />&nbsp; gst_element_set_state( m_gstPipeline, GST_STATE_READY );<br />&nbsp; gst_element_get_state( m_gstPipeline, NULL, NULL, GST_CLOCK_TIME_NONE );<br /><br />Everything fine, but my problem, if i play with m_gstBinary[ FILE ] works ok, but if i play with m_gstBinary[ HTTP ] is not working.<br />My play function sets the state to GST_STATE_PLAYING on m_gstPipeline but i get GST_STATE_CHANGE_ASYNC every time.<br />Before I play a source I change the m_gstPipeline to the correct m_gstBinary but if it is playing I set the state to GST_STATE_NULL:<br /><br />&nbsp; m_gstPlayElement = m_gstBinary[ _binaries ];<br />&nbsp; gst_bin_add_many( GST_BIN(m_gstPipeline), m_gstPlayElement, m_gstBinary[ OUTPUT ], NULL);<br />&nbsp; gst_element_link_many( m_gstPlayElement, m_gstBinary[ OUTPUT ], NULL);<br /><br />&nbsp; GstStateChangeReturn ret = gst_element_set_state( m_gstPipeline, GST_STATE_READY );<br />&nbsp; ret = gst_element_get_state( m_gstPipeline, NULL, NULL, GST_CLOCK_TIME_NONE );<br />&nbsp; <br />Of course I catch the events from m_gstPipeline such as GST_MESSAGE_BUFFERING ... GST_MESSAGE_BUFFERING and so on.<br /><br />But I can't play the stream!<br /><br />Regards<br />ChMaster
    <div class="signature"><br /><br /><br />-- <br />GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!<br />Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01</div></body>
</html>