Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-122608

[REG 6.6.1-6.6.2] [windows] QMediaPlayer failed to set topology on custom QVideoSink

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.5.6, 6.6.3, 6.7.0 RC, 6.8.0 FF
    • 6.6.2, 6.7.0 Beta3
    • Multimedia
    • None
    • "windows" multimedia backend
    • Windows
    • b59bf3fd5 (dev), 961961da7 (6.7), f9e44002c (6.6), d19eb45bf (tqtc/lts-6.5)

    Description

      QMediaPlayer failed to set topology on custom QVideoSink on Windows with 'windows' multimedia backend. Regression for Qt 6.6.2, no such problem with Qt 6.6.1 and earlier. Note: reproduced not for every video sample.

      There is a sample project VideoPreview.zip , which generates image from the first video frame in C++ code and displays it in QML via custom image provider.

      C++ code (simplified):

      class VideoPreviewProvider : public QQuickImageProvider
      {
      public:
          VideoPreviewProvider() : QQuickImageProvider(QQuickImageProvider::Image) {}
          QImage requestImage(const QString &imageId, QSize *, const QSize &) override
          {
              QImage preview;
              QEventLoop loop;
      
              QVideoSink sink;
              QObject::connect(&sink, &QVideoSink::videoFrameChanged, [&] (const QVideoFrame& frame) {
                  preview = frame.toImage();
                  loop.quit();
              });
      
              QMediaPlayer player;
              player.setVideoOutput(&sink);
              player.setSource(imageId);
              player.play();
      
              loop.exec();
              return preview;
          }
      };
      

      Steps to reproduce:
      1. Build and run attached project VideoPreview.zip
      2. Open attached video video_1280.mp4
      3, Observe debug output

      Actual result: no video preview is displayed. Error in the debug output.

      Error  QMediaPlayer::ResourceError :  "Failed to set topology."
      

      Expected result: video preview is displayed, no errors

      Attachments

        1. video_1280.mp4
          5.05 MB
        2. VideoPreview.zip
          2 kB

        Issue Links

          For Gerrit Dashboard: QTBUG-122608
          # Subject Branch Project Status CR V

          Activity

            People

              laknoll Lars Knoll
              studiosus Vladimir Belyavsky
              Votes:
              4 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes