<div> Hi ,</div>
<div> I think you can send such extradata using caps . <br> </div>
<div>So on demuxer side do :---</div>
<div> </div>
<div> GstBuffer *=buf;<font size="2"></font></div>
<div>
<p> buf = gst_buffer_new_and_alloc (size);</p>
<p> memcpy (GST_BUFFER_DATA (buf), the data u want to pass as an extradata (should be guint8*) , size);</p>
<p> gst_caps_set_simple (stream->caps,"<font color="#a31515" size="2"><font color="#a31515" size="2">codec_data"</font></font><font size="2">, GST_TYPE_BUFFER, buf, NULL);</font></p>
<p> gst_buffer_unref (buf);</p></div>
<div> On Decoder side in _setcaps function u can do :----</div>
<div> </div>
<div> </div>
<div> GstBuffer *codec_data = NULL;<br> </div>
<div> guint8* extradata =NULL;</div>
<div><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> </div>
<div> codec_data = gst_value_get_buffer(value); </div>
<div><strong></strong> </div>
<div> extradata =GST_BUFFER_DATA(codec_data);</div>
<div> </div>
<div> // now u can parse extradata to get your fields .</div>
<div> </div>
<div><br></div>
<div class="gmail_quote">2009/8/20 Chen, Weian <span dir="ltr"><<a href="mailto:weian.chen@intel.com">weian.chen@intel.com</a>></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) 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">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<<a href="mailto:weian.chen@intel.com">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 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's new with<br>Crystal 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><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's new with<br>Crystal 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><br>
</div></div></blockquote></div><br><br clear="all">
<div></div><br>-- <br>Regards,<br><br>Sudarshan Bisht<br>