Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QMediaPlayer setVideoOutput locks up user interface

QMediaPlayer setVideoOutput locks up user interface

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 684 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gmparker2000
    wrote on last edited by gmparker2000
    #1

    I took the mdi example from qt examples as a starting point. I created my own mdi child window called "VideoMdiChild".

    VideoMdiChild *MainWindow::createMdiChild()
    {
        VideoMdiChild *child = new VideoMdiChild;
        mdiArea->addSubWindow(child);
        return child;
    }
    

    This video mdi child uses a form that contains a video widget. The video widget contains a QMediaPlayer. When I open the video mdi child it locks up the entire user interface until I resize the window. Once resized, the menu becomes usable again. The toolbar is also unresponsive until I tear it off and place it somewhere else.

    If I remove the line "_mediaPlayer->setVideoOutput(videoWidget);" from the following code, then things work properly. Of course this means that the video is not rendered.

    VideoWidget::VideoWidget(QWidget *parent) :
        QWidget(parent)
    {
        _mediaPlayer = new QMediaPlayer(
                    this
                    , QMediaPlayer::VideoSurface);
    
        QVideoWidget *videoWidget = new QVideoWidget;
        _mediaPlayer->setVideoOutput(videoWidget);
    
        QBoxLayout *layout = new QVBoxLayout;
        layout->addWidget(videoWidget);
        setLayout(layout);
    
       ...
    }
    

    Am I doing something obviously wrong? I tried 5.11.2, 5.11.1, and 5.9.7. They all exhibit the same behavior.

    Qt 5.11.2 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 5.3.1 20160406 (Red Hat 5.3.1-6)) on "xcb"
    OS: Ubuntu 18.04.1 LTS [linux version 4.15.0-42-generic]

    Architecture: x86_64; features: SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 AVX AVX2

    1 Reply Last reply
    0
    • G Offline
      G Offline
      gmparker2000
      wrote on last edited by
      #3

      So it looks like it turned out to be related to display scaling in KDE. If you set the scale to an even number like 2 then there are no problems. I had changed the scaling to 1.7. I have it set to 2 now and the problem appears to be gone.

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #2

        Hi,

        Do you have the same behavior if you use your distribution provided Qt ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • G Offline
          G Offline
          gmparker2000
          wrote on last edited by
          #3

          So it looks like it turned out to be related to display scaling in KDE. If you set the scale to an even number like 2 then there are no problems. I had changed the scaling to 1.7. I have it set to 2 now and the problem appears to be gone.

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #4

            Thanks for sharing your findings !

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved