QMediaPlayer - "Internal data flow error."
Unsolved
General and Desktop
-
Hello.
I am trying to read a video input in Linux (Ubuntu 16.04 LTS) using QMediaPlayer. The video is read and show fine. However after some random time i constantly get this error:
Error: "Internal data flow error." and my video stops showing. By opening the video again it resumes as usual.The code I used to confirm the error:
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) , player(0, QMediaPlayer::VideoSurface) //QMediaPlayer , videoItem(0) // QGraphicsVideoItem { ui->setupUi(this); videoItem = new QGraphicsVideoItem; QGraphicsScene *scene = new QGraphicsScene(this); ui->graphicsView->setScene(scene); scene->addItem(videoItem); player.setVideoOutput(videoItem); player.setMedia(QUrl("v4l2:///dev/video0")); player.play(); }
What could be causing this error and how can I resolve it without automatically calling the video on QMediaPlayer::StoppedState?