- 
    
Bug
 - 
    Resolution: Fixed
 - 
    
P1: Critical
 - 
    6.5.0, dev
 - 
    None
 - 
    MacBook Pro M1, 2020
macOS Ventura 13.3.1 
- 
        
 - 
        aa2b9b047 (dev), ea62bd143 (6.5)
 
QMediaPlayer produces invalid frames on custom QVideoSink on macOS with 'darwin' backend. Regression on Qt 6.5.0, no such problem with Qt 6.4.3 and earlier.
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 *size, const QSize &requestedSize) override { QImage preview; QEventLoop loop; QVideoSink sink; QObject::connect(&sink, &QVideoSink::videoFrameChanged, [&] (const QVideoFrame& frame) { if (!frame.isValid()) { qDebug() << "invalid frame!"; return; } preview = frame.toImage(); loop.quit(); }); QMediaPlayer player; player.setVideoOutput(&sink); player.setSource(QUrl::fromLocalFile(imageId)); player.play(); loop.exec(); return preview; } };
Now all frames from QVideoSink came as invalid.
Steps to reproduce:
1. Build and run attached project
2. Open any video
Actual result: no video preview is displayed, warnings in output
Expected result: video preview is displayed, no warnings
- relates to
 - 
                    
QTBUG-113313 QVideoSink: missed documentation for some recently added public API
-         
     - Closed
 
 -