videotestsrc gst-pipeline on i.mx8 arm processor shows just white screen
Unsolved
Mobile and Embedded
-
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 { public: 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) { ui->setupUi(this); player = new QMediaPlayer; player->setVideoOutput(new Surface(player)); player->setMedia(QUrl("gst-pipeline: videotestsrc ! qtvideosink")); player->play(); } MainWindow::~MainWindow() { delete ui; }