Qt World Summit: Submit your Presentation

How to use QMediaPlayer not in the main thread?

  • I'm try to use QMediaPlayer with my own VideoSurface derived from QAbstractVideoSurface and want to execute QAbstractVideoSurface::present not in the main thread, cose it could take a lot of time. For this i try to do:

    mediaPlayer = new QMediaPlayer;
    mediaPlaylist = new QMediaPlaylist(mediaPlayer);
    auto avi1 = QUrl::fromLocalFile(QDir::currentPath() + "/debug/1.avi");
    videoSurface = new VideoSurface(mediaPlayer);

    but QAbstractVideoSurface::present of videoSurface object still processes in the main thread. What do I wrong? How to resolve this issue (of course if it's possible:) )?

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    AFAIK, no that can't be done.

    What take so long ?

Log in to reply