<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" xmlns:a="urn:schemas-microsoft-com:office:access" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" xmlns:b="urn:schemas-microsoft-com:office:publisher" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:odc="urn:schemas-microsoft-com:office:odc" xmlns:oa="urn:schemas-microsoft-com:office:activation" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:q="http://schemas.xmlsoap.org/soap/envelope/" xmlns:rtc="http://microsoft.com/officenet/conferencing" xmlns:D="DAV:" xmlns:Repl="http://schemas.microsoft.com/repl/" xmlns:mt="http://schemas.microsoft.com/sharepoint/soap/meetings/" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ppda="http://www.passport.com/NameSpace.xsd" xmlns:ois="http://schemas.microsoft.com/sharepoint/soap/ois/" xmlns:dir="http://schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:udc="http://schemas.microsoft.com/data/udc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sub="http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/" xmlns:ec="http://www.w3.org/2001/04/xmlenc#" xmlns:sp="http://schemas.microsoft.com/sharepoint/" xmlns:sps="http://schemas.microsoft.com/sharepoint/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:udcs="http://schemas.microsoft.com/data/udc/soap" xmlns:udcxf="http://schemas.microsoft.com/data/udc/xmlfile" xmlns:udcp2p="http://schemas.microsoft.com/data/udc/parttopart" xmlns:st="&#1;" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">

<head>

<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<base href="x-msg://1/">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:windowtext;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=ZH-CN link=blue vlink=blue style='word-wrap: break-word;-webkit-nbsp-mode: space;
-webkit-line-break: after-white-space'>

<div class=Section1>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>Thanks a lot for your information/suggestion.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>And I have made some experiments, and found that: I
have to create new GstBuffer for every gst_pad_push() in _chain(), once the
GstBuffer is used, it could not push data to downstream element successfully,
the pipeline still keeps running, but the data in GstBuffer can¡¯t be written
into file.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>Please note, I mean I need to create GstBuffer for
each call of _chain(), but not the real buffer which will contain real data (GstBufer¡¯s
member variable <i><span style='font-style:italic'>-&gt;data</span></i> will
point this buffer)<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'>What¡¯s the problem?<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-US style='font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<div>

<p class=MsoNormal><font size=2 color=blue face=Arial><span lang=EN-US
style='font-size:10.0pt;font-family:Arial;color:blue'>thanks,</span></font><span
lang=EN-US><o:p></o:p></span></p>

<p class=MsoNormal><font size=2 color=blue face=Arial><span lang=EN-US
style='font-size:10.0pt;font-family:Arial;color:blue'>Weian</span></font><span
lang=EN-US><o:p></o:p></span></p>

</div>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span lang=EN-US style='font-size:12.0pt'>

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

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

<p class=MsoNormal><b><font size=2 face=Tahoma><span lang=EN-US
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>
Clark, Rob [mailto:rob@ti.com] <br>
<b><span style='font-weight:bold'>Sent:</span></b> 2010</span></font><font
size=2 face=&#23435;&#20307;><span style='font-size:10.0pt;font-family:SimSun'>Äê</span></font><font
size=2 face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>1</span></font><font
size=2 face=&#23435;&#20307;><span style='font-size:10.0pt;font-family:SimSun'>ÔÂ</span></font><font
size=2 face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>9</span></font><font
size=2 face=&#23435;&#20307;><span style='font-size:10.0pt;font-family:SimSun'>ÈÕ</span></font><font
size=2 face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>
17: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> Re: [gst-devel] Question
on how to use GstBuffer?</span></font><span lang=EN-US><o:p></o:p></span></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-US
style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-US
style='font-size:12.0pt'>yes, there are a handful of examples of this..
&nbsp;look for example, in v4l2bufferpool.. &nbsp;xvimagesink, etc..<o:p></o:p></span></font></p>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-US
style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-US
style='font-size:12.0pt'>basically the principle is to subclass GstBuffer,
provide your own finalize function that revives the buffer and returns it to
your pool of buffers.<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-US
style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-US
style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-US
style='font-size:12.0pt'>(random thought: &nbsp;really, it's a pattern seen in
enough gst elements, that perhaps it would be nice to see a generic
GstBufferPool class..)<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-US
style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-US
style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-US
style='font-size:12.0pt'>BR,<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-US
style='font-size:12.0pt'>-R<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-US
style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<div>

<div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-US
style='font-size:12.0pt'>On Jan 7, 2010, at 8:56 PM, <st1:PersonName w:st="on">Chen,
 Weian</st1:PersonName> wrote:<o:p></o:p></span></font></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-US
style='font-size:12.0pt'><br>
<br>
<o:p></o:p></span></font></p>

