I’m developing an application in Qt(5), and basically I’m trying to render the same video source onto 2 locations in my window, using QtMultimedia5.
I’m doing it in QML, but if there is a solution in C++ I will be happy to implement it instead.
I have no problem to show a video in a window. Problems start when I try to use the same QMediaSource but render it onto 2 windows / controls.
What I see is happening is that QMediaService::requestControl is called, which returns a QVideoRendererControl object. Then QVideoRendererControl::setSurface is called to set the surface to which it renders the video.
So from what I gather QMediaService has one surface to which it renders the video at any given time.
How can I render to 2 surfaces or more? Are there other classes that will suit my needs better?
Cheers
Well, this was fairly simple, not the way I expected though. You gotta love QtQuick2.
So I have a MediaPlayer source and a VideoOutput item in my QML code:
All I had to do was just to add a ShaderEffectSource and set tbltSlides as its source.
So simple:
EDIT: Obviously, in order to have the best quality you’d want the tbltSlides item to be bigger than the ShaderEffectSource, so that the shader downsizes the original image.