QGst::Buffer

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

QGst::Buffer

Matias Hernandez Arellano
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.


Any idea will help

Thanks a lot

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




_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: QGst::Buffer

George Kiagiadakis
On Tue, Apr 12, 2011 at 5:12 PM, Matias Hernandez Arellano
<[hidden email]> 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
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: QGst::Buffer

Matias Hernandez Arellano
> 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
> <[hidden email]> 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
> [hidden email]
> 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




_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel