QGst::Buffer

George Kiagiadakis kiagiadakis.george at gmail.com
Tue Apr 12 06:39:29 PDT 2011


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:

QGst::BufferPtr b = QGst::Buffer::create(size);
quint8 *data = b->data();
//use the data pointer to write.

Regards,
George


More information about the gstreamer-devel mailing list