<br><br><div class="gmail_quote">On Mon, Nov 30, 2009 at 8:50 AM, Sameer Naik <span dir="ltr">&lt;<a href="mailto:sameer.subscriptions@damagehead.com">sameer.subscriptions@damagehead.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
I have developed an audio decoder plugin for gstreamer that uses TI&#39;s<br>
dsp decoders that decode the audio frames on the dsp.<br>
<br>
An overview of the plugin architecture:<br>
In the plugin i am parsing the audio stream (if the stream is not<br>
packetized) so as to feed entire audio frames to the dsp decoder. Due<br>
to the parsing code i store some of the input data to parse with the<br>
next input buffer. in the stream once i have sync&#39;d to an audioframe,<br>
i calculate the encoded framelength and start copying the data into an<br>
internal buffer that is designated as the dsp decoders  input buffer.<br>
Only after the entire frame has been copying, the DSP algorithm is<br>
fired up to decode the encoded audio frame.<br>
<br>
Regarding seeking i have a few questions.<br>
Firstly, on an seek event i will need to clear the data in the<br>
decoders input buffer as well as the data that i store for parsing<br>
with the next input buffer. I want to know whether<br>
1] the plugin could receive a buffer (_chain process) and an event<br>
(_event_handler) at the same time.  What i mean to say is if the<br>
_chain function is called, could the pad _event handler be called<br>
while the _chain function is still processing the input buffer.<br>
2] Or does this happen in an orderly fashion, where if the _chain<br>
function is currently processing data, then the pad _event  handler<br>
will not be called until the _chain has finished its processing.<br>
Currently i have specified locks on the dsp decoders input buffers,<br>
which is required if case 1 true, while it is absolutely unnecessary<br>
if case 2 is true.<br>
<br></blockquote><div><br>This might help you Sameer:<br>
<pre><code>&quot;The actual seek is performed in the application thread so that success<br>or failure can be reported as a return value of the seek event. It is<br>therefore important that before executing the seek, the element acquires<br>
the STREAM_LOCK so that the streaming thread and the seek get serialized.&quot;<br></code></pre>

<a href="http://cgit.freedesktop.org/gstreamer/gstreamer/tree/docs/design/part-events.txt">http://cgit.freedesktop.org/gstreamer/gstreamer/tree/docs/design/part-events.txt</a><br>
 
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Secondly, as mentioned above i clear the decoders input buffer and the<br>
other buffers on a seek event. Should i do this buffer cleanup on a<br>
seek event or should i handle this in a new segment event or both.<br>
<br></blockquote><div><br>The documentation of the events should help you with the newsegment too.<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

Currently seeking is working most of the time. however it does fail<br>
sometimes. Your response will help me in narrowing things down.<br>
<br>
Please comment<br>
~Sameer<br>
<br></blockquote><div><br><pre><code>best regards,<br>Katcipis</code></pre> 
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
------------------------------------------------------------------------------<br>
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day<br>
trial. Simplify your report design, integration and deployment - and focus on<br>
what you do best, core application coding. Discover what&#39;s new with<br>
Crystal Reports now.  <a href="http://p.sf.net/sfu/bobj-july" target="_blank">http://p.sf.net/sfu/bobj-july</a><br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
</blockquote></div><br><br>