QGst::Buffer

Matias Hernandez Arellano msdark at archlinux.cl
Wed Apr 13 06:55:57 PDT 2011


> QGst::BufferPtr b = QGst::Buffer::create(size);
> quint8 *data = b->data();
> //use the data pointer to write.
So, George Kiagiadakis told me this is wrong.. i need to use memcpy() to copy data into the buffer...but i can't make it right...

so, how can i copy data (i have a OpenCV Image and i need to copy the image data .. this is a uchar* ) into the QGst::Buffer ... to then push into appsrc????
El 12-04-2011, a las 9:39, George Kiagiadakis escribió:

> On Tue, Apr 12, 2011 at 5:12 PM, Matias Hernandez Arellano
> <msdark at archlinux.cl> wrote:
>> How can i create a Buffer (or set the Data) using QGst???
>> 
>> I'm search a lot and read over and over the documentation and the examples and i can't get it.
>> 
>> QGst::BufferPtr b = new QGst::Buffer::create(size).dynamic_cast<QGst::Buffer>(); //this create a Buffer
>> 
>> Now i need set the data of the buffer... to use to push into appsrc.
> 
> Hello,
> 
> The QGst::Buffer class has a data() method which gives you a pointer
> to the allocated buffer. You can use this pointer to write on the
> buffer.
> 
> Btw, the above line of code looks terribly wrong to me... Here is how
> you should use it:
> 
> 
> 
> Regards,
> George
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

Matías Hernandez Arellano
Ingeniero de Software/Proyectos en VisionLabs S.A
CDA Archlinux-CL
www.msdark.archlinux.cl






More information about the gstreamer-devel mailing list