Browse Source

Implement GLVideoItem stub for no-gstreamer builds

QGC4.4
Andrew Voznytsa 5 years ago
parent
commit
b2fe913c1b
  1. 7
      qgroundcontrol.pro
  2. 16
      src/VideoStreaming/GLVideoItemStub.cc
  3. 18
      src/VideoStreaming/GLVideoItemStub.h
  4. 11
      src/VideoStreaming/VideoStreaming.cc
  5. 2
      src/VideoStreaming/VideoStreaming.h
  6. 8
      src/VideoStreaming/VideoStreaming.pri

7
qgroundcontrol.pro

@ -331,13 +331,6 @@ contains (DEFINES, QGC_DISABLE_PAIRING) {
DEFINES += QGC_ENABLE_PAIRING DEFINES += QGC_ENABLE_PAIRING
} }
#
# Add qmlglsink (libs/gst-plugins-good/ext/qt)
#
include(qmlglsink.pri)
# #
# External library configuration # External library configuration
# #

16
src/VideoStreaming/GLVideoItemStub.cc

@ -0,0 +1,16 @@
#include "GLVideoItemStub.h"
GLVideoItemStub::GLVideoItemStub()
{
// setFlag(QQuickItem::ItemHasContents, true);
}
GLVideoItemStub::~GLVideoItemStub()
{
}
//QSGNode*
//GLVideoItemStub::updatePaintNode(QSGNode* oldNode, UpdatePaintNodeData* updatePaintNodeData)
//{
// return oldNode;
//}

18
src/VideoStreaming/GLVideoItemStub.h

@ -0,0 +1,18 @@
#pragma once
#include <QtQuick/QQuickItem>
class GLVideoItemStub : public QQuickItem
{
Q_OBJECT
public:
GLVideoItemStub();
~GLVideoItemStub();
protected:
// QSGNode* updatePaintNode(QSGNode* oldNode, UpdatePaintNodeData* updatePaintNodeData);
private:
};

11
src/VideoStreaming/VideoStreaming.cc

@ -25,6 +25,8 @@
#if defined(__ios__) #if defined(__ios__)
#include "gst_ios_init.h" #include "gst_ios_init.h"
#endif #endif
#else
#include "GLVideoItemStub.h"
#endif #endif
#include "VideoStreaming.h" #include "VideoStreaming.h"
@ -183,9 +185,10 @@ void initializeVideoStreaming(int &argc, char* argv[], char* logpath, char* debu
qCritical() << "unable to find qmlglsink - you need to build it yourself and add to GST_PLUGIN_PATH"; qCritical() << "unable to find qmlglsink - you need to build it yourself and add to GST_PLUGIN_PATH";
} }
#else #else
Q_UNUSED(argc); qmlRegisterType<GLVideoItemStub> ("org.freedesktop.gstreamer.GLVideoItem", 1, 0, "GstGLVideoItem");
Q_UNUSED(argv); Q_UNUSED(argc)
Q_UNUSED(logpath); Q_UNUSED(argv)
Q_UNUSED(debuglevel); Q_UNUSED(logpath)
Q_UNUSED(debuglevel)
#endif #endif
} }

2
src/VideoStreaming/VideoStreaming.h

@ -17,5 +17,3 @@
#pragma once #pragma once
extern void initializeVideoStreaming (int &argc, char *argv[], char* filename, char* debuglevel); extern void initializeVideoStreaming (int &argc, char *argv[], char* filename, char* debuglevel);

8
src/VideoStreaming/VideoStreaming.pri

@ -126,6 +126,7 @@ VideoEnabled {
$$PWD/iOS $$PWD/iOS
} }
include($$PWD/../../qmlglsink.pri)
} else { } else {
LinuxBuild|MacBuild|iOSBuild|WindowsBuild|AndroidBuild { LinuxBuild|MacBuild|iOSBuild|WindowsBuild|AndroidBuild {
message("Skipping support for video streaming (GStreamer libraries not installed)") message("Skipping support for video streaming (GStreamer libraries not installed)")
@ -133,5 +134,10 @@ VideoEnabled {
} else { } else {
message("Skipping support for video streaming (Unsupported platform)") message("Skipping support for video streaming (Unsupported platform)")
} }
}
SOURCES += \
$$PWD/GLVideoItemStub.cc
HEADERS += \
$$PWD/GLVideoItemStub.h
}

Loading…
Cancel
Save