PDA

View Full Version : Two sibling widgets, one in foreground transparent, one is in background VLC



mburakalkan
14th September 2010, 13:30
Hello,

I am trying to create a libvlc implementation in linux environment. I have two QFrames in my application, one for vlc to put its vout on background, and the other one is for html renderer engine which using QImage render its data on screen.

My aim is to put vlc frame in background and html render frame in foreground to see the playing movie through the transparent html page.Whole application is transparent (e.g. no background color, Qt::WA_TranslucentBackground set composition is on etc.) libvlc only aware of videoFrame->WId() and nothing more

I am able to see my desktop through the application while rendering full transparent html page, but when playback starts, it raises to the top and covers the area of html rendering frame. I've tried many solutions, writing custom layout, raising -lowering widgets etc, but no good so far.


How can I prevent video frame to cover html rendering frame? I only want to see playback through the transparent html.. How can I organize widgets positions in a application and make sure some widget never raise over another widget? Is it possible?

Using linux/ qt 4.6



Thanks!

wysota
14th September 2010, 17:19
I don't think the problem is the stacking order of widgets. I think the video is simply rendered on the window surface bypassing Qt's backingstore completely. It'd be best if you could render the frames to an image and then render the image to the widget using Qt's API (which will make it go through the backingstore). Then you can render someting over the image.

mburakalkan
14th September 2010, 17:40
Hmm I guess you are right, but in the case of libvlc it doesn't really accepting a QImage or some other widget, all libvlc requiring is winId of a qwidget..


So I'd better searching for another multimedia lib, maybe gstreamer?

wysota
14th September 2010, 17:43
Why not simply use QtMultimedia module?

mburakalkan
14th September 2010, 17:53
as far as I know QtMultimedia is part of QtMobility? and again is it ready for every day playing tasks?

And last time I checked it wasn't compiling on my ubuntu 9 linux box

wysota
14th September 2010, 17:56
as far as I know QtMultimedia is part of QtMobility?
No, it's a regular Qt module.


and again is it ready for every day playing tasks?
In your case it should be sufficient. For more highlevel things Phonon is still more appropriate.


And last time I checked it wasn't compiling on my ubuntu 9 linux box
Compiles ok on my Linux box.

mburakalkan
14th September 2010, 18:04
Thanks for pointing out, I didn't know about QtMultimedia,
I have another question by using QtMultimedia and other modules what does it take to decode a udp stream on the local network
I mean when I use vlc module in my application I simply give vlc my url like udp://@__someipadd:1234 and vlc starts to decode stream
If I use QtMultimedia I guess I will have to handle network stram in my application bu using network module, since QtMultimedia seems very low level?

wysota
14th September 2010, 18:47
If I use QtMultimedia I guess I will have to handle network stram in my application bu using network module, since QtMultimedia seems very low level?

Unfortunately I don't know that, that could be true, yes. I've never actually used QtMultimedia myself. It could even be that QtMultimedia is not capable of decoding frames itself (at least I can't find any classes for this). If it's not fit for your task then maybe you'll have more luck with Phonon.

mburakalkan
14th September 2010, 18:52
Unfortunately I don't know that, that could be true, yes. I've never actually used QtMultimedia myself.
Ok Thanks, I will be searching potential mediaplaying-ready implementations - phonon, qtmobility, qtmultimedia and if successful update here. Thank you

wysota
14th September 2010, 19:00
If all you are after is video and not audio then some time ago I managed to use libavformat/libavcodec for decoding video. If you combine it with QtMultimedia, you should get a nice video playback. I didn't invest enough time to get sound working but maybe all you need is to interconnect the audio stream with QAudioOutput.