<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div>Thank you!&nbsp; Actually we already started to do as what you proposed.&nbsp; Before we implemented an audio sink derived from GstAudioSink already, now I'm try to seek a better solution to revise our old audio sink, you know, which had a ring buffer, to support MP3.<br><br>Best regards,<br>Dale<br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- 原始邮件 ----<br>发件人: "Zheng, Huan" &lt;huan.zheng@intel.com&gt;<br>收件人: Discussion of the development of GStreamer &lt;gstreamer-devel@lists.sourceforge.net&gt;<br>已发送: 2008/10/8(周三), 上午11:37:13<br>主题: Re: [gst-devel] how to implement an MP3 sink element<br><br>


 
 

 

<style>
<!--
 
 _filtered {font-family:宋体;panose-1:2 1 6 0 3 1 1 1 1 1;}
 _filtered {font-family:PMingLiU;panose-1:2 2 3 0 0 0 0 0 0 0;}
 _filtered {font-family:Tahoma;panose-1:2 11 6 4 3 5 4 4 2 4;}
 _filtered {font-family:"Palatino Linotype";panose-1:2 4 5 2 5 5 5 3 3 4;}
 _filtered {panose-1:2 1 6 0 3 1 1 1 1 1;}
 _filtered {font-family:Pristina;panose-1:3 6 4 2 4 4 6 8 2 4;}
 _filtered {panose-1:2 2 3 0 0 0 0 0 0 0;}
 
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;margin-bottom:.0001pt;font-size:12.0pt;font-family:宋体;}
a:link, span.MsoHyperlink
        {color:blue;text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;text-decoration:underline;}
