-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1ee342a
commit 3d58329
Showing
16 changed files
with
380 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Project: PiOmxTexturesQmlUtils | ||
* Author: Luca Carlon | ||
* Date: 03.12.2016 | ||
* | ||
* Copyright (c) 2016 Luca Carlon. All rights reserved. | ||
* | ||
* This file is part of PiOmxTexturesQmlUtils. | ||
* | ||
* PiOmxTexturesQmlUtils is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* PiOmxTexturesQmlUtils is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with PiOmxTexturesQmlUtils. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
/*------------------------------------------------------------------------------ | ||
| includes | ||
+-----------------------------------------------------------------------------*/ | ||
#include "omx_piomxtexturesplugin.h" | ||
|
||
/*------------------------------------------------------------------------------ | ||
| OMX_PiOmxTexturesPlugin::OMX_PiOmxTexturesPlugin | ||
+-----------------------------------------------------------------------------*/ | ||
OMX_PiOmxTexturesPlugin::OMX_PiOmxTexturesPlugin(QObject* parent) : | ||
QQmlExtensionPlugin(parent) | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* Project: PiOmxTexturesQmlUtils | ||
* Author: Luca Carlon | ||
* Date: 03.12.2016 | ||
* | ||
* Copyright (c) 2016 Luca Carlon. All rights reserved. | ||
* | ||
* This file is part of PiOmxTexturesQmlUtils. | ||
* | ||
* PiOmxTexturesQmlUtils is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* PiOmxTexturesQmlUtils is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with PiOmxTexturesQmlUtils. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#ifndef OMX_PIOMXTEXTURESPLUGIN_H | ||
#define OMX_PIOMXTEXTURESPLUGIN_H | ||
|
||
/*------------------------------------------------------------------------------ | ||
| includes | ||
+-----------------------------------------------------------------------------*/ | ||
#include <QQmlExtensionPlugin> | ||
#include <QtQml> | ||
#include <QObject> | ||
#include <QProcess> | ||
|
||
#include "omx_logging.h" | ||
#include "pot_videoprobe.h" | ||
|
||
/*------------------------------------------------------------------------------ | ||
| OMX_PiOmxTexturesPlugin class | ||
+-----------------------------------------------------------------------------*/ | ||
class OMX_PiOmxTexturesPlugin : public QQmlExtensionPlugin | ||
{ | ||
Q_OBJECT | ||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") | ||
|
||
public: | ||
OMX_PiOmxTexturesPlugin(QObject* parent = 0); | ||
|
||
void registerTypes(const char* uri) { | ||
log_info("PiOmxTexturesQmlUtils version %s built %s, %s.", | ||
VERSION, __DATE__, __TIME__); | ||
|
||
log_info("Registering POT_VideoProbe QML type..."); | ||
Q_ASSERT(uri == QLatin1String("PiOmxTexturesQmlUtils")); | ||
qmlRegisterType<POT_VideoProbe>(uri, 0, 1, "POT_VideoProbe"); | ||
} | ||
}; | ||
|
||
#endif // OMX_PIOMXTEXTURESPLUGIN_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# | ||
# Project: PiOmxTexturesVideoLayer | ||
# Author: Luca Carlon | ||
# Date: 01.10.2016 | ||
# | ||
# Copyright (c) 2016 Luca Carlon. All rights reserved. | ||
# | ||
# This file is part of PiOmxTexturesVideoLayer. | ||
# | ||
# PiOmxTexturesQmlUtils is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Lesser General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# PiOmxTexturesQmlUtils is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Lesser General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Lesser General Public License | ||
# along with PiOmxTexturesQmlUtils. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
|
||
TEMPLATE = lib | ||
|
||
VERSION = 0.1.0 | ||
DEFINES += VERSION=\\\"$$VERSION\\\" | ||
|
||
QT += quick qml multimedia | ||
CONFIG += qt plugin | ||
QMAKE_CXXFLAGS += -std=c++11 | ||
|
||
INCLUDEPATH += \ | ||
$$_PRO_FILE_PWD_/../3rdparty/LightLogger \ | ||
$$_PRO_FILE_PWD_/../3rdparty/LightSmartPtr \ | ||
$$_PRO_FILE_PWD_/../piomxtextures_src | ||
|
||
HEADERS += \ | ||
omx_piomxtexturesplugin.h \ | ||
pot_videoprobe.h | ||
|
||
SOURCES += \ | ||
omx_piomxtexturesplugin.cpp \ | ||
pot_videoprobe.cpp | ||
|
||
RESOURCES += resources.qrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
* Project: PiOmxTexturesQmlUtils | ||
* Author: Luca Carlon | ||
* Date: 03.12.2016 | ||
* | ||
* Copyright (c) 2016 Luca Carlon. All rights reserved. | ||
* | ||
* This file is part of PiOmxTexturesQmlUtils. | ||
* | ||
* PiOmxTexturesQmlUtils is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* PiOmxTexturesQmlUtils is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with PiOmxTexturesQmlUtils. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
/*------------------------------------------------------------------------------ | ||
| includes | ||
+-----------------------------------------------------------------------------*/ | ||
#include <QMediaObject> | ||
#include <QMediaPlayer> | ||
|
||
#include "pot_videoprobe.h" | ||
|
||
/*------------------------------------------------------------------------------ | ||
| POT_VideoProbe::POT_VideoProbe | ||
+-----------------------------------------------------------------------------*/ | ||
POT_VideoProbe::POT_VideoProbe(QObject* parent) : | ||
QVideoProbe(parent) | ||
{ | ||
// Do nothing. | ||
} | ||
|
||
/*------------------------------------------------------------------------------ | ||
| POT_VideoProbe::source | ||
+-----------------------------------------------------------------------------*/ | ||
QObject* POT_VideoProbe::source() | ||
{ | ||
return m_source; | ||
} | ||
|
||
/*------------------------------------------------------------------------------ | ||
| POT_VideoProbe::setSource | ||
+-----------------------------------------------------------------------------*/ | ||
void POT_VideoProbe::setSource(QObject* source) | ||
{ | ||
if (m_source == source) | ||
return; | ||
m_source = source; | ||
|
||
QMediaPlayer* player = NULL; | ||
if (m_source) | ||
player = qvariant_cast<QMediaPlayer*>(m_source->property("mediaObject")); | ||
|
||
if (!QVideoProbe::setSource((QMediaObject*)player)) { | ||
qWarning("Failed to set probe."); | ||
m_source = NULL; | ||
return; | ||
} | ||
|
||
emit sourceChanged(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Project: PiOmxTexturesQmlUtils | ||
* Author: Luca Carlon | ||
* Date: 03.12.2016 | ||
* | ||
* Copyright (c) 2016 Luca Carlon. All rights reserved. | ||
* | ||
* This file is part of PiOmxTexturesQmlUtils. | ||
* | ||
* PiOmxTexturesQmlUtils is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* PiOmxTexturesQmlUtils is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with PiOmxTexturesQmlUtils. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#ifndef POT_VIDEOPROBE_H | ||
#define POT_VIDEOPROBE_H | ||
|
||
/*------------------------------------------------------------------------------ | ||
| includes | ||
+-----------------------------------------------------------------------------*/ | ||
#include <QQuickItem> | ||
#include <QVideoProbe> | ||
|
||
/*------------------------------------------------------------------------------ | ||
| POT_VideoProbe class | ||
+-----------------------------------------------------------------------------*/ | ||
class POT_VideoProbe : public QVideoProbe | ||
{ | ||
Q_OBJECT | ||
|
||
Q_PROPERTY(QObject* source READ source WRITE setSource NOTIFY sourceChanged) | ||
|
||
public: | ||
POT_VideoProbe(QObject* parent = 0); | ||
|
||
QObject* source(); | ||
void setSource(QObject* source); | ||
|
||
signals: | ||
void sourceChanged(); | ||
|
||
private: | ||
QObject* m_source; | ||
}; | ||
|
||
#endif // POT_VIDEOPROBE_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<RCC> | ||
<qresource prefix="/"/> | ||
</RCC> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.