diff --git a/ground/gcs/src/libs/gstreamer/gstreamer_dependencies.pri b/ground/gcs/src/libs/gstreamer/gstreamer_dependencies.pri index 9e307a556..f99e33b9f 100644 --- a/ground/gcs/src/libs/gstreamer/gstreamer_dependencies.pri +++ b/ground/gcs/src/libs/gstreamer/gstreamer_dependencies.pri @@ -1,6 +1,29 @@ DEFINES += USE_GSTREAMER opencv:DEFINES += USE_OPENCV +macx { + GLIB_DIR = $$system(brew --prefix glib) + GSTREAMER_DIR = $$system(brew --prefix gstreamer) + GST_BASE_DIR = $$system(brew --prefix gst-plugins-base) + + message(Using glib from here: $$GLIB_DIR) + message(Using gstreamer from here: $$GSTREAMER_DIR) + message(Using gst base from here: $GST_BASE_DIR) + + INCLUDEPATH += $$GLIB_DIR/include/glib-2.0 + INCLUDEPATH += $$GLIB_DIR/lib/glib-2.0/include + + INCLUDEPATH += $$GST_BASE_DIR/include/gstreamer-1.0/ + INCLUDEPATH += $$GSTREAMER_DIR/include/gstreamer-1.0 + INCLUDEPATH += $$GSTREAMER_DIR/lib/gstreamer-1.0/include + + LIBS +=-L$$GLIB_DIR/lib + LIBS += -L$$GSTREAMER_DIR/lib -L$$GST_BASE_DIR/lib + + LIBS += -lglib-2.0 -lgobject-2.0 + LIBS += -lgstreamer-1.0 -lgstapp-1.0 -lgstpbutils-1.0 -lgstvideo-1.0 +} + linux|win32 { CONFIG += link_pkgconfig PKGCONFIG += glib-2.0 gobject-2.0 diff --git a/ground/gcs/src/libs/gstreamer/readme.txt b/ground/gcs/src/libs/gstreamer/readme.txt index f351173db..94f6d9b62 100644 --- a/ground/gcs/src/libs/gstreamer/readme.txt +++ b/ground/gcs/src/libs/gstreamer/readme.txt @@ -39,6 +39,8 @@ Upgrade to latest version of the packages using Synaptic Package Manager or CLI # Mac ############################################################################### +brew install gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav libav x264 + ############################################################################### # How to find required libraries (for copydata.pro) ############################################################################### diff --git a/ground/gcs/src/libs/gstreamer/videowidget.cpp b/ground/gcs/src/libs/gstreamer/videowidget.cpp index 7bba53db2..74488f972 100644 --- a/ground/gcs/src/libs/gstreamer/videowidget.cpp +++ b/ground/gcs/src/libs/gstreamer/videowidget.cpp @@ -91,7 +91,10 @@ VideoWidget::VideoWidget(QWidget *parent) : // make the widget native so it gets its own native window id that we will pass to gstreamer setAttribute(Qt::WA_NativeWindow); - // setAttribute(Qt::WA_DontCreateNativeAncestors); +#ifdef Q_OS_MAC + // WA_DontCreateNativeAncestors is needed on mac + setAttribute(Qt::WA_DontCreateNativeAncestors); +#endif // set black background QPalette pal(palette());