<span style='orphans: 2;widows: 2;-webkit-border-horizontal-spacing: 0px;
-webkit-border-vertical-spacing: 0px;-webkit-text-decorations-in-effect: none;
-webkit-text-size-adjust: auto;-webkit-text-stroke-width: 0px;word-spacing:
0px'>

<div link=blue vlink=purple>

<div>

<p class=MsoNormal style='text-align:justify;text-justify:inter-ideograph'><font
size=2 face=Arial><span lang=EN-US style='font-size:10.0pt;font-family:Arial'>Hi
All,<u1:p></u1:p></span></font><font size=2><span lang=EN-US style='font-size:
10.5pt'><o:p></o:p></span></font></p>

<p class=MsoNormal style='text-align:justify;text-justify:inter-ideograph'><font
size=2 face=Arial><span lang=EN-US style='font-size:10.0pt;font-family:Arial'><u1:p>&nbsp;</u1:p></span></font><font
size=2><span lang=EN-US style='font-size:10.5pt'><o:p></o:p></span></font></p>

<p class=MsoNormal style='text-align:justify;text-justify:inter-ideograph'><font
size=2 face=Arial><span lang=EN-US style='font-size:10.0pt;font-family:Arial'>In
my current element, I will create and new a GstBuffer (which means to use
g_malloc to allocate buffer) in the _chain() function for each frame.<u1:p></u1:p></span></font><font
size=2><span lang=EN-US style='font-size:10.5pt'><o:p></o:p></span></font></p>

<p class=MsoNormal style='text-align:justify;text-justify:inter-ideograph'><font
size=2 face=Arial><span lang=EN-US style='font-size:10.0pt;font-family:Arial'><u1:p>&nbsp;</u1:p></span></font><font
size=2><span lang=EN-US style='font-size:10.5pt'><o:p></o:p></span></font></p>

<p class=MsoNormal style='text-align:justify;text-justify:inter-ideograph'><font
size=2 face=Arial><span lang=EN-US style='font-size:10.0pt;font-family:Arial'>My
question is: Can I allocate several buffers (ring buffers) ahead of time, then
I can re-use them and don¡¯t need to allocate buffer for each call of _chain, if
yes, how?<u1:p></u1:p></span></font><font size=2><span lang=EN-US
style='font-size:10.5pt'><o:p></o:p></span></font></p>

<p class=MsoNormal style='text-align:justify;text-justify:inter-ideograph'><font
size=2 face=Arial><span lang=EN-US style='font-size:10.0pt;font-family:Arial'><u1:p>&nbsp;</u1:p></span></font><font
size=2><span lang=EN-US style='font-size:10.5pt'><o:p></o:p></span></font></p>

<p class=MsoNormal style='text-align:justify;text-justify:inter-ideograph'><font
size=2 face=Arial><span lang=EN-US style='font-size:10.0pt;font-family:Arial'>Thanks
in advanced.<u1:p></u1:p></span></font><font size=2><span lang=EN-US
style='font-size:10.5pt'><o:p></o:p></span></font></p>

<p class=MsoNormal style='text-align:justify;text-justify:inter-ideograph'><font
size=2 face=Arial><span lang=EN-US style='font-size:10.0pt;font-family:Arial'><u1:p>&nbsp;</u1:p></span></font><font
size=2><span lang=EN-US style='font-size:10.5pt'><o:p></o:p></span></font></p>

<p class=MsoNormal style='text-align:justify;text-justify:inter-ideograph'><font
size=2 color=blue face=Arial><span lang=EN-US style='font-size:10.0pt;
font-family:Arial;color:blue'>Weian</span></font><font size=2><span lang=EN-US
style='font-size:10.5pt'><u1:p></u1:p><o:p></o:p></span></font></p>

</div>

<p class=MsoNormal><font size=4 face=Helvetica><span lang=EN-US
style='font-size:13.5pt;font-family:Helvetica'>------------------------------------------------------------------------------<br>
This<span class=apple-converted-space>&nbsp;</span><a href="http://SF.Net">SF.Net</a><span
class=apple-converted-space>&nbsp;</span>email is sponsored by the Verizon
Developer Community<br>
Take advantage of Verizon's best-in-class app development support<br>
A streamlined, 14 day to market process makes app distribution fast and easy<br>
Join now and get one step closer to millions of Verizon customers<br>
<a href="http://p.sf.net/sfu/verizon-dev2dev">http://p.sf.net/sfu/verizon-dev2dev</a><span
class=apple-converted-space>&nbsp;</span>_______________________________________________<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">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><o:p></o:p></span></font></p>

</div>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-US
style='font-size:12.0pt'></span><o:p>&nbsp;</o:p></span></font></p>

</div>

</div>

</div>

</body>

</html>