<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( &argc, &argv ). It works fine. <br />After this i create a new pipeline with function gstt_pipeline_new( "name" );<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 /> GstElement *outputConvert = gst_element_factory_make ("audioconvert", "audioconvert" );<br /> GstElement *outputResample = gst_element_factory_make ("audioresample", "audioresample" );<br /> GstElement *outputVolume = gst_element_factory_make ("volume", "volume" );<br /> GstElement *outputSink = PSGstHelper::audioSink(); // gives me the correct audio from systemx<br /><br /> gst_bin_add_many( GST_BIN( m_gstBinary[ OUTPUT ] ), outputConvert, outputResample, outputVolume, outputSink, NULL );<br /> gst_element_link_many( outputConvert, outputResample, outputVolume, outputSink, NULL );<br /><br /> GstPad *outputPad = gst_element_get_static_pad( outputConvert, "sink" );<br /> gst_element_add_pad( m_gstBinary[ OUTPUT ], gst_ghost_pad_new( "sink", outputPad ) );<br /> gst_object_unref( outputPad );<br /> gst_object_ref( m_gstBinary[ OUTPUT ] );<br /> <br />After creating this binary, i create a new binary for "filesrc"<br /> <br /> GstElement *fileSource = gst_element_factory_make( "filesrc", "filesrc" );<br /> GstElement *fileDecoder = gst_element_factory_make( "decodebin", "decodebin" );<br /> GstElement *fileIdentity = gst_element_factory_make( "identity", "identity" );<br /><br /> if( fileSource && fileDecoder && fileIdentity) {<br /> gst_bin_add_many( GST_BIN( m_gstBinary[ FILE ] ), fileSource, fileDecoder, fileIdentity, NULL );<br /> gst_element_link_many( fileSource, fileDecoder, NULL );<br /><br /> g_signal_connect( G_OBJECT(fileDecoder), "new-decoded-pad", G_CALLBACK(gstPadLink), fileIdentity );<br /><br /> GstPad * pad = gst_element_get_static_pad (fileIdentity, "src");<br /> gst_element_add_pad( m_gstBinary[ FILE ], gst_ghost_pad_new("src", pad) );<br /> gst_object_unref(pad);<br /><br /> gst_object_ref( m_gstBinary[ FILE ] );<br /> //g_timeout_add( 200, (GSourceFunc)gstQueryTimePosition, fileSource );<br /> }<br /><br />After creating this binary, i create a new binary for "playbin"<br /><br /> GstElement *httpSource = gst_element_factory_make( "playbin", "playbin" );<br /> GstElement *httpDecoder = gst_element_factory_make( "decodebin", "decodebin" );<br /> GstElement *httpIdentity = gst_element_factory_make( "identity", "identity" );<br /><br /> if( httpSource && httpDecoder && httpIdentity ) {<br /> gst_bin_add_many( GST_BIN( m_gstBinary[ HTTP ] ), httpSource, httpDecoder, httpIdentity, NULL );<br /> gst_element_link_many( httpSource, httpDecoder, httpIdentity, NULL );<br /><br /> g_signal_connect( G_OBJECT(httpDecoder), "new-decoded-pad", G_CALLBACK(gstPadLink), httpIdentity );<br /><br /> GstPad *httpPad = gst_element_get_static_pad( httpIdentity, "src" );<br /> gst_element_add_pad( m_gstBinary[ HTTP ], gst_ghost_pad_new( "src", httpPad ) );<br /> gst_object_unref( httpPad );<br /><br /> gst_object_ref( m_gstBinary[ HTTP ] );<br /> g_timeout_add( 200, (GSourceFunc)gstQueryTimePosition, httpSource );<br /> }<br /> <br />At end i set the state to ready:<br /><br /> gst_element_set_state( m_gstPipeline, GST_STATE_READY );<br /> 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 /> m_gstPlayElement = m_gstBinary[ _binaries ];<br /> gst_bin_add_many( GST_BIN(m_gstPipeline), m_gstPlayElement, m_gstBinary[ OUTPUT ], NULL);<br /> gst_element_link_many( m_gstPlayElement, m_gstBinary[ OUTPUT ], NULL);<br /><br /> GstStateChangeReturn ret = gst_element_set_state( m_gstPipeline, GST_STATE_READY );<br /> ret = gst_element_get_state( m_gstPipeline, NULL, NULL, GST_CLOCK_TIME_NONE );<br /> <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>