Qt World Summit: Submit your Presentation

videotestsrc gst-pipeline on i.mx8 arm processor shows just white screen

  • This code seems to run fine but just produces a window with white rather than the normal videotestsrc test pattern. I'm new to this so I have no clue even how to debug this.

    Maybe there is something simple with the pipeline I'm missing?

    #include "mainwindow.h"
    #include "ui_mainwindow.h"
    #include <QAbstractVideoSurface>
    class Surface : public QAbstractVideoSurface
        Surface(QObject *p) : QAbstractVideoSurface(p) { }
        QList<QVideoFrame::PixelFormat> supportedPixelFormats(QAbstractVideoBuffer::HandleType) const override
            // Make sure that the driver supports this pixel format.
            return QList<QVideoFrame::PixelFormat>() << QVideoFrame::Format_YUYV;
        // Video frames are handled here.
        bool present(const QVideoFrame &) override { return true; }
    MainWindow::MainWindow(QWidget *parent)
        : QMainWindow(parent)
        , ui(new Ui::MainWindow)
        player = new QMediaPlayer;
        player->setVideoOutput(new Surface(player));
        player->setMedia(QUrl("gst-pipeline: videotestsrc ! qtvideosink"));
        delete ui;

Log in to reply