<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> </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> </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> </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> </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> </o:p></span></font></p>
<div>
<p class=MsoNormal><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'>
Do it as soon as you get extradata , before calling gst_pad_push . <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'> <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>
<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> <<a
href="mailto:weian.chen@intel.com">weian.chen@intel.com</a>><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'> </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'> </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'> </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'> <o:p></o:p></span></font></p>
<div>
<p><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'> Hi
,<o:p></o:p></span></font></p>
</div>
<div>
<p><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'>
I think you can send such extradata using caps . <br>
<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'> <o:p></o:p></span></font></p>
</div>
<div>
<p><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'>
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'>
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'>
memcpy (GST_BUFFER_DATA (buf), the data u want to pass as an extradata
(should be guint8*) , size);<o:p></o:p></span></font></p>
<p><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'> gst_caps_set_simple
(stream->caps,"</span></font><font size=2 color="#a31515"><span
lang=EN-US style='font-size:10.0pt;color:#A31515'>codec_data"</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'>
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'> 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'> <o:p></o:p></span></font></p>
</div>
<div>
<p><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'> <o:p></o:p></span></font></p>
</div>
<div>
<p><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'>
GstBuffer *codec_data = NULL;<br>
<o:p></o:p></span></font></p>
</div>
<div>
<p><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'>
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>
capStruct =
gst_caps_get_structure(caps,0);<br>
<br>
/* Read extra data passed via demuxer. */<br>
value =
gst_structure_get_value(capStruct, "codec_data");<br>
<o:p></o:p></span></font></p>
</div>
<div>
<p><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'>
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'>
<o:p></o:p></span></font></p>
</div>
<div>
<p><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'>
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'> <o:p></o:p></span></font></p>
</div>
<div>
<p><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'>
// 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'> <o:p></o:p></span></font></p>
</div>
<div>
<p><font size=3 face=宋体><span lang=EN-US style='font-size:12.0pt'> <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> <<a href="mailto:weian.chen@intel.com"
target="_blank">weian.chen@intel.com</a>><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) 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><<a
href="mailto:weian.chen@intel.com" target="_blank">weian.chen@intel.com</a>>
wrote:<br>
> Hi All,<br>
><br>
> I need to send some data to the next element before calling the _chain<br>
> function (such as send the data from src element to encoder element), does<br>
> 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. <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. <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. <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>