span.EmailStyle17
        {font-family:"Palatino Linotype";color:purple;font-weight:normal;font-style:normal;text-decoration:none none;}
 _filtered {margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {}
-->
</style>



<div class="Section1">

<p class="MsoNormal"><font size="2" color="purple" face="Palatino Linotype"><span style="font-size: 10pt; font-family: &quot;Palatino Linotype&quot;; color: purple;" lang="EN-US">My
idea is to derive from Gstbasesink</span></font></p> 

<p class="MsoNormal"><font size="2" color="purple" face="Palatino Linotype"><span style="font-size: 10pt; font-family: &quot;Palatino Linotype&quot;; color: purple;" lang="EN-US">And
this derived sink will do the following thing: 1, mp3 decode 2, pcm rendering
3, provide Gstclock</span></font></p> 

<p class="MsoNormal"><font size="2" color="purple" face="Palatino Linotype"><span style="font-size: 10pt; font-family: &quot;Palatino Linotype&quot;; color: purple;" lang="EN-US">And
there are several plugins that you will need to reference correspondingly: 1,
mad plugin 2, alsasink plugin 3, Gstbaseaudiosink</span></font></p> 

<p class="MsoNormal"><font size="2" color="purple" face="Palatino Linotype"><span style="font-size: 10pt; font-family: &quot;Palatino Linotype&quot;; color: purple;" lang="EN-US">And
this derived sink will depend on the following libraries: 1, mad decode library
2, id3tag library 3, libasound </span></font></p> 

<p class="MsoNormal"><font size="2" color="purple" face="Palatino Linotype"><span style="font-size: 10pt; font-family: &quot;Palatino Linotype&quot;; color: purple;" lang="EN-US"> &nbsp;</span></font></p> 

<p class="MsoNormal"><font size="2" color="purple" face="Palatino Linotype"><span style="font-size: 10pt; font-family: &quot;Palatino Linotype&quot;; color: purple;" lang="EN-US">Inside
the </span></font><font size="2" color="red" face="Palatino Linotype"><span style="font-size: 10pt; font-family: &quot;Palatino Linotype&quot;; color: red;" lang="EN-US">render</span></font><font size="2" color="purple" face="Palatino Linotype"><span style="font-size: 10pt; font-family: &quot;Palatino Linotype&quot;; color: purple;" lang="EN-US"> function of this derived
sink, you will need to combine the </span></font><font size="2" color="red" face="Palatino Linotype"><span style="font-size: 10pt; font-family: &quot;Palatino Linotype&quot;; color: red;" lang="EN-US">chain</span></font><font size="2" color="purple" face="Palatino Linotype"><span style="font-size: 10pt; font-family: &quot;Palatino Linotype&quot;; color: purple;" lang="EN-US"> function of mad plugin with </span></font><font size="2" color="red" face="Palatino Linotype"><span style="font-size: 10pt; font-family: &quot;Palatino Linotype&quot;; color: red;" lang="EN-US">ALSA</span></font><font size="2" color="purple" face="Palatino Linotype"><span style="font-size: 10pt; font-family: &quot;Palatino Linotype&quot;; color: purple;" lang="EN-US"> pcm rendering functions.</span></font></p> 

<p class="MsoNormal"><font size="2" color="purple" face="Palatino Linotype"><span style="font-size: 10pt; font-family: &quot;Palatino Linotype&quot;; color: purple;" lang="EN-US"> &nbsp;</span></font></p> 

<p class="MsoNormal"><font size="2" color="purple" face="Palatino Linotype"><span style="font-size: 10pt; font-family: &quot;Palatino Linotype&quot;; color: purple;" lang="EN-US">What
I have done is that I have integrated ALSA pcm rendering into the </span></font><font size="2" color="red" face="Palatino Linotype"><span style="font-size: 10pt; font-family: &quot;Palatino Linotype&quot;; color: red;" lang="EN-US">render</span></font><font size="2" color="purple" face="Palatino Linotype"><span style="font-size: 10pt; font-family: &quot;Palatino Linotype&quot;; color: purple;" lang="EN-US"> function of the derived
sink, and let this sink provide a GstClock. So that this derived the sink could
now directly play out raw pcm data. Usage is: filesrc location=rawpcm ! mysink</span></font></p> 

<p class="MsoNormal"><font size="2" color="purple" face="Palatino Linotype"><span style="font-size: 10pt; font-family: &quot;Palatino Linotype&quot;; color: purple;" lang="EN-US">I’m
not going to add mp3 decode into the render function, because my scenario is
hardware decoding, what I’m going to do is to add mp3 frame parsing into the
render function, and print out frame information for each frame.</span></font></p> 

<p class="MsoNormal"><font size="2" color="purple" face="Palatino Linotype"><span style="font-size: 10pt; font-family: &quot;Palatino Linotype&quot;; color: purple;" lang="EN-US"> &nbsp;</span></font></p> 

<p class="MsoNormal"><font size="2" color="purple" face="Palatino Linotype"><span style="font-size: 10pt; font-family: &quot;Palatino Linotype&quot;; color: purple;" lang="EN-US">Any
suggestions are appreciated!</span></font></p> 

<p class="MsoNormal"><font size="2" color="purple" face="Palatino Linotype"><span style="font-size: 10pt; font-family: &quot;Palatino Linotype&quot;; color: purple;" lang="EN-US"> &nbsp;</span></font></p> 

<div>

<p class="MsoNormal"><font size="3" color="navy" face="Pristina"><span style="font-size: 12pt; font-family: Pristina; color: navy;" lang="EN-US">Best Regards, Zheng,
Huan(ZBT)</span></font></p> 

<p class="MsoNormal"><font size="3" color="purple" face="Pristina"><span style="font-size: 12pt; font-family: Pristina; color: purple;" lang="EN-US">OTC/SSD/SSG</span></font></p> 

<p class="MsoNormal"><font size="3" color="navy" face="Pristina"><span style="font-size: 12pt; font-family: Pristina; color: navy;" lang="EN-US">Intel Aisa-Pacific
Research &amp; Developement Ltd</span></font></p> 

<p class="MsoNormal"><font size="3" color="purple" face="Pristina"><span style="font-size: 12pt; font-family: Pristina; color: purple;" lang="EN-US">Tel: 021-6116 6435</span></font></p> 

<p class="MsoNormal"><font size="3" color="purple" face="Pristina"><span style="font-size: 12pt; font-family: Pristina; color: purple;" lang="EN-US">Inet: 8821 6435</span></font><font color="purple"><span style="color: purple;" lang="EN-US"></span></font></p> 

<p class="MsoNormal"><font size="3" color="purple" face="Pristina"><span style="font-size: 12pt; font-family: Pristina; color: purple;" lang="EN-US">Cub: 3W035</span></font><span lang="EN-US"></span></p> 

</div>

<div>

<div class="MsoNormal" style="text-align: center;" align="center"><font size="3" face="宋体"><span style="font-size: 12pt;" lang="EN-US">

<hr tabindex="-1" size="2" width="100%" align="center">

</span></font></div>

<p class="MsoNormal"><b><font size="2" face="Tahoma"><span style="font-size: 10pt; font-family: Tahoma; font-weight: bold;" lang="EN-US">From:</span></font></b><font size="2" face="Tahoma"><span style="font-size: 10pt; font-family: Tahoma;" lang="EN-US">
Dale Tian [mailto:daletian@yahoo.cn] <br>
<b><span style="font-weight: bold;">Sent:</span></b> 2008</span></font><font size="2"><span style="font-size: 10pt;">年</span></font><font size="2" face="Tahoma"><span style="font-size: 10pt; font-family: Tahoma;" lang="EN-US">10</span></font><font size="2"><span style="font-size: 10pt;">月</span></font><font size="2" face="Tahoma"><span style="font-size: 10pt; font-family: Tahoma;" lang="EN-US">8</span></font><font size="2"><span style="font-size: 10pt;">日</span></font><font size="2" face="Tahoma"><span style="font-size: 10pt; font-family: Tahoma;" lang="EN-US"> 10:55<br>
<b><span style="font-weight: bold;">To:</span></b> Discussion
 of the development of GStreamer<br>
<b><span style="font-weight: bold;">Subject:</span></b> [gst-devel] how to
implement an MP3 sink element</span></font><span lang="EN-US"></span></p> 

</div>

<p class="MsoNormal"><font size="3" face="宋体"><span style="font-size: 12pt;" lang="EN-US"> &nbsp;</span></font></p> 

<div>

<div>

<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size: 12pt; font-family: &quot;Times New Roman&quot;;" lang="EN-US">Is there anyone has
implemented an MP3 sink or some decoder+sink element, or have any ideas about
that?&nbsp; Now I'm try to design such a sink.<br>
Is it possible for us to inherited from GstAudioSink, which uses a
GstRingBuffer?&nbsp; From current release I cannot see any code to support MP3
frames in the ring buffer, but in GstRingBuffer, it defines a buffer format
type "GST_BUFTYPE_MPEG: samples in mpeg audio format".&nbsp; Anyone
knows what that type can be used for?&nbsp; Is that something we can extend to
support MP3 frames in ring buffer?<br>
<br>
Thank you.<br>
Best regards,<br>
Dale</span></font></p> 

</div>

</div>

<p class="MsoNormal"><font size="3" face="宋体"><span style="font-size: 12pt;" lang="EN-US"> &nbsp;</span></font></p> 

<div class="MsoNormal" style="text-align: center;" align="center"><font size="3" face="宋体"><span style="font-size: 12pt;" lang="EN-US">

<hr size="1" width="100%" align="center">

</span></font></div>

<p class="MsoNormal"><font size="3" face="宋体"><span style="font-size: 12pt;" lang="EN-US"><a rel="nofollow" target="_blank" href="http://cn.mail.yahoo.com/"><span lang="EN-US"><span lang="EN-US">雅虎邮箱,您的终生邮箱!</span></span></a></span></font></p> 

</div>

</div></div></div><br>


      <hr size=1><a href="http://cn.mail.yahoo.com/"> 雅虎邮箱,您的终生邮箱!</a></body></html>