<div>Hi All, Please give your kind help.<br>This question cause me several days without final idea.</div>
<div> </div>
<div>My purpose is to seek on HTTP wav stream over either neonhttpsrc or gnomevfssrc(, maybe there are other plugin).</div>
<div>But the problem is seek cannot jump to the position which i want to seek and cannot change the state.</div>
<div>with error:</div>
<div> </div>
<div><neonhttpsrc> pausing after gst_pad_push() = wrong-state</div>
<div>basesink gstbasesink.c:2099:gst_base_sink_render_object:<alsasink0> do_sync returned wrong-state</div>
<div> </div>
<div> </div>
<div>I first give my codes logic, then with the debug logs.</div>
<div>The gst version on my FEDORA 8</div>
<div>gstreamer.i386 0.10.15-1.fc8 installed<br>gstreamer-devel.i386 0.10.15-1.fc8 installed<br>gstreamer-ffmpeg.i386 0.10.3-7.fc8 installed<br>
gstreamer-plugins-bad.i386 0.10.5-16.fc8 installed<br>gstreamer-plugins-base.i386 0.10.15-4.fc8 installed<br>gstreamer-plugins-base-devel.i386 0.10.15-4.fc8 installed<br>
gstreamer-plugins-good.i386 0.10.6-7.fc8 installed<br>gstreamer-plugins-pulse.i386 0.9.5-0.4.svn20070924. installed<br>gstreamer-plugins-ugly.i386 0.10.6-6.fc8 installed<br>
gstreamer-python.i386 0.10.8-2.fc8 installed<br>gstreamer-tools.i386 0.10.15-1.fc8 installed<br></div>
<div>codes logic:</div>
<div>-------------------------------------------------------------------------------------------</div>
<div> const char *src_name = "neonhttpsrc"; <br> </div>
<div> memset(&(renderer->audioDecoder), 0, sizeof(renderer->audioDecoder));<br> memset(pHttpDecoder, 0, sizeof(*pHttpDecoder));</div>
<div> renderer->selectionFlag |= pkSTREAM_SELECTION_FLAG_AUDIO;</div>
<div> renderer->audioDecoder.pipeline = gst_pipeline_new("pcm-decoder-over-http");</div>
<div> //1. open src: <br> pHttpDecoder->fakesrc = gst_element_factory_make(src_name,src_name);<br> if(!(pHttpDecoder->fakesrc)) <br> {<br> }</div>
<div> g_object_set (G_OBJECT (pHttpDecoder->fakesrc), "location", pcszUrl, NULL);<br> </div>
<div> <br> //2. open wavparse<br> pHttpDecoder->decoder = gst_element_factory_make("wavparse", "wavparse0");<br> <br> //3. open audioconvert<br> pHttpDecoder->convert = gst_element_factory_make("audioconvert", "audioconvert0");<br>
//4. open audioconvert<br> pHttpDecoder->aresample = gst_element_factory_make("audioresample", "audioresample0");<br> //5. open alsasink<br> pHttpDecoder->audiosink = gst_element_factory_make("alsasink", "alsasink0");<br>
/* Setup pipeline */<br> gst_bin_add_many(GST_BIN(renderer->audioDecoder.pipeline),<br> pHttpDecoder->fakesrc,<br> pHttpDecoder->decoder,<br> pHttpDecoder->convert,<br> pHttpDecoder->aresample,<br>
pHttpDecoder->audiosink, NULL);</div>
<div> gst_element_link_many(pHttpDecoder->fakesrc, pHttpDecoder->decoder, NULL);<br> gst_element_link_many(pHttpDecoder->decoder, pHttpDecoder->convert, NULL);</div>
<div> </div>
<div> g_signal_connect(pHttpDecoder->decoder, "pad-added", G_CALLBACK(NewPad_Cb), pHttpDecoder->convert);<br> <br> gst_element_link_many(pHttpDecoder->convert, pHttpDecoder->aresample, pHttpDecoder->audiosink, NULL);<br>
</div>
<div> gst_element_set_state(pipeline, GST_STATE_PAUSED);<br> for(index=0; index < 5; index++)<br> {<br> gst_element_get_state (pipeline, &cur_state, NULL, 1 * GST_SECOND);<br> if ( WaitchangeToState != cur_state ) <br>
{}</div>
<div> else</div>
<div> {break;}</div>
<div> }</div>
<div> // begin seek.<br> b_seek_result = gst_element_seek (audiosink, 1.0, format, SeekFlags ,<br> GST_SEEK_TYPE_SET, time_nanoseconds,<br> GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE); </div>
<div> </div>
<div> gst_element_set_state(hRenderer->audioDecoder.pipeline, GST_STATE_PLAYING);</div>
<div> </div>
<div> </div>
<div>-------------------------------------------------------------------------------------------</div>
<div>logs:</div>
<div>
<div>-------------------------------------------------------------------------------------------</div>
<div> </div></div>
<div>0:00:26.600566000 32405 0xb9dc3e0 DEBUG basesink gstbasesink.c:1718:gst_base_sink_do_sync:<alsasink0> non syncable object 0x8ccb278<br>0:00:26.600574000 32405 0x8cb5560 DEBUG GST_EVENT gstpad.c:4214:gst_pad_send_event:<audioresample0:sink> have event type 19 (FLUSH_START)<br>
0:00:26.600577000 32405 0xb9dc3e0 DEBUG basesink gstbasesink.c:2057:gst_base_sink_render_object:<alsasink0> rendering event 0x8ccb278, type newsegment<br>0:00:26.600584000 32405 0x8cb5560 DEBUG GST_EVENT gstpad.c:4220:gst_pad_send_event:<audioresample0:sink> set flush flag<br>
0:00:26.600589000 32405 0xb9dc3e0 DEBUG baseaudiosink gstbaseaudiosink.c:629:gst_base_audio_sink_event:<alsasink0> new segment rate of 1.000000<br>0:00:26.600596000 32405 0x8cb5560 DEBUG GST_EVENT gstpad.c:4214:gst_pad_send_event:<alsasink0:sink> have event type 19 (FLUSH_START)<br>
0:00:26.600610000 32405 0x8cb5560 DEBUG GST_EVENT gstpad.c:4220:gst_pad_send_event:<alsasink0:sink> set flush flag<br>0:00:26.600606000 32405 0xb9dc3e0 DEBUG basesink gstbasesink.c:1122:gst_base_sink_configure_segment:<alsasink0> configured NEWSEGMENT update 0, rate 1.000000, applied rate 1.000000, format GST_FORMAT_TIME, 0:00:00.000000000 -- 0:04:42.906660998, time 0:00:00.000000000, accum 0:00:00.000000000<br>
0:00:26.600623000 32405 0x8cb5560 DEBUG basesink gstbasesink.c:2309:gst_base_sink_event:<alsasink0> event 0x8ccb2c8 (flush-start)<br>0:00:26.600639000 32405 0x8cb5560 DEBUG ringbuffer gstringbuffer.c:1112:gst_ring_buffer_clear_all:<audiosinkringbuffer0> clear all segments<br>
0:00:26.600641000 32405 0xb9dc3e0 DEBUG basesink gstbasesink.c:2091:gst_base_sink_render_object:<alsasink0> object unref after render 0x8ccb278<br>0:00:26.600661000 32405 0xb9dc3e0 DEBUG basesink gstbasesink.c:2215:gst_base_sink_queue_object_unlocked:<alsasink0> rendering queued object 0x8d054a0<br>
0:00:26.600662000 32405 0x8cb5560 DEBUG ringbuffer gstringbuffer.c:866:gst_ring_buffer_pause_unlocked:<audiosinkringbuffer0> pausing ringbuffer<br>0:00:26.600674000 32405 0xb9dc3e0 DEBUG basesink gstbasesink.c:1718:gst_base_sink_do_sync:<alsasink0> non syncable object 0x8d054a0<br>
0:00:26.600680000 32405 0x8cb5560 DEBUG ringbuffer gstringbuffer.c:895:gst_ring_buffer_pause_unlocked:<audiosinkringbuffer0> was not started<br>0:00:26.600684000 32405 0xb9dc3e0 DEBUG basesink gstbasesink.c:2057:gst_base_sink_render_object:<alsasink0> rendering event 0x8d054a0, type tag<br>
0:00:26.600690000 32405 0x8cb5560 DEBUG basesink gstbasesink.c:2375:gst_base_sink_event:<alsasink0> flush-start 0x8ccb2c8<br>0:00:26.600694000 32405 0xb9dc3e0 DEBUG basesink gstbasesink.c:2091:gst_base_sink_render_object:<alsasink0> object unref after render 0x8d054a0<br>
0:00:26.600751000 32405 0xb9dc3e0 DEBUG basesink gstbasesink.c:1344:gst_base_sink_get_sync_times:<alsasink0> got times start: 0:00:00.000000000, stop: 0:00:00.023219955, do_sync 0<br>0:00:26.600764000 32405 0xb9dc3e0 DEBUG basesink gstbasesink.c:1653:gst_base_sink_do_sync:<alsasink0> prerolling object 0xb9ddca0<br>
0:00:26.600777000 32405 0xb9dc3e0 DEBUG basesink gstbasesink.c:1506:gst_base_sink_wait_preroll:<alsasink0> waiting in preroll for flush or PLAYING<br>0:00:26.600792000 32405 0x8cb5560 DEBUG basesink gstbasesink.c:2713:gst_base_sink_set_flushing:<alsasink0> flushing out data thread, need preroll to TRUE<br>
0:00:26.600802000 32405 0x8cb5560 DEBUG basesink gstbasesink.c:1067:gst_base_sink_preroll_queue_flush:<alsasink0> flushing queue 0xb9ac040<br>0:00:26.600820000 32405 0xb9dc3e0 DEBUG basesink gstbasesink.c:1519:gst_base_sink_wait_preroll:<alsasink0> preroll interrupted<br>
0:00:26.600830000 32405 0xb9dc3e0 DEBUG basesink gstbasesink.c:1723:gst_base_sink_do_sync:<alsasink0> we are flushing<br>0:00:26.600839000 32405 0xb9dc3e0 DEBUG basesink gstbasesink.c:2099:gst_base_sink_render_object:<alsasink0> do_sync returned wrong-state<br>
0:00:26.600848000 32405 0xb9dc3e0 DEBUG basesink gstbasesink.c:2091:gst_base_sink_render_object:<alsasink0> object unref after render 0xb9ddca0<br>0:00:26.600862000 32405 0xb9dc3e0 WARN wavparse gstwavparse.c:1645:gst_wavparse_stream_data:<wavparse0> Error pushing on srcpad 0xb99e630, is linked? = 1<br>
0:00:26.600873000 32405 0xb9dc3e0 INFO basesrc gstbasesrc.c:2054:gst_base_src_loop:<neonhttpsrc> pausing after gst_pad_push() = wrong-state<br>0:00:26.600885000 32405 0xb9dc3e0 DEBUG basesrc gstbasesrc.c:2080:gst_base_src_loop:<neonhttpsrc> pausing task, reason wrong-state<br>
0:00:26.600887000 32405 0x8cb5560 DEBUG GST_STATES gstelement.c:2209:gst_element_lost_state:<alsasink0> lost state of PAUSED to PAUSED<br>0:00:26.600900000 32405 0xb9dc3e0 DEBUG GST_PADS gstpad.c:4394:gst_pad_pause_task:<neonhttpsrc:src> pause task<br>
0:00:26.600912000 32405 0xb9dc3e0 DEBUG task gsttask.c:476:gst_task_pause:<task0> Pausing task 0xb859948<br>0:00:26.600910000 32405 0x8cb5560 DEBUG GST_BUS gstbus.c:337:gst_bus_post:<bus0> [msg 0x8d0e158] posting on bus, type state-changed, GstMessageState, old-state=(GstState)GST_STATE_PAUSED, new-state=(GstState)GST_STATE_PAUSED, pending-state=(GstState)GST_STATE_PAUSED; from source <alsasink0><br>
0:00:26.600939000 32405 0x8cb5560 DEBUG bin gstbin.c:2699:gst_bin_handle_message_func:<pcm-decoder-over-http> [msg 0x8d0e158] handling child alsasink0 message of type state-changed<br>0:00:26.600949000 32405 0x8cb5560 DEBUG bin gstbin.c:2903:gst_bin_handle_message_func:<pcm-decoder-over-http> posting message upward<br>
0:00:26.600960000 32405 0x8cb5560 DEBUG GST_BUS gstbus.c:337:gst_bus_post:<bus1> [msg 0x8d0e158] posting on bus, type state-changed, GstMessageState, old-state=(GstState)GST_STATE_PAUSED, new-state=(GstState)GST_STATE_PAUSED, pending-state=(GstState)GST_STATE_PAUSED; from source <alsasink0><br>
0:00:26.600986000 32405 0x8cb5560 DEBUG GST_BUS gstbus.c:367:gst_bus_post:<bus1> [msg 0x8d0e158] pushing on async queue<br>0:00:26.600998000 32405 0x8cb5560 DEBUG GST_BUS gstbus.c:372:gst_bus_post:<bus1> [msg 0x8d0e158] pushed on async queue<br>
0:00:26.601008000 32405 0x8cb5560 DEBUG GST_BUS gstbus.c:363:gst_bus_post:<bus0> [msg 0x8d0e158] dropped<br>0:00:26.601022000 32405 0x8cb5560 DEBUG GST_BUS gstbus.c:337:gst_bus_post:<bus0> [msg 0x8d0e198] posting on bus, type async-start, GstMessageAsyncStart, new-base-time=(boolean)true; from source <alsasink0><br>
0:00:26.601043000 32405 0x8cb5560 DEBUG pipeline gstpipeline.c:326:reset_stream_time:<pcm-decoder-over-http> reset stream_time to 0<br>0:00:26.601053000 32405 0x8cb5560 DEBUG bin gstbin.c:2699:gst_bin_handle_message_func:<pcm-decoder-over-http> [msg 0x8d0e198] handling child alsasink0 message of type async-start<br>
0:00:26.601065000 32405 0x8cb5560 DEBUG bin gstbin.c:2833:gst_bin_handle_message_func:<pcm-decoder-over-http> ASYNC_START message 0x8d0e198, alsasink0<br>0:00:26.601075000 32405 0x8cb5560 DEBUG bin gstbin.c:739:find_message:<pcm-decoder-over-http> no message found matching types 00100000<br>
0:00:26.601085000 32405 0x8cb5560 DEBUG bin gstbin.c:775:bin_replace_message:<pcm-decoder-over-http> got new message 0x8d0e198, async-start from alsasink0<br>0:00:26.601095000 32405 0x8cb5560 DEBUG GST_STATES gstbin.c:2464:bin_handle_async_start:<pcm-decoder-over-http> lost state of PAUSED, new PAUSED<br>
0:00:26.601109000 32405 0x8cb5560 DEBUG GST_BUS gstbus.c:337:gst_bus_post:<bus1> [msg 0x8d0e1d8] posting on bus, type state-changed, GstMessageState, old-state=(GstState)GST_STATE_PAUSED, new-state=(GstState)GST_STATE_PAUSED, pending-state=(GstState)GST_STATE_PAUSED; from source <pcm-decoder-over-http><br>
0:00:26.601136000 32405 0x8cb5560 DEBUG GST_BUS gstbus.c:367:gst_bus_post:<bus1> [msg 0x8d0e1d8] pushing on async queue<br>0:00:26.601146000 32405 0x8cb5560 DEBUG GST_BUS gstbus.c:372:gst_bus_post:<bus1> [msg 0x8d0e1d8] pushed on async queue<br>
0:00:26.601158000 32405 0x8cb5560 DEBUG GST_BUS gstbus.c:363:gst_bus_post:<bus0> [msg 0x8d0e198] dropped<br>0:00:26.601172000 32405 0x8cb5560 DEBUG GST_PADS gstpad.c:4261:gst_pad_send_event:<alsasink0:sink> sent event, result 1<br>
0:00:26.601183000 32405 0x8cb5560 DEBUG GST_PADS gstpad.c:4261:gst_pad_send_event:<audioresample0:sink> sent event, result 1<br>0:00:26.601193000 32405 0x8cb5560 DEBUG GST_PADS gstpad.c:4261:gst_pad_send_event:<audioconvert0:sink> sent event, result 1<br>
0:00:26.601202000 32405 0x8cb5560 DEBUG wavparse gstwavparse.c:800:gst_wavparse_perform_seek:<wavparse0> stopped streaming at 23219955<br>0:00:26.601212000 32405 0x8cb5560 DEBUG wavparse gstwavparse.c:809:gst_wavparse_perform_seek:<wavparse0> configuring seek<br>
0:00:26.601221000 32405 0x8cb5560 DEBUG wavparse gstwavparse.c:819:gst_wavparse_perform_seek:<wavparse0> cur_type =2<br>0:00:26.601244000 32405 0x8cb5560 DEBUG query gstquery.c:371:gst_query_new: creating new query 0x8d9b4e0 2<br>
0:00:26.601256000 32405 0x8cb5560 DEBUG GST_PADS gstpad.c:3053:gst_pad_query:<neonhttpsrc:src> sending query 0x8d9b4e0<br>0:00:26.601268000 32405 0x8cb5560 DEBUG basesrc gstbasesrc.c:776:gst_base_src_default_query:<neonhttpsrc> duration query in format bytes<br>
0:00:26.601283000 32405 0x8cb5560 DEBUG basesrc gstbasesrc.c:884:gst_base_src_default_query:<neonhttpsrc> query duration returns 1<br>0:00:26.601295000 32405 0x8cb5560 DEBUG wavparse gstwavparse.c:868:gst_wavparse_perform_seek:<wavparse0> seek: offset 17992828, end 49904764, segment 0:01:42.000000000 -- 0:04:42.906660998<br>
0:00:26.601307000 32405 0x8cb5560 DEBUG wavparse gstwavparse.c:874:gst_wavparse_perform_seek:<wavparse0> sending flush stop<br>0:00:26.601317000 32405 0x8cb5560 DEBUG GST_EVENT gstevent.c:286:gst_event_new: creating new event 0x8ccb2f0 flush-stop 39<br>
0:00:26.601329000 32405 0x8cb5560 DEBUG GST_EVENT gstpad.c:4224:gst_pad_send_event:<audioconvert0:sink> cleared flush flag<br>0:00:26.601341000 32405 0x8cb5560 DEBUG GST_EVENT gstpad.c:4224:gst_pad_send_event:<audioresample0:sink> cleared flush flag<br>
0:00:26.601351000 32405 0x8cb5560 DEBUG libaudioresample resample.c:130:resample_input_flush: flush<br>0:00:26.601364000 32405 0x8cb5560 DEBUG GST_EVENT gstpad.c:4224:gst_pad_send_event:<alsasink0:sink> cleared flush flag<br>
0:00:26.601374000 32405 0x8cb5560 DEBUG basesink gstbasesink.c:2309:gst_base_sink_event:<alsasink0> event 0x8ccb2f0 (flush-stop)<br>0:00:26.601384000 32405 0x8cb5560 DEBUG ringbuffer gstringbuffer.c:1112:gst_ring_buffer_clear_all:<audiosinkringbuffer0> clear all segments<br>
0:00:26.601399000 32405 0x8cb5560 DEBUG basesink gstbasesink.c:2404:gst_base_sink_event:<alsasink0> flush-stop 0x8ccb2f0<br>0:00:26.601413000 32405 0x8cb5560 DEBUG GST_PADS gstpad.c:4261:gst_pad_send_event:<alsasink0:sink> sent event, result 1<br>
0:00:26.601424000 32405 0x8cb5560 DEBUG GST_PADS gstpad.c:4261:gst_pad_send_event:<audioresample0:sink> sent event, result 1<br>0:00:26.601442000 32405 0x8cb5560 DEBUG GST_PADS gstpad.c:4261:gst_pad_send_event:<audioconvert0:sink> sent event, result 1<br>
0:00:26.601451000 32405 0x8cb5560 DEBUG wavparse gstwavparse.c:906:gst_wavparse_perform_seek:<wavparse0> Creating newsegment from 102000000000 to 282906660998<br>0:00:26.601463000 32405 0x8cb5560 INFO GST_EVENT gstevent.c:528:gst_event_new_new_segment_full: creating newsegment update 0, rate 1.000000, format GST_FORMAT_TIME, start 0:01:42.000000000, stop 0:04:42.906660998, position 0:01:42.000000000<br>
0:00:26.601482000 32405 0x8cb5560 DEBUG GST_EVENT gstevent.c:286:gst_event_new: creating new event 0x8ccb318 newsegment 102<br>0:00:26.601495000 32405 0x8cb5560 DEBUG wavparse gstwavparse.c:918:gst_wavparse_perform_seek:<wavparse0> mark DISCONT, we did a seek to another position<br>
0:00:26.601508000 32405 0x8cb5560 DEBUG GST_PADS gstpad.c:4261:gst_pad_send_event:<wavparse0:src> sent event, result 1<br>0:00:26.601526000 32405 0x8cb5560 DEBUG GST_PADS gstpad.c:4261:gst_pad_send_event:<audioconvert0:src> sent event, result 1<br>
0:00:26.601539000 32405 0x8cb5560 DEBUG GST_PADS gstpad.c:4261:gst_pad_send_event:<audioresample0:src> sent event, result 1<br>():Line[2361]: Seek success! <br>():LINE[2507] seeking returned result 0 <br>
0:00:26.601558000 32405 0x8cb5560 DEBUG GST_STATES gstelement.c:2283:gst_element_set_state_func:<pcm-decoder-over-http> set_state to PLAYING<br>0:00:26.601568000 32405 0x8cb5560 DEBUG GST_STATES gstelement.c:2319:gst_element_set_state_func:<pcm-decoder-over-http> current PAUSED, old_pending PAUSED, next PAUSED, old return ASYNC<br>
0:00:26.601579000 32405 0x8cb5560 DEBUG GST_STATES gstelement.c:2373:gst_element_set_state_func:<pcm-decoder-over-http> element was busy with async state change<br>0:00:26.601591000 32405 0x8cb5560 INFO GST_STATES gstbin.c:1537:gst_bin_get_state_func:<pcm-decoder-over-http> getting state<br>
0:00:26.601600000 32405 0x8cb5560 DEBUG GST_STATES gstelement.c:1840:gst_element_get_state_func:<pcm-decoder-over-http> getting state, timeout 0:00:01.000000000<br>0:00:26.601615000 32405 0x8cb5560 DEBUG GST_STATES gstelement.c:1845:gst_element_get_state_func:<pcm-decoder-over-http> RETURN is ASYNC<br>
0:00:26.601625000 32405 0x8cb5560 INFO GST_STATES gstelement.c:1881:gst_element_get_state_func:<pcm-decoder-over-http> waiting for element to commit state<br>0:00:27.601655000 32405 0x8cb5560 INFO GST_STATES gstelement.c:1885:gst_element_get_state_func:<pcm-decoder-over-http> timed out<br>
0:00:27.601688000 32405 0x8cb5560 DEBUG GST_STATES gstelement.c:1918:gst_element_get_state_func:<pcm-decoder-over-http> state current: PAUSED, pending: PLAYING, result: ASYNC<br>():Line[2512]: cur_state is 3 <br>
returned with retVal 0x(0) </div>
<div><br> </div>
<div><br><br><br> </div>