Not able to see the video through punch hole
We have been working on browser application on SOC which render and plays video on video plane. We made video playing rectangle as punch hole to see the video from graphics plane. Also we made this rectangle as transparent in QT webkit we are not able to see the backend video ( which is playing on video plane), only black screen is appearing.
Can any body faced similar kind of issue while using QT webkit + opengles combination.. If yes please let me know...anybody help is appreciated....
[edit:koahnig, blanks before first paragraph removed]
Hi and welcome to devnet forum
The forum has a feature for formatting the input as source. Accidently you hit this feature by adding a couple of blanks as start of the first paragraph. I have removed them for you.
@koahnig Thank you
@Srinath Easiest way to puch a hole in web page is to paint player rect with QPainter::CompositionMode_Clear. It will make a transparent hole clearing all backgrounds underneath your video element, but other elements such as tooltips of playbackcontrols will be able to overlap video just like in "normal" browser.
Also, this thread might be helpful for you too: https://forum.qt.io/topic/76208/how-to-find-the-absolute-screen-position-of-an-element-on-a-webpage
@Konstantin-Tokarev Thanks for the quick response. I tried with the above Composition mode. Still black screen is appearing ,not able to see the back video.
This is the code part i am referring:
void GraphicsContext::clearRect(const FloatRect& rect)
if (paintingDisabled()) return; QPainter* p = m_data->p(); QPainter::CompositionMode currentCompositionMode = p->compositionMode(); p->setCompositionMode(QPainter::CompositionMode_Clear); p->fillRect(rect,Qt::transparent); p->setCompositionMode(currentCompositionMode);
I have also tried with commenting fillRect in this case, still white screen appears. Not able to see the video through rectangle. Could you please let me know is there anything to modify to see the below video.
Hi @Konstantin-Tokarev , Problem got resolved for me. I have used GL_SCISSOR_TEST instead of fillrect. Now i am able to see the video through punch hole.
@Srinath I assumed you can see through qt widgets filled with transparent color, otherwise my advise is not applicable