[vlc-devel] Libvlc, OpenGL and Qt

Rémy Sanchez remy.sanchez at hyperthese.net
Thu Sep 22 23:46:41 CEST 2011


Well, I'm not sure it's the best place to ask my question, but I would feel 
strange asking that on vlc-users...

Anyways : I'm doing a Qt application that show pictures, videos and stuff 
inside of a QGLWidget (actualy, Qt is merely used to create the OpenGL context 
and for the signal/slot facility).

By inspiring myself of the SDL example from the wiki, I was able to display 
some video, however there is still a lot of bugs. See the code :


In short, update() is called every 1/60 second to draw on the screen if the 
slide is in a visible state. Everything is in the Qt thread, excepted the 
callbacks given to VLC. With this code, I get a video, but from what I see :

	- libvlc_media_get_tracks_info() returns 0 tracks, even with 
libvlc_media_parse(m) being called just before.
	- I'm forced to create the texture with the GL_BGRA format, and to draw 
it upside down, I'm not sure how normal this is
	- Calling libvlc_video_set_format() from resize() while the video is 
playing does nothing
	- video_end_callback() is not called when the video reaches the end

By the way, I'm voluntarily trying to do soft video scaling, because my GPU is 
quite crappy (Intel GMA...) and having it to resize things is killing the FPS, 
which I need to be perfect. I'm however not sure how sustainable this will be, 
being given the 1920x1080 screen...

Any suggestion on those issues, or anything else I did wrong, is much 

Thanks :)
Rémy Sanchez
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20110922/d648d66d/attachment.sig>

More information about the vlc-devel mailing list