Below is my code for a very basic player however I am getting a ton of linker errors. Which i have no idea how to solve.
main.cpp
#include <QDebug>
#include <QApplication>
#include <QMediaPlayer>
//#include <QVideoWidget>
#include <QtMultimediaWidgets/QVideoWidget>
#include <QVBoxLayout>
#include <QFile>
int main(int argc, char** argv)
{
QApplication app(argc, argv);
QWidget *widget = new QWidget;
widget->resize(400, 300);
QVBoxLayout *layout = new QVBoxLayout;
QMediaPlayer* player = new QMediaPlayer;
QVideoWidget* vw = new QVideoWidget;
layout->addWidget(vw);
widget->setLayout(layout);
player->setVideoOutput(vw);
QFile file("big_buck_bunny_480p_surround-fix.avi");
if(!file.open(QIODevice::ReadOnly))
qDebug() << "Could not open file";
player->setMedia(QUrl::fromLocalFile("big_buck_bunny_480p_surround-fix.avi"));
player->play();
widget->show();
qDebug() << player->availableMetaData() << player->currentMedia().canonicalUrl();
return app.exec();
}
RTSP.pro
#-------------------------------------------------
#
# Project created by QtCreator 2014-07-22T14:42:07
#
#-------------------------------------------------
QT += core gui multimedia
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = RTSP
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp
HEADERS += mainwindow.h
FORMS += mainwindow.ui
Any help on how to proceed from here would be great as pretty lost where to go from here.
Thanks
↧