<DIV>Hi Tyler,</DIV>
<DIV>&nbsp;&nbsp; Thank your reply first,my pipeline is just working in pull mode according to what&nbsp;you said, it is:</DIV>
<DIV>gst-launch-0.10 filesrc location=$1 ! adecoder Codec=3 ! queue max-size-buffers=23 min-threshold-buffers =2 ! osssink<BR>and the&nbsp;source is a mp3 file,which is 32kbps,44100Hz and 2 channels</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp; and ,addtionally,I think maybe I should add some code to the <FONT color="#808080">GST_EVENT_FLUSH_STOP </FONT>processing to empty the buffers before forward the event</DIV>
<DIV>&nbsp;</DIV>
<DIV>Volter<BR></DIV><BR>在2008-04-09,"Tyler Nielsen" &lt;tyler@behindtheset.com&gt; 写道:<BR>
<BLOCKQUOTE id="isReplyContent" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Volter,<BR><BR>What pipeline did you use?&nbsp; What audio file type are you playing?&nbsp; Adecoder can run in two modes, push or pull.&nbsp; In pull mode, adecoder drivers the pipeline, and as you pointed out it doesn't implement seek.&nbsp; In push mode, adecoder receives data from upstream, as long as the upstream component supports seeking, adecoder doesn't need to do anything additional.<BR><BR>As an example, with mp3, this won't seek correctly, because adecoder just pulls data from the filesrc.<BR>filesrc location=$1 ! adecoder Codec=3 ! osssink<BR><BR>This will seek, (but I've found it's very slow on my dm6446):<BR>filesrc location=$1 ! mp3parse ! adecoder ! osssink<BR><BR>Tyler<BR><BR>
<DIV class="gmail_quote">2008/4/8 Volter Yen &lt;<A href="mailto:volter619@163.com">volter619@163.com</A>&gt;:<BR>
<BLOCKQUOTE class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<DIV>Hi all,</DIV>
<DIV>&nbsp;&nbsp;&nbsp; Recently,I used the adecode to try to implement an&nbsp;audio player with &nbsp;fast forward/backwad fuctions, but It gave no response to my seeking action in my application, and the probelm maybe be caused by the event process in the decode element,it just forward the event to other elements in the pipe. </DIV>
<DIV>&nbsp;and&nbsp; the related codes are&nbsp;as follow:&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT color="#808080">static gboolean gst_adecoder_src_event(GstPad * pad, GstEvent * event)<BR>{<BR>&nbsp;&nbsp;&nbsp; gboolean res;</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp; GstADecoder *adecoder;</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp; adecoder = GST_ADECODER(GST_PAD_PARENT(pad));</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp; if (adecoder-&gt;codec_handle == NULL)</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp; goto no_decoder;</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp; res = gst_pad_push_event(adecoder-&gt;sinkpad, event);</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp; return res;</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp; no_decoder:<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GST_DEBUG_OBJECT(adecoder, "no decoder, cannot handle event");</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gst_event_unref(event);</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return FALSE;<BR>&nbsp;&nbsp;&nbsp; }<BR>}</FONT></DIV>
<DIV><FONT color="#808080"></FONT>&nbsp;</DIV>
<DIV><FONT color="#808080"></FONT>&nbsp;</DIV>
<DIV><FONT color="#808080">static gboolean gst_adecoder_sink_event(GstPad * pad, GstEvent * event)<BR>{</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp; GstADecoder *adecoder = GST_ADECODER(GST_PAD_PARENT(pad));</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp; gboolean ret = TRUE;</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp; #ifdef DEBUG</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp; printf("Got %s event on sink pad\n", GST_EVENT_TYPE_NAME(event));</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp; #endif</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp; switch (GST_EVENT_TYPE(event))<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;case GST_EVENT_NEWSEGMENT:</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;ret = gst_pad_event_default(pad, event);</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;break;</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp; &nbsp;case GST_EVENT_FLUSH_START:</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ret = gst_pad_event_default(pad, event);</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp; &nbsp;case GST_EVENT_FLUSH_STOP:</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ret = gst_pad_event_default(pad, event);</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp; &nbsp;case GST_EVENT_EOS:</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gst_adecoder_decode_remaining(adecoder);</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT><FONT color="#808080">ret = gst_pad_event_default(pad, event);</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp; &nbsp;default:</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ret = gst_pad_event_default(pad, event);</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<BR>&nbsp;&nbsp;&nbsp; }</FONT></DIV>
<DIV><FONT color="#808080">&nbsp;&nbsp;&nbsp; return ret;<BR>}</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Is there any problem? Any suggestion? Thank you!</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Volter</DIV><BR><BR>
<HR>
<FONT style="FONT-SIZE: 12px; LINE-HEIGHT: 15px">500强春季最新高薪职位信息,</FONT><A style="FONT-SIZE: 12px; COLOR: blue; LINE-HEIGHT: 15px; TEXT-DECORATION: underline" href="http://popme.163.com/link/004199_0407_8566.html" target="_blank">快填简历参加面试</A><BR>_______________________________________________<BR>Davinci-linux-open-source mailing list<BR><A href="mailto:Davinci-linux-open-source@linux.davincidsp.com">Davinci-linux-open-source@linux.davincidsp.com</A><BR><A href="http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source" target="_blank">http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source</A><BR><BR></BLOCKQUOTE></DIV><BR></BLOCKQUOTE><br><!-- footer --><br> 
<hr>
<font style="font-size:12px;line-height:15px;">蒙牛以领先责任创4年至高荣誉 </font><a style="font-size:12px;line-height:15px; color:blue; text-decoration:underline;" href="http://popme.163.com/link/004228_0408_3476.html">权威数据为蒙牛加冕</a>