<div dir="ltr"><div>&nbsp;</div>
<div>Hi , </div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Try following , would work&nbsp;&nbsp; , </div>
<div>&nbsp;</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;get_data(void *buffer, size_t frame)<br>&nbsp; &nbsp; &nbsp; &nbsp;{<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;GstBuffer *gst_buffer ;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;gst_buffer = &nbsp;gst_buffer_new_and_alloc (frame);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;memcpy(GST_BUFFER_DATA(gst_buffer) , buffer, frame);<br>
&nbsp; &nbsp; &nbsp; &nbsp;}<br></div>
<div><br><br>&nbsp;</div>
<div class="gmail_quote">On Mon, Sep 22, 2008 at 3:57 PM, arnabsamanta <span dir="ltr">&lt;<a href="mailto:arnabsamanta@tataelxsi.co.in">arnabsamanta@tataelxsi.co.in</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">&nbsp;Hi ,<br>&nbsp; &nbsp; &nbsp; &nbsp;how can i copy the contents of an ordinary buffer created in C++ to the<br>GstBuffer buffer.<br>
&nbsp; &nbsp; &nbsp; &nbsp;i have the following.... can any body tell me if its correct<br><br>&nbsp; &nbsp; &nbsp; &nbsp;get_data(void *buffer, size_t frame)<br>&nbsp; &nbsp; &nbsp; &nbsp;{<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;GstBuffer *gst_buffer ;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;gst_buffer = &nbsp;gst_buffer_new_and_alloc (frame);<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;memcpy(gst_buffer , buffer, frame);<br>&nbsp; &nbsp; &nbsp; &nbsp;}<br><br>&nbsp; &nbsp; &nbsp; &nbsp;where buffer is the memory segment created by the previous function by<br>&quot;new&quot;<br><br><br>&nbsp; &nbsp; &nbsp; &nbsp;i did so as i guess ,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;gst_buffer = GST_BUFFER_CAST(buffer);<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; or<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;gst_buffer = GST_BUFFER_DATA(buffer)<br><br>&nbsp; &nbsp; &nbsp; &nbsp;wont work because &quot;buffer&quot; is not a n GST type buffer.<br><br>&nbsp; &nbsp; &nbsp; &nbsp;is my understanding as stated above is correct ?<br>
&nbsp; &nbsp; &nbsp; &nbsp;if wrong , can any body tell me the correct way ?<br><br>&nbsp;regards,<br>&nbsp; &nbsp; &nbsp; &nbsp;~Arnab<br><br><br>The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments contained in it.<br>
<br>-------------------------------------------------------------------------<br>This SF.Net email is sponsored by the Moblin Your Move Developer&#39;s challenge<br>Build the coolest Linux based applications with Moblin SDK &amp; win great prizes<br>
Grand prize is a trip for two to an Open Source event anywhere in the world<br><a href="http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/" target="_blank">http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/</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>
</blockquote></div><br><br clear="all"><br>-- <br>Regards,<br><br>Sudarshan Bisht<br></div>