Unsolved Video player not work in child dialog. Error:Failed to activate video surface
-
From my video analysis project, In
MainWindow
, I have oneQMediaPlayer
andsetVideoOutput(subclassVideoSurface)
to play video. It is work well. And a button to show one child dialog, this dialog also hasQMediaPlayer
andsetVideoOutput(subclassVideoSurface)
to play another video. but, it was not work after MainWindow's palyer had some operate. eg: i paused MainWindow's player before child dialog to show.I found the demo(Qt5.7.0/Examples/Qt-5.7/multimediawidgets/customvideosurface/customvideowidget) to test my problem.
It had the same question.
If the first player not play video, the child dialog's player can work well.
If the first player played one video and pause it, the child dialog's player can not to work. and had theError message: Failed to activate video surface
I modified the demo at here, you can download it to test the problem.
-
@joeQ Do you set same surface in both QMediaPlayers?
-
mainwindow----> obj1 = new player ---> sur1 = new surface ----> obj1.setVideoOutpus(sur1) child dialog-----> obj2 = new player ---> sur2 = new surface ----> obj2.setVideoOutpus(sur2)
same subclass surface, different object to used.
-
Hi,
What OS/Distribution are you running on ? Can you also check with the latest version of Qt ?
-
I used Mac, I let one friend to test it on Windows10, It had not the problem. So it is maybe the cause of operating system.
-
That's why I'm suggesting to test a more recent version current is 5.9.2.