From ee2a2df89cfb7cf95c3109fd2a0f38ff9ab0e567 Mon Sep 17 00:00:00 2001 From: dogmaphobic Date: Mon, 6 Jul 2015 16:45:03 -0400 Subject: [PATCH] iOS Build --- QGCCommon.pri | 15 +++++++++------ src/VideoStreaming/VideoStreaming.pri | 13 ++++++++++--- .../gstqtvideosink/delegates/basedelegate.cpp | 2 +- .../delegates/qwidgetvideosinkdelegate.cpp | 2 +- .../gstqtvideosink/gstqtquick2videosink.cpp | 2 +- .../gstqtvideosink/gstqtvideosinkbase.cpp | 2 +- 6 files changed, 23 insertions(+), 13 deletions(-) diff --git a/QGCCommon.pri b/QGCCommon.pri index 7d3cdfb46..37309504f 100644 --- a/QGCCommon.pri +++ b/QGCCommon.pri @@ -54,10 +54,13 @@ linux { error("Unsupported Mac toolchain, only 64-bit LLVM+clang is supported") } } else : ios { + !equals(QT_MAJOR_VERSION, 5) | !greaterThan(QT_MINOR_VERSION, 4) { + error("Unsupported Qt version, 5.5.x or greater is required for iOS") + } message("iOS build") CONFIG += iOSBuild MobileBuild app_bundle DEFINES += __ios__ - warning("iOS build is experimental and not yet functional") + warning("iOS build is experimental and not yet fully functional") } else { error("Unsupported build platform, only Linux, Windows, Android and Mac (Mac OS and iOS) are supported") } @@ -107,10 +110,10 @@ iOSBuild { # For whatever reason, the iOS build fails with these set. Some files have the full, # properly concatenaded path and file name while others have only the second portion, # as if BUILDDIR was empty. - OBJECTS_DIR = ~/tmp/qgcfoo - MOC_DIR = ~/tmp/qgcfoo - UI_DIR = ~/tmp/qgcfoo - RCC_DIR = ~/tmp/qgcfoo + OBJECTS_DIR = $$(HOME)/tmp/qgcfoo + MOC_DIR = $$(HOME)/tmp/qgcfoo + UI_DIR = $$(HOME)/tmp/qgcfoo + RCC_DIR = $$(HOME)/tmp/qgcfoo } else { OBJECTS_DIR = $${BUILDDIR}/obj MOC_DIR = $${BUILDDIR}/moc @@ -126,7 +129,7 @@ AndroidBuild { # We place the created plugin lib into the objects dir so that make clean will clean it as well iOSBuild { - LOCATION_PLUGIN_DESTDIR = ~/tmp/qgcfoo + LOCATION_PLUGIN_DESTDIR = $$(HOME)/tmp/qgcfoo } else { LOCATION_PLUGIN_DESTDIR = $$OBJECTS_DIR } diff --git a/src/VideoStreaming/VideoStreaming.pri b/src/VideoStreaming/VideoStreaming.pri index b07cba488..631ba493b 100644 --- a/src/VideoStreaming/VideoStreaming.pri +++ b/src/VideoStreaming/VideoStreaming.pri @@ -28,7 +28,6 @@ LinuxBuild { CONFIG += link_pkgconfig packagesExist(gstreamer-1.0) { message("Including support for video streaming") - DEFINES += QGC_GST_STREAMING PKGCONFIG += gstreamer-1.0 gstreamer-video-1.0 CONFIG += VideoEnabled } @@ -37,11 +36,19 @@ LinuxBuild { GST_ROOT = /Library/Frameworks/GStreamer.framework exists($$GST_ROOT) { message("Including support for video streaming") - DEFINES += QGC_GST_STREAMING CONFIG += VideoEnabled INCLUDEPATH += $$GST_ROOT/Headers LIBS += -F/Library/Frameworks -framework GStreamer } +} else:iOSBuild { + #- gstreamer framework installed by the gstreamer iOS SDK installer (default to home directory) + GST_ROOT = $$(HOME)/Library/Developer/GStreamer/iPhone.sdk/GStreamer.framework + exists($$GST_ROOT) { + message("Including support for video streaming") + CONFIG += VideoEnabled + INCLUDEPATH += $$GST_ROOT/Headers + LIBS += -F$$(HOME)/Library/Developer/GStreamer/iPhone.sdk -framework GStreamer + } } else:WindowsBuild { #- gstreamer installed by default under c:/gstreamer # This is not working. It builds but at runtime, it expects to find @@ -51,7 +58,6 @@ LinuxBuild { GST_ROOT = c:/gstreamer/1.0/x86 exists($$GST_ROOT) { message("Including support for video streaming") - DEFINES += QGC_GST_STREAMING CONFIG += VideoEnabled LIBS += -L$$GST_ROOT/lib/gstreamer-1.0/static -lgstreamer-1.0 -lgstvideo-1.0 -lgstbase-1.0 LIBS += -L$$GST_ROOT/lib -lglib-2.0 -lintl -lgobject-2.0 @@ -67,6 +73,7 @@ LinuxBuild { VideoEnabled { DEFINES += \ + QGC_GST_STREAMING \ GST_PLUGIN_BUILD_STATIC \ QTGLVIDEOSINK_NAME=qt5glvideosink \ QTVIDEOSINK_NAME=qt5videosink diff --git a/src/VideoStreaming/gstqtvideosink/delegates/basedelegate.cpp b/src/VideoStreaming/gstqtvideosink/delegates/basedelegate.cpp index c095da865..ee927536c 100644 --- a/src/VideoStreaming/gstqtvideosink/delegates/basedelegate.cpp +++ b/src/VideoStreaming/gstqtvideosink/delegates/basedelegate.cpp @@ -161,7 +161,7 @@ bool BaseDelegate::event(QEvent *event) BufferEvent *bufEvent = dynamic_cast(event); Q_ASSERT(bufEvent); - GST_TRACE_OBJECT(m_sink, "Received buffer %"GST_PTR_FORMAT, bufEvent->buffer); + GST_TRACE_OBJECT(m_sink, "Received buffer %" GST_PTR_FORMAT, bufEvent->buffer); if (isActive()) { gst_buffer_replace (&m_buffer, bufEvent->buffer); diff --git a/src/VideoStreaming/gstqtvideosink/delegates/qwidgetvideosinkdelegate.cpp b/src/VideoStreaming/gstqtvideosink/delegates/qwidgetvideosinkdelegate.cpp index c867a8c4a..8f8318cf7 100644 --- a/src/VideoStreaming/gstqtvideosink/delegates/qwidgetvideosinkdelegate.cpp +++ b/src/VideoStreaming/gstqtvideosink/delegates/qwidgetvideosinkdelegate.cpp @@ -43,7 +43,7 @@ QWidget *QWidgetVideoSinkDelegate::widget() const void QWidgetVideoSinkDelegate::setWidget(QWidget *widget) { - GST_LOG_OBJECT(m_sink, "Setting \"widget\" property to %"GST_PTR_FORMAT, widget); + GST_LOG_OBJECT(m_sink, "Setting \"widget\" property to %" GST_PTR_FORMAT, widget); if (m_widget) { m_widget.data()->removeEventFilter(this); diff --git a/src/VideoStreaming/gstqtvideosink/gstqtquick2videosink.cpp b/src/VideoStreaming/gstqtvideosink/gstqtquick2videosink.cpp index af00d9275..eedfd0699 100644 --- a/src/VideoStreaming/gstqtvideosink/gstqtquick2videosink.cpp +++ b/src/VideoStreaming/gstqtvideosink/gstqtquick2videosink.cpp @@ -254,7 +254,7 @@ gst_qt_quick2_video_sink_show_frame(GstVideoSink *sink, GstBuffer *buffer) { GstQtQuick2VideoSink *self = GST_QT_QUICK2_VIDEO_SINK (sink); - GST_TRACE_OBJECT(self, "Posting new buffer (%"GST_PTR_FORMAT") for rendering.", buffer); + GST_TRACE_OBJECT(self, "Posting new buffer (%" GST_PTR_FORMAT ") for rendering.", buffer); QCoreApplication::postEvent(self->priv->delegate, new BaseDelegate::BufferEvent(buffer)); diff --git a/src/VideoStreaming/gstqtvideosink/gstqtvideosinkbase.cpp b/src/VideoStreaming/gstqtvideosink/gstqtvideosinkbase.cpp index 1d84deab7..12dc844e6 100644 --- a/src/VideoStreaming/gstqtvideosink/gstqtvideosinkbase.cpp +++ b/src/VideoStreaming/gstqtvideosink/gstqtvideosinkbase.cpp @@ -213,7 +213,7 @@ GstFlowReturn GstQtVideoSinkBase::show_frame(GstVideoSink *video_sink, GstBuffer { GstQtVideoSinkBase *sink = GST_QT_VIDEO_SINK_BASE(video_sink); - GST_TRACE_OBJECT(sink, "Posting new buffer (%"GST_PTR_FORMAT") for rendering.", buffer); + GST_TRACE_OBJECT(sink, "Posting new buffer (%" GST_PTR_FORMAT") for rendering.", buffer); QCoreApplication::postEvent(sink->delegate, new BaseDelegate::BufferEvent(buffer)); -- 2.22.0