<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:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=gb2312">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[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="City"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="place"/>
<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:宋体;
        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:"\@宋体";
        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:宋体;}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:宋体;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:blue;
        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>

<div class=Section1>

<p class=MsoNormal><font size=2 color=blue face=Arial><span lang=EN-US
style='font-size:10.0pt;font-family:Arial;color:blue'><o:p>&nbsp;</o:p></span></font></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'>Sorry, actually I should
do it in the source element.<o:p></o:p></span></font></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'><o:p>&nbsp;</o:p></span></font></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'>So the problem is
different, because maybe the source element will not call gst_pad_push at all.<o:p></o:p></span></font></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'><o:p>&nbsp;</o:p></span></font></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'>Could you give me some
hints?<o:p></o:p></span></font></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'><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><font
color=blue><span lang=EN-US style='color:blue'><o:p></o:p></span></font></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=宋体><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'>
sudarshan bisht [mailto:bisht.sudarshan@gmail.com] <br>
<b><span style='font-weight:bold'>Sent:</span></b> 2009</span></font><font
size=2><span style='font-size:10.0pt'>年</span></font><font size=2 face=Tahoma><span
lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>8</span></font><font
size=2><span style='font-size:10.0pt'>月</span></font><font size=2 face=Tahoma><span
lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>20</span></font><font
size=2><span style='font-size:10.0pt'>日</span></font><font size=2 face=Tahoma><span
lang=EN-US style='font-size:10.0pt;font-family:Tahoma'> 13:37<br>
<b><span style='font-weight:bold'>To:</span></b> <st1:PersonName w:st="on">Discussion
 of the development of GStreamer</st1:PersonName><br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [gst-devel] How to
send data to next elemnet before calling _chain()</span></font><span
lang=EN-US><o:p></o:p></span></p>

</div>

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

<div>

<p class=MsoNormal><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'>&nbsp;&nbsp;
Do it as soon as you get extradata&nbsp;, before calling gst_pad_push . &nbsp;<o:p></o:p></span></font></p>

</div>

<div>

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

</div>

<div>

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

</div>

<div>

<p class=MsoNormal><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'>2009/8/20
<st1:PersonName w:st="on">Chen, Weian</st1:PersonName> &lt;<a
href="mailto:weian.chen@intel.com">weian.chen@intel.com</a>&gt;<o:p></o:p></span></font></p>

<div vlink=blue link=blue>

<div>

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

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

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

<p><font size=2 color=blue face=Arial><span lang=EN-US style='font-size:10.0pt;
font-family:Arial;color:blue'>Then in demuxer side, where (or which function)
these code should put?</span></font><span lang=EN-US><o:p></o:p></span></p>

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

<div>

<p><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><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=宋体><span lang=EN-US style='font-size:12.0pt'>

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

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

<p><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'>
sudarshan bisht [mailto:<a href="mailto:bisht.sudarshan@gmail.com"
target="_blank">bisht.sudarshan@gmail.com</a>] <br>
<b><span style='font-weight:bold'>Sent:</span></b> 2009</span></font><font
size=2><span style='font-size:10.0pt'>年</span></font><font size=2 face=Tahoma><span
lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>8</span></font><font
size=2><span style='font-size:10.0pt'>月</span></font><font size=2 face=Tahoma><span
lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>20</span></font><font
size=2><span style='font-size:10.0pt'>日</span></font><font size=2 face=Tahoma><span
lang=EN-US style='font-size:10.0pt;font-family:Tahoma'> 12:32 <o:p></o:p></span></font></p>

<div>

<div>

<p class=MsoNormal><font size=2 face=Tahoma><span lang=EN-US style='font-size:
10.0pt;font-family:Tahoma'><br>
<b><span style='font-weight:bold'>To:</span></b> <st1:PersonName w:st="on">Discussion
 of the development of GStreamer</st1:PersonName><br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [gst-devel] How to
send data to next elemnet before calling _chain()<o:p></o:p></span></font></p>

</div>

</div>

</div>

<div>

<div>

<p><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<div>

<p><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Hi&nbsp;
,<o:p></o:p></span></font></p>

</div>

<div>

<p><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
I think you can send such extradata&nbsp;using caps .&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<o:p></o:p></span></font></p>

</div>

<div>

<p><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'>So on demuxer
side do :---<o:p></o:p></span></font></p>

</div>

<div>

<p><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
GstBuffer *=buf;<o:p></o:p></span></font></p>

</div>

<div>

<p><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
buf = gst_buffer_new_and_alloc (size);<o:p></o:p></span></font></p>

<p><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
memcpy (GST_BUFFER_DATA (buf),&nbsp;the data u want to pass as an extradata
(should be guint8*)&nbsp;, size);<o:p></o:p></span></font></p>

<p><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gst_caps_set_simple
(stream-&gt;caps,&quot;</span></font><font size=2 color="#a31515"><span
lang=EN-US style='font-size:10.0pt;color:#A31515'>codec_data&quot;</span></font><font
size=2><span lang=EN-US style='font-size:10.0pt'>, GST_TYPE_BUFFER, buf, NULL);</span></font><span
lang=EN-US><o:p></o:p></span></p>

