diff --git a/.gitignore b/.gitignore index e43b0f9..4a7c12d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,5 @@ .DS_Store +*.o +*.so +moc_*.cpp +Makefile diff --git a/QmlVlc.cpp b/QmlVlc.cpp index 0a30937..bcd9660 100644 --- a/QmlVlc.cpp +++ b/QmlVlc.cpp @@ -34,7 +34,7 @@ #include "QmlVlcMmPlayer.h" #endif -const char* qmlVlcUri = "QmlVlc"; +const char* qmlVlcUri = "rsatom.qml.vlc"; const int QmlVlcVersionMajor = 0; const int QmlVlcVersionMinor = 1; diff --git a/QmlVlcPlayer.cpp b/QmlVlcPlayer.cpp index 19d43ee..3063e54 100644 --- a/QmlVlcPlayer.cpp +++ b/QmlVlcPlayer.cpp @@ -34,6 +34,8 @@ QmlVlcPlayer::QmlVlcPlayer( QObject* parent ) m_libvlc = QmlVlcConfig::instance().createLibvlcInstance(); if( m_libvlc ) player().open( m_libvlc ); + else + qCritical("Couldn't create libvlc instance. Check vlc plugins dir."); } QmlVlcPlayer::~QmlVlcPlayer() diff --git a/qmldir b/qmldir new file mode 100644 index 0000000..2b024d6 --- /dev/null +++ b/qmldir @@ -0,0 +1,2 @@ +module rsatom.qml.vlc +plugin qmlvlcplugin diff --git a/qmlvlc.pro b/qmlvlc.pro new file mode 100644 index 0000000..3c76fee --- /dev/null +++ b/qmlvlc.pro @@ -0,0 +1,22 @@ +include(QmlVlc.pri) + +CONFIG += c++11 +LIBS += -lvlc +TARGET = qmlvlcplugin + +PLUGIN_IMPORT_PATH = rsatom/qml/vlc + +TEMPLATE = lib +CONFIG += qt plugin +QT += qml quick + +target.path = $$[QT_INSTALL_QML]/$$PLUGIN_IMPORT_PATH +INSTALLS += target + +qmldir.files += $$_PRO_FILE_PWD_/qmldir +qmldir.path += $$target.path +INSTALLS += qmldir + +HEADERS += qmlvlc_plugin.h + + diff --git a/qmlvlc_plugin.h b/qmlvlc_plugin.h new file mode 100644 index 0000000..aa42a04 --- /dev/null +++ b/qmlvlc_plugin.h @@ -0,0 +1,21 @@ +#pragma once + +#include +#include + +#include + +#define QMLVLC_PLUGIN_ID "rsatom.qml.vlc" + +class Q_DECL_EXPORT QmlVlcExtensionPlugin : public QQmlExtensionPlugin { + Q_OBJECT + Q_PLUGIN_METADATA(IID QMLVLC_PLUGIN_ID) + + public: + virtual void initializeEngine(QQmlEngine *engine, const char *uri) {} + virtual void registerTypes(const char *uri) + { + Q_ASSERT(QString(QMLVLC_PLUGIN_ID) == uri); + RegisterQmlVlc(); + } +};