Transparency of QDeclarativeView containing QML on top of a QWidget playing a video (using either phonon or libvlc)

巧了我就是萌 提交于 2019-12-05 12:40:09

Are you still fighting with this issue? I, sadly, do not have a satisfying answer for you. The best I can do is point you to reasons why it doesn't work:

http://lists.trolltech.com/qt-interest/2007-02/thread01061-0.html

See Message #4 in the link above.

I have tried many different methods to get transparent painting over a video (specifically Phonon::VideoPlayer) using Qt. The only method I've found so far, is to set the overlaying QWidget as a toolTip doing something like

pWidget->setWindowFlags(Qt::ToolTip)

Depending on what exactly you're wanting to do this may be sufficient, but (in my opinion) it's a hack at best. I'm actively struggling with this issue and if I can find some sort of solution, I'll be sure to post it here.

Best of luck.

you're using direct rendering (by passing the wid of the widget) which draws the video overtop at that geometry:

libvlc_media_player_set_x_window

you need to use offscreen rendering and draw that to your qwidget. this can be done with an opengl context (complicated) or using the callback methods available in libvlc.

if you use the display callback (libvlc_video_display_cb) libvlc will also generate lock/unlock methods also, if you need. in this method libvlc will expect some parameters to be set such as canvas geometry and pixel format.

that said, phonon has a libvlc backend which might help, but may still use direct rendering depending on some factors..

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!