<p><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
gst_buffer_unref (buf);<o:p></o:p></span></font></p>

</div>

<div>

<p><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'>&nbsp;On
Decoder side in _setcaps function u can do :----<o:p></o:p></span></font></p>

</div>

<div>

<p><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
GstBuffer&nbsp;&nbsp;&nbsp; *codec_data = NULL;<br>
&nbsp;&nbsp;&nbsp;&nbsp; <o:p></o:p></span></font></p>

</div>

<div>

<p><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
guint8* extradata =NULL;<o:p></o:p></span></font></p>

</div>

<div>

<p><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;capStruct =
gst_caps_get_structure(caps,0);<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* Read extra data passed via demuxer. */<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; value =
gst_structure_get_value(capStruct, &quot;codec_data&quot;);<br>
&nbsp;&nbsp;&nbsp;&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'>&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; codec_data = gst_value_get_buffer(value); <o:p></o:p></span></font></p>

</div>

<div>

<p><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<o:p></o:p></span></font></p>

</div>

<div>

<p><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
extradata =GST_BUFFER_DATA(codec_data);<o:p></o:p></span></font></p>

</div>

<div>

<p><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
// now u can parse extradata to get your fields .<o:p></o:p></span></font></p>

</div>

<div>

<p><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'>2009/8/20 <st1:PersonName
w:st="on">Chen, Weian</st1:PersonName> &lt;<a href="mailto:weian.chen@intel.com"
target="_blank">weian.chen@intel.com</a>&gt;<o:p></o:p></span></font></p>

<p><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'><br>
The data I want to send is couple of bytes (some information of current
element) &nbsp;which will be used in next element's _setcap() funct. So we
could not wait the gst_pad_push() function to send.<br>
<br>
thanks,<br>
<font color="#888888"><span style='color:#888888'>Weian</span></font><o:p></o:p></span></font></p>

<div>

<div>

<p><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'>-----Original
Message-----<br>
From: Michael Smith [mailto:<a href="mailto:msmith@xiph.org" target="_blank">msmith@xiph.org</a>]<br>
Sent: 2009</span>年<span lang=EN-US>8</span>月<span lang=EN-US>20</span>日<span
lang=EN-US> 1:35<br>
To: <st1:PersonName w:st="on">Discussion of the development of GStreamer</st1:PersonName><br>
Subject: Re: [gst-devel] How to send data to next elemnet before calling
_chain()<br>
<br>
On Wed, Aug 19, 2009 at 4:41 AM, <st1:PersonName w:st="on">Chen, Weian</st1:PersonName>&lt;<a
href="mailto:weian.chen@intel.com" target="_blank">weian.chen@intel.com</a>&gt;
wrote:<br>
&gt; Hi All,<br>
&gt;<br>
&gt; I need to send some data to the next element before calling the _chain<br>
&gt; function (such as send the data from src element to encoder element), does<br>
&gt; it possible?<br>
<br>
Can you explain in a bit more detail what you want to do?<br>
<br>
You normally should call gst_pad_push() to send data to the next<br>
element in your pipeline - but that calls the chain function in that<br>
next element, so it sounds like you're asking for something different?<br>
<br>
What data do you want to send? Why do you want to avoid calling the<br>
chain function when sending this data?<br>
<br>
Mike<br>
<br>
------------------------------------------------------------------------------<br>
Let Crystal Reports handle the reporting - Free <st1:City w:st="on"><st1:place
 w:st="on">Crystal</st1:place></st1:City> 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's new with<br>
<st1:City w:st="on"><st1:place w:st="on">Crystal</st1:place></st1:City> Reports
now. &nbsp;<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" target="_blank">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>
------------------------------------------------------------------------------<br>
Let Crystal Reports handle the reporting - Free <st1:City w:st="on"><st1:place
 w:st="on">Crystal</st1:place></st1:City> 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's new with<br>
<st1:City w:st="on"><st1:place w:st="on">Crystal</st1:place></st1:City> Reports
now. &nbsp;<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" target="_blank">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><o:p></o:p></span></font></p>

</div>

</div>

</div>

<p><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'><br>
<br clear=all>
<o:p></o:p></span></font></p>

<p><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'><br>
-- <br>
Regards,<br>
<br>
Sudarshan Bisht<o:p></o:p></span></font></p>

</div>

</div>

</div>

</div>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3 face=宋体><span
lang=EN-US style='font-size:12.0pt'><br>
------------------------------------------------------------------------------<br>
Let Crystal Reports handle the reporting - Free <st1:City w:st="on"><st1:place
 w:st="on">Crystal</st1:place></st1:City> 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's new with<br>
<st1:City w:st="on"><st1:place w:st="on">Crystal</st1:place></st1:City> Reports
now. &nbsp;<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><o:p></o:p></span></font></p>

</div>

<p class=MsoNormal><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'><br>
<br clear=all>
<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'><br>
-- <br>
Regards,<br>
<br>
Sudarshan Bisht<o:p></o:p></span></font></p>

</div>

</body>

</html>