Phonon::VideoWidget embedded inside a QGraphicsProxyWidget

Marco Martin notmart at gmail.com
Fri Mar 26 19:29:58 CET 2010


On Friday 26 March 2010, Alessandro Diaferia wrote:
> As you currently may be aware of, embedding a Phonon::VideoWidget inside a
> QGraphicsProxyWidget causes the video appealing awfully while playing. I've
> been bouncing here and there on IRC talking with Lucas Murray from KWin and
> Mark Kretschmann from Phonon.
> 
> Lucas says putting the VideoWidget behind the Plasma Desktop is not the way
> to go as he says this is like using a Window Manger to put a widget inside
> a fake Window Manager (Plasma) and hence a loop. As he makes us notice

i still think it is indeed the way to go, because we won't use any of this in 
plasma-desktop.

> that the flag KeepBelow would put our widget below other widgets but not
> below Plasma which is registered as Desktop. (Correct me if I'm wrong).
> 
> So, temporarily abandoned that idea i was trying to find a way to redirect
> VideoWidget painting directly onto a QGraphicsWidget. This seems to be

don't think this way would be fast

> impossible to achive through a QPixmap::grabWidget, probably due to
> VideoWidget's internals. QPixmap::grabWindow, instead, works pretty well
> and fast. But this forces us to have a QWidget always visible that is not
> what we want.
> Given this, then, i was trying to find a way to extract VideoWidget frames
> rather than hacking through QPainter redirects but even this seems to be
> not possible. Mark pointed me to the Amarok VideoClip applet which
> displays videos from YouTube. But having a look at its code you can
> understand that Phonon::VideoWidget is simply put in place of the Applet
> when displaying a video. That is just fine for Amarok because there is no
> risk for other applets to cover the VideoClip one.
> 
> So, finally, keeping all this in mind i had a *rather nasty and probably
> impossible idea*. But it still worths a try: what about using a similar
> approach? We could use a plain Phonon::VideoWidget without embedding it
> anywhere. We can put it on top of the applet and make it follow its
> movements. When other applets cover our VideoApplet (we can call it this
> way from now on) we can simulate a faking covering using a mask directly
> on the Phonon::VideoWidget. Is this anyhow possible?

it would work until any transformation is applied over it.

and as long as you don't try to put any other graphicswidget over it (we would 
live the old systray nightmare over and over again).

i think videowidget is perfectly fine as is, as long the video has the size of 
a small thumbnail it works good and we can transform it any way we want.

and is future proof. probably some days the whole stack would suck way less at 
least enough to permit to use it also for full screen (if say some day shaders 
will be used for video decoding or something like that)

the mediacenter as is now is a -completely- different problem.
here we want to display a fullscreen video, with occasionally some chrome over 
it when we need.

as a "temporary" solution (that will indeed last for years) putting the video 
on a window behind the  mediacenter chrome (and hiding completely the plasma 
window when not needed) is the less hacky (believe or not :p) more performant 
and simpler to implement solution
(given that there is already an option to pull the videowidget out of plasma 
and make it a real fullscreen window)

it will be possible to use it only in the mediacenter shell but that's fine, 
it's something that is needed only there
and if some day somebody really wants to make it work on plasma-desktop or 
plasma-netbook it's quite simple just use a window like the dashboard to 
display controls, dot a desktop window.

Cheers,
Marco Martin


More information about the Plasma-devel mailing list