Page 1 of 1

libvlc: get the pointer on the data

Posted: 14 Feb 2012 11:04
by KidCoding
Hello!

How to get the data pointer on the decoded image (unsigned char* or char* or whatever)?
Is there any callback where I can get the pointer on the data each time a new image is decoded?

Thanks,
KiD

N.B.: I'm on Ubuntu 11.4. I have installed libvlc-dev 1.1.9 from synaptic (ubuntu ppa)

Re: libvlc: get the pointer on the data

Posted: 14 Feb 2012 12:15
by RĂ©mi Denis-Courmont
That is what video filters VLC plugins are for. Well, that and optionally but typically modifying the image.

Re: libvlc: get the pointer on the data

Posted: 14 Feb 2012 12:53
by KidCoding
Well...
Could you give me a link to some doc? (How to implement a plugin for example? or Some sample code...)

Re: libvlc: get the pointer on the data

Posted: 14 Feb 2012 14:33
by KidCoding
Just to be more specific about my question.
I'm using libvlc to decode videos in a c++ app (based on this code http://wiki.videolan.org/LibVLC_SampleCode_Qt ).
So, libvlc decodes a video and pass the result to a window (Qt here).

I want to do some processing on the image before I display it. This is why I need an access to the data pointer.

Thanks,
KiD

Re: libvlc: get the pointer on the data

Posted: 16 Mar 2012 12:06
by KidCoding
For those who want the answer, it can be found in the SDL example http://wiki.videolan.org/LibVLC_SampleCode_SDL .

To access pixels, the callbacks have to be used. In the callback (unlock) function (defined by vlc see SDL example), a pointer to the pixels date is given.

Cheers,
KiD

Re: libvlc: get the pointer on the data

Posted: 25 Mar 2012 11:43
by jiapei100
Any example including both the video and audio streams?

Cheers
Pei
For those who want the answer, it can be found in the SDL example http://wiki.videolan.org/LibVLC_SampleCode_SDL .

To access pixels, the callbacks have to be used. In the callback (unlock) function (defined by vlc see SDL example), a pointer to the pixels date is given.

Cheers,
KiD