JackCity63
2nd June 2015, 22:45
I am having some trouble with implementing QtGStreamer with QT. I have downloaded the source code for QtGStreamer and put it in "C:/qt-gstreamer-1.2.0" I am trying to run one of the examples that was provided, the player example.
Here is my code:
player.pro
TEMPLATE = app
TARGET = player
CONFIG += silent
CONFIG += pkgconfig
contains(QT_VERSION, ^4\\..*) {
PKGCONFIG += QtGStreamer-1.0 QtGStreamerUi-1.0 QtGlib-2.0 QtGStreamerUtils-1.0
QT += widgets
}
contains(QT_VERSION, ^5\\..*) {
PKGCONFIG += Qt5GStreamer-1.0 Qt5GStreamerUi-1.0 Qt5Glib-2.0 Qt5GStreamerUtils-1.0 Qt5GStreamerQuick-1.0
QT += widgets \
enginio
}
QMAKE_CXXFLAGS += -std=c++0x
DEFINES += QT_NO_KEYWORDS
HEADERS += mediaapp.h player.h
SOURCES += main.cpp mediaapp.cpp player.cpp
INCLUDEPATH += C:\qt-gstreamer-1.2.0\src \
C:\boost_1_58_0
main.cpp
#include "mediaapp.h"
#include <QApplication>
#include <QGst/Init>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QGst::init(&argc, &argv);
MediaApp media;
media.show();
if (argc == 2) {
media.openFile(argv[1]);
}
return app.exec();
}
There are other cpp files in the example, but they are all giving the same type of error. When I try to build the project, I get the error "undefined reference to 'QGst::init'" I cannot figure out what I am doing wrong. I think there needs to be something changed in the .pro file, but I couldn't find anything telling me what to do to fix it. I am on Windows, using with mingw compiler.
Here is my code:
player.pro
TEMPLATE = app
TARGET = player
CONFIG += silent
CONFIG += pkgconfig
contains(QT_VERSION, ^4\\..*) {
PKGCONFIG += QtGStreamer-1.0 QtGStreamerUi-1.0 QtGlib-2.0 QtGStreamerUtils-1.0
QT += widgets
}
contains(QT_VERSION, ^5\\..*) {
PKGCONFIG += Qt5GStreamer-1.0 Qt5GStreamerUi-1.0 Qt5Glib-2.0 Qt5GStreamerUtils-1.0 Qt5GStreamerQuick-1.0
QT += widgets \
enginio
}
QMAKE_CXXFLAGS += -std=c++0x
DEFINES += QT_NO_KEYWORDS
HEADERS += mediaapp.h player.h
SOURCES += main.cpp mediaapp.cpp player.cpp
INCLUDEPATH += C:\qt-gstreamer-1.2.0\src \
C:\boost_1_58_0
main.cpp
#include "mediaapp.h"
#include <QApplication>
#include <QGst/Init>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QGst::init(&argc, &argv);
MediaApp media;
media.show();
if (argc == 2) {
media.openFile(argv[1]);
}
return app.exec();
}
There are other cpp files in the example, but they are all giving the same type of error. When I try to build the project, I get the error "undefined reference to 'QGst::init'" I cannot figure out what I am doing wrong. I think there needs to be something changed in the .pro file, but I couldn't find anything telling me what to do to fix it. I am on Windows, using with mingw compiler.