[gst-devel] querry : copying an ordinary buffer to GstBuffer
sudarshan bisht
bisht.sudarshan at gmail.com
Mon Sep 22 12:47:07 CEST 2008
Hi ,
Try following , would work ,
get_data(void *buffer, size_t frame)
{
GstBuffer *gst_buffer ;
gst_buffer = gst_buffer_new_and_alloc (frame);
memcpy(GST_BUFFER_DATA(gst_buffer) , buffer, frame);
}
On Mon, Sep 22, 2008 at 3:57 PM, arnabsamanta
<arnabsamanta at tataelxsi.co.in>wrote:
> Hi ,
> how can i copy the contents of an ordinary buffer created in C++ to
> the
> GstBuffer buffer.
> i have the following.... can any body tell me if its correct
>
> get_data(void *buffer, size_t frame)
> {
> GstBuffer *gst_buffer ;
> gst_buffer = gst_buffer_new_and_alloc (frame);
> memcpy(gst_buffer , buffer, frame);
> }
>
> where buffer is the memory segment created by the previous function
> by
> "new"
>
>
> i did so as i guess ,
> gst_buffer = GST_BUFFER_CAST(buffer);
> or
> gst_buffer = GST_BUFFER_DATA(buffer)
>
> wont work because "buffer" is not a n GST type buffer.
>
> is my understanding as stated above is correct ?
> if wrong , can any body tell me the correct way ?
>
> regards,
> ~Arnab
>
>
> 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.
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
--
Regards,
Sudarshan Bisht
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20080922/afe70a92/attachment.htm>
More information about the gstreamer-devel
mailing list