<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Hi&nbsp; ,</div>
<div>&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; </div>
<div>So on demuxer side do :---</div>
<div>&nbsp;</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GstBuffer *=buf;<font size="2"></font></div>
<div>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; buf = gst_buffer_new_and_alloc (size);</p>
<p>&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);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gst_caps_set_simple (stream-&gt;caps,&quot;<font color="#a31515" size="2"><font color="#a31515" size="2">codec_data&quot;</font></font><font size="2">, GST_TYPE_BUFFER, buf, NULL);</font></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gst_buffer_unref (buf);</p></div>
<div>&nbsp;On Decoder side in _setcaps function u can do :----</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GstBuffer&nbsp;&nbsp;&nbsp; *codec_data = NULL;<br>&nbsp;&nbsp;&nbsp;&nbsp; </div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; guint8* extradata =NULL;</div>
<div><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;</div>
<div>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; codec_data = gst_value_get_buffer(value); </div>
<div><strong></strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; extradata =GST_BUFFER_DATA(codec_data);</div>
<div>&nbsp;</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // now u can parse extradata to get your fields .</div>
<div>&nbsp;</div>
<div><br></div>
<div class="gmail_quote">2009/8/20 Chen, Weian <span dir="ltr">&lt;<a href="mailto:weian.chen@intel.com">weian.chen@intel.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>The data I want to send is couple of bytes (some information of current element) &nbsp;which will be used in next element&#39;s _setcap() funct. So we could not wait the gst_pad_push() function to send.<br>
<br>thanks,<br><font color="#888888">Weian<br></font>
<div>
<div></div>
<div class="h5">-----Original Message-----<br>From: Michael Smith [mailto:<a href="mailto:msmith@xiph.org">msmith@xiph.org</a>]<br>Sent: 2009Äê8ÔÂ20ÈÕ 1:35<br>To: Discussion of the development of GStreamer<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, Chen, Weian&lt;<a href="mailto:weian.chen@intel.com">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&#39;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 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. &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><br>
------------------------------------------------------------------------------<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. &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><br>
</div></div></blockquote></div><br><br clear="all">
<div></div><br>-- <br>Regards,<br><br>Sudarshan Bisht<br>