Details
-
Bug
-
Resolution: Out of scope
-
P1: Critical
-
4.7.0
Description
It should be possible to place an overlay on top of video content using a widget hierarchy as follows:
TLW | +--Container | +--VideoWidget | +--Overlay
VideoWidget can either be:
- Derived from Phonon::VideoWidget, in which case the Phonon backend internally creates a child widget can calls winId() on it
- Derived from QWidget, in which case winId() is called by the VideoWidget itself and the native window handle passed to CVideoPlayerUtility2
The position and size of Overlay is updated whenever the position or size of VideoWidget changes - this can be done by installing an eventFilter on VideoWidget.
The z-order of Overlay is higher than that of VideoWidget.
Because winId() is called on either VideoWidget or one of its children, native window handles are created for all widgets in the tree, including Overlay. Video is therefore rendered into a separate native window from that used to display the overlay.
Environment
Qt: Built from source, qt-s60-public/4.7 commit 700ba679
Device: N8, wk26 RnD image
Steps to reproduce
This can be reproduced using the attached test app videooverlay_QTBUG-12607_1.zip.
The attached logs were created in the above environment using the following command line options [1]:
native.log
videooverlay.exe -container -video native -overlay nativechildwidget -graphicssystem openvg
phonon.log
videooverlay.exe -container -video phonon -overlay nativechildwidget -graphicssystem openvg
Expected behaviour
Overlay is visible on top of video content [2].
Observed behaviour
- When the application starts up, the UI is rendered correctly (other than the positioning error tracked by
QTBUG-12605). - When video starts playing, it covers the overlay [3]
Notes
[1] When using the raster paint engine, native video rendering works correctly, but only if a special paint mode is set on VideoWidget:
videooverlay.exe -container -video native -videowidgetpaint disable -overlay nativechildwidget -graphicssystem raster
or
videooverlay.exe -container -video native -videowidgetpaint zerofill -overlay nativechildwidget -graphicssystem raster
Setting either paint mode when using OpenVG graphics has no effect.
[2] The overlay will be displayed transparent, even if Qt::WA_TranslucentBackground is set on it. This is because, to be shown translucent, the overlay must be a TLW, because this is the only way for the overlay to be rendered to a backing store which has an alpha channel. This can be done by running the test app with the following options:
videooverlay.exe -container -video phonon -overlay toplevelwidget -overlaypaint translucent -graphicssystem raster
The video and overlay are then rendered correctly (other than the positioning error tracked by QTBUG-12605).
[3] Whenever '-video native' is specified, the borders above and below the video content are filled with white, rather than the expected black borders.
[4] This is not a window z-ordering problem: calling raise() on Overlay, at the point when video is displayed, does not have any effect.
Attachments
Issue Links
- is replaced by
-
QTBUG-13469 Allow non-toplevel native widgets to be translucent
- Closed