AW: AW: gst-bad qmlglsink and Windows

Weber, Holger Holger.Weber at telerob.com
Thu Sep 7 14:08:08 UTC 2017


There were some other issues I tried to fix. The most time I spend on figuring out why the qml element wasn't loaded. The problem was, that it was linked against the debug dlls of qt and my app was running in release mode.

Also changing to release in QtCreator didn't help because there was a "debug" keyword in the .pro file.
Maybe someone finds this helpful...

This patch works for 1.12...
---
 ext/qt/gstplugin.cc      | 11 ++++++++++-
 ext/qt/gstqtglutility.cc |  6 +++---
 ext/qt/qtplugin.pro      | 13 +++++--------
 3 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/ext/qt/gstplugin.cc b/ext/qt/gstplugin.cc
index 01ca2752c..05d7d255b 100644
--- a/ext/qt/gstplugin.cc
+++ b/ext/qt/gstplugin.cc
@@ -22,6 +22,14 @@
 #include "config.h"
 #endif
 
+#ifndef GST_PACKAGE_NAME
+#define GST_PACKAGE_NAME   "GStreamer Bad Plug-ins (qmake)"
+#define GST_PACKAGE_ORIGIN "Unknown package origin"
+#define GST_LICENSE        "LGPL"
+#define PACKAGE            "gst-plugins-bad (qmake)"
+#define PACKAGE_VERSION    "1.12.0.1"
+#endif
+
 #include "gstqtsink.h"
 #include "gstqtsrc.h"
 #include <QtQml/QQmlApplicationEngine>
@@ -34,13 +42,14 @@ plugin_init (GstPlugin * plugin)
     return FALSE;
   }
   
+#ifndef HAVE_QT_WIN32
   if (!gst_element_register (plugin, "qmlglsrc",
           GST_RANK_NONE, GST_TYPE_QT_SRC)) {
     return FALSE;
   }
+#endif
   /* this means the plugin must be loaded before the qml engine is loaded */
   qmlRegisterType<QtGLVideoItem> ("org.freedesktop.gstreamer.GLVideoItem", 1, 0, "GstGLVideoItem");
-
   return TRUE;
 }
 
diff --git a/ext/qt/gstqtglutility.cc b/ext/qt/gstqtglutility.cc
index a4b22aa95..067876bcd 100644
--- a/ext/qt/gstqtglutility.cc
+++ b/ext/qt/gstqtglutility.cc
@@ -230,7 +230,7 @@ gst_qt_get_gl_wrapcontext (GstGLDisplay * display,
       wglMakeCurrent (device, 0);
       gst_object_unref (window);
       if (!gst_gl_context_create (*context, *wrap_glcontext, &error)) {
-        GST_ERROR ("%p failed to create shared GL context: %s", this, error->message);
+        // GST_ERROR ("%p failed to create shared GL context: %s", this, error->message);
         g_object_unref (*context);
         *context = NULL;
         g_object_unref (*wrap_glcontext);
@@ -239,10 +239,10 @@ gst_qt_get_gl_wrapcontext (GstGLDisplay * display,
         return FALSE;
       }
       wglMakeCurrent (device, (HGLRC) gl_handle);
-    }
+    } G_STMT_END;
 #endif
     gst_gl_context_activate (*wrap_glcontext, FALSE);
-  } G_STMT_END;
+  }
 
   return TRUE;
 }
diff --git a/ext/qt/qtplugin.pro b/ext/qt/qtplugin.pro
index af1d8ddc1..ed9464b6a 100644
--- a/ext/qt/qtplugin.pro
+++ b/ext/qt/qtplugin.pro
@@ -5,7 +5,7 @@ TARGET = libgstqtsink
 QT += qml quick widgets
 
 QT_CONFIG -= no-pkg-config
-CONFIG += link_pkgconfig debug plugin
+CONFIG += link_pkgconfig plugin
 PKGCONFIG = \
     gstreamer-1.0 \
     gstreamer-video-1.0 \
@@ -13,19 +13,16 @@ PKGCONFIG = \
 
 DEFINES += \
     GST_USE_UNSTABLE_API \
-    HAVE_QT_WIN32 \
-    'GST_PACKAGE_NAME=\"GStreamer Bad Plug-ins (qmake)\"' \
-    'GST_PACKAGE_ORIGIN=\"Unknown package origin\"' \
-    'GST_LICENSE=\"LGPL\"' \
-    'PACKAGE=\"gst-plugins-bad (qmake)\"' \
-    'PACKAGE_VERSION=\"1.9.0.1\"'
+    HAVE_QT_WIN32
 
 SOURCES += \
     gstplugin.cc \
     gstqsgtexture.cc \
+    gstqtglutility.cc \
     gstqtsink.cc \
     qtitem.cc
 
+
 HEADERS += \
     gstqsgtexture.h \
     gstqtgl.h \
@@ -36,4 +33,4 @@ INCLUDEPATH += \
     $$(GSTREAMER_ROOT)/include \
     $$[QT_INSTALL_PREFIX]/include/QtGui/$$[QT_VERSION]/QtGui/
 
-    
\ No newline at end of file
+    
-- 
2.13.2.windows.1



-----Ursprüngliche Nachricht-----
Von: gstreamer-devel [mailto:gstreamer-devel-bounces at lists.freedesktop.org] Im Auftrag von Tim Müller
Gesendet: Donnerstag, 7. September 2017 11:18
An: gstreamer-devel at lists.freedesktop.org
Betreff: Re: AW: gst-bad qmlglsink and Windows

On Thu, 2017-09-07 at 07:00 +0000, Weber, Holger wrote:

Hi Holger,

> Building doesn’t work I get a compiler error which has something to 
> doe with GST_PLUGIN_DEFINE. I used qtcreator which is included in 
> msys.
>  
> C:/msys64/mingw32/bin/mingw32-make -f Makefile.Debug
> mingw32-make[1]: Entering directory 'C:/msys64/home/nice.guy/gst- 
> plugins-bad/ext/build-qtplugin-telerob-Debug'
> g++ -c -fno-keep-inline-dllexport -march=i686 -mtune=core2 -Wa,-mbig-
> obj -pipe -g -pthread -mms-bitfields -pthread -mms-bitfields -pthread 
> -mms-bitfields -Wextra -Wall -W -fexceptions -mthreads -DUNICODE 
> -DGST_USE_UNSTABLE_API -DHAVE_QT_WIN32 -DGST_PACKAGE_NAME="GStreamer 
> Bad Plug-ins (qmake)" -DGST_PACKAGE_ORIGIN="Unknown package origin"
> -DGST_LICENSE="LGPL" -DPACKAGE="gst-plugins-bad (qmake)"
> -DPACKAGE_VERSION="1.9.0.1" -DQT_QML_DEBUG ...
>                  from ../qt/gstplugin.cc:25:
> <command-line>:0:17: error: too many decimal points in number
> ../qt/gstplugin.cc:51:18: note: in expansion of macro 
> 'PACKAGE_VERSION'
>      plugin_init, PACKAGE_VERSION, GST_LICENSE, GST_PACKAGE_NAME,
                  ^
I can reproduce that on Linux. It looks like a quoting issue.

I've pushed a quick fix here:

https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=fcf8b
6bb908ea32073fce3b355f6cc89a67bc52c

Cheers
 -Tim

--
Tim Müller, Centricular Ltd - http://www.centricular.com

Join us at the GStreamer Conference!
21-22 October 2017 in Prague, Czech Republic http://gstreamer.freedesktop.org/conference/
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


More information about the gstreamer-devel mailing list