diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b1022583..f0fb30985 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,9 @@ cmake_minimum_required(VERSION 3.16) -project(QOpenHDProject VERSION 0.1 LANGUAGES CXX) +project(QOpenHDProject VERSION 0.1 LANGUAGES C CXX) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) @@ -64,6 +66,8 @@ qt_add_executable(QOpenHDApp app/telemetry/settings/mavlinksettingsmodel.cpp app/telemetry/settings/pollutionhelper.cpp app/telemetry/settings/wblinksettingshelper.cpp + # + app/telemetry/tutil/geodesi_helper.cpp ### #app/videostreaming/vscommon/custom/rawreceiver.cpp @@ -90,13 +94,22 @@ target_include_directories(QOpenHDApp PUBLIC app/telemetry/util) target_include_directories(QOpenHDApp PUBLIC app/videostreaming/vscommon) target_include_directories(QOpenHDApp PUBLIC lib) +target_include_directories(QOpenHDApp PUBLIC lib/geographiclib-c-2.0/src) -qt_add_qml_module(QOpenHDApp - URI QOpenHD - VERSION 1.0 - QML_FILES - qml/MainX.qml -) +#qt_add_qml_module(QOpenHDApp +# URI hello +# VERSION 1.0 +# QML_FILES +# qml/main.qml +# qml/ui/AnyParamBusyIndicator.qml +# qml/ui/HUDOverlayGrid.qml +# qml/ui/elements/ +# qml/ui/sidebar/ +# qml/ui/widgets/ +#) +#qt6_add_resources(qml_QRC +# PREFIX "/" +# qml/qml.qrc) target_link_libraries(QOpenHDApp diff --git a/app/main.cpp b/app/main.cpp index 00ab6103b..2bb72417a 100755 --- a/app/main.cpp +++ b/app/main.cpp @@ -418,8 +418,12 @@ int main(int argc, char *argv[]) { #endif ); - // TODO QT 6 - engine.load(QUrl(QLatin1String("qrc:/main.qml"))); + //engine.load(QUrl(QLatin1String("qrc:/main.qml"))); + //const QUrl url("qrc:/qt/qml/hello/qml/main.qml"); + //const QUrl url(QStringLiteral("qrc:/qt/qml/main.qml")); + //const QUrl url(QStringLiteral("qrc:/qml/main.qml")); + const QUrl url(QStringLiteral("qrc:/main.qml")); + engine.load(url); //engine.loadFromModule("QOpenHD", "qrc:/main.qml"); //engine.loadFromModule("QOpenHDApp","qrc:/main.qml"); //engine.load("qml/main.qml"); diff --git a/app/telemetry/models/fcmavlinksystem.cpp b/app/telemetry/models/fcmavlinksystem.cpp index 9d17bb78f..d921669ed 100644 --- a/app/telemetry/models/fcmavlinksystem.cpp +++ b/app/telemetry/models/fcmavlinksystem.cpp @@ -123,7 +123,6 @@ bool FCMavlinkSystem::process_message(const mavlink_message_t &msg) mavlink_system_time_t sys_time; mavlink_msg_system_time_decode(&msg, &sys_time); set_sys_time_unix_usec(sys_time.time_unix_usec); - // TODO QT 6 doesn't have it QDateTime time; time.setMSecsSinceEpoch(sys_time.time_unix_usec/1000); set_sys_time_unix_as_str(time.toString()); diff --git a/app/telemetry/telemetry.pri b/app/telemetry/telemetry.pri index 0ca10ddf7..edc81a1f3 100644 --- a/app/telemetry/telemetry.pri +++ b/app/telemetry/telemetry.pri @@ -18,6 +18,7 @@ SOURCES += \ $$PWD/settings/pollutionhelper.cpp \ $$PWD/settings/wblinksettingshelper.cpp \ $$PWD/action/impl/xparam.cpp \ + $$PWD/tutil/geodesi_helper.cpp \ app/telemetry/models/aohdsystem.cpp \ app/telemetry/models/camerastreammodel.cpp \ app/telemetry/models/rcchannelsmodel.cpp \ @@ -29,6 +30,7 @@ SOURCES += \ app/telemetry/models/fcmavlinksystem.cpp \ app/telemetry/models/fcmavlinkmissionitemsmodel.cpp \ + HEADERS += \ $$PWD/action/impl/cmdsender.h \ $$PWD/action/create_cmd_helper.hpp \ diff --git a/app/telemetry/tutil/geodesi_helper.cpp b/app/telemetry/tutil/geodesi_helper.cpp new file mode 100644 index 000000000..668b2edc5 --- /dev/null +++ b/app/telemetry/tutil/geodesi_helper.cpp @@ -0,0 +1,19 @@ +#include "geodesi_helper.h" + +extern "C" { +#include "lib/geographiclib-c-2.0/src/geodesic.h" +//#include "geodesic.h" +} + +double distance_between(double lat1, double lon1, double lat2, double lon2){ + double s12; + //double azi1; + //double azi2; + + geod_geodesic geod{}; + // from https://manpages.ubuntu.com/manpages/bionic/man3/geodesic.3.html + const double a = 6378137, f = 1/298.257223563; // WGS84 + geod_init(&geod,a,f); + geod_inverse(&geod,lat1,lon1,lat2,lon2,&s12,0,0); //&azi1,&azi2 + return s12; +} diff --git a/app/telemetry/tutil/geodesi_helper.h b/app/telemetry/tutil/geodesi_helper.h index 6a35526ef..60a25a830 100644 --- a/app/telemetry/tutil/geodesi_helper.h +++ b/app/telemetry/tutil/geodesi_helper.h @@ -1,25 +1,6 @@ #ifndef GEODESI_HELPER_H #define GEODESI_HELPER_H -//#include -#include "lib/geographiclib-c-2.0/src/geodesic.h" - -// return: distance in m between 2 points -static double distance_between(double lat1,double lon1,double lat2,double lon2){ - double s12; - //double azi1; - //double azi2; - - geod_geodesic geod{}; - // from https://manpages.ubuntu.com/manpages/bionic/man3/geodesic.3.html - const double a = 6378137, f = 1/298.257223563; // WGS84 - geod_init(&geod,a,f); - geod_inverse(&geod,lat1,lon1,lat2,lon2,&s12,0,0); //&azi1,&azi2 - return s12; -} - -/*static double distance_between(double lat1,double lon1,double lat2,double lon2){ - return 0; -}*/ +double distance_between(double lat1,double lon1,double lat2,double lon2); #endif // GEODESI_HELPER_H diff --git a/app/vs_legacy/README.md b/app/vs_legacy/README.md deleted file mode 100644 index 66589126e..000000000 --- a/app/vs_legacy/README.md +++ /dev/null @@ -1,6 +0,0 @@ -Old stuff that no one understands except maybe stephen. -Mostly for platforms other than standart linux. -Before we re-introduce this code into QOpenHD, someone has to check if these (hacks ???!!) are still needed, if there are better solution(s) -nowadays and then re-implement this stuff. -Honestly, until someone takes this task upon him, we won't be able to compile QOpenHD for anything else than standard linux. -No one can maintain this old and undocumented code in its current state. diff --git a/app/vs_legacy/androidsurfacetexture.cpp b/app/vs_legacy/androidsurfacetexture.cpp deleted file mode 100644 index 527cef557..000000000 --- a/app/vs_legacy/androidsurfacetexture.cpp +++ /dev/null @@ -1,198 +0,0 @@ - -#include "androidsurfacetexture.h" - -#include -#include - -#include - - -static const char QtSurfaceTextureListenerClassName[] = "com/openhd/android/SurfaceTextureListener"; - -typedef QVector SurfaceTextures; - -Q_GLOBAL_STATIC(SurfaceTextures, g_surfaceTextures); -Q_GLOBAL_STATIC(QMutex, g_textureMutex); - -// native method for QtSurfaceTexture.java - -static void notifyFrameAvailable(JNIEnv* , jobject, jlong id) { - const QMutexLocker lock(g_textureMutex); - const int idx = g_surfaceTextures->indexOf(id); - - if (idx == -1) { - return; - } - - AndroidSurfaceTexture *obj = reinterpret_cast(g_surfaceTextures->at(idx)); - - if (obj) { - Q_EMIT obj->frameAvailable(); - } -} - - -AndroidSurfaceTexture::AndroidSurfaceTexture(quint32 texName): QObject() { - Q_STATIC_ASSERT(sizeof (jlong) >= sizeof (void *)); - - QAndroidJniEnvironment env; - - m_surfaceTexture = QAndroidJniObject("android/graphics/SurfaceTexture", "(I)V", jint(texName)); - - if (env->ExceptionCheck()) { - env->ExceptionClear(); - } - - if (!m_surfaceTexture.isValid()) { - return; - } - - const QMutexLocker lock(g_textureMutex); - - g_surfaceTextures->append(jlong(this)); - - QAndroidJniObject listener(QtSurfaceTextureListenerClassName, "(J)V", jlong(this)); - - setOnFrameAvailableListener(listener); -} - - -AndroidSurfaceTexture::~AndroidSurfaceTexture() { - if (m_surface.isValid()) { - m_surface.callMethod("release"); - } - - if (m_surfaceTexture.isValid()) { - release(); - - const QMutexLocker lock(g_textureMutex); - - const int idx = g_surfaceTextures->indexOf(jlong(this)); - - if (idx != -1) { - g_surfaceTextures->remove(idx); - } - } -} - - -QMatrix4x4 AndroidSurfaceTexture::getTransformMatrix() { - QMatrix4x4 matrix; - if (!m_surfaceTexture.isValid()) { - return matrix; - } - - QAndroidJniEnvironment env; - - jfloatArray array = env->NewFloatArray(16); - - m_surfaceTexture.callMethod("getTransformMatrix", "([F)V", array); - - env->GetFloatArrayRegion(array, 0, 16, matrix.data()); - env->DeleteLocalRef(array); - - return matrix; -} - - -void AndroidSurfaceTexture::release() { - m_surfaceTexture.callMethod("release"); -} - - -void AndroidSurfaceTexture::updateTexImage() { - if (!m_surfaceTexture.isValid()) { - return; - } - - m_surfaceTexture.callMethod("updateTexImage"); -} - - -jobject AndroidSurfaceTexture::surfaceTexture() { - return m_surfaceTexture.object(); -} - - -jobject AndroidSurfaceTexture::surface() { - if (!m_surface.isValid()) { - m_surface = QAndroidJniObject("android/view/Surface", - "(Landroid/graphics/SurfaceTexture;)V", - m_surfaceTexture.object()); - } - return m_surface.object(); -} - - -jobject AndroidSurfaceTexture::surfaceHolder() { - if (!m_surfaceHolder.isValid()) { - m_surfaceHolder = QAndroidJniObject("org/qtproject/qt5/android/multimedia/QtSurfaceTextureHolder", - "(Landroid/view/Surface;)V", - surface()); - } - - return m_surfaceHolder.object(); -} - - -void AndroidSurfaceTexture::attachToGLContext(quint32 texName) { - if (!m_surfaceTexture.isValid()) { - return; - } - - m_surfaceTexture.callMethod("attachToGLContext", "(I)V", texName); -} - - -void AndroidSurfaceTexture::detachFromGLContext() { - if (!m_surfaceTexture.isValid()) { - return; - } - - m_surfaceTexture.callMethod("detachFromGLContext"); -} - - -bool AndroidSurfaceTexture::initJNI(JNIEnv *env) { - QAndroidJniEnvironment jenv; - - jclass clazz = jenv.findClass(QtSurfaceTextureListenerClassName); - - QAndroidJniObject qjniObject(QtSurfaceTextureListenerClassName); - - static const JNINativeMethod methods[] = { - {"notifyFrameAvailable", "(J)V", (void *)notifyFrameAvailable} - }; - - if (clazz && env->RegisterNatives(clazz, - methods, - sizeof(methods) / sizeof(methods[0])) != JNI_OK) { - return false; - } - return true; -} - -jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) { - Q_UNUSED(reserved) - static bool initialized = false; - if (initialized) { - return JNI_VERSION_1_6; - } - - initialized = true; - - JNIEnv* env; - if (vm->GetEnv(reinterpret_cast(&env), JNI_VERSION_1_6) != JNI_OK) { - return -1; - } - - AndroidSurfaceTexture::initJNI(env); - - return JNI_VERSION_1_6; -} - -void AndroidSurfaceTexture::setOnFrameAvailableListener(const QAndroidJniObject &listener) { - m_surfaceTexture.callMethod("setOnFrameAvailableListener", - "(Landroid/graphics/SurfaceTexture$OnFrameAvailableListener;)V", - listener.object()); -} diff --git a/app/vs_legacy/androidsurfacetexture.h b/app/vs_legacy/androidsurfacetexture.h deleted file mode 100644 index 3b5008202..000000000 --- a/app/vs_legacy/androidsurfacetexture.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef ANDROIDSURFACETEXTURE_H -#define ANDROIDSURFACETEXTURE_H - -#include - -#include -#include - -#include - -QT_BEGIN_NAMESPACE - -class AndroidSurfaceTexture : public QObject { - Q_OBJECT -public: - explicit AndroidSurfaceTexture(quint32 texName); - ~AndroidSurfaceTexture(); - jobject surfaceTexture(); - jobject surface(); - jobject surfaceHolder(); - inline bool isValid() const { return m_surfaceTexture.isValid(); } - QMatrix4x4 getTransformMatrix(); - void release(); // API level 14 - void updateTexImage(); - void attachToGLContext(quint32 texName); // API level 16 - void detachFromGLContext(); // API level 16 - static bool initJNI(JNIEnv *env); -Q_SIGNALS: - void frameAvailable(); -private: - void setOnFrameAvailableListener(const QAndroidJniObject &listener); - QAndroidJniObject m_surfaceTexture; - QAndroidJniObject m_surface; - QAndroidJniObject m_surfaceHolder; -}; -QT_END_NAMESPACE -#endif // ANDROIDSURFACETEXTURE_H diff --git a/app/vs_legacy/gst_ios_init.h b/app/vs_legacy/gst_ios_init.h deleted file mode 100644 index 858cb8d38..000000000 --- a/app/vs_legacy/gst_ios_init.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef __GST_IOS_INIT_H__ -#define __GST_IOS_INIT_H__ - -#include - -G_BEGIN_DECLS - -void gst_ios_init(int argc, char* argv[]); - -G_END_DECLS - -#endif diff --git a/app/vs_legacy/gst_ios_init.m b/app/vs_legacy/gst_ios_init.m deleted file mode 100644 index 38e2cd62f..000000000 --- a/app/vs_legacy/gst_ios_init.m +++ /dev/null @@ -1,41 +0,0 @@ -#include "gst_ios_init.h" -#import -#import - - - -void -gst_ios_init (int argc, char* argv[]) -{ - GstPluginFeature *plugin; - GstRegistry *reg; - NSString *resources = [[NSBundle mainBundle] resourcePath]; - NSString *tmp = NSTemporaryDirectory(); - NSString *cache = [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Caches"]; - NSString *docs = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]; - - const gchar *resources_dir = [resources UTF8String]; - const gchar *tmp_dir = [tmp UTF8String]; - const gchar *cache_dir = [cache UTF8String]; - const gchar *docs_dir = [docs UTF8String]; - gchar *ca_certificates; - - g_setenv ("TMP", tmp_dir, TRUE); - g_setenv ("TEMP", tmp_dir, TRUE); - g_setenv ("TMPDIR", tmp_dir, TRUE); - g_setenv ("XDG_RUNTIME_DIR", resources_dir, TRUE); - g_setenv ("XDG_CACHE_HOME", cache_dir, TRUE); - - g_setenv ("HOME", docs_dir, TRUE); - g_setenv ("XDG_DATA_DIRS", resources_dir, TRUE); - g_setenv ("XDG_CONFIG_DIRS", resources_dir, TRUE); - g_setenv ("XDG_CONFIG_HOME", cache_dir, TRUE); - g_setenv ("XDG_DATA_HOME", resources_dir, TRUE); - g_setenv ("FONTCONFIG_PATH", resources_dir, TRUE); - - ca_certificates = g_build_filename (resources_dir, "ssl", "certs", "ca-certificates.crt", NULL); - g_setenv ("CA_CERTIFICATES", ca_certificates, TRUE); - g_free (ca_certificates); - - gst_init (NULL, NULL); -} diff --git a/app/vs_legacy/openhdandroidrender.cpp b/app/vs_legacy/openhdandroidrender.cpp deleted file mode 100644 index 1c7b15a36..000000000 --- a/app/vs_legacy/openhdandroidrender.cpp +++ /dev/null @@ -1,190 +0,0 @@ -#if defined(ENABLE_VIDEO_RENDER) -#if defined(__android__) - -#include "openhdandroidrender.h" - -#include -#include -#include -#include -#include - -struct State { - QMatrix4x4 uSTMatrix; - GLuint textureId = 0; - - int compare(const State *other) const - { - return (uSTMatrix == other->uSTMatrix && textureId == other->textureId) ? 0 : -1; - } -}; - - -class SurfaceTextureShader : QSGSimpleMaterialShader { - QSG_DECLARE_SIMPLE_COMPARABLE_SHADER(SurfaceTextureShader, State) -public: - const char *vertexShader() const override { - return - "uniform mat4 qt_Matrix; \n" - "uniform mat4 uSTMatrix; \n" - "attribute vec4 aPosition; \n" - "attribute vec4 aTextureCoord; \n" - "varying vec2 vTextureCoord; \n" - "void main() { \n" - " gl_Position = qt_Matrix * aPosition; \n" - " vTextureCoord = (uSTMatrix * aTextureCoord).xy; \n" - "}"; - } - - const char *fragmentShader() const override { - return - "#extension GL_OES_EGL_image_external : require \n" - "precision mediump float; \n" - "varying vec2 vTextureCoord; \n" - "uniform lowp float qt_Opacity; \n" - "uniform samplerExternalOES sTexture; \n" - "void main() { \n" - " gl_FragColor = texture2D(sTexture, vTextureCoord) * qt_Opacity; \n" - "}"; - } - - QList attributes() const override { - return QList() << "aPosition" << "aTextureCoord"; - } - - void updateState(const State *state, const State *) override { - program()->setUniformValue(m_uSTMatrixLoc, state->uSTMatrix); - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_EXTERNAL_OES, state->textureId); - } - - void resolveUniforms() override { - m_uSTMatrixLoc = program()->uniformLocation("uSTMatrix"); - program()->setUniformValue("sTexture", 0); - } - -private: - int m_uSTMatrixLoc; -}; - -class SurfaceTextureNode : public QSGGeometryNode -{ -public: - SurfaceTextureNode(const QAndroidJniObject &surfaceTexture, GLuint textureId): QSGGeometryNode(), - m_surfaceTexture(surfaceTexture), - m_geometry(QSGGeometry::defaultAttributes_TexturedPoint2D(), 4), - m_textureId(textureId) { - setFlag(UsePreprocess); - - setGeometry(&m_geometry); - - QSGSimpleMaterial *material = SurfaceTextureShader::createMaterial(); - material->state()->textureId = m_textureId; - material->setFlag(QSGMaterial::Blending, false); - setMaterial(material); - setFlag(OwnsMaterial); - - QAndroidJniEnvironment env; - jfloatArray array = env->NewFloatArray(16); - m_uSTMatrixArray = jfloatArray(env->NewGlobalRef(array)); - env->DeleteLocalRef(array); - } - - ~SurfaceTextureNode() override { - QAndroidJniEnvironment()->DeleteGlobalRef(m_uSTMatrixArray); - } - - void preprocess() override; - -private: - QAndroidJniObject m_surfaceTexture; - QSGGeometry m_geometry; - jfloatArray m_uSTMatrixArray = nullptr; - GLuint m_textureId; -}; - - -void SurfaceTextureNode::preprocess() -{ - auto mat = static_cast *>(material()); - if (!mat) { - return; - } - m_surfaceTexture.callMethod("updateTexImage"); - m_surfaceTexture.callMethod("getTransformMatrix", "([F)V", m_uSTMatrixArray); - QAndroidJniEnvironment env; - env->GetFloatArrayRegion(m_uSTMatrixArray, 0, 16, mat->state()->uSTMatrix.data()); -} - - -extern "C" void Java_com_openhd_android_SurfaceTextureListener_frameAvailable(JNIEnv env, jobject jthis, jlong ptr, jobject surfaceTexture) { - auto item = reinterpret_cast(ptr); - QMetaObject::invokeMethod(item, "update", Qt::QueuedConnection); -} - - -OpenHDAndroidRender::OpenHDAndroidRender(QQuickItem *parent): QQuickItem(parent) { - setFlags(ItemHasContents); - connect(this, &OpenHDAndroidRender::onUpdate, this, &OpenHDAndroidRender::doUpdate, Qt::QueuedConnection); - connect(this, &QQuickItem::windowChanged, this, &OpenHDAndroidRender::handleWindowChanged); -} - - -void OpenHDAndroidRender::setWindow(QQuickWindow *window) { - m_window = window; - //m_window->setClearBeforeRendering(false); - emit windowChanged(m_window); -} - -void OpenHDAndroidRender::handleWindowChanged(QQuickWindow *window) { - if (!window) { - return; - } - m_window = window; - //connect(m_window, &QQuickWindow::sceneGraphInvalidated, this, &OpenHDAndroidRender::cleanup, Qt::DirectConnection); - //m_window->setClearBeforeRendering(false); -} - -void OpenHDAndroidRender::doUpdate() { - window()->update(); -} - -OpenHDAndroidRender::~OpenHDAndroidRender() { - if (m_textureId) { - glBindTexture(GL_TEXTURE_EXTERNAL_OES, 0); - glDeleteTextures(1, &m_textureId); - } -} - - -QSGNode *OpenHDAndroidRender::updatePaintNode(QSGNode *n, QQuickItem::UpdatePaintNodeData *) { - SurfaceTextureNode *node = static_cast(n); - if (!node) { - glGenTextures(1, &m_textureId); - glBindTexture(GL_TEXTURE_EXTERNAL_OES, m_textureId); - glTexParameterf(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameterf(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - m_surfaceTexture = QAndroidJniObject("android/graphics/SurfaceTexture", "(I)V", m_textureId); - m_surfaceTexture.callMethod("setOnFrameAvailableListener", - "(Landroid/graphics/SurfaceTexture$OnFrameAvailableListener;)V", - QAndroidJniObject("com/openhd/android/SurfaceTextureListener", - "(J)V", jlong(this)).object()); - node = new SurfaceTextureNode(m_surfaceTexture, m_textureId); - emit surfaceTextureChanged(this); - } - - QRectF rect(boundingRect()); - float tmp = rect.top(); - rect.setTop(rect.bottom()); - rect.setBottom(tmp); - - QSGGeometry::updateTexturedRectGeometry(node->geometry(), rect, QRectF(0, 0, 1, 1)); - node->markDirty(QSGNode::DirtyGeometry | QSGNode::DirtyMaterial); - - return node; -} - -#endif -#endif diff --git a/app/vs_legacy/openhdandroidrender.h b/app/vs_legacy/openhdandroidrender.h deleted file mode 100644 index 5bac2e9e6..000000000 --- a/app/vs_legacy/openhdandroidrender.h +++ /dev/null @@ -1,48 +0,0 @@ -#if defined(ENABLE_VIDEO_RENDER) -#if defined(__android__) - -#ifndef OPENHDANDROIDRENDER_H -#define OPENHDANDROIDRENDER_H - -#include -#include - - -class OpenHDAndroidRender : public QQuickItem { - Q_OBJECT -public: - OpenHDAndroidRender(QQuickItem *parent = nullptr); - ~OpenHDAndroidRender() override; - - const QAndroidJniObject &surfaceTexture() const { - return m_surfaceTexture; - } - - Q_PROPERTY(QQuickWindow *window MEMBER m_window WRITE setWindow NOTIFY windowChanged) - - Q_INVOKABLE void setWindow(QQuickWindow *window); - - QQuickWindow *m_window = nullptr; - -protected: - QSGNode *updatePaintNode(QSGNode *n, UpdatePaintNodeData *) override; - -private slots: - void handleWindowChanged(QQuickWindow *win); - void doUpdate(); - -signals: - void surfaceTextureChanged(OpenHDAndroidRender *surfaceTexture); - void windowChanged(QQuickWindow *window); - void onUpdate(); - -private: - uint32_t m_textureId = 0; - - QAndroidJniObject m_surfaceTexture; -}; - -#endif // OPENHDANDROIDRENDER_H - -#endif -#endif diff --git a/app/vs_legacy/openhdandroidvideo.cpp b/app/vs_legacy/openhdandroidvideo.cpp deleted file mode 100644 index 901527bfb..000000000 --- a/app/vs_legacy/openhdandroidvideo.cpp +++ /dev/null @@ -1,247 +0,0 @@ -#if defined(ENABLE_VIDEO_RENDER) -#if defined(__android__) - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include "openhdandroidvideo.h" -#include "openhdrender.h" -#include "constants.h" -#include "localmessage.h" - -#include "sharedqueue.h" - -using namespace std::chrono; - -#include "h264_common.h" - - -OpenHDAndroidVideo::OpenHDAndroidVideo(enum OpenHDStreamType stream_type): OpenHDVideo(stream_type) { - qDebug() << "OpenHDAndroidVideo::OpenHDAndroidVideo()"; - connect(this, &OpenHDAndroidVideo::configure, this, &OpenHDAndroidVideo::androidConfigure, Qt::DirectConnection); -} - -OpenHDAndroidVideo::~OpenHDAndroidVideo() { - qDebug() << "~OpenHDAndroidVideo()"; -} - -void OpenHDAndroidVideo::start() { - // nothing needed -} - -void OpenHDAndroidVideo::stop() { - if (codec) { - if (isConfigured) { - AMediaCodec_stop(codec); - isConfigured = false; - } - AMediaCodec_delete(codec); - codec = nullptr; - } - if (format) { - AMediaFormat_delete(format); - format = nullptr; - } -} - -OpenHDRender* OpenHDAndroidVideo::videoOut() const { - return m_videoOut; -} - -void OpenHDAndroidVideo::setVideoOut(OpenHDRender *videoOut) { - qDebug() << "OpenHDAndroidVideo::setVideoOut()"; - if (m_videoOut == videoOut) { - return; - } - - if (m_videoOut) { - m_videoOut->disconnect(this); - } - - m_videoOut = videoOut; - - auto setSurfaceTexture = [=] { - QAndroidJniEnvironment env; - - window = ANativeWindow_fromSurface(env, m_videoOut->surfaceTexture()->surface()); - }; - - - bool surfaceValid = videoOut->surfaceTexture()->isValid(); - - if (surfaceValid) { - setSurfaceTexture(); - } else { - connect(m_videoOut.data(), &OpenHDRender::surfaceTextureChanged, this, setSurfaceTexture); - } - - emit videoOutChanged(); -} - - - -void OpenHDAndroidVideo::androidConfigure() { - - auto t = QThread::currentThread(); - - qDebug() << "OpenHDAndroidVideo::androidConfigure()"; - qDebug() << t; - - media_status_t status; - - codec = AMediaCodec_createDecoderByType("video/avc"); - - m_videoOut.data()->setVideoSize(QSize(width, height)); - - format = AMediaFormat_new(); - AMediaFormat_setString(format, AMEDIAFORMAT_KEY_MIME, "video/avc"); - AMediaFormat_setInt32(format, AMEDIAFORMAT_KEY_WIDTH, width); - AMediaFormat_setInt32(format, AMEDIAFORMAT_KEY_HEIGHT, height); - AMediaFormat_setInt32(format, AMEDIAFORMAT_KEY_PUSH_BLANK_BUFFERS_ON_STOP, 0); - AMediaFormat_setInt32(format, AMEDIAFORMAT_KEY_MAX_INPUT_SIZE, 0); - - - AMediaFormat_setBuffer (format, "csd-0", sps, sps_len); - AMediaFormat_setBuffer (format, "csd-1", pps, pps_len); - - status = AMediaCodec_configure(codec, - format, - window, - nullptr, - 0); - - - switch (status) { - case AMEDIA_OK: { - break; - } - case AMEDIA_ERROR_UNKNOWN: { - qDebug() << "AMediaCodec_configure: AMEDIA_ERROR_UNKNOWN"; - break; - } - case AMEDIA_ERROR_MALFORMED: { - qDebug() << "AMediaCodec_configure: AMEDIA_ERROR_MALFORMED"; - break; - } - case AMEDIA_ERROR_UNSUPPORTED: { - qDebug() << "AMediaCodec_configure: AMEDIA_ERROR_UNSUPPORTED"; - break; - } - case AMEDIA_ERROR_INVALID_OBJECT: { - qDebug() << "AMediaCodec_configure: AMEDIA_ERROR_INVALID_OBJECT"; - break; - } - case AMEDIA_ERROR_INVALID_PARAMETER: { - qDebug() << "AMediaCodec_configure: AMEDIA_ERROR_INVALID_PARAMETER"; - break; - } - default: { - break; - } - } - - - status = AMediaCodec_start(codec); - - if (status != AMEDIA_OK) { - qDebug() << "AMediaCodec_start failed"; - stop(); - - return; - } - - isConfigured = true; - - QThread::msleep(100); - - //QFuture input_future = QtConcurrent::run(this, &OpenHDAndroidVideo::inputLoop); - QFuture render_future = QtConcurrent::run(this, &OpenHDAndroidVideo::renderLoop); -} - -void OpenHDAndroidVideo::inputLoop() { - while (true) { - //auto nalUnit = nalQueue.front(); - //processFrame(nalUnit); - } -} - -void OpenHDAndroidVideo::processFrame(QByteArray &nal, webrtc::H264::NaluType frameType) { - if (frameType == webrtc::H264::NaluType::kAud) { - return; - } - - if (!isConfigured) { - return; - } - - ssize_t buffIdx = AMediaCodec_dequeueInputBuffer(codec, 35000); - - if (buffIdx == AMEDIACODEC_INFO_TRY_AGAIN_LATER) { - return; - } else if (buffIdx < 0) { - return; - } - - auto now = steady_clock::now().time_since_epoch(); - auto pts = duration_cast(now).count(); - - size_t buffsize; - uint8_t* inputBuff = AMediaCodec_getInputBuffer(codec, buffIdx, &buffsize); - size_t finalSize = 0; - if (inputBuff) { - memcpy(inputBuff, nal.data(), nal.size()); - finalSize = nal.size(); - } - //qDebug() << "AMediaCodec_queueInputBuffer"; - AMediaCodec_queueInputBuffer(codec, buffIdx, 0, finalSize, pts, 0); -} - - -void OpenHDAndroidVideo::renderLoop() { - while (true) { - if (!isConfigured) { - return; - } - AMediaCodecBufferInfo info; - auto status = AMediaCodec_dequeueOutputBuffer(codec, &info, 35000); - if (status >= 0) { - //const int64_t ts = (int64_t)duration_cast(steady_clock::now().time_since_epoch()).count(); - //AMediaCodec_releaseOutputBufferAtTime(codec, status, ts); - AMediaCodec_releaseOutputBuffer(codec, (size_t)status, info.size != 0); - } else if (status == AMEDIACODEC_INFO_OUTPUT_BUFFERS_CHANGED) { - //qDebug("output buffers changed"); - } else if (status == AMEDIACODEC_INFO_OUTPUT_FORMAT_CHANGED) { - //auto format = AMediaCodec_getOutputFormat(codec); - //qDebug("format changed to: %s", AMediaFormat_toString(format)); - //AMediaFormat_delete(format); - } else if (status == AMEDIACODEC_INFO_TRY_AGAIN_LATER) { - //qDebug("no output buffer right now"); - } else { - //qDebug("unexpected info code: %zd", status); - } - } -} - -#endif -#endif diff --git a/app/vs_legacy/openhdandroidvideo.h b/app/vs_legacy/openhdandroidvideo.h deleted file mode 100644 index 06daeebbe..000000000 --- a/app/vs_legacy/openhdandroidvideo.h +++ /dev/null @@ -1,54 +0,0 @@ -#if defined(ENABLE_VIDEO_RENDER) -#if defined(__android__) - -#ifndef OpenHDAndroidVideo_H -#define OpenHDAndroidVideo_H - -#include - -#include - -#include "openhdvideo.h" -#include "openhdrender.h" - -#include - - -class OpenHDAndroidVideo : public OpenHDVideo -{ - Q_OBJECT - Q_PROPERTY(OpenHDRender *videoOut READ videoOut WRITE setVideoOut NOTIFY videoOutChanged) - -public: - OpenHDAndroidVideo(enum OpenHDStreamType stream_type = OpenHDStreamTypeMain); - virtual ~OpenHDAndroidVideo() override; - - OpenHDRender *videoOut() const; - Q_INVOKABLE void setVideoOut(OpenHDRender *videoOut); - - - void start() override; - void stop() override; - void renderLoop() override; - void inputLoop() override; - void processFrame(QByteArray &nal, webrtc::H264::NaluType frameType) override; - -public slots: - void androidConfigure(); - -signals: - void videoOutChanged(); - -private: - - QPointer m_videoOut; - - AMediaCodec* codec = nullptr; - AMediaFormat *format = nullptr; - ANativeWindow * window = nullptr; -}; - -#endif // OpenHDAndroidVideo_H - -#endif -#endif diff --git a/app/vs_legacy/openhdapplevideo.cpp b/app/vs_legacy/openhdapplevideo.cpp deleted file mode 100644 index 14b32c9c2..000000000 --- a/app/vs_legacy/openhdapplevideo.cpp +++ /dev/null @@ -1,297 +0,0 @@ -#if defined(ENABLE_VIDEO_RENDER) -#if defined(__apple__) - -#include -#include -#include -#include -#include - -#include "openhdapplevideo.h" -#include "openhdrender.h" -#include "localmessage.h" - -#include "sharedqueue.h" - -#include - -#include "h264_common.h" - -#include "appleplatform.h" - - -using namespace std::chrono; - - -void decompressionOutputCallback(void *decompressionOutputRefCon, - void *sourceFrameRefCon, - OSStatus status, - VTDecodeInfoFlags infoFlags, - CVImageBufferRef imageBuffer, - CMTime presentationTimeStamp, - CMTime presentationDuration) { - OpenHDAppleVideo *t = static_cast(decompressionOutputRefCon); - - if (status != noErr) { - qDebug() << "Decompressed error: " << status; - } else { - t->processDecodedFrame(imageBuffer); - } -} - - -OpenHDAppleVideo::OpenHDAppleVideo(enum OpenHDStreamType stream_type): OpenHDVideo(stream_type) { - qDebug() << "OpenHDAppleVideo::OpenHDAppleVideo()"; - connect(this, &OpenHDAppleVideo::configure, this, &OpenHDAppleVideo::vtdecConfigure, Qt::DirectConnection); - - connect(this, &OpenHDAppleVideo::setup, this, &OpenHDAppleVideo::onSetup); - -} - -void OpenHDAppleVideo::onSetup() { - qDebug() << "OpenHDAppleVideo::onSetup()"; - - #if defined(__ios__) - auto applePlatform = ApplePlatform::instance(); - connect(applePlatform, &ApplePlatform::willEnterForeground, this, &OpenHDAppleVideo::start, Qt::QueuedConnection); - connect(applePlatform, &ApplePlatform::didEnterBackground, this, &OpenHDAppleVideo::stop, Qt::QueuedConnection); - #endif -} - - -OpenHDAppleVideo::~OpenHDAppleVideo() { - qDebug() << "~OpenHDAppleVideo()"; -} - - -void OpenHDAppleVideo::start() { - m_background = false; - m_restart = true; -} - - -void OpenHDAppleVideo::stop() { - m_background = true; - if (m_decompressionSession != nullptr) { - VTDecompressionSessionInvalidate(m_decompressionSession); - CFRelease(m_decompressionSession); - m_decompressionSession = nullptr; - } - if (m_formatDesc != nullptr) { - CFRelease(m_formatDesc); - m_formatDesc = nullptr; - } -} - - -OpenHDRender* OpenHDAppleVideo::videoOut() const { - return m_videoOut; -} - - -void OpenHDAppleVideo::setVideoOut(OpenHDRender *videoOut) { - qDebug() << "OpenHDAppleVideo::setVideoOut(" << videoOut << ")"; - - if (m_videoOut == videoOut) { - return; - } - - if (m_videoOut) { - //m_videoOut->disconnect(this); - } - - m_videoOut = videoOut; - - emit videoOutChanged(); -} - - -void OpenHDAppleVideo::vtdecConfigure() { - auto t = QThread::currentThread(); - - qDebug() << "OpenHDAppleVideo::vtdecConfigure()"; - qDebug() << t; - - OSStatus status; - - if (m_formatDesc != nullptr) { - CFRelease(m_formatDesc); - m_formatDesc = nullptr; - } - - // iOS decoder wants the SPS and PPS without any headers so we skip that part and use just the data - uint8_t* vtdec_sps = (uint8_t*)malloc(sps_len - 4); - uint8_t* vtdec_pps = (uint8_t*)malloc(pps_len - 4); - - memcpy(vtdec_sps, &sps[4], sps_len-4); - memcpy(vtdec_pps, &pps[4], pps_len-4); - - uint8_t* parameterSetPointers[2] = {vtdec_sps, vtdec_pps}; - size_t parameterSetSizes[2] = {(size_t)sps_len-4, (size_t)pps_len-4}; - - status = CMVideoFormatDescriptionCreateFromH264ParameterSets(kCFAllocatorDefault, - 2, - (const uint8_t *const*)parameterSetPointers, - parameterSetSizes, - 4, - &m_formatDesc); - - free(vtdec_sps); - free(vtdec_pps); - - if (status != noErr) { - qDebug() << "CMVideoFormatDescriptionCreateFromH264ParameterSets() failed: " << (int)status; - return; - } - qDebug() << "CMVideoFormatDescriptionCreateFromH264ParameterSets() success"; - - - // set up the callback that will be run whenever a frame is decoded - m_decompressionSession = nullptr; - VTDecompressionOutputCallbackRecord callBackRecord; - callBackRecord.decompressionOutputCallback = decompressionOutputCallback; - callBackRecord.decompressionOutputRefCon = static_cast(this); - - #if defined(__ios__) - int useGL = 1; - - const void *keys[] = { kCVPixelBufferOpenGLESCompatibilityKey }; - const void *values[] = { CFNumberCreate(nullptr, kCFNumberIntType, &useGL) }; - - CFDictionaryRef destinationImageBufferAttributes = CFDictionaryCreate(nullptr, - keys, - values, - 1, - nullptr, - nullptr); - #else - CFDictionaryRef destinationImageBufferAttributes = nullptr; - #endif - - status = VTDecompressionSessionCreate(nullptr, - m_formatDesc, - nullptr, - destinationImageBufferAttributes, - &callBackRecord, - &m_decompressionSession); - - if (status != noErr) { - qDebug() << "Decompression session error:" << status; - return; - } - - qDebug() << "Decompression session created"; - - - isConfigured = true; - - QThread::msleep(100); - - m_videoOut->setFormat(width, height, QVideoFrame::PixelFormat::Format_BGRA32); -} - - -void OpenHDAppleVideo::inputLoop() { - -} - - -void OpenHDAppleVideo::processFrame(QByteArray &nal, webrtc::H264::NaluType frameType) { - - if (frameType == webrtc::H264::NaluType::kSps || frameType == webrtc::H264::NaluType::kPps || frameType == webrtc::H264::NaluType::kAud) { - return; - } - - CMSampleBufferRef sampleBuffer = nullptr; - CMBlockBufferRef blockBuffer = nullptr; - - QByteArray avccBuffer; - avccBuffer.append(nal.data(), nal.size()); - - uint32_t dataLength32 = htonl(avccBuffer.size() - 4); - memcpy (avccBuffer.data(), &dataLength32, sizeof (uint32_t)); - - - OSStatus status = CMBlockBufferCreateWithMemoryBlock(nullptr, - avccBuffer.data(), - avccBuffer.size(), - kCFAllocatorNull, - nullptr, - 0, - avccBuffer.size(), - 0, - &blockBuffer); - - // now create our sample buffer from the block buffer, - if(status != noErr) { - qDebug() << "CMBlockBufferCreateWithMemoryBlock fail: " << status; - if (blockBuffer) { - CFRelease(blockBuffer); - } - return; - } - - const size_t sampleSize = avccBuffer.size(); - - status = CMSampleBufferCreateReady(kCFAllocatorDefault, - blockBuffer, - m_formatDesc, - 1, - 0, - nullptr, - 1, - &sampleSize, - &sampleBuffer); - - - if (status != noErr) { - qDebug() << "CMSampleBufferCreateReady fail: " << status; - if (sampleBuffer) { - CFRelease(sampleBuffer); - } - if (blockBuffer) { - CFRelease(blockBuffer); - } - return; - } - - // set some values of the sample buffer's attachments - CFArrayRef attachments = CMSampleBufferGetSampleAttachmentsArray(sampleBuffer, true); - CFMutableDictionaryRef dict = (CFMutableDictionaryRef)CFArrayGetValueAtIndex(attachments, 0); - CFDictionarySetValue(dict, kCMSampleAttachmentKey_DisplayImmediately, kCFBooleanTrue); - - - VTDecodeFrameFlags flags = kVTDecodeFrame_EnableAsynchronousDecompression; - VTDecodeInfoFlags flagOut; - - status = VTDecompressionSessionDecodeFrame(m_decompressionSession, - sampleBuffer, - flags, - nullptr, - &flagOut); - - if (status != noErr) { - qDebug() << "VTDecompressionSessionDecodeFrame fail: " << status; - } - - if (sampleBuffer) { - CFRelease(sampleBuffer); - } - if (blockBuffer) { - CFRelease(blockBuffer); - } -} - - -void OpenHDAppleVideo::processDecodedFrame(CVImageBufferRef imageBuffer) { - if (m_videoOut) { - m_videoOut->paintFrame(imageBuffer); - } -} - -void OpenHDAppleVideo::renderLoop() { - -} - -#endif -#endif diff --git a/app/vs_legacy/openhdapplevideo.h b/app/vs_legacy/openhdapplevideo.h deleted file mode 100644 index a7c6624d7..000000000 --- a/app/vs_legacy/openhdapplevideo.h +++ /dev/null @@ -1,59 +0,0 @@ -#if defined(ENABLE_VIDEO_RENDER) -#if defined(__apple__) - -#ifndef OpenHDAppleVideo_H -#define OpenHDAppleVideo_H - -#include - -#include - -#include "openhdvideo.h" -#include "openhdrender.h" - -#include - -class OpenHDAppleVideo : public OpenHDVideo -{ - Q_OBJECT - Q_PROPERTY(OpenHDRender *videoOut READ videoOut WRITE setVideoOut NOTIFY videoOutChanged) - -public: - OpenHDAppleVideo(enum OpenHDStreamType stream_type = OpenHDStreamTypeMain); - virtual ~OpenHDAppleVideo() override; - - OpenHDRender *videoOut() const; - Q_INVOKABLE void setVideoOut(OpenHDRender *videoOut); - - - void start() override; - void stop() override; - void renderLoop() override; - void inputLoop() override; - void processFrame(QByteArray &nal, webrtc::H264::NaluType frameType) override; - void processDecodedFrame(CVImageBufferRef imageBuffer); - -public slots: - void vtdecConfigure(); - void onSetup(); - -signals: - void videoOutChanged(); - -protected: - QPointer m_videoOut; - -private: - quint64 m_last_time = 0; - quint64 m_frames = 0; - - CMVideoFormatDescriptionRef m_formatDesc = nullptr; - VTDecompressionSessionRef m_decompressionSession = nullptr; - - -}; - -#endif // OpenHDAppleVideo_H - -#endif -#endif diff --git a/app/vs_legacy/openhdmmalvideo.cpp b/app/vs_legacy/openhdmmalvideo.cpp deleted file mode 100644 index 1d57a4499..000000000 --- a/app/vs_legacy/openhdmmalvideo.cpp +++ /dev/null @@ -1,451 +0,0 @@ -#if defined(ENABLE_VIDEO_RENDER) -#if defined(__rasp_pi__) - -#include -#include -#include -#include -#include - -#include "openhdmmalvideo.h" -#include "openhdrender.h" -#include "constants.h" -#include "localmessage.h" - -#include "sharedqueue.h" - -#include "bcm_host.h" -#include "interface/mmal/mmal.h" -#include "interface/mmal/mmal_parameters_video.h" -#include "interface/mmal/util/mmal_util.h" -#include "interface/mmal/util/mmal_util_params.h" -#include "interface/mmal/util/mmal_default_components.h" -#include "interface/vcos/vcos.h" - -using namespace std::chrono; - -#include "h264_common.h" - - -static bool initialized_mmal = false; - -/* - * Callback from the input port. - * Buffer has been consumed and is available to be used again. - */ -static void input_callback(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer) -{ - struct CONTEXT_T *ctx = (struct CONTEXT_T *)port->userdata; - - /* The decoder is done with the data, just recycle the buffer header into its pool */ - mmal_buffer_header_release(buffer); - - /* Signal the prcocessFrame function */ - vcos_semaphore_post(&ctx->in_semaphore); -} - -/* - * Callback from the output port. - * Buffer has been produced by the port and is available for processing. - */ -static void output_callback(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer) -{ - struct CONTEXT_T *ctx = (struct CONTEXT_T *)port->userdata; - - /* Queue the decoded video frame so renderLoop can get it */ - mmal_queue_put(ctx->queue, buffer); - - /* Signal the renderLoop */ - vcos_semaphore_post(&ctx->out_semaphore); -} - - -OpenHDMMALVideo::OpenHDMMALVideo(enum OpenHDStreamType stream_type): OpenHDVideo(stream_type) { - qDebug() << "OpenHDMMALVideo::OpenHDMMALVideo()"; - connect(this, &OpenHDMMALVideo::configure, this, &OpenHDMMALVideo::mmalConfigure, Qt::DirectConnection); -} - - -OpenHDMMALVideo::~OpenHDMMALVideo() { - qDebug() << "~OpenHDMMALVideo()"; -} - - -void OpenHDMMALVideo::start() { - // nothing needed -} - - -void OpenHDMMALVideo::stop() { - if (m_decoder) { - mmal_port_disable(m_decoder->input[0]); - mmal_port_disable(m_decoder->output[0]); - mmal_component_disable(m_decoder); - } - - if (m_pool_in) { - mmal_port_pool_destroy(m_decoder->input[0], m_pool_in); - } - - if (m_pool_out) { - mmal_port_pool_destroy(m_decoder->output[0], m_pool_out); - } - - if (m_decoder) { - mmal_component_destroy(m_decoder); - } - - if (m_context.queue) { - mmal_queue_destroy(m_context.queue); - } - - vcos_semaphore_delete(&m_context.in_semaphore); - vcos_semaphore_delete(&m_context.out_semaphore); -} - - -OpenHDRender* OpenHDMMALVideo::videoOut() const { - return m_videoOut; -} - - -void OpenHDMMALVideo::setVideoOut(OpenHDRender *videoOut) { - qDebug() << "OpenHDMMALVideo::setVideoOut(" << videoOut << ")"; - - if (m_videoOut == videoOut) { - return; - } - - if (m_videoOut) { - m_videoOut->disconnect(this); - } - - m_videoOut = videoOut; - - emit videoOutChanged(); -} - - -void OpenHDMMALVideo::mmalConfigure() { - if (!initialized_mmal) { - initialized_mmal = true; - bcm_host_init(); - } - - auto t = QThread::currentThread(); - - qDebug() << "OpenHDMMALVideo::mmalConfigure()"; - qDebug() << t; - - /* - * Used to signal the input function and the output loop that a buffer is ready, - * which prevents us from having to loop and burn CPU time, and also ensures that - * there is no delay before using the available buffer. - */ - vcos_semaphore_create(&m_context.in_semaphore, "qopenhd_in", 1); - vcos_semaphore_create(&m_context.out_semaphore, "qopenhd_out", 1); - - m_status = mmal_component_create(MMAL_COMPONENT_DEFAULT_VIDEO_DECODER, &m_decoder); - - if (m_status != MMAL_SUCCESS) { - qDebug() << "failed to create MMAL decoder"; - return; - } - - /* - * Set format of video decoder input port - */ - MMAL_ES_FORMAT_T *format_in = m_decoder->input[0]->format; - - format_in->type = MMAL_ES_TYPE_VIDEO; - format_in->encoding = MMAL_ENCODING_H264; - format_in->es->video.width = VCOS_ALIGN_UP(width, 32); - format_in->es->video.height = VCOS_ALIGN_UP(height, 16); - format_in->es->video.frame_rate.num = fps; - format_in->es->video.frame_rate.den = 1; - format_in->es->video.par.num = 1; - format_in->es->video.par.den = 1; - /* - * If the data is known to be framed then the following flag should be set: - */ - format_in->flags |= MMAL_ES_FORMAT_FLAG_FRAMED; - - m_status = mmal_format_extradata_alloc(format_in, sps_len + pps_len); - - if (m_status != MMAL_SUCCESS) { - qDebug() << "failed to allocate extradata in MMAL"; - return; - } - format_in->extradata_size = sps_len + pps_len; - memcpy(format_in->extradata, sps, sps_len); - memcpy(format_in->extradata + sps_len, pps, pps_len); - - - /* - * Set zero copy on the input port, which uses VCSM to map the buffers into arm memory address space, - * allowing us to avoid copying the buffer back to the GPU side once we fill it with h264 data. There - * isn't much overhead either way since the amount of data is small, but we can do it so we will. - */ - m_status = mmal_port_parameter_set_boolean(m_decoder->input[0], MMAL_PARAMETER_ZERO_COPY, MMAL_TRUE); - if (m_status != MMAL_SUCCESS) { - qDebug() << "Failed to set zero copy on input port"; - return; - } - - m_status = mmal_port_format_commit(m_decoder->input[0]); - if (m_status != MMAL_SUCCESS) { - qDebug() << "failed to commit input format"; - return; - } - - - /* - * Don't infer timestamps from the framerate - */ - m_status = mmal_port_parameter_set_boolean(m_decoder->output[0], MMAL_PARAMETER_VIDEO_INTERPOLATE_TIMESTAMPS, MMAL_FALSE); - if (m_status != MMAL_SUCCESS) { - qDebug() << "Failed to disable timestamp interpolation on output port"; - return; - } - - /* - * Set zero copy on the output port, which uses VCSM to map the decoded frame buffers into arm memory - * address space, allowing us to avoid copying large amounts of data from GPU->Arm for every single - * decoded frame. - * - * The overhead of the copying would be significant enough to affect framerate. Testing suggests it - * becomes a factor around the 60fps+ rate, but even if we could technically get away with it, it - * would waste resources. - */ - m_status = mmal_port_parameter_set_boolean(m_decoder->output[0], MMAL_PARAMETER_ZERO_COPY, MMAL_TRUE); - if (m_status != MMAL_SUCCESS) { - qDebug() << "Failed to set zero copy on output port"; - return; - } - - /* - * Don't discard corrupt decoded frames, pass them on to the Arm side for rendering. - */ - m_status = mmal_port_parameter_set_boolean(m_decoder->output[0], MMAL_PARAMETER_VIDEO_DECODE_ERROR_CONCEALMENT, MMAL_FALSE); - if (m_status != MMAL_SUCCESS) { - qDebug() << "Failed to set error concealment on output port"; - return; - } - - m_status = mmal_port_format_commit(m_decoder->output[0]); - if (m_status != MMAL_SUCCESS) { - qDebug() << "failed to commit output format"; - return; - } - - - - MMAL_ES_FORMAT_T *format_out = m_decoder->output[0]->format; - - qDebug("%s\n", m_decoder->output[0]->name); - qDebug(" type: %i, fourcc: %4.4s\n", format_out->type, (char *)&format_out->encoding); - qDebug(" bitrate: %i, framed: %i\n", format_out->bitrate, - !!(format_out->flags & MMAL_ES_FORMAT_FLAG_FRAMED)); - qDebug(" extra data: %i, %p\n", format_out->extradata_size, format_out->extradata); - qDebug(" width: %i, height: %i, (%i,%i,%i,%i)\n", - format_out->es->video.width, format_out->es->video.height, - format_out->es->video.crop.x, format_out->es->video.crop.y, - format_out->es->video.crop.width, format_out->es->video.crop.height); - - /* - * Size of the input buffers used for h264 data. These only need to be large enough for the - * largest NAL unit we will likely feed to the decoder, 512KB seems ok in testing but may - * need to be a bit larger for higher bitrates. - */ - m_decoder->input[0]->buffer_num = 15; - m_decoder->input[0]->buffer_size = 768 * 1024; - m_pool_in = mmal_port_pool_create(m_decoder->input[0], - m_decoder->input[0]->buffer_num, - m_decoder->input[0]->buffer_size); - - if (!m_pool_in) { - qDebug() << "failed to create input pool in MMAL"; - return; - } - - /* - * Decoded frame buffers, these have to be large enough to hold an entire raw frame. The h264 decoder - * can't decode anything much larger than 1080p, but a single 1080p YUV420 frame is about 3.2MB - * so we add some extra margin on top of that. - */ - m_decoder->output[0]->buffer_num = 15; - m_decoder->output[0]->buffer_size = 3500000; - m_pool_out = mmal_port_pool_create(m_decoder->output[0], - m_decoder->output[0]->buffer_num, - m_decoder->output[0]->buffer_size); - - if (!m_pool_out) { - qDebug() << "failed to create input pool in MMAL"; - return; - } - - m_context.queue = mmal_queue_create(); - - /* - * Provide a context pointer that will be passed back to us in the input and output callbacks - */ - m_decoder->input[0]->userdata = (MMAL_PORT_USERDATA_T *)&m_context; - m_decoder->output[0]->userdata = (MMAL_PORT_USERDATA_T *)&m_context; - - - m_status = mmal_port_enable(m_decoder->input[0], input_callback); - if (m_status != MMAL_SUCCESS) { - qDebug() << "failed to set input callback in MMAL"; - return; - } - m_status = mmal_port_enable(m_decoder->output[0], output_callback); - if (m_status != MMAL_SUCCESS) { - qDebug() << "failed to set output callback in MMAL"; - return; - } - - m_status = mmal_component_enable(m_decoder); - - if (m_status != MMAL_SUCCESS) { - qDebug() << "failed to enable decoder in MMAL"; - return; - } - - isConfigured = true; - - QThread::msleep(100); - - - - // the pi decoder hardware always gives us this format, so we hardcode it - m_videoOut->setFormat(width, height, QVideoFrame::PixelFormat::Format_YUV420P); - - /* - * Input is currently driven directly by the incoming h264 parser, using a queue and a - * separate loop does not seem to work in testing, might be a MediaCodec quirk or just a bug here - * somewhere - */ - //QFuture input_future = QtConcurrent::run(this, &OpenHDMMALVideo::inputLoop); - QFuture render_future = QtConcurrent::run(this, &OpenHDMMALVideo::renderLoop); -} - - -void OpenHDMMALVideo::inputLoop() { - while (true) { - auto nalUnit = nalQueue.front(); - //processFrame(nalUnit); - } -} - - -void OpenHDMMALVideo::processFrame(QByteArray &nal, webrtc::H264::NaluType frameType) { - if (!isConfigured) { - return; - } - - MMAL_BUFFER_HEADER_T *buffer; - - while (true) { - vcos_semaphore_wait(&m_context.in_semaphore); - - if ((buffer = mmal_queue_get(m_pool_in->queue)) != nullptr) { - - memcpy(buffer->data, nal.data(), nal.length()); - buffer->length = nal.length(); - - buffer->offset = 0; - - buffer->flags |= MMAL_BUFFER_HEADER_FLAG_FRAME_END; - - buffer->pts = buffer->dts = MMAL_TIME_UNKNOWN; - - if (!buffer->length) { - break; - } - - m_status = mmal_port_send_buffer(m_decoder->input[0], buffer); - if (m_status != MMAL_SUCCESS) { - break; - } - break; - } - } -} - - -void OpenHDMMALVideo::renderLoop() { - - MMAL_BUFFER_HEADER_T *buffer; - MMAL_STATUS_T status = MMAL_EINVAL; - - while (true) { - vcos_semaphore_wait(&m_context.out_semaphore); - - - /* Get decoded frame */ - while ((buffer = mmal_queue_get(m_context.queue)) != NULL) { - if (buffer->cmd) { - if (m_videoOut) { - double frameSize = 1920 * 1080 * 1.5; - uint8_t *dummyFrame = (uint8_t*)malloc(sizeof(char) * frameSize); - memset(dummyFrame, 0, (size_t)frameSize); - m_videoOut->paintFrame(dummyFrame, (size_t)frameSize); - m_videoOut->paintFrame(dummyFrame, (size_t)frameSize); - m_videoOut->paintFrame(dummyFrame, (size_t)frameSize); - m_videoOut->paintFrame(dummyFrame, (size_t)frameSize); - free(dummyFrame); - } - if (buffer->cmd == MMAL_EVENT_FORMAT_CHANGED) { - MMAL_EVENT_FORMAT_CHANGED_T *event = mmal_event_format_changed_get(buffer); - /*Assume we can't reuse the buffers, so have to disable, destroy - pool, create new pool, enable port, feed in buffers.*/ - status = mmal_port_disable(m_decoder->output[0]); - - //Clear the queue of all buffers - while(mmal_queue_length(m_pool_out->queue) != m_pool_out->headers_num) { - MMAL_BUFFER_HEADER_T *buf; - vcos_semaphore_wait(&m_context.out_semaphore); - buf = mmal_queue_get(m_context.queue); - mmal_buffer_header_release(buf); - } - - mmal_port_pool_destroy(m_decoder->output[0], m_pool_out); - status = mmal_format_full_copy(m_decoder->output[0]->format, event->format); - status = mmal_port_format_commit(m_decoder->output[0]); - - m_pool_out = mmal_port_pool_create(m_decoder->output[0], - m_decoder->output[0]->buffer_num, - m_decoder->output[0]->buffer_size); - - status = mmal_port_enable(m_decoder->output[0], output_callback); - m_videoOut->setFormat(event->format->es->video.width, event->format->es->video.height, QVideoFrame::PixelFormat::Format_YUV420P); - } - mmal_buffer_header_release(buffer); - } else { - // buffer is released by the renderer when it finishes with the frame - if (m_videoOut) { - m_videoOut->paintFrame(buffer); - } - m_frames = m_frames + 1; - qint64 current_timestamp = QDateTime::currentMSecsSinceEpoch(); - auto elapsed = current_timestamp - m_last_time; - if (elapsed > 5000) { - auto fps = m_frames / (elapsed / 1000.0); - m_last_time = current_timestamp; - m_frames = 0; - } - } - } - - /* Send empty buffers to the output port of the decoder */ - while ((buffer = mmal_queue_get(m_pool_out->queue)) != nullptr) { - m_status = mmal_port_send_buffer(m_decoder->output[0], buffer); - if (m_status != MMAL_SUCCESS) { - //qDebug() << "failed to send output buffer"; - } - } - } -} - -#endif -#endif diff --git a/app/vs_legacy/openhdmmalvideo.h b/app/vs_legacy/openhdmmalvideo.h deleted file mode 100644 index 9b4deb5c5..000000000 --- a/app/vs_legacy/openhdmmalvideo.h +++ /dev/null @@ -1,70 +0,0 @@ -#if defined(ENABLE_VIDEO_RENDER) -#if defined(__rasp_pi__) - -#ifndef OpenHDMMALVideo_H -#define OpenHDMMALVideo_H - -#include - -#include - -#include "openhdvideo.h" -#include "openhdrender.h" - -#include "bcm_host.h" -#include "interface/mmal/mmal.h" -#include "interface/mmal/util/mmal_default_components.h" -#include "interface/vcos/vcos.h" - -struct CONTEXT_T { - VCOS_SEMAPHORE_T in_semaphore; - VCOS_SEMAPHORE_T out_semaphore; - MMAL_QUEUE_T *queue; -}; - -class OpenHDMMALVideo : public OpenHDVideo -{ - Q_OBJECT - Q_PROPERTY(OpenHDRender *videoOut READ videoOut WRITE setVideoOut NOTIFY videoOutChanged) - -public: - OpenHDMMALVideo(enum OpenHDStreamType stream_type = OpenHDStreamTypeMain); - virtual ~OpenHDMMALVideo() override; - - OpenHDRender *videoOut() const; - Q_INVOKABLE void setVideoOut(OpenHDRender *videoOut); - - - void start() override; - void stop() override; - void renderLoop() override; - void inputLoop() override; - void processFrame(QByteArray &nal, webrtc::H264::NaluType frameType) override; - -public slots: - void mmalConfigure(); - -signals: - void videoOutChanged(); - -private: - struct CONTEXT_T m_context; - - MMAL_STATUS_T m_status = MMAL_EINVAL; - MMAL_COMPONENT_T *m_decoder = 0; - - MMAL_POOL_T *m_pool_in = 0; - MMAL_POOL_T *m_pool_out = 0; - - QPointer m_videoOut; - - quint64 m_last_time = 0; - quint64 m_frames = 0; - - -}; - -#endif // OpenHDMMALVideo_H - -#endif -#endif diff --git a/app/vs_legacy/openhdrender.cpp b/app/vs_legacy/openhdrender.cpp deleted file mode 100644 index 2166e45cf..000000000 --- a/app/vs_legacy/openhdrender.cpp +++ /dev/null @@ -1,797 +0,0 @@ -#if defined(ENABLE_VIDEO_RENDER) - -#include "openhdrender.h" - -#include -#include -#include -#include - - -#if defined(__android__) - -static const GLfloat g_vertex_data[] = { - -1.f, 1.f, - 1.f, 1.f, - 1.f, -1.f, - -1.f, -1.f -}; - -static const GLfloat g_texture_data[] = { - 0.f, 0.f, - 1.f, 0.f, - 1.f, 1.f, - 0.f, 1.f -}; - -void OpenGLResourcesDeleter::deleteTextureHelper(quint32 id) { - if (id != 0) - glDeleteTextures(1, &id); -} - -void OpenGLResourcesDeleter::deleteFboHelper(void *fbo) { - delete reinterpret_cast(fbo); -} - -void OpenGLResourcesDeleter::deleteShaderProgramHelper(void *prog) { - delete reinterpret_cast(prog); -} - -void OpenGLResourcesDeleter::deleteThisHelper() { - delete this; -} - - -class AndroidTextureVideoBuffer : public QAbstractVideoBuffer { -public: - AndroidTextureVideoBuffer(OpenHDRender *renderer, const QSize &size) - : QAbstractVideoBuffer(GLTextureHandle) - , m_mapMode(NotMapped) - , m_renderer(renderer) - , m_size(size) - , m_textureUpdated(false) {} - - - virtual ~AndroidTextureVideoBuffer() {} - - MapMode mapMode() const { - return m_mapMode; - } - - uchar *map(MapMode mode, int *numBytes, int *bytesPerLine) { - if (m_mapMode == NotMapped && mode == ReadOnly && updateFrame()) { - m_mapMode = mode; - m_image = m_renderer->m_fbo->toImage(); - if (numBytes) { - *numBytes = m_image.sizeInBytes(); - } - if (bytesPerLine) { - *bytesPerLine = m_image.bytesPerLine(); - } - return m_image.bits(); - } else { - return 0; - } - } - - void unmap() { - m_image = QImage(); - m_mapMode = NotMapped; - } - - QVariant handle() const { - AndroidTextureVideoBuffer *that = const_cast(this); - if (!that->updateFrame()) { - return QVariant(); - } - return m_renderer->m_fbo->texture(); - } -private: - bool updateFrame() { - // Even though the texture was updated in a previous call, we need to re-check - // that this has not become a stale buffer, e.g., if the output size changed or - // has since became invalid. - if (!m_renderer->m_nativeSize.isValid()) { - return false; - } - - // Size changed - if (m_renderer->m_nativeSize != m_size) { - return false; - } - // In the unlikely event that we don't have a valid fbo, but have a valid size, - // force an update. - const bool forceUpdate = !m_renderer->m_fbo; - if (m_textureUpdated && !forceUpdate) { - return true; - } - // update the video texture (called from the render thread) - return (m_textureUpdated = m_renderer->renderFrameToFbo()); - } - MapMode m_mapMode; - OpenHDRender *m_renderer = nullptr; - QImage m_image; - QSize m_size; - bool m_textureUpdated; -}; - -#endif - - -#if defined(__apple__) -#include - -// copied from Qt source to avoid pulling in an objc++ header -QVideoFrame::PixelFormat QtPixelFormatFromCVFormat(OSType avPixelFormat) -{ - /* BGRA <-> ARGB "swap" is intentional: - to work correctly with GL_RGBA, color swap shaders - (in QSG node renderer etc.). */ - switch (avPixelFormat) { - case kCVPixelFormatType_32ARGB: - return QVideoFrame::Format_BGRA32; - case kCVPixelFormatType_32BGRA: - return QVideoFrame::Format_ARGB32; - case kCVPixelFormatType_24RGB: - return QVideoFrame::Format_RGB24; - case kCVPixelFormatType_24BGR: - return QVideoFrame::Format_BGR24; - case kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange: - case kCVPixelFormatType_420YpCbCr8BiPlanarFullRange: - return QVideoFrame::Format_NV12; - case kCVPixelFormatType_422YpCbCr8: - return QVideoFrame::Format_UYVY; - case kCVPixelFormatType_422YpCbCr8_yuvs: - return QVideoFrame::Format_YUYV; - default: - return QVideoFrame::Format_Invalid; - } -} - - -class CVPixelBufferVideoBuffer : public QAbstractPlanarVideoBuffer -{ -public: - CVPixelBufferVideoBuffer(CVPixelBufferRef buffer, OpenHDRender *renderer) - #ifndef Q_OS_IOS - : QAbstractPlanarVideoBuffer(NoHandle) - #else - : QAbstractPlanarVideoBuffer(renderer->supportsTextures() - && CVPixelBufferGetPixelFormatType(buffer) == kCVPixelFormatType_32BGRA - ? GLTextureHandle : NoHandle) - , m_texture(nullptr) - #endif - , m_renderer(renderer) - , m_buffer(buffer) - , m_mode(NotMapped) { - - CVPixelBufferRetain(m_buffer); - } - - virtual ~CVPixelBufferVideoBuffer() { - unmap(); - #ifdef Q_OS_IOS - if (m_texture) { - CFRelease(m_texture); - } - #endif - CVPixelBufferRelease(m_buffer); - } - - MapMode mapMode() const { - return m_mode; - } - - /* - * Copied from Qt source. - * - * The framework version of this class depends on a different rendering method that we - * don't use, so we copy the method here instead - */ - int map(QAbstractVideoBuffer::MapMode mode, int *numBytes, int bytesPerLine[4], uchar *data[4]) { - const size_t nPlanes = CVPixelBufferGetPlaneCount(m_buffer); - - if (!nPlanes) { - data[0] = map(mode, numBytes, bytesPerLine); - return data[0] ? 1 : 0; - } - - if (mode != QAbstractVideoBuffer::NotMapped && m_mode == QAbstractVideoBuffer::NotMapped) { - CVPixelBufferLockBaseAddress(m_buffer, mode == QAbstractVideoBuffer::ReadOnly - ? kCVPixelBufferLock_ReadOnly - : 0); - - if (numBytes) - *numBytes = CVPixelBufferGetDataSize(m_buffer); - - if (bytesPerLine) { - bytesPerLine[0] = CVPixelBufferGetBytesPerRowOfPlane(m_buffer, 0); - bytesPerLine[1] = CVPixelBufferGetBytesPerRowOfPlane(m_buffer, 1); - } - - if (data) { - data[0] = static_cast(CVPixelBufferGetBaseAddressOfPlane(m_buffer, 0)); - data[1] = static_cast(CVPixelBufferGetBaseAddressOfPlane(m_buffer, 1)); - } - - m_mode = mode; - } - - return nPlanes; - } - - uchar *map(MapMode mode, int *numBytes, int *bytesPerLine) { - if (mode != NotMapped && m_mode == NotMapped) { - CVPixelBufferLockBaseAddress(m_buffer, mode == QAbstractVideoBuffer::ReadOnly - ? kCVPixelBufferLock_ReadOnly - : 0); - - const size_t nPlanes = CVPixelBufferGetPlaneCount(m_buffer); - - if (numBytes) { - *numBytes = CVPixelBufferGetDataSize(m_buffer); - } - - if (bytesPerLine) { - *bytesPerLine = CVPixelBufferGetBytesPerRow(m_buffer); - } - - m_mode = mode; - - return (uchar*)CVPixelBufferGetBaseAddress(m_buffer); - } else { - return nullptr; - } - } - - void unmap() { - if (m_mode != NotMapped) { - CVPixelBufferUnlockBaseAddress(m_buffer, m_mode == QAbstractVideoBuffer::ReadOnly - ? kCVPixelBufferLock_ReadOnly - : 0); - m_mode = NotMapped; - } - } - - QVariant handle() const { -#ifdef Q_OS_IOS - // Called from the render thread, so there is a current OpenGL context - - if (!m_renderer->m_textureCache) { - QOpenGLContext *c = QOpenGLContext::currentContext(); - - CVReturn err = CVOpenGLESTextureCacheCreate(kCFAllocatorDefault, - nullptr, - c, - nullptr, - &m_renderer->m_textureCache); - - if (err != kCVReturnSuccess) - qWarning("Error creating texture cache"); - } - - if (m_renderer->m_textureCache && !m_texture) { - CVOpenGLESTextureCacheFlush(m_renderer->m_textureCache, 0); - - CVReturn err = CVOpenGLESTextureCacheCreateTextureFromImage(kCFAllocatorDefault, - m_renderer->m_textureCache, - m_buffer, - nullptr, - GL_TEXTURE_2D, - GL_RGBA, - CVPixelBufferGetWidth(m_buffer), - CVPixelBufferGetHeight(m_buffer), - GL_RGBA, - GL_UNSIGNED_BYTE, - 0, - &m_texture); - - if (err != kCVReturnSuccess) { - qWarning("Error creating texture from buffer"); - } - } - - if (m_texture) { - return CVOpenGLESTextureGetName(m_texture); - } else { - return 0; - } -#else - return QVariant(); -#endif - } - -private: -#ifdef Q_OS_IOS - mutable CVOpenGLESTextureRef m_texture; -#endif - OpenHDRender *m_renderer = nullptr; - CVPixelBufferRef m_buffer = nullptr; - MapMode m_mode = NotMapped; -}; -#endif - - -#if defined(__rasp_pi__) -#include "interface/mmal/mmal.h" - -class MMALPixelBufferVideoBuffer : public QAbstractPlanarVideoBuffer -{ -public: - MMALPixelBufferVideoBuffer(MMAL_BUFFER_HEADER_T *buffer, int width, int height): QAbstractPlanarVideoBuffer(NoHandle), m_buffer(buffer), m_mode(NotMapped), m_width(width), m_height(height) { - - } - - ~MMALPixelBufferVideoBuffer() { - mmal_buffer_header_release(m_buffer); - } - - MapMode mapMode() const { - return m_mode; - } - - int map(QAbstractVideoBuffer::MapMode mode, int *numBytes, int bytesPerLine[4], uchar *data[4]) { - const size_t nPlanes = m_buffer->type->video.planes; - - if (!nPlanes) { - data[0] = map(mode, numBytes, bytesPerLine); - return data[0] ? 1 : 0; - } - - if (mode != QAbstractVideoBuffer::NotMapped && m_mode == QAbstractVideoBuffer::NotMapped) { - if (numBytes) - *numBytes = m_buffer->length; - - if (bytesPerLine) { - bytesPerLine[0] = m_buffer->type->video.pitch[0]; - bytesPerLine[1] = m_buffer->type->video.pitch[1]; - bytesPerLine[2] = m_buffer->type->video.pitch[2]; - } - - if (data) { - data[0] = static_cast(m_buffer->data + m_buffer->type->video.offset[0]); - data[1] = static_cast(m_buffer->data + m_buffer->type->video.offset[1]); - data[2] = static_cast(m_buffer->data + m_buffer->type->video.offset[2]); - } - - m_mode = mode; - } - - return nPlanes; - } - - uchar *map(MapMode mode, int *numBytes, int *bytesPerLine) { - if (mode != NotMapped && m_mode == NotMapped) { - if (numBytes) { - *numBytes = m_buffer->length; - } - - if (bytesPerLine) { - *bytesPerLine = m_buffer->length / m_height; - } - - m_mode = mode; - - return (uchar*)m_buffer->data; - } else { - return nullptr; - } - } - - void unmap() { - if (m_mode != NotMapped) { - m_mode = NotMapped; - } - } - -private: - MMAL_BUFFER_HEADER_T *m_buffer = nullptr; - MapMode m_mode = NotMapped; - int m_width = 0; - int m_height = 0; -}; -#endif - - - -OpenHDRender::OpenHDRender(QQuickItem *parent): QQuickItem(parent) - , m_supportsTextures(false) -#ifdef Q_OS_IOS - , m_textureCache(nullptr) -#endif - -#if defined(__android__) - , m_surfaceTexture(0) - , m_externalTex(0) - , m_fbo(0) - , m_program(0) - , m_glDeleter(0) - , m_surfaceTextureCanAttachToContext(true) -#endif - { - qDebug() << "OpenHDRender::OpenHDRender()"; - - QObject::connect(this, &OpenHDRender::newFrameAvailable, this, &OpenHDRender::onNewVideoContentReceived, Qt::QueuedConnection); -} - -void OpenHDRender::paintFrame(uint8_t *buffer_data, size_t buffer_length) { - if (buffer_length < 1024) { - return; - } - - QSize s = m_format.frameSize(); - auto stride = s.width(); - - QVideoFrame f(buffer_length, s, stride, m_format.pixelFormat()); - f.map(QAbstractVideoBuffer::MapMode::WriteOnly); - memcpy(f.bits(), buffer_data, buffer_length); - f.unmap(); - - emit newFrameAvailable(f); -} - -#if defined(__apple__) -void OpenHDRender::paintFrame(CVImageBufferRef imageBuffer) { - int width = CVPixelBufferGetWidth(imageBuffer); - int height = CVPixelBufferGetHeight(imageBuffer); - - QVideoFrame::PixelFormat format = QtPixelFormatFromCVFormat(CVPixelBufferGetPixelFormatType(imageBuffer)); - - QAbstractVideoBuffer *buffer = new CVPixelBufferVideoBuffer(imageBuffer, this); - QVideoFrame f(buffer, QSize(width, height), format); - emit newFrameAvailable(f); -} -#endif - -#if defined(__rasp_pi__) -void OpenHDRender::paintFrame(MMAL_BUFFER_HEADER_T *buffer) { - int width = m_format.frameWidth(); - int height = m_format.frameHeight(); - - QAbstractVideoBuffer *b = new MMALPixelBufferVideoBuffer(buffer, width, height); - QVideoFrame f(b, QSize(width, height), QVideoFrame::PixelFormat::Format_YUV420P); - emit newFrameAvailable(f); -} -#endif - -OpenHDRender::~OpenHDRender() { -#if defined(__android__) - clearSurfaceTexture(); - - if (m_glDeleter) { // Make sure all of these are deleted on the render thread. - m_glDeleter->deleteFbo(m_fbo); - m_glDeleter->deleteShaderProgram(m_program); - m_glDeleter->deleteTexture(m_externalTex); - m_glDeleter->deleteThis(); - } -#endif -} - -void OpenHDRender::setVideoSurface(QAbstractVideoSurface *surface) { - qDebug() << "OpenHDRender::setVideoSurface()"; - - if (m_surface && m_surface != surface && m_surface->isActive()) { - m_surface->stop(); - } - - #if defined(__android__) - if (m_surface) { - if (!m_surfaceTextureCanAttachToContext) { - m_surface->setProperty("_q_GLThreadCallback", QVariant()); - } - } - #endif - - - m_surface = surface; - - m_supportsTextures = m_surface ? !m_surface->supportedPixelFormats(QAbstractVideoBuffer::GLTextureHandle).isEmpty() : false; - - #if defined(__android__) - if (m_surface && !m_surfaceTextureCanAttachToContext) { - m_surface->setProperty("_q_GLThreadCallback", - QVariant::fromValue(this)); - } - #endif -} - - -#if defined(__android__) -bool OpenHDRender::isReady() { - qDebug() << "OpenHDRender::isReady()"; - - return m_surfaceTextureCanAttachToContext || QOpenGLContext::currentContext() || m_externalTex; -} - - -AndroidSurfaceTexture *OpenHDRender::surfaceTexture() { - qDebug() << "OpenHDRender::surfaceTexture()"; - if (!initSurfaceTexture()) { - return 0; - } - return m_surfaceTexture; -} - - -bool OpenHDRender::initSurfaceTexture() { - qDebug() << "OpenHDRender::initSurfaceTexture()"; - - if (m_surfaceTexture) { - return true; - } - - if (!m_surface) { - return false; - } - - if (!m_surfaceTextureCanAttachToContext) { - // if we have an OpenGL context in the current thread, create a texture. Otherwise, wait - // for the GL render thread to call us back to do it. - if (QOpenGLContext::currentContext()) { - glGenTextures(1, &m_externalTex); - - if (!m_glDeleter) { - m_glDeleter = new OpenGLResourcesDeleter; - } - } else if (!m_externalTex) { - return false; - } - } - - QMutexLocker locker(&m_mutex); - - m_surfaceTexture = new AndroidSurfaceTexture(m_externalTex); - - if (m_surfaceTexture->surfaceTexture() != 0) { - connect(m_surfaceTexture, &AndroidSurfaceTexture::frameAvailable, this, &OpenHDRender::onFrameAvailable); - } else { - delete m_surfaceTexture; - m_surfaceTexture = 0; - - if (m_glDeleter) { - m_glDeleter->deleteTexture(m_externalTex); - } - - m_externalTex = 0; - } - - return m_surfaceTexture != 0; -} - - -void OpenHDRender::clearSurfaceTexture() { - qDebug() << "OpenHDRender::clearSurfaceTexture()"; - - QMutexLocker locker(&m_mutex); - - if (m_surfaceTexture) { - delete m_surfaceTexture; - - m_surfaceTexture = 0; - } - - // Also reset the attached OpenGL texture - // Note: The Android SurfaceTexture class does not release the texture on deletion, - // only if detachFromGLContext() called (API level >= 16), so we'll do it manually, - // on the render thread. - if (m_surfaceTextureCanAttachToContext) { - if (m_glDeleter) { - m_glDeleter->deleteTexture(m_externalTex); - } - - m_externalTex = 0; - } -} - - -void OpenHDRender::setVideoSize(const QSize &size) { - qDebug() << "OpenHDRender::setVideoSize()"; - - QMutexLocker locker(&m_mutex); - - if (m_nativeSize == size) { - return; - } - - stop(); - - m_nativeSize = size; -} - -void OpenHDRender::stop() { - qDebug() << "OpenHDRender::stop()"; - - if (m_surface && m_surface->isActive()) { - m_surface->stop(); - } - - m_nativeSize = QSize(); -} - - - -void OpenHDRender::reset() { - qDebug() << "OpenHDRender::reset()"; - - // flush pending frame - - if (m_surface) { - m_surface->present(QVideoFrame()); - } - - clearSurfaceTexture(); -} - - -void OpenHDRender::onFrameAvailable() { - if (!m_nativeSize.isValid() || !m_surface) { - return; - } - - QAbstractVideoBuffer *buffer = new AndroidTextureVideoBuffer(this, m_nativeSize); - - QVideoFrame frame(buffer, m_nativeSize, QVideoFrame::Format_ABGR32); - - if (m_surface->isActive() && (m_surface->surfaceFormat().pixelFormat() != frame.pixelFormat() - || m_surface->surfaceFormat().frameSize() != frame.size())) { - m_surface->stop(); - } - - if (!m_surface->isActive()) { - QVideoSurfaceFormat format(frame.size(), frame.pixelFormat(), - QAbstractVideoBuffer::GLTextureHandle); - m_surface->start(format); - } - - if (m_surface->isActive()) - m_surface->present(frame); -} - - -bool OpenHDRender::renderFrameToFbo() { - QMutexLocker locker(&m_mutex); - - if (!m_nativeSize.isValid() || !m_surfaceTexture) { - return false; - } - - createGLResources(); - - m_surfaceTexture->updateTexImage(); - - // save current render states - GLboolean stencilTestEnabled; - GLboolean depthTestEnabled; - GLboolean scissorTestEnabled; - GLboolean blendEnabled; - glGetBooleanv(GL_STENCIL_TEST, &stencilTestEnabled); - glGetBooleanv(GL_DEPTH_TEST, &depthTestEnabled); - glGetBooleanv(GL_SCISSOR_TEST, &scissorTestEnabled); - glGetBooleanv(GL_BLEND, &blendEnabled); - if (stencilTestEnabled) - glDisable(GL_STENCIL_TEST); - if (depthTestEnabled) - glDisable(GL_DEPTH_TEST); - if (scissorTestEnabled) - glDisable(GL_SCISSOR_TEST); - if (blendEnabled) - glDisable(GL_BLEND); - m_fbo->bind(); - glViewport(0, 0, m_nativeSize.width(), m_nativeSize.height()); - m_program->bind(); - m_program->enableAttributeArray(0); - m_program->enableAttributeArray(1); - m_program->setUniformValue("frameTexture", GLuint(0)); - m_program->setUniformValue("texMatrix", m_surfaceTexture->getTransformMatrix()); - glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 0, g_vertex_data); - glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 0, g_texture_data); - glDrawArrays(GL_TRIANGLE_FAN, 0, 4); - m_program->disableAttributeArray(0); - m_program->disableAttributeArray(1); - glBindTexture(GL_TEXTURE_EXTERNAL_OES, 0); - m_fbo->release(); - // restore render states - if (stencilTestEnabled) - glEnable(GL_STENCIL_TEST); - if (depthTestEnabled) - glEnable(GL_DEPTH_TEST); - if (scissorTestEnabled) - glEnable(GL_SCISSOR_TEST); - if (blendEnabled) - glEnable(GL_BLEND); - return true; -} - - -void OpenHDRender::createGLResources() { - Q_ASSERT(QOpenGLContext::currentContext() != NULL); - - if (!m_glDeleter) { - m_glDeleter = new OpenGLResourcesDeleter; - } - - if (m_surfaceTextureCanAttachToContext && !m_externalTex) { - m_surfaceTexture->detachFromGLContext(); - glGenTextures(1, &m_externalTex); - - m_surfaceTexture->attachToGLContext(m_externalTex); - } - - if (!m_fbo || m_fbo->size() != m_nativeSize) { - delete m_fbo; - m_fbo = new QOpenGLFramebufferObject(m_nativeSize); - } - - if (!m_program) { - m_program = new QOpenGLShaderProgram; - QOpenGLShader *vertexShader = new QOpenGLShader(QOpenGLShader::Vertex, m_program); - vertexShader->compileSourceCode("attribute highp vec4 vertexCoordsArray; \n" \ - "attribute highp vec2 textureCoordArray; \n" \ - "uniform highp mat4 texMatrix; \n" \ - "varying highp vec2 textureCoords; \n" \ - "void main(void) \n" \ - "{ \n" \ - " gl_Position = vertexCoordsArray; \n" \ - " textureCoords = (texMatrix * vec4(textureCoordArray, 0.0, 1.0)).xy; \n" \ - "}\n"); - - m_program->addShader(vertexShader); - - QOpenGLShader *fragmentShader = new QOpenGLShader(QOpenGLShader::Fragment, m_program); - - fragmentShader->compileSourceCode("#extension GL_OES_EGL_image_external : require \n" \ - "varying highp vec2 textureCoords; \n" \ - "uniform samplerExternalOES frameTexture; \n" \ - "void main() \n" \ - "{ \n" \ - " gl_FragColor = texture2D(frameTexture, textureCoords); \n" \ - "}\n"); - - m_program->addShader(fragmentShader); - - m_program->bindAttributeLocation("vertexCoordsArray", 0); - m_program->bindAttributeLocation("textureCoordArray", 1); - - m_program->link(); - } -} - -void OpenHDRender::customEvent(QEvent *e) { - if (e->type() == QEvent::User) { - - // This is running in the render thread (OpenGL enabled) - if (!m_surfaceTextureCanAttachToContext && !m_externalTex) { - glGenTextures(1, &m_externalTex); - - if (!m_glDeleter) { - // We'll use this to cleanup GL resources in the correct thread - m_glDeleter = new OpenGLResourcesDeleter; - } - - emit readyChanged(true); - } - } -} -#endif - - -void OpenHDRender::setFormat(int width, int heigth, QVideoFrame::PixelFormat i_format) { - QSize size(width, heigth); - QVideoSurfaceFormat format(size, i_format); - - if (m_surface) { - if (m_surface->isActive()) { - m_surface->stop(); - } - m_format = m_surface->nearestFormat(format); - m_surface->start(m_format); - } -} - -void OpenHDRender::onNewVideoContentReceived(const QVideoFrame &frame) { - if (m_surface) { - m_surface->present(frame); - } -} - -#endif diff --git a/app/vs_legacy/openhdrender.h b/app/vs_legacy/openhdrender.h deleted file mode 100644 index 95c96a0b8..000000000 --- a/app/vs_legacy/openhdrender.h +++ /dev/null @@ -1,133 +0,0 @@ -#if defined(ENABLE_VIDEO_RENDER) - -#ifndef OpenHDRender_H -#define OpenHDRender_H - -#include -#include -#include - -#if defined(__android__) -#include "androidsurfacetexture.h" -#include -#include -#include - -class OpenGLResourcesDeleter : public QObject -{ - Q_OBJECT -public: - void deleteTexture(quint32 id) { QMetaObject::invokeMethod(this, "deleteTextureHelper", Qt::AutoConnection, Q_ARG(quint32, id)); } - void deleteFbo(QOpenGLFramebufferObject *fbo) { QMetaObject::invokeMethod(this, "deleteFboHelper", Qt::AutoConnection, Q_ARG(void *, fbo)); } - void deleteShaderProgram(QOpenGLShaderProgram *prog) { QMetaObject::invokeMethod(this, "deleteShaderProgramHelper", Qt::AutoConnection, Q_ARG(void *, prog)); } - void deleteThis() { QMetaObject::invokeMethod(this, "deleteThisHelper"); } -private: - Q_INVOKABLE void deleteTextureHelper(quint32 id); - Q_INVOKABLE void deleteFboHelper(void *fbo); - Q_INVOKABLE void deleteShaderProgramHelper(void *prog); - Q_INVOKABLE void deleteThisHelper(); -}; - -#endif - -#if defined(__apple__) -#include -#endif - -#if defined(__rasp_pi__) -#include "interface/mmal/mmal.h" -#endif - -class OpenHDRender : public QQuickItem { - Q_OBJECT -public: - OpenHDRender(QQuickItem *parent = nullptr); - ~OpenHDRender() override; - - Q_PROPERTY(QAbstractVideoSurface *videoSurface READ videoSurface WRITE setVideoSurface) - - void paintFrame(uint8_t *buffer_data, size_t buffer_length); - #if defined(__apple__) - void paintFrame(CVImageBufferRef imageBuffer); - #endif - - #if defined(__android__) - void paintFrame(); - #endif - - #if defined(__rasp_pi__) - void paintFrame(MMAL_BUFFER_HEADER_T *buffer); - #endif - - bool supportsTextures() const { return m_supportsTextures; } - - QAbstractVideoSurface* videoSurface() const { return m_surface; } - -#if defined(__android__) - AndroidSurfaceTexture *surfaceTexture(); - bool isReady(); - void setVideoSize(const QSize &); - void stop(); - void reset(); - void customEvent(QEvent *) override; -#endif - -signals: - void newFrameAvailable(const QVideoFrame &frame); - - #if defined(__android__) - void surfaceTextureChanged(OpenHDRender *surfaceTexture); - void readyChanged(bool); - #endif - -private: - QAbstractVideoSurface *m_surface = nullptr; - QVideoSurfaceFormat m_format; - - bool m_supportsTextures; - -#ifdef Q_OS_IOS - CVOpenGLESTextureCacheRef m_textureCache = nullptr; -#endif - - friend class CVPixelBufferVideoBuffer; - - -public: - void setVideoSurface(QAbstractVideoSurface *surface); - - void setFormat(int width, int heigth, QVideoFrame::PixelFormat format); - - - - bool initSurfaceTexture(); - bool renderFrameToFbo(); - void createGLResources(); - - #if defined(__android__) - QMutex m_mutex; - - void clearSurfaceTexture(); - - QSize m_nativeSize; - - AndroidSurfaceTexture *m_surfaceTexture; - quint32 m_externalTex; - QOpenGLFramebufferObject *m_fbo; - QOpenGLShaderProgram *m_program; - OpenGLResourcesDeleter *m_glDeleter; - bool m_surfaceTextureCanAttachToContext; - #endif - - -public slots: - void onNewVideoContentReceived(const QVideoFrame &frame); - - #if defined(__android__) - void onFrameAvailable(); - #endif -}; - -#endif // OpenHDRender_H - -#endif diff --git a/app/vs_legacy/openhdvideo.cpp b/app/vs_legacy/openhdvideo.cpp deleted file mode 100644 index e0929b1b4..000000000 --- a/app/vs_legacy/openhdvideo.cpp +++ /dev/null @@ -1,564 +0,0 @@ -#if defined(ENABLE_VIDEO_RENDER) - -#include "openhdvideo.h" - -#include -#include -#include -#include - -#include "localmessage.h" - -#include "openhd.h" - - - -#include "h264_common.h" -#include "sps_parser.h" -#include "pps_parser.h" - - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - - -OpenHDVideoReceiver::OpenHDVideoReceiver(OpenHDVideo *video, enum OpenHDStreamType stream_type): QObject(), m_stream_type(stream_type), m_video(video) { - qDebug() << "OpenHDVideoReceiver::OpenHDVideoReceiver()"; -} - - -OpenHDVideoReceiver::~OpenHDVideoReceiver() { - qDebug() << "~OpenHDVideoReceiver()"; -} - - -void OpenHDVideoReceiver::onStarted() { - qDebug() << "OpenHDVideoReceiver::onStarted()"; - - connect(this, &OpenHDVideoReceiver::start, this, &OpenHDVideoReceiver::onStart, Qt::BlockingQueuedConnection); - connect(this, &OpenHDVideoReceiver::stop, this, &OpenHDVideoReceiver::onStop, Qt::BlockingQueuedConnection); - - QSettings settings; - - if (m_stream_type == OpenHDStreamTypeMain) { - m_video_port = settings.value("main_video_port", 5600).toInt(); - } else { - m_video_port = settings.value("pip_video_port", 5601).toInt(); - } - - onStart(); -} - - -void OpenHDVideoReceiver::onStop() { -#if defined(USE_RAW_SOCKET) - -#else - -#endif -} - - -void OpenHDVideoReceiver::onStart() { - QSettings settings; - - if (m_stream_type == OpenHDStreamTypeMain) { - m_video_port = settings.value("main_video_port", 5600).toInt(); - } else { - m_video_port = settings.value("pip_video_port", 5601).toInt(); - } - - - struct sockaddr_in myaddr; - int recvlen; - int fd; - unsigned char buf[65535]; - - - if ((fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) { - perror("cannot create socket\n"); - return; - } - - memset((char *)&myaddr, 0, sizeof(myaddr)); - myaddr.sin_family = AF_INET; - myaddr.sin_addr.s_addr = htonl(INADDR_ANY); - myaddr.sin_port = htons(m_video_port); - - if (bind(fd, (struct sockaddr *)&myaddr, sizeof(myaddr)) < 0) { - perror("bind failed"); - return; - } - - int n = 1024 * 1024; - - if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &n, sizeof(n)) == -1) { - qDebug() << "Failed to set socket SO_RCVBUF"; - } - - - //int flags = fcntl(fd, F_GETFL, 0); - //fcntl(fd, F_SETFL, flags | O_NONBLOCK); - - int d; - socklen_t len = sizeof(d); - - getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &d, &len); - - qDebug() << "real socket buffer size: " << d; - - emit socketChanged(fd); - - for (;;) { - recvlen = recvfrom(fd, buf, 65535, 0, NULL, NULL); - - if (recvlen > 0) { - QByteArray datagram((char*)buf, recvlen); - QMutexLocker(&m_video->m_mutex); - m_video->onReceivedData(datagram); - } - } -} - - -OpenHDVideo::OpenHDVideo(enum OpenHDStreamType stream_type): QObject(), m_stream_type(stream_type) { - qDebug() << "OpenHDVideo::OpenHDVideo()"; - - sps = (uint8_t*)malloc(sizeof(uint8_t)*1024); - pps = (uint8_t*)malloc(sizeof(uint8_t)*1024); -} - -OpenHDVideo::~OpenHDVideo() { - qDebug() << "~OpenHDVideo()"; -} - - -/* - * General initialization. - * - * Video decoder setup happens in subclasses. - * - */ -void OpenHDVideo::onStarted() { - qDebug() << "OpenHDVideo::onStarted()"; - - QSettings settings; - - if (m_stream_type == OpenHDStreamTypeMain) { - m_video_port = settings.value("main_video_port", 5600).toInt(); - } else { - m_video_port = settings.value("pip_video_port", 5601).toInt(); - } - - m_enable_rtp = settings.value("enable_rtp", true).toBool(); - - lastDataReceived = QDateTime::currentMSecsSinceEpoch(); - - timer = new QTimer(this); - QObject::connect(timer, &QTimer::timeout, this, &OpenHDVideo::reconfigure); - timer->start(1000); - - m_receiver = new OpenHDVideoReceiver(this, m_stream_type); - - if (m_stream_type == OpenHDStreamTypeMain) { - m_receiverThread.setObjectName("mainVideoRecv"); - } else { - m_receiverThread.setObjectName("pipVideoRecv"); - } - - connect(m_receiver, &OpenHDVideoReceiver::socketChanged, this, &OpenHDVideo::onSocketChanged); - - QObject::connect(&m_receiverThread, &QThread::started, m_receiver, &OpenHDVideoReceiver::onStarted); - m_receiver->moveToThread(&m_receiverThread); - - m_receiverThread.start(); - m_receiverThread.setPriority(QThread::TimeCriticalPriority); - - emit setup(); -} - - -void OpenHDVideo::onSocketChanged(int fd) { - m_socket = fd; -} - - -/* - * Fired by m_timer. - * - * This is primarily a way to check for video stalls so the UI layer can take action - * if necessary, such as hiding the PiP element when the stream has stopped. - */ -void OpenHDVideo::reconfigure() { - if (m_background) { - return; - } - - QMutexLocker locker(&m_mutex); - - auto currentTime = QDateTime::currentMSecsSinceEpoch(); - - if (currentTime - lastDataReceived < 2500) { - if (m_stream_type == OpenHDStreamTypeMain) { - OpenHD::instance()->set_main_video_running(true); - } else { - OpenHD::instance()->set_pip_video_running(true); - } - } else { - if (m_stream_type == OpenHDStreamTypeMain) { - OpenHD::instance()->set_main_video_running(false); - } else { - OpenHD::instance()->set_pip_video_running(false); - } - } - - QSettings settings; - - int port = 0; - - if (m_stream_type == OpenHDStreamTypeMain) { - port = settings.value("main_video_port", 5600).toInt(); - } else { - port = settings.value("pip_video_port", 5601).toInt(); - } - - if (m_video_port != port) { - m_restart = true; - } - - auto enable_rtp = settings.value("enable_rtp", true).toBool(); - if (m_enable_rtp != enable_rtp) { - m_enable_rtp = enable_rtp; - m_restart = true; - } - - if (m_restart) { - m_restart = false; - //emit m_receiver->stop(); - shutdown(m_socket, SHUT_RD); - m_receiverThread.quit(); - m_receiverThread.wait(); - stop(); - tempBuffer.clear(); - rtpBuffer.clear(); - sentSPS = false; - haveSPS = false; - sentPPS = false; - havePPS = false; - sentIDR = false; - isStart = true; - isConfigured = false; - m_receiverThread.start(); - m_receiverThread.setPriority(QThread::TimeCriticalPriority); - } -} - - -void OpenHDVideo::startVideo() { - QMutexLocker locker(&m_mutex); -#if defined(ENABLE_MAIN_VIDEO) || defined(ENABLE_PIP) - firstRun = false; - lastDataReceived = QDateTime::currentMSecsSinceEpoch(); - OpenHD::instance()->set_main_video_running(false); - OpenHD::instance()->set_pip_video_running(false); - QFuture future = QtConcurrent::run(this, &OpenHDVideo::start); -#endif -} - - -void OpenHDVideo::stopVideo() { - QMutexLocker locker(&m_mutex); -#if defined(ENABLE_MAIN_VIDEO) || defined(ENABLE_PIP) - QFuture future = QtConcurrent::run(this, &OpenHDVideo::stop); -#endif -} - - - -void OpenHDVideo::onReceivedData(QByteArray data) { - if (m_enable_rtp || m_stream_type == OpenHDStreamTypePiP) { - parseRTP(data); - } else { - tempBuffer.append(data); - findNAL(); - } -} - - -/* - * Simple RTP parse, just enough to get the frame data - * - */ -void OpenHDVideo::parseRTP(QByteArray &datagram) { - const uint8_t MINIMUM_HEADER_LENGTH = 12; - - if (datagram.size() < MINIMUM_HEADER_LENGTH) { - // too small to be RTP - return; - } - - uint8_t first_byte = datagram[0]; - uint8_t second_byte = datagram[1]; - - uint8_t version = static_cast(first_byte >> 6); - uint8_t padding = static_cast((first_byte >> 5) & 1); - uint8_t extension = static_cast((first_byte >> 4) & 1); - uint8_t csrcCount = static_cast(first_byte & 0x0f); - uint8_t marker = static_cast(second_byte >> 7); - uint8_t payload_type = static_cast(second_byte & 0x7f); - uint16_t sequence_number = static_cast((datagram[2] << 8) | datagram[3]); - uint32_t timestamp = static_cast((datagram[4] << 24) | (datagram[5] << 16) | (datagram[6] << 8) | datagram[7]); - uint32_t ssrc = static_cast((datagram[8] << 24) | (datagram[9] << 16) | (datagram[10] << 8) | (datagram[11])); - - QByteArray csrc; - for (int i = 0; i < csrcCount; i++) { - csrc.append(datagram[9 + 4 * i]); - } - - auto payloadOffset = MINIMUM_HEADER_LENGTH + 4 * csrcCount; - - QByteArray payload(datagram.data() + payloadOffset, datagram.size() - payloadOffset); - - const int type_stap_a = 24; - const int type_stap_b = 25; - - const int type_fu_a = 28; - const int type_fu_b = 29; - - - - auto nalu_f = static_cast((payload[0] >> 7) & 0x1); - auto nalu_nri = static_cast((payload[0] >> 5) & 0x3); - auto nalu_type = static_cast( payload[0] & 0x1f); - - bool submit = false; - - switch (nalu_type) { - case type_stap_a: { - // not supported - break; - } - case type_stap_b: { - // not supported - break; - } - case type_fu_a: { - fu_a_header fu_a; - fu_a.s = static_cast((payload[1] >> 7) & 0x1); - fu_a.e = static_cast((payload[1] >> 6) & 0x1); - fu_a.r = static_cast((payload[1] >> 5) & 0x1); - fu_a.type = static_cast((payload[1]) & 0x1f); - - if (fu_a.s == 1) { - rtpBuffer.clear(); - uint8_t reassembled = 0; - reassembled |= (nalu_f << 7); - reassembled |= (nalu_nri << 5); - reassembled |= (fu_a.type & 0x1f); - rtpBuffer.append((char*)&reassembled, 1); - rtpBuffer.append(payload.data() + 2, payload.size() - 2); - } else if (fu_a.e == 1) { - rtpBuffer.append(payload.data() + 2, payload.size() - 2); - submit = true; - } else { - rtpBuffer.append(payload.data() + 2, payload.size() - 2); - } - break; - } - case type_fu_b: { - // not supported - break; - } - default: { - // should be a single NAL - rtpBuffer.append(payload); - submit = true; - break; - } - } - if (submit) { - QByteArray nalUnit(rtpBuffer); - rtpBuffer.clear(); - processNAL(nalUnit); - } -}; - - - -void OpenHDVideo::findNAL() { - size_t sz = tempBuffer.size(); - - if (sz == 0) { - return; - } - - uint8_t* p = (uint8_t*)tempBuffer.data(); - - int final_offset = 0; - - auto indexes = webrtc::H264::FindNaluIndices(p, sz); - - if (indexes.empty()) { - return; - } - - for (auto & index : indexes) { - if (index.payload_size == 0) { - continue; - } - QByteArray nalUnit((const char*)&p[index.payload_start_offset], index.payload_size); - processNAL(nalUnit); - final_offset = index.payload_start_offset + index.payload_size; - } - - if (final_offset != 0) { - tempBuffer.remove(0, final_offset); - } -} - - -/* - * Parses the NAL header to determine which kind of NAL this is, and then either - * configure the decoder if needed or send the NAL on to the decoder, taking - * care to send the PPS and SPS first, then an IDR, then other frame types. - * - * Some hardware decoders, particularly on Android, will crash if sent an IDR - * before the PPS/SPS, or a non-IDR before an IDR. - * - */ -void OpenHDVideo::processNAL(QByteArray &nalUnit) { - webrtc::H264::NaluType nalu_type = webrtc::H264::ParseNaluType(nalUnit.data()[0]); - - switch (nalu_type) { - case webrtc::H264::NaluType::kSlice: { - if (isConfigured && sentSPS && sentPPS && sentIDR) { - QByteArray _n; - _n.append(NAL_HEADER, 4); - _n.append(nalUnit); - processFrame(_n, nalu_type); - //nalQueue.push_back(_n); - } - break; - } - case webrtc::H264::NaluType::kIdr: { - if (isConfigured && sentSPS && sentPPS) { - QByteArray _n; - _n.append(NAL_HEADER, 4); - _n.append(nalUnit); - - processFrame(_n, nalu_type); - //nalQueue.push_back(_n); - - sentIDR = true; - } - break; - } - case webrtc::H264::NaluType::kSps: { - auto new_width = 0; - auto new_height = 0; - auto new_fps = 0; - - auto _sps = webrtc::SpsParser::ParseSps((const uint8_t*)nalUnit.data() + webrtc::H264::kNaluTypeSize, nalUnit.size() - webrtc::H264::kNaluTypeSize); - - if (_sps) { - new_width = _sps->width; - new_height = _sps->height; - new_fps = 30; - - // the webrtc h264 parser doesn't support this yet, but we can add it - /*int vui_present = _sps->vui_params_present; - if (vui_present) { - if (nalu_sps->timing_info_present_flag) { - auto num_units_in_tick = nalu_sps->num_units_in_tick; - - auto time_scale = nalu_sps->time_scale; - new_fps = time_scale / num_units_in_tick; - } else { - new_fps = 30; - } - }*/ - - if (new_height != height || new_width != width || new_fps != fps) { - height = new_height; - width = new_width; - fps = new_fps; - } - - if (!haveSPS) { - QByteArray extraData; - extraData.append(NAL_HEADER, 4); - extraData.append(nalUnit); - - sps_len = extraData.size(); - memcpy(sps, extraData.data(), extraData.size()); - haveSPS = true; - } - if (isConfigured) { - QByteArray _n; - _n.append(NAL_HEADER, 4); - _n.append(nalUnit); - - processFrame(_n, nalu_type); - //nalQueue.push_back(_n); - - sentSPS = true; - } - } - - break; - } - case webrtc::H264::NaluType::kPps: { - if (!havePPS) { - QByteArray extraData; - extraData.append(NAL_HEADER, 4); - extraData.append(nalUnit); - - pps_len = extraData.length(); - memcpy(pps, extraData.data(), extraData.size()); - havePPS = true; - } - if (isConfigured && sentSPS) { - QByteArray _n; - _n.append(NAL_HEADER, 4); - _n.append(nalUnit); - - processFrame(_n, nalu_type); - //nalQueue.push_back(_n); - - sentPPS = true; - } - break; - } - case webrtc::H264::NaluType::kAud: { - QByteArray _n; - _n.append(NAL_HEADER, 4); - _n.append(nalUnit); - - processFrame(_n, nalu_type); - break; - } - default: { - qDebug() << "unknown frame_type: " << nalu_type; - break; - } - } - - if (haveSPS && havePPS && isStart) { - emit configure(); - isStart = false; - } - if (isConfigured) { - lastDataReceived = QDateTime::currentMSecsSinceEpoch(); - } -} - -#endif diff --git a/app/vs_legacy/openhdvideo.h b/app/vs_legacy/openhdvideo.h deleted file mode 100755 index 396c54284..000000000 --- a/app/vs_legacy/openhdvideo.h +++ /dev/null @@ -1,153 +0,0 @@ -#if defined(ENABLE_VIDEO_RENDER) - -#ifndef OpenHDVideo_H -#define OpenHDVideo_H - -#include -#include -#include - -#include "sharedqueue.h" - -#include "h264_common.h" - -enum OpenHDStreamType { - OpenHDStreamTypeMain, - OpenHDStreamTypePiP -}; - -class QUdpSocket; - - -constexpr char NAL_HEADER[4] = {'\x00', '\x00', '\x00', '\x01'}; - - -typedef struct { - uint8_t s : 1; - uint8_t e : 1; - uint8_t r : 1; - uint8_t type : 5; -} fu_a_header; - - -class OpenHDVideo; - -class OpenHDVideoReceiver : public QObject -{ - Q_OBJECT - -public: - OpenHDVideoReceiver(OpenHDVideo *video, enum OpenHDStreamType stream_type = OpenHDStreamTypeMain); - virtual ~OpenHDVideoReceiver(); - -signals: - void setup(); - void start(); - void stop(); - void socketChanged(int fd); - -public slots: - void onStarted(); - void onStop(); - void onStart(); - -protected: - int m_video_port = 0; - enum OpenHDStreamType m_stream_type; - OpenHDVideo *m_video = nullptr; -}; - - - -class OpenHDVideo : public QObject -{ - Q_OBJECT - -public: - OpenHDVideo(enum OpenHDStreamType stream_type = OpenHDStreamTypeMain); - virtual ~OpenHDVideo(); - - qint64 lastDataReceived = 0; - int m_video_port = 0; - QMutex m_mutex; - -signals: - void videoRunning(bool running); - void configure(); - void setup(); - -public slots: - void startVideo(); - void stopVideo(); - void onStarted(); - void onReceivedData(QByteArray data); - void onSocketChanged(int fd); - -protected: - OpenHDVideoReceiver *m_receiver = nullptr; - QThread m_receiverThread; - int m_socket = 0; - - void parseRTP(QByteArray &datagram); - void findNAL(); - void processNAL(QByteArray &nalUnit); - void reconfigure(); - - virtual void start() = 0; - virtual void stop() = 0; - virtual void inputLoop() = 0; - virtual void renderLoop() = 0; - virtual void processFrame(QByteArray &nal, webrtc::H264::NaluType frameType) = 0; - - bool firstRun = true; - - bool m_enable_rtp = true; - - enum OpenHDStreamType m_stream_type; - - bool m_restart = false; - bool m_background = false; - - int main_default_port = 5600; - int pip_default_port = 5601; - - - QTimer* timer = nullptr; - - QByteArray tempBuffer; - QByteArray accessUnit; - - QByteArray rtpBuffer; - size_t rtpData = 0; - bool rtpStateFrag = false; - - bool haveSPS = false; - bool havePPS = false; - bool isStart = true; - bool isFirstAU = true; - bool isConfigured = false; - bool sentIDR = false; - bool sentSPS = false; - bool sentPPS = false; - - uint8_t *sps = nullptr; - uint8_t sps_len = 0; - uint8_t *pps = nullptr; - uint8_t pps_len = 0; - - int width; - int height; - int fps; - - QVideoFrame::PixelFormat format = QVideoFrame::PixelFormat::Format_YUV420P; - - uint32_t pts = 0; - bool sawInputEOS = false; - bool sawOutputEOS = false; - - SharedQueue nalQueue; -}; - -#endif // OpenHDVideo_H - -#endif diff --git a/install_build_dep.sh b/install_build_dep.sh index f97c5ad52..3317e4480 100755 --- a/install_build_dep.sh +++ b/install_build_dep.sh @@ -30,8 +30,6 @@ PLATFORM_PACKAGES="qml-module-qt-labs-platform" if [[ "${PLATFORM}" == "rpi" ]]; then install_pi_packages - # Repairing MMAL-Graph-Lib - sed -i 's/util\/\mmal_connection.h/mmal_connection.h/g' /usr/include/interface/mmal/util/mmal_graph.h elif [[ "${PLATFORM}" == "ubuntu-x86" ]] ; then install_x86_packages elif [[ "${PLATFORM}" == "rock5" ]] ; then diff --git a/qml/MainX.qml b/qml/MainX.qml deleted file mode 100644 index 755ab5602..000000000 --- a/qml/MainX.qml +++ /dev/null @@ -1,171 +0,0 @@ - -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.Material 2.12 -import QtQuick.Layouts 1.0 -import Qt.labs.settings 1.0 - -import OpenHD 1.0 - -import "./ui" -import "./ui/widgets" -import "./ui/elements" -import "./ui/configpopup" -import "./video" - -ApplicationWindow { - id: applicationWindow - visible: true - - - //property int m_window_width: 1280 - //property int m_window_height: 720 - property int m_window_width: 850 // This is 480p 16:9 - property int m_window_height: 480 - - //width: 850 - //height: 480 - width: (settings.general_screen_rotation == 90 || settings.general_screen_rotation == 270) ? m_window_height : m_window_width - height: (settings.general_screen_rotation == 90 || settings.general_screen_rotation == 270) ? m_window_width : m_window_height - - onWidthChanged: { - _qrenderstats.set_window_width(width) - } - onHeightChanged: { - _qrenderstats.set_window_height(height) - } - - contentOrientation: settings.general_screen_rotation===0 ? Qt.PortraitOrientation : Qt.LandscapeOrientation - contentItem.rotation: settings.general_screen_rotation - - //minimumWidth: 850 - //minimumHeight: 480 - title: qsTr("QOpenHD EVO") - // Transparent background is needed when the video is not rendered via (OpenGL) inside QT, - // but rather done independently by using a pipeline that directly goes to the HW composer (e.g. mmal on pi). - //color: "transparent" //Consti10 transparent background - //color : "#2C3E50" // reduce KREBS - color: settings.app_background_transparent ? "transparent" : "#2C3E50" - //flags: Qt.WindowStaysOnTopHint| Qt.FramelessWindowHint| Qt.X11BypassWindowManagerHint; - //flags: Qt.WindowStaysOnTopHint| Qt.X11BypassWindowManagerHint; - //visibility: "FullScreen" - // android / ios - specifc: We need to explicitly say full screen, otherwise things might be "cut off" - visibility: (settings.dev_force_show_full_screen || QOPENHD_IS_MOBILE) ? "FullScreen" : "AutomaticVisibility" - - // This only exists to be able to fully rotate "everything" for users that have their screen upside down for some reason. - // Won't affect the video, but heck, then just mount your camera upside down. - // TODO: the better fix really would be to somehow the the RPI HDMI config to rotate the screen in HW - but r.n there seems to be - // no way, at least on MMAL - // NOTE: If this creates issues, just comment it out - I'd love to get rid of it as soon as we can. - Item{ - // rotation: settings.general_screen_rotation - anchors.centerIn: parent - width: (settings.general_screen_rotation == 90 || settings.general_screen_rotation == 270) ? parent.height : parent.width - height: (settings.general_screen_rotation == 90 || settings.general_screen_rotation == 270) ? parent.width : parent.height - - // Local app settings. Uses the "user defaults" system on Mac/iOS, the Registry on Windows, - // and equivalent settings systems on Linux and Android - // On linux, they generally are stored under /home/username/.config/Open.HD - // See https://doc.qt.io/qt-5/qsettings.html#platform-specific-notes for more info - AppSettings { - id: settings - Component.onCompleted: { - // - } - } - - // Loads the proper (platform-dependent) video widget for the main (primary) video - // primary video is always full-screen and behind the HUD OSD Elements - Loader { - anchors.fill: parent - z: 1.0 - source: { - if(QOPENHD_ENABLE_VIDEO_VIA_ANDROID){ - return "../video/ExpMainVideoAndroid.qml" - } - // If we have avcodec at compile time, we prefer it over qmlglsink since it provides lower latency - // (not really avcodec itself, but in this namespace we have 1) the preferred sw decode path and - // 2) also the mmal rpi path ) - if(QOPENHD_ENABLE_VIDEO_VIA_AVCODEC){ - return "../video/MainVideoQSG.qml"; - } - // Fallback / windows or similar - if(QOPENHD_ENABLE_GSTREAMER_QMLGLSINK){ - return "../video/MainVideoGStreamer.qml"; - } - console.warn("No primary video implementation") - return "" - } - } - - - ColorPicker { - id: colorPicker - height: 264 - width: 380 - z: 15.0 - anchors.centerIn: parent - } - - // UI areas - - HUDOverlayGrid { - id: hudOverlayGrid - anchors.fill: parent - z: 3.0 - //onSettingsButtonClicked: { - // settings_panel.openSettings(); - //} - // Performance seems to be better on embedded devices like - // rpi with layers disabled (aka default) but this is not exact science - layer.enabled: false - } - - - ConfigPopup { - id: settings_panel - visible: false - } - - WorkaroundMessageBox{ - id: workaroundmessagebox - } - - CardToast{ - id: card_toast - m_text: _qopenhd.toast_text - visible: _qopenhd.toast_visible - } - - // Used by settings that require a restart - RestartQOpenHDMessageBox{ - id: restartQOpenHDMessageBox - } - - // Allows closing QOpenHD via a keyboard shortcut - // also stops the service, such that it is not restartet - Shortcut { - sequence: "Ctrl+F12" - onActivated: { - _qopenhd.disable_service_and_quit() - } - } - AnyParamBusyIndicator{ - z: 10 - } - - Component.onCompleted: { - console.log("Completed"); - hudOverlayGrid.regain_focus() - } - } -} - -/*##^## -Designer { - D{i:6;anchors_y:8}D{i:7;anchors_y:32}D{i:8;anchors_y:32}D{i:9;anchors_y:8}D{i:10;anchors_y:32} -D{i:11;anchors_y:32}D{i:12;anchors_y:11}D{i:13;anchors_y:11}D{i:14;anchors_x:62}D{i:15;anchors_x:128} -D{i:16;anchors_x:136;anchors_y:11}D{i:17;anchors_x:82;anchors_y:8}D{i:19;anchors_y:8} -D{i:21;anchors_y:31}D{i:22;anchors_y:8}D{i:23;anchors_y:11}D{i:24;anchors_y:32} -} -##^##*/ diff --git a/qml/main.qml b/qml/main.qml index dce107cf3..252bf89a0 100755 --- a/qml/main.qml +++ b/qml/main.qml @@ -98,7 +98,7 @@ ApplicationWindow { } } - + // TODO QT 6 ColorPicker { id: colorPicker height: 264 diff --git a/qml/ui/AnyParamBusyIndicator.qml b/qml/ui/AnyParamBusyIndicator.qml index 6ced62250..086695f97 100644 --- a/qml/ui/AnyParamBusyIndicator.qml +++ b/qml/ui/AnyParamBusyIndicator.qml @@ -1,10 +1,10 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 -import QtQuick.Controls.Styles 1.4 + import QtQuick.Controls.Material 2.12 import QtQuick.Layouts 1.0 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 import OpenHD 1.0 diff --git a/qml/ui/HUDOverlayGrid.qml b/qml/ui/HUDOverlayGrid.qml index 77be32dd9..32f585462 100644 --- a/qml/ui/HUDOverlayGrid.qml +++ b/qml/ui/HUDOverlayGrid.qml @@ -1,8 +1,6 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 -import QtQuick.Controls.Styles 1.4 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 import OpenHD 1.0 @@ -494,6 +492,7 @@ Item { } // Extra element - allows customizing the OSD color(s) and more + // TODO QT 6 OSDCustomizer { id: osdCustomizer anchors.centerIn: parent diff --git a/qml/ui/configpopup/ConfigPopup.qml b/qml/ui/configpopup/ConfigPopup.qml index de73ea75f..83152c618 100644 --- a/qml/ui/configpopup/ConfigPopup.qml +++ b/qml/ui/configpopup/ConfigPopup.qml @@ -1,6 +1,5 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 -import QtQuick.Dialogs 1.3 import QtQuick.Layouts 1.12 import QtQuick.Window 2.12 import Qt.labs.settings 1.0 diff --git a/qml/ui/configpopup/ConfigPopupSidebarButton.qml b/qml/ui/configpopup/ConfigPopupSidebarButton.qml index 38035d150..a2b94359e 100644 --- a/qml/ui/configpopup/ConfigPopupSidebarButton.qml +++ b/qml/ui/configpopup/ConfigPopupSidebarButton.qml @@ -1,6 +1,5 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 -import QtQuick.Dialogs 1.3 import QtQuick.Layouts 1.12 import QtQuick.Window 2.12 import Qt.labs.settings 1.0 diff --git a/qml/ui/configpopup/connect/ConnectPanel.qml b/qml/ui/configpopup/connect/ConnectPanel.qml index 0ebe6d5f0..18afccc6d 100644 --- a/qml/ui/configpopup/connect/ConnectPanel.qml +++ b/qml/ui/configpopup/connect/ConnectPanel.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 import Qt.labs.settings 1.0 diff --git a/qml/ui/configpopup/connect/PaneConnectionMode.qml b/qml/ui/configpopup/connect/PaneConnectionMode.qml index f1dee8db1..ec0de98a9 100644 --- a/qml/ui/configpopup/connect/PaneConnectionMode.qml +++ b/qml/ui/configpopup/connect/PaneConnectionMode.qml @@ -1,7 +1,8 @@ -import QtQuick 2.12 +//import QtQuick 2.12 +import QtQuick 2.15 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 import Qt.labs.settings 1.0 @@ -235,8 +236,12 @@ Rectangle{ TextField { Layout.alignment: Qt.AlignCenter id: textFieldip - validator: RegExpValidator { - regExp: /^((?:[0-1]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])\.){0,3}(?:[0-1]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])$/ + // TODO QT 6 + //validator: RegExpValidator { + // regExp: /^((?:[0-1]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])\.){0,3}(?:[0-1]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])$/ + //} + validator: RegularExpressionValidator{ + regularExpression: /^((?:[0-1]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])\.){0,3}(?:[0-1]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])$/ } inputMethodHints: Qt.ImhFormattedNumbersOnly text: settings.qopenhd_mavlink_connection_manual_tcp_ip diff --git a/qml/ui/configpopup/dev/AppDeveloperStatsPanel.qml b/qml/ui/configpopup/dev/AppDeveloperStatsPanel.qml index c88657073..8ac4d8917 100644 --- a/qml/ui/configpopup/dev/AppDeveloperStatsPanel.qml +++ b/qml/ui/configpopup/dev/AppDeveloperStatsPanel.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 diff --git a/qml/ui/configpopup/dev/QOpenHDServiceDialoque.qml b/qml/ui/configpopup/dev/QOpenHDServiceDialoque.qml index 8e3a8d523..09d0bbc74 100644 --- a/qml/ui/configpopup/dev/QOpenHDServiceDialoque.qml +++ b/qml/ui/configpopup/dev/QOpenHDServiceDialoque.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtQuick.Dialogs 1.1 + import QtQuick.Controls.Material 2.12 import Qt.labs.settings 1.0 diff --git a/qml/ui/configpopup/log/LogMessagesStatusView.qml b/qml/ui/configpopup/log/LogMessagesStatusView.qml index a90be3110..7c717e564 100644 --- a/qml/ui/configpopup/log/LogMessagesStatusView.qml +++ b/qml/ui/configpopup/log/LogMessagesStatusView.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 import Qt.labs.settings 1.0 diff --git a/qml/ui/configpopup/log/LogMessagesView.qml b/qml/ui/configpopup/log/LogMessagesView.qml index b26a6a5a8..b0b77f5b8 100644 --- a/qml/ui/configpopup/log/LogMessagesView.qml +++ b/qml/ui/configpopup/log/LogMessagesView.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 import Qt.labs.settings 1.0 diff --git a/qml/ui/configpopup/openhd_settings/ChooseCameraDialoque.qml b/qml/ui/configpopup/openhd_settings/ChooseCameraDialoque.qml index 8228696c0..aa68662e2 100644 --- a/qml/ui/configpopup/openhd_settings/ChooseCameraDialoque.qml +++ b/qml/ui/configpopup/openhd_settings/ChooseCameraDialoque.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 import "../../elements" diff --git a/qml/ui/configpopup/openhd_settings/ChooseResolutionDialoque.qml b/qml/ui/configpopup/openhd_settings/ChooseResolutionDialoque.qml index a23bbbe5c..009eba370 100644 --- a/qml/ui/configpopup/openhd_settings/ChooseResolutionDialoque.qml +++ b/qml/ui/configpopup/openhd_settings/ChooseResolutionDialoque.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 import "../../elements" diff --git a/qml/ui/configpopup/openhd_settings/DialoqueFreqChangeAirGnd.qml b/qml/ui/configpopup/openhd_settings/DialoqueFreqChangeAirGnd.qml index 9dc43f634..a4b7b4d85 100644 --- a/qml/ui/configpopup/openhd_settings/DialoqueFreqChangeAirGnd.qml +++ b/qml/ui/configpopup/openhd_settings/DialoqueFreqChangeAirGnd.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 import "../../elements" diff --git a/qml/ui/configpopup/openhd_settings/DialoqueFreqChangeGndOnly.qml b/qml/ui/configpopup/openhd_settings/DialoqueFreqChangeGndOnly.qml index ed2162fde..a259be552 100644 --- a/qml/ui/configpopup/openhd_settings/DialoqueFreqChangeGndOnly.qml +++ b/qml/ui/configpopup/openhd_settings/DialoqueFreqChangeGndOnly.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 import "../../elements" diff --git a/qml/ui/configpopup/openhd_settings/FreqComboBoxRow.qml b/qml/ui/configpopup/openhd_settings/FreqComboBoxRow.qml index 56c5eeee2..b4eb997ad 100644 --- a/qml/ui/configpopup/openhd_settings/FreqComboBoxRow.qml +++ b/qml/ui/configpopup/openhd_settings/FreqComboBoxRow.qml @@ -3,9 +3,9 @@ import QtQuick 2.0 import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Styles 1.4 + import Qt.labs.settings 1.0 diff --git a/qml/ui/configpopup/openhd_settings/LinkQuickPanel.qml b/qml/ui/configpopup/openhd_settings/LinkQuickPanel.qml index 197ecd781..c88e04cea 100644 --- a/qml/ui/configpopup/openhd_settings/LinkQuickPanel.qml +++ b/qml/ui/configpopup/openhd_settings/LinkQuickPanel.qml @@ -3,9 +3,9 @@ import QtQuick 2.0 import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Styles 1.4 + import Qt.labs.settings 1.0 diff --git a/qml/ui/configpopup/openhd_settings/MavlinkParamEditor.qml b/qml/ui/configpopup/openhd_settings/MavlinkParamEditor.qml index f28c3cdb7..5ab1b9456 100644 --- a/qml/ui/configpopup/openhd_settings/MavlinkParamEditor.qml +++ b/qml/ui/configpopup/openhd_settings/MavlinkParamEditor.qml @@ -1,9 +1,9 @@ import QtQuick 2.12 import QtQuick.Controls 2.4 import QtQuick.Layouts 1.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Styles 1.4 + import Qt.labs.settings 1.0 diff --git a/qml/ui/configpopup/openhd_settings/MavlinkParamPanel.qml b/qml/ui/configpopup/openhd_settings/MavlinkParamPanel.qml index f2e0960e5..724396c23 100644 --- a/qml/ui/configpopup/openhd_settings/MavlinkParamPanel.qml +++ b/qml/ui/configpopup/openhd_settings/MavlinkParamPanel.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 import Qt.labs.settings 1.0 diff --git a/qml/ui/configpopup/openhd_settings/MavlinkParamValueEditElement.qml b/qml/ui/configpopup/openhd_settings/MavlinkParamValueEditElement.qml index 7dd5f5e21..e9759801b 100644 --- a/qml/ui/configpopup/openhd_settings/MavlinkParamValueEditElement.qml +++ b/qml/ui/configpopup/openhd_settings/MavlinkParamValueEditElement.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 import Qt.labs.settings 1.0 diff --git a/qml/ui/configpopup/openhd_settings/OHDSettingsPanel.qml b/qml/ui/configpopup/openhd_settings/OHDSettingsPanel.qml index 7f2cd993f..90396b4d4 100644 --- a/qml/ui/configpopup/openhd_settings/OHDSettingsPanel.qml +++ b/qml/ui/configpopup/openhd_settings/OHDSettingsPanel.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 import Qt.labs.settings 1.0 diff --git a/qml/ui/configpopup/openhd_settings/PopupAnalyzeChannels.qml b/qml/ui/configpopup/openhd_settings/PopupAnalyzeChannels.qml index 2c7eca68a..caa4596a7 100644 --- a/qml/ui/configpopup/openhd_settings/PopupAnalyzeChannels.qml +++ b/qml/ui/configpopup/openhd_settings/PopupAnalyzeChannels.qml @@ -3,9 +3,9 @@ import QtQuick 2.0 import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Styles 1.4 + import Qt.labs.settings 1.0 diff --git a/qml/ui/configpopup/openhd_settings/PopupBigGeneric.qml b/qml/ui/configpopup/openhd_settings/PopupBigGeneric.qml index 65b864df0..c83d003c0 100644 --- a/qml/ui/configpopup/openhd_settings/PopupBigGeneric.qml +++ b/qml/ui/configpopup/openhd_settings/PopupBigGeneric.qml @@ -3,9 +3,9 @@ import QtQuick 2.0 import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Styles 1.4 + import Qt.labs.settings 1.0 diff --git a/qml/ui/configpopup/openhd_settings/PopupEnableSTBCLDPC.qml b/qml/ui/configpopup/openhd_settings/PopupEnableSTBCLDPC.qml index 4d2de314f..85f6c904c 100644 --- a/qml/ui/configpopup/openhd_settings/PopupEnableSTBCLDPC.qml +++ b/qml/ui/configpopup/openhd_settings/PopupEnableSTBCLDPC.qml @@ -3,9 +3,9 @@ import QtQuick 2.0 import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Styles 1.4 + import Qt.labs.settings 1.0 diff --git a/qml/ui/configpopup/openhd_settings/PopupScanChannels.qml b/qml/ui/configpopup/openhd_settings/PopupScanChannels.qml index b9370b07c..12c82d339 100644 --- a/qml/ui/configpopup/openhd_settings/PopupScanChannels.qml +++ b/qml/ui/configpopup/openhd_settings/PopupScanChannels.qml @@ -3,9 +3,9 @@ import QtQuick 2.0 import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Styles 1.4 + import Qt.labs.settings 1.0 diff --git a/qml/ui/configpopup/openhd_settings/PopupTxPowerEditor.qml b/qml/ui/configpopup/openhd_settings/PopupTxPowerEditor.qml index d614f9dc0..fc51c4973 100644 --- a/qml/ui/configpopup/openhd_settings/PopupTxPowerEditor.qml +++ b/qml/ui/configpopup/openhd_settings/PopupTxPowerEditor.qml @@ -3,9 +3,9 @@ import QtQuick 2.0 import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Styles 1.4 + import Qt.labs.settings 1.0 diff --git a/qml/ui/configpopup/qopenhd_settings/AppDevSettingsView.qml b/qml/ui/configpopup/qopenhd_settings/AppDevSettingsView.qml index fd2871318..b19fa1701 100755 --- a/qml/ui/configpopup/qopenhd_settings/AppDevSettingsView.qml +++ b/qml/ui/configpopup/qopenhd_settings/AppDevSettingsView.qml @@ -1,10 +1,9 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 import QtQuick.Layouts 1.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 import Qt.labs.settings 1.0 -import Qt.labs.folderlistmodel 2.0 import OpenHD 1.0 diff --git a/qml/ui/configpopup/qopenhd_settings/AppGeneralSettingsView.qml b/qml/ui/configpopup/qopenhd_settings/AppGeneralSettingsView.qml index 30973d3e7..eb39ae8bb 100755 --- a/qml/ui/configpopup/qopenhd_settings/AppGeneralSettingsView.qml +++ b/qml/ui/configpopup/qopenhd_settings/AppGeneralSettingsView.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 import Qt.labs.settings 1.0 diff --git a/qml/ui/configpopup/qopenhd_settings/AppScreenSettingsView.qml b/qml/ui/configpopup/qopenhd_settings/AppScreenSettingsView.qml index aaa1c4d3d..5039fbab1 100755 --- a/qml/ui/configpopup/qopenhd_settings/AppScreenSettingsView.qml +++ b/qml/ui/configpopup/qopenhd_settings/AppScreenSettingsView.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 import Qt.labs.settings 1.0 diff --git a/qml/ui/configpopup/qopenhd_settings/AppSettingsPanel.qml b/qml/ui/configpopup/qopenhd_settings/AppSettingsPanel.qml index 4c112a200..2ede04e42 100755 --- a/qml/ui/configpopup/qopenhd_settings/AppSettingsPanel.qml +++ b/qml/ui/configpopup/qopenhd_settings/AppSettingsPanel.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 import Qt.labs.settings 1.0 diff --git a/qml/ui/configpopup/qopenhd_settings/AppVehicleSettingsView.qml b/qml/ui/configpopup/qopenhd_settings/AppVehicleSettingsView.qml index ef6956e26..1441db980 100755 --- a/qml/ui/configpopup/qopenhd_settings/AppVehicleSettingsView.qml +++ b/qml/ui/configpopup/qopenhd_settings/AppVehicleSettingsView.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 import Qt.labs.settings 1.0 diff --git a/qml/ui/configpopup/qopenhd_settings/AppVideoSettingsView.qml b/qml/ui/configpopup/qopenhd_settings/AppVideoSettingsView.qml index e02b9e9ce..435789f4a 100755 --- a/qml/ui/configpopup/qopenhd_settings/AppVideoSettingsView.qml +++ b/qml/ui/configpopup/qopenhd_settings/AppVideoSettingsView.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 import Qt.labs.settings 1.0 diff --git a/qml/ui/configpopup/qopenhd_settings/AppWidgetSettingsView.qml b/qml/ui/configpopup/qopenhd_settings/AppWidgetSettingsView.qml index 0bd496f84..9b36f0905 100755 --- a/qml/ui/configpopup/qopenhd_settings/AppWidgetSettingsView.qml +++ b/qml/ui/configpopup/qopenhd_settings/AppWidgetSettingsView.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 import Qt.labs.settings 1.0 @@ -1298,7 +1298,7 @@ ScrollView { anchors.left: parent.left } - NewSwitch { + Switch { width: 32 height: elementHeight anchors.rightMargin: Qt.inputMethod.visible ? 96 : 36 diff --git a/qml/ui/configpopup/qopenhd_settings/AppWidgetStyleSettingsView.qml b/qml/ui/configpopup/qopenhd_settings/AppWidgetStyleSettingsView.qml index dc2030770..bf57fb1e4 100644 --- a/qml/ui/configpopup/qopenhd_settings/AppWidgetStyleSettingsView.qml +++ b/qml/ui/configpopup/qopenhd_settings/AppWidgetStyleSettingsView.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 import Qt.labs.settings 1.0 diff --git a/qml/ui/configpopup/rc/RcDebugScreenFC.qml b/qml/ui/configpopup/rc/RcDebugScreenFC.qml index aa4630511..2909efab5 100644 --- a/qml/ui/configpopup/rc/RcDebugScreenFC.qml +++ b/qml/ui/configpopup/rc/RcDebugScreenFC.qml @@ -2,7 +2,7 @@ import QtQuick 2.12 import QtQuick.Window 2.0 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 diff --git a/qml/ui/configpopup/rc/RcDebugScreenOpenHD.qml b/qml/ui/configpopup/rc/RcDebugScreenOpenHD.qml index 77f9fd2e1..be4cf90d9 100644 --- a/qml/ui/configpopup/rc/RcDebugScreenOpenHD.qml +++ b/qml/ui/configpopup/rc/RcDebugScreenOpenHD.qml @@ -2,7 +2,7 @@ import QtQuick 2.12 import QtQuick.Window 2.0 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 diff --git a/qml/ui/configpopup/rc/RcInfoPanel.qml b/qml/ui/configpopup/rc/RcInfoPanel.qml index 8c4a759ea..2096be750 100644 --- a/qml/ui/configpopup/rc/RcInfoPanel.qml +++ b/qml/ui/configpopup/rc/RcInfoPanel.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 import Qt.labs.settings 1.0 diff --git a/qml/ui/configpopup/rc/RcInfoScreen.qml b/qml/ui/configpopup/rc/RcInfoScreen.qml index be3027e95..d9d16f283 100644 --- a/qml/ui/configpopup/rc/RcInfoScreen.qml +++ b/qml/ui/configpopup/rc/RcInfoScreen.qml @@ -2,7 +2,7 @@ import QtQuick 2.12 import QtQuick.Window 2.0 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 diff --git a/qml/ui/configpopup/status/DialoqueNotAlive.qml b/qml/ui/configpopup/status/DialoqueNotAlive.qml index 7130f737a..1833e5ec8 100644 --- a/qml/ui/configpopup/status/DialoqueNotAlive.qml +++ b/qml/ui/configpopup/status/DialoqueNotAlive.qml @@ -1,9 +1,9 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 -import QtQuick.Controls.Styles 1.4 + import QtQuick.Controls.Material 2.12 import QtQuick.Layouts 1.0 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 import OpenHD 1.0 diff --git a/qml/ui/configpopup/status/PowerActionDialoque.qml b/qml/ui/configpopup/status/PowerActionDialoque.qml index 4802b0969..4ca6eb99c 100644 --- a/qml/ui/configpopup/status/PowerActionDialoque.qml +++ b/qml/ui/configpopup/status/PowerActionDialoque.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtQuick.Dialogs 1.1 + import QtQuick.Controls.Material 2.12 import Qt.labs.settings 1.0 diff --git a/qml/ui/configpopup/status/QOpenHDVersionCard.qml b/qml/ui/configpopup/status/QOpenHDVersionCard.qml index 098c51c3f..16d38947a 100644 --- a/qml/ui/configpopup/status/QOpenHDVersionCard.qml +++ b/qml/ui/configpopup/status/QOpenHDVersionCard.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtQuick.Dialogs 1.1 + import QtQuick.Controls.Material 2.12 import Qt.labs.settings 1.0 diff --git a/qml/ui/configpopup/status/StatusCardBodyFC.qml b/qml/ui/configpopup/status/StatusCardBodyFC.qml index eae174946..8fda5f62a 100644 --- a/qml/ui/configpopup/status/StatusCardBodyFC.qml +++ b/qml/ui/configpopup/status/StatusCardBodyFC.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtQuick.Dialogs 1.1 + import QtQuick.Controls.Material 2.12 import Qt.labs.settings 1.0 diff --git a/qml/ui/configpopup/status/StatusCardBodyOpenHD.qml b/qml/ui/configpopup/status/StatusCardBodyOpenHD.qml index 8d0cefd74..3c1cc51e0 100644 --- a/qml/ui/configpopup/status/StatusCardBodyOpenHD.qml +++ b/qml/ui/configpopup/status/StatusCardBodyOpenHD.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtQuick.Dialogs 1.1 + import QtQuick.Controls.Material 2.12 import Qt.labs.settings 1.0 diff --git a/qml/ui/configpopup/status/StatusCardRow.qml b/qml/ui/configpopup/status/StatusCardRow.qml index 8c2b8cf5f..199a8faa9 100644 --- a/qml/ui/configpopup/status/StatusCardRow.qml +++ b/qml/ui/configpopup/status/StatusCardRow.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtQuick.Dialogs 1.1 + import QtQuick.Controls.Material 2.12 import Qt.labs.settings 1.0 diff --git a/qml/ui/elements/AppSettings.qml b/qml/ui/elements/AppSettings.qml index c06c45323..558460c4f 100644 --- a/qml/ui/elements/AppSettings.qml +++ b/qml/ui/elements/AppSettings.qml @@ -295,7 +295,7 @@ Settings { property bool map_drone_track: true property bool map_show_mission_waypoints: true - property bool adsb_enable: true + property bool adsb_enable: false property double adsb_radius: 50000 //using meters for now- api is in NM property bool adsb_show_internet_data: true property bool adsb_show_sdr_data: true diff --git a/qml/ui/elements/BaseHeaderItem.qml b/qml/ui/elements/BaseHeaderItem.qml index 220d08655..f3c6c327e 100644 --- a/qml/ui/elements/BaseHeaderItem.qml +++ b/qml/ui/elements/BaseHeaderItem.qml @@ -3,9 +3,9 @@ import QtQuick 2.0 import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Styles 1.4 + // UI element for a header // consisting of a title an a close button diff --git a/qml/ui/elements/BaseHeaderItem2.qml b/qml/ui/elements/BaseHeaderItem2.qml index 5ef6134d8..73e021879 100644 --- a/qml/ui/elements/BaseHeaderItem2.qml +++ b/qml/ui/elements/BaseHeaderItem2.qml @@ -3,9 +3,9 @@ import QtQuick 2.0 import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 -import QtQuick.Controls.Styles 1.4 + // UI element for a header // consisting of a title an a close button diff --git a/qml/ui/elements/BigClickableText.qml b/qml/ui/elements/BigClickableText.qml index fda16ec16..380139937 100644 --- a/qml/ui/elements/BigClickableText.qml +++ b/qml/ui/elements/BigClickableText.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtQuick.Dialogs 1.1 + import QtQuick.Controls.Material 2.12 import OpenHD 1.0 diff --git a/qml/ui/elements/ButtonDisconnected.qml b/qml/ui/elements/ButtonDisconnected.qml index 3d031851b..50185f874 100644 --- a/qml/ui/elements/ButtonDisconnected.qml +++ b/qml/ui/elements/ButtonDisconnected.qml @@ -1,6 +1,6 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 // Disconnected Icon diff --git a/qml/ui/elements/ButtonGreen.qml b/qml/ui/elements/ButtonGreen.qml index 68c8d8ee8..c4a4a82a5 100644 --- a/qml/ui/elements/ButtonGreen.qml +++ b/qml/ui/elements/ButtonGreen.qml @@ -1,9 +1,9 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 -import QtQuick.Controls.Styles 1.4 + import QtQuick.Controls.Material 2.12 import QtQuick.Layouts 1.0 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 import OpenHD 1.0 diff --git a/qml/ui/elements/ButtonIconConnect.qml b/qml/ui/elements/ButtonIconConnect.qml index 480fa55bd..3525d0e66 100644 --- a/qml/ui/elements/ButtonIconConnect.qml +++ b/qml/ui/elements/ButtonIconConnect.qml @@ -1,6 +1,6 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 // Connect - either wired (wired icon) or wireless (wireless icon) diff --git a/qml/ui/elements/ButtonIconGear.qml b/qml/ui/elements/ButtonIconGear.qml index c2702e1a1..8b6616aed 100644 --- a/qml/ui/elements/ButtonIconGear.qml +++ b/qml/ui/elements/ButtonIconGear.qml @@ -1,6 +1,6 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 // Info icon and blue color diff --git a/qml/ui/elements/ButtonIconInfo.qml b/qml/ui/elements/ButtonIconInfo.qml index d3331f04f..ef76c51ad 100644 --- a/qml/ui/elements/ButtonIconInfo.qml +++ b/qml/ui/elements/ButtonIconInfo.qml @@ -1,6 +1,5 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 -import QtQuick.Dialogs 1.0 import QtQuick.Controls.Material 2.12 // Info icon and blue color diff --git a/qml/ui/elements/ButtonIconInfo2.qml b/qml/ui/elements/ButtonIconInfo2.qml index 8c416e53b..e49b12eb0 100644 --- a/qml/ui/elements/ButtonIconInfo2.qml +++ b/qml/ui/elements/ButtonIconInfo2.qml @@ -1,6 +1,6 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 // Info icon, no blue color diff --git a/qml/ui/elements/ButtonIconWarning.qml b/qml/ui/elements/ButtonIconWarning.qml index ff58ca9e8..7464ca1d5 100644 --- a/qml/ui/elements/ButtonIconWarning.qml +++ b/qml/ui/elements/ButtonIconWarning.qml @@ -1,6 +1,6 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 // Used to hint at something's wrong - diff --git a/qml/ui/elements/ButtonOrange.qml b/qml/ui/elements/ButtonOrange.qml index f1b2af167..036b7a69b 100644 --- a/qml/ui/elements/ButtonOrange.qml +++ b/qml/ui/elements/ButtonOrange.qml @@ -1,9 +1,9 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 -import QtQuick.Controls.Styles 1.4 + import QtQuick.Controls.Material 2.12 import QtQuick.Layouts 1.0 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 import OpenHD 1.0 diff --git a/qml/ui/elements/ButtonRed.qml b/qml/ui/elements/ButtonRed.qml index 854b7c22a..d09683127 100644 --- a/qml/ui/elements/ButtonRed.qml +++ b/qml/ui/elements/ButtonRed.qml @@ -1,9 +1,9 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 -import QtQuick.Controls.Styles 1.4 + import QtQuick.Controls.Material 2.12 import QtQuick.Layouts 1.0 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 import OpenHD 1.0 diff --git a/qml/ui/elements/ButtonSimple.qml b/qml/ui/elements/ButtonSimple.qml index f489ddfec..ca03887ab 100644 --- a/qml/ui/elements/ButtonSimple.qml +++ b/qml/ui/elements/ButtonSimple.qml @@ -1,6 +1,6 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 Button { diff --git a/qml/ui/elements/ButtonYellow.qml b/qml/ui/elements/ButtonYellow.qml index 561ad3ebe..69ca48676 100644 --- a/qml/ui/elements/ButtonYellow.qml +++ b/qml/ui/elements/ButtonYellow.qml @@ -1,9 +1,9 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 -import QtQuick.Controls.Styles 1.4 + import QtQuick.Controls.Material 2.12 import QtQuick.Layouts 1.0 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 import OpenHD 1.0 diff --git a/qml/ui/elements/Card.qml b/qml/ui/elements/Card.qml index bee5a4804..b26441958 100644 --- a/qml/ui/elements/Card.qml +++ b/qml/ui/elements/Card.qml @@ -1,7 +1,6 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 diff --git a/qml/ui/elements/CardToast.qml b/qml/ui/elements/CardToast.qml index 58210c7d9..e1fff9a0f 100644 --- a/qml/ui/elements/CardToast.qml +++ b/qml/ui/elements/CardToast.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + // // Similar behvaiour to android Toast diff --git a/qml/ui/elements/ColorPicker.qml b/qml/ui/elements/ColorPicker.qml index a62d5e15f..41a672b2e 100644 --- a/qml/ui/elements/ColorPicker.qml +++ b/qml/ui/elements/ColorPicker.qml @@ -1,9 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 -import QtQuick.Controls.Styles 1.4 import QtQuick.Controls.Material 2.12 import QtQuick.Layouts 1.0 -import QtGraphicalEffects 1.12 import "colorwheel" diff --git a/qml/ui/elements/ColoredCheckboxForm.ui.qml b/qml/ui/elements/ColoredCheckboxForm.ui.qml index 647411945..23f2c63fb 100644 --- a/qml/ui/elements/ColoredCheckboxForm.ui.qml +++ b/qml/ui/elements/ColoredCheckboxForm.ui.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + CheckBox { id: el diff --git a/qml/ui/elements/NewSpinBox.qml b/qml/ui/elements/NewSpinBox.qml index 67cf124e9..b407642e5 100644 --- a/qml/ui/elements/NewSpinBox.qml +++ b/qml/ui/elements/NewSpinBox.qml @@ -1,7 +1,7 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 import QtQuick.Layouts 1.12 -import QtQuick.Controls.Styles 1.4 + import Qt.labs.settings 1.0 diff --git a/qml/ui/elements/OSDCustomizer.qml b/qml/ui/elements/OSDCustomizer.qml index 0cdce625c..9d08ebf3e 100644 --- a/qml/ui/elements/OSDCustomizer.qml +++ b/qml/ui/elements/OSDCustomizer.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 import "colorwheel" diff --git a/qml/ui/elements/RestartQOpenHDMessageBox.qml b/qml/ui/elements/RestartQOpenHDMessageBox.qml index a484135e1..3fa97b652 100644 --- a/qml/ui/elements/RestartQOpenHDMessageBox.qml +++ b/qml/ui/elements/RestartQOpenHDMessageBox.qml @@ -1,9 +1,9 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 -import QtQuick.Controls.Styles 1.4 + import QtQuick.Controls.Material 2.12 import QtQuick.Layouts 1.0 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 import OpenHD 1.0 diff --git a/qml/ui/elements/SettingBaseElement.qml b/qml/ui/elements/SettingBaseElement.qml index 23fe9ff56..ce35d179b 100644 --- a/qml/ui/elements/SettingBaseElement.qml +++ b/qml/ui/elements/SettingBaseElement.qml @@ -2,7 +2,7 @@ import QtQuick 2.0 import QtQuick 2.12 import QtQuick.Controls 2.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 // Base element for QOpenHD settings. diff --git a/qml/ui/elements/SettingBaseElement2.qml b/qml/ui/elements/SettingBaseElement2.qml index 2f9cc8e60..43dbbc5d2 100644 --- a/qml/ui/elements/SettingBaseElement2.qml +++ b/qml/ui/elements/SettingBaseElement2.qml @@ -2,7 +2,7 @@ import QtQuick 2.0 import QtQuick 2.12 import QtQuick.Controls 2.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 // Base element for QOpenHD settings. diff --git a/qml/ui/elements/SettingsCategory.qml b/qml/ui/elements/SettingsCategory.qml index d2dc8ab19..fd9139f32 100644 --- a/qml/ui/elements/SettingsCategory.qml +++ b/qml/ui/elements/SettingsCategory.qml @@ -2,7 +2,7 @@ import QtQuick 2.0 import QtQuick 2.12 import QtQuick.Controls 2.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 Column { diff --git a/qml/ui/elements/SettingsHeaderElement.qml b/qml/ui/elements/SettingsHeaderElement.qml index b7c015715..9fb173b3e 100644 --- a/qml/ui/elements/SettingsHeaderElement.qml +++ b/qml/ui/elements/SettingsHeaderElement.qml @@ -2,7 +2,7 @@ import QtQuick 2.0 import QtQuick 2.12 import QtQuick.Controls 2.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 // Base element for QOpenHD settings. diff --git a/qml/ui/elements/SimpleAdvancedChoiceElement.qml b/qml/ui/elements/SimpleAdvancedChoiceElement.qml index 6724d21f5..3b9524cc8 100644 --- a/qml/ui/elements/SimpleAdvancedChoiceElement.qml +++ b/qml/ui/elements/SimpleAdvancedChoiceElement.qml @@ -2,7 +2,7 @@ import QtQuick 2.0 import QtQuick 2.12 import QtQuick.Controls 2.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 // Allows the user to switch between simple and advanced view diff --git a/qml/ui/elements/SlideSwitchForm.ui.qml b/qml/ui/elements/SlideSwitchForm.ui.qml index e58d368ba..ed5bf07f7 100644 --- a/qml/ui/elements/SlideSwitchForm.ui.qml +++ b/qml/ui/elements/SlideSwitchForm.ui.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + Item { id: slideSwitch diff --git a/qml/ui/elements/WorkaroundMessageBox.qml b/qml/ui/elements/WorkaroundMessageBox.qml index 780dc27c0..685bdcc69 100644 --- a/qml/ui/elements/WorkaroundMessageBox.qml +++ b/qml/ui/elements/WorkaroundMessageBox.qml @@ -1,9 +1,9 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 -import QtQuick.Controls.Styles 1.4 + import QtQuick.Controls.Material 2.12 import QtQuick.Layouts 1.0 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 import OpenHD 1.0 diff --git a/qml/ui/elements/XDecimalSpinBox.qml b/qml/ui/elements/XDecimalSpinBox.qml index 3e5d3fdc1..f1019ac1d 100644 --- a/qml/ui/elements/XDecimalSpinBox.qml +++ b/qml/ui/elements/XDecimalSpinBox.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtQuick.Dialogs 1.0 + import QtQuick.Controls.Material 2.12 import Qt.labs.settings 1.0 diff --git a/qml/ui/sidebar/InfoElement2.qml b/qml/ui/sidebar/InfoElement2.qml index 4f07e9e32..8365161d5 100644 --- a/qml/ui/sidebar/InfoElement2.qml +++ b/qml/ui/sidebar/InfoElement2.qml @@ -1,7 +1,7 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import QtQuick.Shapes 1.0 import QtQuick.Controls.Material 2.0 diff --git a/qml/ui/sidebar/Panel2Video.qml b/qml/ui/sidebar/Panel2Video.qml index 25ab84293..950394e72 100644 --- a/qml/ui/sidebar/Panel2Video.qml +++ b/qml/ui/sidebar/Panel2Video.qml @@ -1,7 +1,7 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import QtQuick.Shapes 1.0 import QtQuick.Controls.Material 2.0 diff --git a/qml/ui/sidebar/Panel3Camera.qml b/qml/ui/sidebar/Panel3Camera.qml index e84f4f347..86f4a759b 100644 --- a/qml/ui/sidebar/Panel3Camera.qml +++ b/qml/ui/sidebar/Panel3Camera.qml @@ -1,7 +1,7 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import QtQuick.Shapes 1.0 import QtQuick.Controls.Material 2.0 diff --git a/qml/ui/sidebar/Panel4Recording.qml b/qml/ui/sidebar/Panel4Recording.qml index b453b8753..ce9b7a97b 100644 --- a/qml/ui/sidebar/Panel4Recording.qml +++ b/qml/ui/sidebar/Panel4Recording.qml @@ -1,7 +1,7 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import QtQuick.Shapes 1.0 import QtQuick.Controls.Material 2.0 diff --git a/qml/ui/sidebar/Panel5RC.qml b/qml/ui/sidebar/Panel5RC.qml index 1ffe3d0c2..4c7fc5b1b 100644 --- a/qml/ui/sidebar/Panel5RC.qml +++ b/qml/ui/sidebar/Panel5RC.qml @@ -1,7 +1,7 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import QtQuick.Shapes 1.0 import QtQuick.Controls.Material 2.0 diff --git a/qml/ui/sidebar/Panel6Misc.qml b/qml/ui/sidebar/Panel6Misc.qml index 650231f53..7bee37768 100644 --- a/qml/ui/sidebar/Panel6Misc.qml +++ b/qml/ui/sidebar/Panel6Misc.qml @@ -1,7 +1,7 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import QtQuick.Shapes 1.0 import QtQuick.Controls.Material 2.0 diff --git a/qml/ui/sidebar/Panel7Status.qml b/qml/ui/sidebar/Panel7Status.qml index 2c53c3b1c..dc191e44d 100644 --- a/qml/ui/sidebar/Panel7Status.qml +++ b/qml/ui/sidebar/Panel7Status.qml @@ -1,7 +1,7 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import QtQuick.Shapes 1.0 import QtQuick.Controls.Material 2.0 diff --git a/qml/ui/sidebar/RCChannelView.qml b/qml/ui/sidebar/RCChannelView.qml index 2e6841cab..778c014af 100644 --- a/qml/ui/sidebar/RCChannelView.qml +++ b/qml/ui/sidebar/RCChannelView.qml @@ -1,7 +1,7 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import QtQuick.Shapes 1.0 import QtQuick.Controls.Material 2.0 diff --git a/qml/ui/sidebar/SideBarBasePanel.qml b/qml/ui/sidebar/SideBarBasePanel.qml index 6a9ce004f..57de7accf 100644 --- a/qml/ui/sidebar/SideBarBasePanel.qml +++ b/qml/ui/sidebar/SideBarBasePanel.qml @@ -1,7 +1,7 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import QtQuick.Shapes 1.0 import QtQuick.Controls.Material 2.0 diff --git a/qml/ui/sidebar/SideBarMain.qml b/qml/ui/sidebar/SideBarMain.qml index 67ea1b638..5ff31d047 100644 --- a/qml/ui/sidebar/SideBarMain.qml +++ b/qml/ui/sidebar/SideBarMain.qml @@ -1,7 +1,7 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import QtQuick.Shapes 1.0 import QtQuick.Controls.Material 2.0 diff --git a/qml/ui/sidebar/SidebarStackButton.qml b/qml/ui/sidebar/SidebarStackButton.qml index 251ddb243..d0886719f 100644 --- a/qml/ui/sidebar/SidebarStackButton.qml +++ b/qml/ui/sidebar/SidebarStackButton.qml @@ -1,7 +1,7 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import QtQuick.Shapes 1.0 import QtQuick.Controls.Material 2.0 diff --git a/qml/ui/widgets/AirBatteryWidget.qml b/qml/ui/widgets/AirBatteryWidget.qml index 1005781e2..c16abc8ee 100644 --- a/qml/ui/widgets/AirBatteryWidget.qml +++ b/qml/ui/widgets/AirBatteryWidget.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 import OpenHD 1.0 diff --git a/qml/ui/widgets/AirspeedTempWidget.qml b/qml/ui/widgets/AirspeedTempWidget.qml index a1d27d09a..0ea335031 100644 --- a/qml/ui/widgets/AirspeedTempWidget.qml +++ b/qml/ui/widgets/AirspeedTempWidget.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 import OpenHD 1.0 diff --git a/qml/ui/widgets/AltitudeSecondWidget.qml b/qml/ui/widgets/AltitudeSecondWidget.qml index 991e7ac36..65c4f250c 100644 --- a/qml/ui/widgets/AltitudeSecondWidget.qml +++ b/qml/ui/widgets/AltitudeSecondWidget.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 import OpenHD 1.0 diff --git a/qml/ui/widgets/AltitudeWidget.qml b/qml/ui/widgets/AltitudeWidget.qml index 3af92c2e7..86b357dbc 100644 --- a/qml/ui/widgets/AltitudeWidget.qml +++ b/qml/ui/widgets/AltitudeWidget.qml @@ -1,9 +1,9 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 -import QtQuick.Controls.Styles 1.4 -import QtQuick.Extras 1.4 + + import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import QtQuick.Shapes 1.0 import Qt.labs.settings 1.0 diff --git a/qml/ui/widgets/AoaWidget.qml b/qml/ui/widgets/AoaWidget.qml index 0ee4a12b1..a1bfc13be 100644 --- a/qml/ui/widgets/AoaWidget.qml +++ b/qml/ui/widgets/AoaWidget.qml @@ -1,9 +1,9 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 -import QtQuick.Controls.Styles 1.4 -import QtQuick.Extras 1.4 + + import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import QtQuick.Shapes 1.0 import Qt.labs.settings 1.0 diff --git a/qml/ui/widgets/ArrowWidget.qml b/qml/ui/widgets/ArrowWidget.qml index 9db8bc369..ea8ba1680 100644 --- a/qml/ui/widgets/ArrowWidget.qml +++ b/qml/ui/widgets/ArrowWidget.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 import QtQuick.Shapes 1.0 diff --git a/qml/ui/widgets/BaseWidgetDefaultUiControlElements.qml b/qml/ui/widgets/BaseWidgetDefaultUiControlElements.qml index dfb736eb1..54547f07c 100644 --- a/qml/ui/widgets/BaseWidgetDefaultUiControlElements.qml +++ b/qml/ui/widgets/BaseWidgetDefaultUiControlElements.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 // Can be used to quickly add the right UI elements for (persistently) setting scale and opacity for a HUD element (e.g. an element extending BaseWidget) diff --git a/qml/ui/widgets/ControlWidget.qml b/qml/ui/widgets/ControlWidget.qml index 20b4cb1f4..e39e7b4c5 100644 --- a/qml/ui/widgets/ControlWidget.qml +++ b/qml/ui/widgets/ControlWidget.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 import OpenHD 1.0 diff --git a/qml/ui/widgets/DistanceSensorWidget.qml b/qml/ui/widgets/DistanceSensorWidget.qml index 03d535792..91fc27932 100644 --- a/qml/ui/widgets/DistanceSensorWidget.qml +++ b/qml/ui/widgets/DistanceSensorWidget.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 import OpenHD 1.0 diff --git a/qml/ui/widgets/EscTempWidget.qml b/qml/ui/widgets/EscTempWidget.qml index 1c2eb4934..ada241f73 100644 --- a/qml/ui/widgets/EscTempWidget.qml +++ b/qml/ui/widgets/EscTempWidget.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 import OpenHD 1.0 diff --git a/qml/ui/widgets/FlightDistanceWidget.qml b/qml/ui/widgets/FlightDistanceWidget.qml index 6af9a4695..4ebf2fbda 100644 --- a/qml/ui/widgets/FlightDistanceWidget.qml +++ b/qml/ui/widgets/FlightDistanceWidget.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 import OpenHD 1.0 diff --git a/qml/ui/widgets/FlightMahKmWidget.qml b/qml/ui/widgets/FlightMahKmWidget.qml index 479c2eb1f..10bc7c731 100644 --- a/qml/ui/widgets/FlightMahKmWidget.qml +++ b/qml/ui/widgets/FlightMahKmWidget.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 import OpenHD 1.0 diff --git a/qml/ui/widgets/FlightMahWidget.qml b/qml/ui/widgets/FlightMahWidget.qml index 1a9a727f1..efa6704eb 100644 --- a/qml/ui/widgets/FlightMahWidget.qml +++ b/qml/ui/widgets/FlightMahWidget.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 import OpenHD 1.0 diff --git a/qml/ui/widgets/FlightModeWidget.qml b/qml/ui/widgets/FlightModeWidget.qml index 9ec8fd080..8f08134bf 100644 --- a/qml/ui/widgets/FlightModeWidget.qml +++ b/qml/ui/widgets/FlightModeWidget.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 import OpenHD 1.0 diff --git a/qml/ui/widgets/FlightTimeWidget.qml b/qml/ui/widgets/FlightTimeWidget.qml index 1b0455f71..038a86293 100644 --- a/qml/ui/widgets/FlightTimeWidget.qml +++ b/qml/ui/widgets/FlightTimeWidget.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 import OpenHD 1.0 diff --git a/qml/ui/widgets/FpvWidget.qml b/qml/ui/widgets/FpvWidget.qml index 99f4b6546..5520a484f 100644 --- a/qml/ui/widgets/FpvWidget.qml +++ b/qml/ui/widgets/FpvWidget.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 import QtQuick.Controls.Material 2.12 diff --git a/qml/ui/widgets/GPIOWidget.qml b/qml/ui/widgets/GPIOWidget.qml index 044adff02..b42204190 100644 --- a/qml/ui/widgets/GPIOWidget.qml +++ b/qml/ui/widgets/GPIOWidget.qml @@ -1,9 +1,9 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 -import QtQuick.Controls.Styles 1.4 + import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 import OpenHD 1.0 diff --git a/qml/ui/widgets/GPSWidget.qml b/qml/ui/widgets/GPSWidget.qml index d49ffda4f..b939a04ff 100644 --- a/qml/ui/widgets/GPSWidget.qml +++ b/qml/ui/widgets/GPSWidget.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 import QtQuick.Shapes 1.0 diff --git a/qml/ui/widgets/GroundPowerWidget.qml b/qml/ui/widgets/GroundPowerWidget.qml index 0e41d3b0d..52a3a3d8a 100644 --- a/qml/ui/widgets/GroundPowerWidget.qml +++ b/qml/ui/widgets/GroundPowerWidget.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.15 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 import OpenHD 1.0 diff --git a/qml/ui/widgets/HeadingWidget.qml b/qml/ui/widgets/HeadingWidget.qml index cf7500c21..1c750ca78 100644 --- a/qml/ui/widgets/HeadingWidget.qml +++ b/qml/ui/widgets/HeadingWidget.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 import QtQuick.Shapes 1.0 diff --git a/qml/ui/widgets/HomeDistanceWidget.qml b/qml/ui/widgets/HomeDistanceWidget.qml index f6c05b6a9..c996a567e 100644 --- a/qml/ui/widgets/HomeDistanceWidget.qml +++ b/qml/ui/widgets/HomeDistanceWidget.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 import QtQuick.Shapes 1.0 diff --git a/qml/ui/widgets/HorizonWidget.qml b/qml/ui/widgets/HorizonWidget.qml index c697546d5..02c1cc0ca 100644 --- a/qml/ui/widgets/HorizonWidget.qml +++ b/qml/ui/widgets/HorizonWidget.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 import OpenHD 1.0 diff --git a/qml/ui/widgets/ImuTempWidget.qml b/qml/ui/widgets/ImuTempWidget.qml index 2286398a0..c3752271c 100644 --- a/qml/ui/widgets/ImuTempWidget.qml +++ b/qml/ui/widgets/ImuTempWidget.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 import OpenHD 1.0 diff --git a/qml/ui/widgets/LinkDownRSSIWidget.qml b/qml/ui/widgets/LinkDownRSSIWidget.qml index bd871b985..6ce4d4301 100644 --- a/qml/ui/widgets/LinkDownRSSIWidget.qml +++ b/qml/ui/widgets/LinkDownRSSIWidget.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 import QtQuick.Shapes 1.0 diff --git a/qml/ui/widgets/LinkUpRSSIWidget.qml b/qml/ui/widgets/LinkUpRSSIWidget.qml index 8a27ecd87..a84302284 100644 --- a/qml/ui/widgets/LinkUpRSSIWidget.qml +++ b/qml/ui/widgets/LinkUpRSSIWidget.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 import OpenHD 1.0 diff --git a/qml/ui/widgets/MessageHUD.qml b/qml/ui/widgets/MessageHUD.qml index be6343909..e85cac077 100644 --- a/qml/ui/widgets/MessageHUD.qml +++ b/qml/ui/widgets/MessageHUD.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 diff --git a/qml/ui/widgets/MessageHUDRow.qml b/qml/ui/widgets/MessageHUDRow.qml index 658fc46c6..7b2c598c7 100644 --- a/qml/ui/widgets/MessageHUDRow.qml +++ b/qml/ui/widgets/MessageHUDRow.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 diff --git a/qml/ui/widgets/MissionWidget.qml b/qml/ui/widgets/MissionWidget.qml index 19f6bfafc..6ed8d47d1 100644 --- a/qml/ui/widgets/MissionWidget.qml +++ b/qml/ui/widgets/MissionWidget.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import QtQuick.Shapes 1.0 import Qt.labs.settings 1.0 diff --git a/qml/ui/widgets/PerformanceHorizonWidget2.qml b/qml/ui/widgets/PerformanceHorizonWidget2.qml index 74400f464..ff81b009b 100644 --- a/qml/ui/widgets/PerformanceHorizonWidget2.qml +++ b/qml/ui/widgets/PerformanceHorizonWidget2.qml @@ -1,7 +1,7 @@ import QtQuick 2.15 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 import QtQuick.Shapes 1.0 diff --git a/qml/ui/widgets/PressTempWidget.qml b/qml/ui/widgets/PressTempWidget.qml index 1a2952d02..009107ebd 100644 --- a/qml/ui/widgets/PressTempWidget.qml +++ b/qml/ui/widgets/PressTempWidget.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 import OpenHD 1.0 diff --git a/qml/ui/widgets/QRenderStatsWidget.qml b/qml/ui/widgets/QRenderStatsWidget.qml index 249029fb7..5a1c1a2c8 100644 --- a/qml/ui/widgets/QRenderStatsWidget.qml +++ b/qml/ui/widgets/QRenderStatsWidget.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import QtQuick.Shapes 1.0 import Qt.labs.settings 1.0 diff --git a/qml/ui/widgets/RCRssiWidget.qml b/qml/ui/widgets/RCRssiWidget.qml index 508e314eb..6147f9574 100644 --- a/qml/ui/widgets/RCRssiWidget.qml +++ b/qml/ui/widgets/RCRssiWidget.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 import OpenHD 1.0 diff --git a/qml/ui/widgets/RollWidget.qml b/qml/ui/widgets/RollWidget.qml index 5435b5359..6a855c15c 100644 --- a/qml/ui/widgets/RollWidget.qml +++ b/qml/ui/widgets/RollWidget.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 import QtQuick.Shapes 1.0 diff --git a/qml/ui/widgets/SOCStatusWidgetAir.qml b/qml/ui/widgets/SOCStatusWidgetAir.qml index 7201abb8d..123489536 100644 --- a/qml/ui/widgets/SOCStatusWidgetAir.qml +++ b/qml/ui/widgets/SOCStatusWidgetAir.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 import OpenHD 1.0 diff --git a/qml/ui/widgets/SOCStatusWidgetGeneric.qml b/qml/ui/widgets/SOCStatusWidgetGeneric.qml index 8b6f5643b..f3d745b13 100644 --- a/qml/ui/widgets/SOCStatusWidgetGeneric.qml +++ b/qml/ui/widgets/SOCStatusWidgetGeneric.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 import OpenHD 1.0 diff --git a/qml/ui/widgets/SOCStatusWidgetGround.qml b/qml/ui/widgets/SOCStatusWidgetGround.qml index a9cd64dd6..84883793d 100644 --- a/qml/ui/widgets/SOCStatusWidgetGround.qml +++ b/qml/ui/widgets/SOCStatusWidgetGround.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 import OpenHD 1.0 diff --git a/qml/ui/widgets/SpeedSecondWidget.qml b/qml/ui/widgets/SpeedSecondWidget.qml index 4b6dff79a..9cac2e00d 100644 --- a/qml/ui/widgets/SpeedSecondWidget.qml +++ b/qml/ui/widgets/SpeedSecondWidget.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 import OpenHD 1.0 diff --git a/qml/ui/widgets/SpeedWidget.qml b/qml/ui/widgets/SpeedWidget.qml index 34cd5d776..b20cf3e9a 100644 --- a/qml/ui/widgets/SpeedWidget.qml +++ b/qml/ui/widgets/SpeedWidget.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import QtQuick.Shapes 1.0 import Qt.labs.settings 1.0 diff --git a/qml/ui/widgets/ThrottleWidget.qml b/qml/ui/widgets/ThrottleWidget.qml index fbb719159..12db840d6 100644 --- a/qml/ui/widgets/ThrottleWidget.qml +++ b/qml/ui/widgets/ThrottleWidget.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import QtQuick.Shapes 1.0 import Qt.labs.settings 1.0 diff --git a/qml/ui/widgets/UAVTimeWiget.qml b/qml/ui/widgets/UAVTimeWiget.qml index 2262bd712..d1a60397b 100644 --- a/qml/ui/widgets/UAVTimeWiget.qml +++ b/qml/ui/widgets/UAVTimeWiget.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 import QtQml 2.15 diff --git a/qml/ui/widgets/VerticalSpeedGaugeWidget.qml b/qml/ui/widgets/VerticalSpeedGaugeWidget.qml index 836bf66a1..b17f957e9 100644 --- a/qml/ui/widgets/VerticalSpeedGaugeWidget.qml +++ b/qml/ui/widgets/VerticalSpeedGaugeWidget.qml @@ -1,11 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 -import QtQuick.Controls.Styles 1.4 -import QtQuick.Extras 1.4 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 import QtQuick.Shapes 1.0 - import Qt.labs.settings 1.0 import OpenHD 1.0 @@ -134,7 +130,8 @@ BaseWidget { } } - CircularGauge { + // TODO QT6 + /*CircularGauge { id: gauge anchors.fill: parent antialiasing: true @@ -194,7 +191,7 @@ BaseWidget { width: 3 } } - } + }*/ } } } diff --git a/qml/ui/widgets/VerticalSpeedSimpleWidget.qml b/qml/ui/widgets/VerticalSpeedSimpleWidget.qml index 9576654f0..61e259172 100644 --- a/qml/ui/widgets/VerticalSpeedSimpleWidget.qml +++ b/qml/ui/widgets/VerticalSpeedSimpleWidget.qml @@ -1,9 +1,9 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 -import QtQuick.Controls.Styles 1.4 -import QtQuick.Extras 1.4 + + import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import QtQuick.Shapes 1.0 import Qt.labs.settings 1.0 diff --git a/qml/ui/widgets/VibrationWidget.qml b/qml/ui/widgets/VibrationWidget.qml index 85bec7c21..9ed96d361 100644 --- a/qml/ui/widgets/VibrationWidget.qml +++ b/qml/ui/widgets/VibrationWidget.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import QtQuick.Shapes 1.0 import Qt.labs.settings 1.0 diff --git a/qml/ui/widgets/VideoBitrateWidgetGeneric.qml b/qml/ui/widgets/VideoBitrateWidgetGeneric.qml index 505febe4b..379b46822 100644 --- a/qml/ui/widgets/VideoBitrateWidgetGeneric.qml +++ b/qml/ui/widgets/VideoBitrateWidgetGeneric.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import QtQuick.Shapes 1.0 import Qt.labs.settings 1.0 diff --git a/qml/ui/widgets/VideoBitrateWidgetPrimary.qml b/qml/ui/widgets/VideoBitrateWidgetPrimary.qml index 551d81971..ec03e6723 100644 --- a/qml/ui/widgets/VideoBitrateWidgetPrimary.qml +++ b/qml/ui/widgets/VideoBitrateWidgetPrimary.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import QtQuick.Shapes 1.0 import Qt.labs.settings 1.0 diff --git a/qml/ui/widgets/VideoBitrateWidgetSecondary.qml b/qml/ui/widgets/VideoBitrateWidgetSecondary.qml index ebbd9c7e7..fc3b636f3 100644 --- a/qml/ui/widgets/VideoBitrateWidgetSecondary.qml +++ b/qml/ui/widgets/VideoBitrateWidgetSecondary.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import QtQuick.Shapes 1.0 import Qt.labs.settings 1.0 diff --git a/qml/ui/widgets/WBLinkRateControlWidget.qml b/qml/ui/widgets/WBLinkRateControlWidget.qml index 5a3866f9a..3d97a128c 100644 --- a/qml/ui/widgets/WBLinkRateControlWidget.qml +++ b/qml/ui/widgets/WBLinkRateControlWidget.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import QtQuick.Shapes 1.0 import QtQuick.Controls.Material 2.12 diff --git a/qml/ui/widgets/WindWidget.qml b/qml/ui/widgets/WindWidget.qml index 5eed74071..b48d6c1cc 100644 --- a/qml/ui/widgets/WindWidget.qml +++ b/qml/ui/widgets/WindWidget.qml @@ -2,7 +2,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Controls.Material 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import Qt.labs.settings 1.0 import QtQuick.Shapes 1.0 diff --git a/qml/ui/widgets/map/MapWidgetForm.ui.qml b/qml/ui/widgets/map/MapWidgetForm.ui.qml index 8f893904c..c50da4bf8 100644 --- a/qml/ui/widgets/map/MapWidgetForm.ui.qml +++ b/qml/ui/widgets/map/MapWidgetForm.ui.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.12 + import QtQuick.Shapes 1.0 import Qt.labs.settings 1.0 @@ -243,7 +243,7 @@ BaseWidget { anchors.left: parent.left verticalAlignment: Text.AlignVCenter } - NewSwitch { + Switch { width: 32 height: parent.height anchors.rightMargin: 6 @@ -265,7 +265,7 @@ BaseWidget { anchors.left: parent.left verticalAlignment: Text.AlignVCenter } - NewSwitch { + Switch { width: 32 height: parent.height anchors.rightMargin: 6 @@ -288,7 +288,7 @@ BaseWidget { anchors.left: parent.left verticalAlignment: Text.AlignVCenter } - NewSwitch { + Switch { width: 32 height: parent.height anchors.rightMargin: 6 diff --git a/qml/video/MainVideoGStreamer.qml b/qml/video/MainVideoGStreamer.qml index bbcec3ff3..e76320da6 100644 --- a/qml/video/MainVideoGStreamer.qml +++ b/qml/video/MainVideoGStreamer.qml @@ -1,5 +1,5 @@ import QtQuick 2.12 -import QtGraphicalEffects 1.12 + import org.freedesktop.gstreamer.GLVideoItem 1.0; diff --git a/qml/video/SecondaryVideoGStreamer.qml b/qml/video/SecondaryVideoGStreamer.qml index 46203e77a..85662aa9e 100644 --- a/qml/video/SecondaryVideoGStreamer.qml +++ b/qml/video/SecondaryVideoGStreamer.qml @@ -1,5 +1,5 @@ import QtQuick 2.12 -import QtGraphicalEffects 1.12 + import QtQuick.Controls 2.15 import QtQuick.Layouts 1.15 diff --git a/qml/video/SecondaryVideoGstreamerPane.qml b/qml/video/SecondaryVideoGstreamerPane.qml index 4b7b2df0a..875b9aa89 100644 --- a/qml/video/SecondaryVideoGstreamerPane.qml +++ b/qml/video/SecondaryVideoGstreamerPane.qml @@ -1,5 +1,5 @@ import QtQuick 2.12 -import QtGraphicalEffects 1.12 + import QtQuick.Controls 2.15 import QtQuick.Layouts 1.15