All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] Add some Gstreamer patches for v1.10
@ 2017-05-26  5:32 Yuqing Zhu
  2017-05-26  5:32 ` [PATCH 1/4] gstreamer1.0-plugins-base: Don't set async of custom text-sink to false in gstplaysink Yuqing Zhu
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Yuqing Zhu @ 2017-05-26  5:32 UTC (permalink / raw)
  To: meta-freescale; +Cc: Yuqing Zhu

-gstreamer1.0-plugins-base:
 1. Don't set async of custom text-sink to false in gstplaysink
    or it will cause A/V sync problem when seeking

-gstreamer1.0-plugins-bad:
 1. Add some i.MX specific code about qmlglplugin
 2. Add gstplayer get_rotate() and set_rotate() API
    Add get/set force-aspect-ratio config API
    Add set audio/ text sink API
 3. Enable opencv on MX6Q & MX6QP


Yuqing Zhu (4):
  gstreamer1.0-plugins-base: Don't set async of custom text-sink to
    false in gstplaysink
  gstreamer1.0-plugins-bad: Add i.mx specific code about qmlglplugin
  gstreamer1.0-plugins-bad: Add some gstplayer API
  gstreamer1.0-plugins-bad: Enable opencv on MX6Q & MX6QP

 .../0008-qmlglplugin-Add-i.mx-specific-code.patch  | 203 ++++++++++++++
 .../0009-Specific-patches-for-gstplayer-API.patch  | 292 +++++++++++++++++++++
 .../gstreamer1.0-plugins-bad_1.10.%.bbappend       |   4 +
 ...-don-t-set-async-of-custom-text-sink-to-f.patch |  35 +++
 .../gstreamer1.0-plugins-base_1.10.%.bbappend      |   1 +
 5 files changed, 535 insertions(+)
 create mode 100755 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0008-qmlglplugin-Add-i.mx-specific-code.patch
 create mode 100755 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0009-Specific-patches-for-gstplayer-API.patch
 create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0003-gstplaysink-don-t-set-async-of-custom-text-sink-to-f.patch

-- 
1.9.1



^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/4] gstreamer1.0-plugins-base: Don't set async of custom text-sink to false in gstplaysink
  2017-05-26  5:32 [PATCH 0/4] Add some Gstreamer patches for v1.10 Yuqing Zhu
@ 2017-05-26  5:32 ` Yuqing Zhu
  2017-05-26  5:32 ` [PATCH 2/4] gstreamer1.0-plugins-bad: Add i.mx specific code about qmlglplugin Yuqing Zhu
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Yuqing Zhu @ 2017-05-26  5:32 UTC (permalink / raw)
  To: meta-freescale; +Cc: Yuqing Zhu

Setting async to false will cause A/V sync problem when seeking.

The preroll needs to use GAP event instead of setting async to false.

Signed-off-by: Yuqing Zhu <carol.zhu@nxp.com>
---
 ...-don-t-set-async-of-custom-text-sink-to-f.patch | 35 ++++++++++++++++++++++
 .../gstreamer1.0-plugins-base_1.10.%.bbappend      |  1 +
 2 files changed, 36 insertions(+)
 create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0003-gstplaysink-don-t-set-async-of-custom-text-sink-to-f.patch

diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0003-gstplaysink-don-t-set-async-of-custom-text-sink-to-f.patch b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0003-gstplaysink-don-t-set-async-of-custom-text-sink-to-f.patch
new file mode 100644
index 0000000..398c491
--- /dev/null
+++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0003-gstplaysink-don-t-set-async-of-custom-text-sink-to-f.patch
@@ -0,0 +1,35 @@
+From 7847d85e7f37a4a40e483f3b3095c7f8a9fdf5ee Mon Sep 17 00:00:00 2001
+From: Mingke Wang <mingke.wang@freescale.com>
+Date: Thu, 19 Mar 2015 14:15:25 +0800
+Subject: [PATCH 02/13] gstplaysink: don't set async of custom text-sink to
+ false
+
+Setting async to false leads to A/V sync problem when seeking.
+The preroll need to use GAP event instead of set async to false.
+
+Upstream-Status: Inappropriate [i.MX specific]
+
+Signed-off-by: Mingke Wang <mingke.wang@freescale.com>
+---
+ gst/playback/gstplaysink.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+ mode change 100644 => 100755 gst/playback/gstplaysink.c
+
+diff --git a/gst/playback/gstplaysink.c b/gst/playback/gstplaysink.c
+old mode 100644
+new mode 100755
+index eaac018..02d019e
+--- a/gst/playback/gstplaysink.c
++++ b/gst/playback/gstplaysink.c
+@@ -2430,7 +2430,7 @@ gen_text_chain (GstPlaySink * playsink)
+           G_TYPE_BOOLEAN);
+       if (elem) {
+         /* make sure the sparse subtitles don't participate in the preroll */
+-        g_object_set (elem, "async", FALSE, NULL);
++        //g_object_set (elem, "async", FALSE, NULL);
+         GST_DEBUG_OBJECT (playsink, "adding custom text sink");
+         gst_bin_add (bin, chain->sink);
+         /* NOTE streamsynchronizer needs streams decoupled */
+-- 
+1.9.1
+
diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.10.%.bbappend b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.10.%.bbappend
index 6137d5e..e6c080e 100644
--- a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.10.%.bbappend
+++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.10.%.bbappend
@@ -3,6 +3,7 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
 GST_IMX_PATCHES = " file://gstplaybin-remove-flag-deinterlace.patch \
                     file://0001-MMFMWK-7030-Linux_MX6QP_ARD-IMXCameraApp-When-Enable.patch \
                     file://0002-Remove-dependence-on-imx-plugin-git.patch \
+                    file://0003-gstplaysink-don-t-set-async-of-custom-text-sink-to-f.patch \
 "
 
 GST_IMX_PATCHES_TO_APPEND = ""
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/4] gstreamer1.0-plugins-bad: Add i.mx specific code about qmlglplugin
  2017-05-26  5:32 [PATCH 0/4] Add some Gstreamer patches for v1.10 Yuqing Zhu
  2017-05-26  5:32 ` [PATCH 1/4] gstreamer1.0-plugins-base: Don't set async of custom text-sink to false in gstplaysink Yuqing Zhu
@ 2017-05-26  5:32 ` Yuqing Zhu
  2017-05-28 23:26   ` Otavio Salvador
  2017-05-26  5:32 ` [PATCH 3/4] gstreamer1.0-plugins-bad: Add some gstplayer API Yuqing Zhu
  2017-05-26  5:32 ` [PATCH 4/4] gstreamer1.0-plugins-bad: Enable opencv on MX6Q & MX6QP Yuqing Zhu
  3 siblings, 1 reply; 9+ messages in thread
From: Yuqing Zhu @ 2017-05-26  5:32 UTC (permalink / raw)
  To: meta-freescale; +Cc: Yuqing Zhu

*Add FB and X11 support for qml gl plugins
*Use Render-to-texture for texture copy since
 we use direct viv for GPU download

Signed-off-by: Yuqing Zhu <carol.zhu@nxp.com>
---
 .../0008-qmlglplugin-Add-i.mx-specific-code.patch  | 203 +++++++++++++++++++++
 .../gstreamer1.0-plugins-bad_1.10.%.bbappend       |   1 +
 2 files changed, 204 insertions(+)
 create mode 100755 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0008-qmlglplugin-Add-i.mx-specific-code.patch

diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0008-qmlglplugin-Add-i.mx-specific-code.patch b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0008-qmlglplugin-Add-i.mx-specific-code.patch
new file mode 100755
index 0000000..c5e1775
--- /dev/null
+++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0008-qmlglplugin-Add-i.mx-specific-code.patch
@@ -0,0 +1,203 @@
+From 2afb646ca0cb911a7735ed5512ebc4a8f02ad052 Mon Sep 17 00:00:00 2001
+From: Haihua Hu <jared.hu@nxp.com>
+Date: Mon, 14 Nov 2016 14:34:47 +0800
+Subject: [PATCH 19/24] qmlglplugin: Add i.mx specific code
+
+1.Add FB and X11 support for qml gl plugins
+2.Use Render-to-texture for texture copy since we use direct viv
+  for GPU download.
+
+Upstream-Status: Inappropriate [i.MX specific]
+
+Signed-off-by: Haihua Hu <jared.hu@nxp.com>
+---
+ configure.ac             |  9 +++++++--
+ ext/qt/gstqtglutility.cc | 17 +++++++++++++---
+ ext/qt/qtwindow.cc       | 50 +++++++++++++++++++++++++++++++++++++++++++++++-
+ ext/qt/qtwindow.h        |  1 +
+ 4 files changed, 71 insertions(+), 6 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 0876a14..a4cc878 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -2967,12 +2967,12 @@ AG_GST_CHECK_FEATURE(QT, [Qt elements], qt, [
+         HAVE_QT="yes"
+         HAVE_QT_WINDOWING="no"
+         QT_VERSION="`$PKG_CONFIG --modversion Qt5Core`"
+-        QPA_INCLUDE_PATH=`$PKG_CONFIG --variable=includedir Qt5Core`/QtGui/${QT_VERSION}/QtGui
++        QPA_INCLUDE_PATH=${STAGING_INCDIR}/../../`$PKG_CONFIG --variable=includedir Qt5Core`/QtGui/${QT_VERSION}/QtGui
+         AS_IF([test -f "$QPA_INCLUDE_PATH/qpa/qplatformnativeinterface.h"], [
+           QT_CFLAGS="$QT_CFLAGS -I$QPA_INCLUDE_PATH"
+           HAVE_QT_QPA_HEADER="yes"
+         ], [AC_MSG_NOTICE([Cannot find QPA])])
+-        if test "x$GST_GL_HAVE_WINDOW_X11" = "x1" -a "x$GST_GL_HAVE_PLATFORM_GLX" = "x1"; then
++        if test "x$GST_GL_HAVE_WINDOW_X11" = "x1" -a "x$GST_GL_HAVE_PLATFORM_EGL" = "x1"; then
+           PKG_CHECK_MODULES(QT_X11, Qt5X11Extras, [
+             AC_DEFINE([HAVE_QT_X11], [], [Define if Qt X11 integration is installed])
+             QT_CFLAGS="$QT_CFLAGS $QT_X11_CFLAGS"
+@@ -3032,6 +3032,11 @@ AG_GST_CHECK_FEATURE(QT, [Qt elements], qt, [
+             HAVE_QT_WINDOWING="yes"
+           fi
+         fi
++        if test "x$GST_GL_HAVE_WINDOW_FB" = "x1" -a "x$GST_GL_HAVE_PLATFORM_EGL" = "x1"; then
++          QT_CFLAGS="$QT_CFLAGS"
++          QT_LIBS="$QT_LIBS"
++          HAVE_QT_WINDOWING="yes"
++        fi
+         if test "x$HAVE_QT_WINDOWING" = "xno"; then
+           AC_MSG_WARN([Could not find any Qt Windowing integration])
+           HAVE_QT="no"
+diff --git a/ext/qt/gstqtglutility.cc b/ext/qt/gstqtglutility.cc
+index 4d6d318..c85465f 100644
+--- a/ext/qt/gstqtglutility.cc
++++ b/ext/qt/gstqtglutility.cc
+@@ -25,10 +25,10 @@
+ #include "gstqtglutility.h"
+ #include <QtGui/QGuiApplication>
+ 
+-#if GST_GL_HAVE_WINDOW_X11 && GST_GL_HAVE_PLATFORM_GLX && defined (HAVE_QT_X11)
++#if GST_GL_HAVE_WINDOW_X11 && GST_GL_HAVE_PLATFORM_EGL && defined (HAVE_QT_X11)
+ #include <QX11Info>
+ #include <gst/gl/x11/gstgldisplay_x11.h>
+-#include <gst/gl/x11/gstglcontext_glx.h>
++#include <gst/gl/egl/gstglcontext_egl.h>
+ #endif
+ 
+ #if GST_GL_HAVE_WINDOW_WAYLAND && GST_GL_HAVE_PLATFORM_EGL && defined (HAVE_QT_WAYLAND)
+@@ -45,6 +45,12 @@
+ #include <gst/gl/coaoa/gstgldisplay_cocoa.h>
+ #endif
+ 
++#if GST_GL_HAVE_WINDOW_FB
++#define LINUX
++#define EGL_API_FB
++#include <gst/gl/fb/gstgldisplay_fb.h>
++#endif
++
+ #define GST_CAT_DEFAULT qt_gl_utils_debug
+ GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
+ 
+@@ -121,7 +127,7 @@ gst_qt_get_gl_wrapcontext (GstGLDisplay * display,
+ 
+ #if GST_GL_HAVE_WINDOW_X11 && defined (HAVE_QT_X11)
+   if (GST_IS_GL_DISPLAY_X11 (display)) {
+-    platform = GST_GL_PLATFORM_GLX;
++    platform = GST_GL_PLATFORM_EGL;
+   }
+ #endif
+ #if GST_GL_HAVE_WINDOW_WAYLAND && defined (HAVE_QT_WAYLAND)
+@@ -134,6 +140,11 @@ gst_qt_get_gl_wrapcontext (GstGLDisplay * display,
+     platform = GST_GL_PLATFORM_EGL;
+   }
+ #endif
++#if GST_GL_HAVE_WINDOW_FB
++  if (GST_IS_GL_DISPLAY_FB (display)) {
++    platform = GST_GL_PLATFORM_EGL;
++  }
++#endif
+   if (platform == 0) {
+ #if GST_GL_HAVE_WINDOW_COCOA && GST_GL_HAVE_PLATFORM_COCOA && defined (HAVE_QT_MAC)
+     platform = GST_GL_PLATFORM_CGL;
+diff --git a/ext/qt/qtwindow.cc b/ext/qt/qtwindow.cc
+index c3fd564..3d96751 100644
+--- a/ext/qt/qtwindow.cc
++++ b/ext/qt/qtwindow.cc
+@@ -66,6 +66,9 @@ struct _QtGLWindowPrivate
+   GstGLDisplay *display;
+   GstGLContext *other_context;
+ 
++  /* used for direct viv renderTarget */
++  GLuint fbo;
++
+   /* frames that qmlview rendered in its gl thread */
+   guint64 frames_rendered;
+ };
+@@ -118,6 +121,8 @@ QtGLWindow::QtGLWindow ( QWindow * parent, QQuickWindow *src ) :
+   else
+     connect (source, SIGNAL(sceneGraphInitialized()), this, SLOT(onSceneGraphInitialized()), Qt::DirectConnection);
+ 
++  connect (source, SIGNAL(sceneGraphInvalidated()), this, SLOT(onSceneGraphInvalidated()), Qt::DirectConnection);
++
+   GST_DEBUG ("%p init Qt Window", this->priv->display);
+ }
+ 
+@@ -210,8 +215,23 @@ QtGLWindow::afterRendering()
+   GST_DEBUG ("qml render target id %d, render to tex %d %dX%d", 
+       this->source->renderTargetId(), dst_tex, width,height);
+ 
++  gl->BindFramebuffer (GL_DRAW_FRAMEBUFFER, this->priv->fbo);
+   gl->BindTexture (GL_TEXTURE_2D, dst_tex);
+-  gl->CopyTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA, 0, 0, width, height, 0);
++  gl->FramebufferTexture2D (GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
++      GL_TEXTURE_2D, dst_tex, 0);
++
++  ret = gst_gl_context_check_framebuffer_status (context);
++  if (!ret) {
++    GST_ERROR ("FBO errors");
++    goto errors;
++  }
++
++  gl->ReadBuffer ( GL_COLOR_ATTACHMENT0 );
++  gl->BlitFramebuffer ( 0, 0, width, height,
++		        0, 0, width, height,
++		        GL_COLOR_BUFFER_BIT, GL_LINEAR );
++
++  //gl->CopyTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA, 0, 0, width, height, 0);
+   
+   GST_DEBUG ("rendering finished");
+ 
+@@ -250,10 +270,38 @@ QtGLWindow::onSceneGraphInitialized()
+   this->priv->initted = gst_qt_get_gl_wrapcontext (this->priv->display,
+       &this->priv->other_context, NULL);
+ 
++  if (this->priv->initted && this->priv->other_context) {
++    const GstGLFuncs *gl;
++
++    gst_gl_context_activate (this->priv->other_context, TRUE);
++    gl = this->priv->other_context->gl_vtable;
++
++    gl->GenFramebuffers (1, &this->priv->fbo);
++
++    gst_gl_context_activate (this->priv->other_context, FALSE);
++  }
++
+   GST_DEBUG ("%p created wrapped GL context %" GST_PTR_FORMAT, this,
+       this->priv->other_context);
+ }
+ 
++void
++QtGLWindow::onSceneGraphInvalidated()
++{
++  GST_DEBUG ("scene graph invalidated");
++
++  if (this->priv->fbo && this->priv->other_context) {
++    const GstGLFuncs *gl;
++
++    gst_gl_context_activate (this->priv->other_context, TRUE);
++    gl = this->priv->other_context->gl_vtable;
++
++    gl->DeleteFramebuffers (1, &this->priv->fbo);
++
++    gst_gl_context_activate (this->priv->other_context, FALSE);
++  }
++}
++
+ bool
+ QtGLWindow::getGeometry(int * width, int * height)
+ {
+diff --git a/ext/qt/qtwindow.h b/ext/qt/qtwindow.h
+index 5820e77..8cb5a2c 100644
+--- a/ext/qt/qtwindow.h
++++ b/ext/qt/qtwindow.h
+@@ -48,6 +48,7 @@ private Q_SLOTS:
+     void beforeRendering ();
+     void afterRendering ();
+     void onSceneGraphInitialized ();
++    void onSceneGraphInvalidated ();
+     void aboutToQuit();
+ 
+ private:
+-- 
+1.9.1
+
diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.%.bbappend b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.%.bbappend
index 7d852d8..0a25c4d 100644
--- a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.%.bbappend
+++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.%.bbappend
@@ -15,6 +15,7 @@ SRC_URI_append_imxgpu2d = " \
     file://0005-glcolorconvert-convert-YUV-to-RGB-use-directviv.patch \
     file://0006-glwindow-work-around-for-no-frame-when-imxplayer-use.patch \
     file://0007-glcolorconvert-fix-MRT-cannot-work-in-GLES3.0.patch \
+    file://0008-qmlglplugin-Add-i.mx-specific-code.patch \
 "
 
 
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/4] gstreamer1.0-plugins-bad: Add some gstplayer API
  2017-05-26  5:32 [PATCH 0/4] Add some Gstreamer patches for v1.10 Yuqing Zhu
  2017-05-26  5:32 ` [PATCH 1/4] gstreamer1.0-plugins-base: Don't set async of custom text-sink to false in gstplaysink Yuqing Zhu
  2017-05-26  5:32 ` [PATCH 2/4] gstreamer1.0-plugins-bad: Add i.mx specific code about qmlglplugin Yuqing Zhu
@ 2017-05-26  5:32 ` Yuqing Zhu
  2017-05-26  5:32 ` [PATCH 4/4] gstreamer1.0-plugins-bad: Enable opencv on MX6Q & MX6QP Yuqing Zhu
  3 siblings, 0 replies; 9+ messages in thread
From: Yuqing Zhu @ 2017-05-26  5:32 UTC (permalink / raw)
  To: meta-freescale; +Cc: Yuqing Zhu

* Add gstplayer get_rotate() and set_rotate() API
* Add get/set force-aspect-ratio config API
* Add set audio/ text sink API

Signed-off-by: Yuqing Zhu <carol.zhu@nxp.com>
---
 .../0009-Specific-patches-for-gstplayer-API.patch  | 292 +++++++++++++++++++++
 .../gstreamer1.0-plugins-bad_1.10.%.bbappend       |   1 +
 2 files changed, 293 insertions(+)
 create mode 100755 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0009-Specific-patches-for-gstplayer-API.patch

diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0009-Specific-patches-for-gstplayer-API.patch b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0009-Specific-patches-for-gstplayer-API.patch
new file mode 100755
index 0000000..0679e4b
--- /dev/null
+++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0009-Specific-patches-for-gstplayer-API.patch
@@ -0,0 +1,292 @@
+From 3d789943c1f0568014ff2399a097b5dfa5d7a92e Mon Sep 17 00:00:00 2001
+From: Lyon Wang <lyon.wang@nxp.com>
+Date: Fri, 30 Dec 2016 15:53:21 +0800
+Subject: [PATCH 3/5] Specific patches for gstplayer API
+
+player: Add get_rotate, set_rotate API
+
+- Add gstplayer get_rotate() and set_rotate() API
+
+player: Add force-aspect-ratio config
+
+- Add get/set force-aspect-ratio config API
+
+player: Add set audio / text sink API
+
+- Add set audio / text sink API
+
+Upstream-Status: Inappropriate [i.MX specific]
+
+Signed-off-by: Lyon Wang <lyon.wang@nxp.com>
+---
+ gst-libs/gst/player/gstplayer.c | 214 ++++++++++++++++++++++++++++++++++++++++
+ gst-libs/gst/player/gstplayer.h |  10 ++
+ 2 files changed, 224 insertions(+)
+
+diff --git a/gst-libs/gst/player/gstplayer.c b/gst-libs/gst/player/gstplayer.c
+index d9ff524..960e7a2 100644
+--- a/gst-libs/gst/player/gstplayer.c
++++ b/gst-libs/gst/player/gstplayer.c
+@@ -86,6 +86,7 @@ typedef enum
+   CONFIG_QUARK_USER_AGENT = 0,
+   CONFIG_QUARK_POSITION_INTERVAL_UPDATE,
+   CONFIG_QUARK_ACCURATE_SEEK,
++  CONFIG_QUARK_FORCE_ASPECT_RATIO,
+ 
+   CONFIG_QUARK_MAX
+ } ConfigQuarkId;
+@@ -94,6 +95,7 @@ static const gchar *_config_quark_strings[] = {
+   "user-agent",
+   "position-interval-update",
+   "accurate-seek",
++  "force-aspect-ratio",
+ };
+ 
+ GQuark _config_quark_table[CONFIG_QUARK_MAX];
+@@ -269,6 +271,7 @@ gst_player_init (GstPlayer * self)
+   self->config = gst_structure_new_id (QUARK_CONFIG,
+       CONFIG_QUARK (POSITION_INTERVAL_UPDATE), G_TYPE_UINT, DEFAULT_POSITION_UPDATE_INTERVAL_MS,
+       CONFIG_QUARK (ACCURATE_SEEK), G_TYPE_BOOLEAN, FALSE,
++      CONFIG_QUARK (FORCE_ASPECT_RATIO), G_TYPE_BOOLEAN, TRUE,
+       NULL);
+   /* *INDENT-ON* */
+ 
+@@ -4259,3 +4262,214 @@ gst_player_config_get_seek_accurate (const GstStructure * config)
+ 
+   return accurate;
+ }
++
++/**
++ * gst_player_get_video_sink:
++ * @player: #GstPlayer instance
++ *
++ * Returns: actual video sink element
++ */
++GstElement *
++gst_player_get_video_sink (GstPlayer * self)
++{
++  GstElement *sink = NULL;
++  GstElement *actual_sink = NULL;
++  GstIteratorResult rc;
++  GstIterator *it;
++  GValue item = { 0, };
++  g_return_val_if_fail (GST_IS_PLAYER (self), NULL);
++
++  g_object_get (G_OBJECT (self->playbin), "video-sink", &sink, NULL);
++  if (NULL == sink) {
++    GST_WARNING_OBJECT (self, "No video-sink found");
++    return NULL;
++  }
++  it = gst_bin_iterate_sinks ((GstBin *) sink);
++  do {
++    rc = gst_iterator_next (it, &item);
++    if (rc == GST_ITERATOR_OK) {
++      break;
++    }
++  } while (rc != GST_ITERATOR_DONE);
++
++  g_object_unref (sink);
++  actual_sink = g_value_get_object (&item);
++  g_value_unset (&item);
++  gst_iterator_free (it);
++
++  if (NULL == actual_sink) {
++    GST_WARNING_OBJECT (self, "No video-sink found");
++    return NULL;
++  }
++
++  return actual_sink;
++}
++
++/**
++ * gst_palyer_set_rotate:
++ * @player: #GstPlayer instance
++ * @rotation: rotation degree value
++ *
++ * Returns: %TRUE or %FALSE
++ *
++ * Set the rotation vaule
++ */
++gboolean
++gst_player_set_rotate (GstPlayer * self, gint rotation)
++{
++  GstElement *video_sink = NULL;
++  GObjectClass *gobjclass = NULL;
++  g_return_val_if_fail (GST_IS_PLAYER (self), FALSE);
++
++  video_sink = gst_player_get_video_sink (self);
++  if (NULL == video_sink) {
++    GST_WARNING_OBJECT (self, " cannot get  video sink ");
++    return FALSE;
++  }
++  GST_DEBUG_OBJECT (self, "set rotation degree '%d'", rotation);
++
++  gobjclass = G_OBJECT_GET_CLASS (G_OBJECT (video_sink));
++  if (g_object_class_find_property (gobjclass, "rotate")
++      && g_object_class_find_property (gobjclass, "reconfig")) {
++    g_object_set (G_OBJECT (video_sink), "rotate", rotation / 90, NULL);
++    g_object_set (G_OBJECT (video_sink), "reconfig", 1, NULL);
++  } else if (g_object_class_find_property (gobjclass, "rotate-method")) {
++    g_object_set (G_OBJECT (video_sink), "rotate-method", rotation / 90, NULL);
++  } else {
++    GST_INFO_OBJECT (self, "can't set rotation for current video sink %s'",
++        gst_element_get_name (video_sink));
++    return FALSE;
++  }
++
++  return TRUE;
++}
++
++/**
++ * gst_player_get_rotate:
++ * @player: #GstPlayer instance
++ *
++ * Returns: the rotation degree value
++ */
++gint
++gst_player_get_rotate (GstPlayer * self)
++{
++  GstElement *video_sink = NULL;
++  GObjectClass *gobjclass = NULL;
++  gint rotation = 0;
++  g_return_val_if_fail (GST_IS_PLAYER (self), 0);
++
++  video_sink = gst_player_get_video_sink (self);
++  if (NULL == video_sink) {
++    GST_WARNING_OBJECT (self, " cannot get  video sink ");
++    return 0;
++  }
++
++  /* check if the element has "rotate" property */
++  gobjclass = G_OBJECT_GET_CLASS (video_sink);
++  if (g_object_class_find_property (gobjclass, "rotate")) {
++    g_object_get (G_OBJECT (video_sink), "rotate", &rotation, NULL);
++    rotation = rotation * 90;
++  } else if (g_object_class_find_property (gobjclass, "rotate-method")) {
++    g_object_get (G_OBJECT (video_sink), "rotate-method", &rotation, NULL);
++    rotation = rotation * 90;
++  }
++
++  GST_DEBUG_OBJECT (self, "get rotation degree '%d'", rotation);
++
++  return rotation;
++}
++
++/**
++ * gst_player_config_set_force_aspect_ratio:
++ * @player: #GstPlayer instance
++ * @force_aspect_ratio: keey original aspect ratio or not
++ *
++ * Enable or disable force aspect ratio
++ * force_aspect_ratio seeking is TRUE by default.
++ *
++ * Since: 1.12
++ */
++void
++gst_player_config_set_force_aspect_ratio (GstPlayer * self, gboolean force_aspect_ratio)
++{
++  GstStructure *config = self->config;
++  g_return_if_fail (config != NULL);
++
++  gst_structure_id_set (config,
++      CONFIG_QUARK (FORCE_ASPECT_RATIO), G_TYPE_BOOLEAN, force_aspect_ratio, NULL);
++
++  g_object_set(self->playbin, "force-aspect-ratio", force_aspect_ratio, NULL);
++}
++
++/**
++ * gst_player_config_get_force_aspect_ratio:
++ * @config: a #GstPlayer configuration
++ *
++ * Returns: %TRUE if force-aspect-ratio is enabled
++ *
++ * Since 1.12
++ */
++gboolean
++gst_player_config_get_force_aspect_ratio (const GstStructure * config)
++{
++  gboolean force_aspect_ratio = TRUE;
++
++  g_return_val_if_fail (config != NULL, FALSE);
++
++  gst_structure_id_get (config,
++      CONFIG_QUARK (FORCE_ASPECT_RATIO), G_TYPE_BOOLEAN, &force_aspect_ratio, NULL);
++
++  return force_aspect_ratio;
++}
++
++/**
++ * gst_player_set_audio_sink:
++ * @player: #GstPlayer instance
++ * @sink_name: the sink name to set
++ *
++ * Returns: %TRUE or %FALSE
++ *
++ * Set the customize audio sink
++ */
++gboolean
++gst_player_set_audio_sink (GstPlayer * self, const gchar * sink_name)
++{
++  GstElement *audio_sink = NULL;
++  g_return_val_if_fail (GST_IS_PLAYER (self), FALSE);
++
++  audio_sink = gst_parse_bin_from_description (sink_name, TRUE, NULL);
++  if (!audio_sink) {
++    GST_ERROR_OBJECT (self, "invalid audio sink %s", sink_name);
++    return FALSE;
++  }
++
++  g_object_set (G_OBJECT (self->playbin), "audio-sink", audio_sink, NULL);
++  GST_DEBUG_OBJECT (self, "set audio sink '%s'", sink_name);
++  return TRUE;
++}
++
++/**
++ * gst_player_set_text_sink:
++ * @player: #GstPlayer instance
++ * @sink_name: the sink name to set
++ *
++ * Returns: %TRUE or %FALSE
++ *
++ * Set the customize video sink
++ */
++gboolean
++gst_player_set_text_sink (GstPlayer * self, const gchar * sink_name)
++{
++  GstElement *text_sink = NULL;
++  g_return_val_if_fail (GST_IS_PLAYER (self), FALSE);
++
++  text_sink = gst_parse_bin_from_description (sink_name, TRUE, NULL);
++  if (!text_sink) {
++    GST_ERROR_OBJECT (self, "invalid text sink %s", sink_name);
++    return FALSE;
++  }
++
++  g_object_set (G_OBJECT (self->playbin), "text-sink", text_sink, NULL);
++  GST_DEBUG_OBJECT (self, "set text sink '%s'", sink_name);
++  return TRUE;
++}
+diff --git a/gst-libs/gst/player/gstplayer.h b/gst-libs/gst/player/gstplayer.h
+index 8426be5..bfc12b2 100644
+--- a/gst-libs/gst/player/gstplayer.h
++++ b/gst-libs/gst/player/gstplayer.h
+@@ -205,6 +205,16 @@ guint          gst_player_config_get_position_update_interval  (const GstStructu
+ void           gst_player_config_set_seek_accurate (GstPlayer * player, gboolean accurate);
+ gboolean       gst_player_config_get_seek_accurate (const GstStructure * config);
+ 
++/* Custom gstplayer API */
++gboolean    gst_player_set_rotate (GstPlayer * player, gint rotation);
++gint        gst_player_get_rotate (GstPlayer * player);
++
++void        gst_player_config_set_force_aspect_ratio (GstPlayer * self, gboolean force_aspect_ratio);
++gboolean    gst_player_config_get_force_aspect_ratio (const GstStructure * config);
++
++gboolean    gst_player_set_audio_sink (GstPlayer * player, const gchar * sink_name);
++gboolean    gst_player_set_text_sink (GstPlayer * player, const gchar * sink_name);
++
+ G_END_DECLS
+ 
+ #endif /* __GST_PLAYER_H__ */
+-- 
+1.9.1
+
diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.%.bbappend b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.%.bbappend
index 0a25c4d..dccc3a9 100644
--- a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.%.bbappend
+++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.%.bbappend
@@ -16,6 +16,7 @@ SRC_URI_append_imxgpu2d = " \
     file://0006-glwindow-work-around-for-no-frame-when-imxplayer-use.patch \
     file://0007-glcolorconvert-fix-MRT-cannot-work-in-GLES3.0.patch \
     file://0008-qmlglplugin-Add-i.mx-specific-code.patch \
+    file://0009-Specific-patches-for-gstplayer-API.patch \
 "
 
 
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 4/4] gstreamer1.0-plugins-bad: Enable opencv on MX6Q & MX6QP
  2017-05-26  5:32 [PATCH 0/4] Add some Gstreamer patches for v1.10 Yuqing Zhu
                   ` (2 preceding siblings ...)
  2017-05-26  5:32 ` [PATCH 3/4] gstreamer1.0-plugins-bad: Add some gstplayer API Yuqing Zhu
@ 2017-05-26  5:32 ` Yuqing Zhu
  2017-05-28 23:28   ` Otavio Salvador
  3 siblings, 1 reply; 9+ messages in thread
From: Yuqing Zhu @ 2017-05-26  5:32 UTC (permalink / raw)
  To: meta-freescale; +Cc: Yuqing Zhu

Signed-off-by: Yuqing Zhu <carol.zhu@nxp.com>
---
 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.%.bbappend | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.%.bbappend b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.%.bbappend
index dccc3a9..7b4008e 100644
--- a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.%.bbappend
+++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.%.bbappend
@@ -6,6 +6,8 @@ PACKAGECONFIG_GL_imxgpu2d = "${@bb.utils.contains('DISTRO_FEATURES', 'opengl x11
 
 PACKAGECONFIG_GL_imxgpu3d = "${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'gles2', '', d)}"
 
+PACKAGECONFIG_append_mx6q = " opencv"
+PACKAGECONFIG_append_mx6qp = " opencv"
 
 SRC_URI_append_imxgpu2d = " \
     file://0001-glplugin-Change-wayland-default-res-to-1024x768.patch \
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/4] gstreamer1.0-plugins-bad: Add i.mx specific code about qmlglplugin
  2017-05-26  5:32 ` [PATCH 2/4] gstreamer1.0-plugins-bad: Add i.mx specific code about qmlglplugin Yuqing Zhu
@ 2017-05-28 23:26   ` Otavio Salvador
  2017-05-31  9:17     ` Carol Zhu
  0 siblings, 1 reply; 9+ messages in thread
From: Otavio Salvador @ 2017-05-28 23:26 UTC (permalink / raw)
  To: Yuqing Zhu; +Cc: meta-freescale

On Fri, May 26, 2017 at 2:32 AM, Yuqing Zhu <carol.zhu@nxp.com> wrote:
> *Add FB and X11 support for qml gl plugins
> *Use Render-to-texture for texture copy since
>  we use direct viv for GPU download
>
> Signed-off-by: Yuqing Zhu <carol.zhu@nxp.com>
> ---
>  .../0008-qmlglplugin-Add-i.mx-specific-code.patch  | 203 +++++++++++++++++++++
>  .../gstreamer1.0-plugins-bad_1.10.%.bbappend       |   1 +
>  2 files changed, 204 insertions(+)
>  create mode 100755 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0008-qmlglplugin-Add-i.mx-specific-code.patch
>
> diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0008-qmlglplugin-Add-i.mx-specific-code.patch b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0008-qmlglplugin-Add-i.mx-specific-code.patch
> new file mode 100755
> index 0000000..c5e1775
> --- /dev/null
> +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0008-qmlglplugin-Add-i.mx-specific-code.patch
> @@ -0,0 +1,203 @@
> +From 2afb646ca0cb911a7735ed5512ebc4a8f02ad052 Mon Sep 17 00:00:00 2001
> +From: Haihua Hu <jared.hu@nxp.com>
> +Date: Mon, 14 Nov 2016 14:34:47 +0800
> +Subject: [PATCH 19/24] qmlglplugin: Add i.mx specific code
> +
> +1.Add FB and X11 support for qml gl plugins
> +2.Use Render-to-texture for texture copy since we use direct viv
> +  for GPU download.
> +
> +Upstream-Status: Inappropriate [i.MX specific]
> +
> +Signed-off-by: Haihua Hu <jared.hu@nxp.com>
> +---
> + configure.ac             |  9 +++++++--
> + ext/qt/gstqtglutility.cc | 17 +++++++++++++---
> + ext/qt/qtwindow.cc       | 50 +++++++++++++++++++++++++++++++++++++++++++++++-
> + ext/qt/qtwindow.h        |  1 +
> + 4 files changed, 71 insertions(+), 6 deletions(-)
> +
> +diff --git a/configure.ac b/configure.ac
> +index 0876a14..a4cc878 100644
> +--- a/configure.ac
> ++++ b/configure.ac
> +@@ -2967,12 +2967,12 @@ AG_GST_CHECK_FEATURE(QT, [Qt elements], qt, [
> +         HAVE_QT="yes"
> +         HAVE_QT_WINDOWING="no"
> +         QT_VERSION="`$PKG_CONFIG --modversion Qt5Core`"
> +-        QPA_INCLUDE_PATH=`$PKG_CONFIG --variable=includedir Qt5Core`/QtGui/${QT_VERSION}/QtGui
> ++        QPA_INCLUDE_PATH=${STAGING_INCDIR}/../../`$PKG_CONFIG --variable=includedir Qt5Core`/QtGui/${QT_VERSION}/QtGui

This is a hack and should not be part of the patch. PKG_CONFIG behaves
well inside OE environment so it is not needed.

> +         AS_IF([test -f "$QPA_INCLUDE_PATH/qpa/qplatformnativeinterface.h"], [
> +           QT_CFLAGS="$QT_CFLAGS -I$QPA_INCLUDE_PATH"
> +           HAVE_QT_QPA_HEADER="yes"
> +         ], [AC_MSG_NOTICE([Cannot find QPA])])
> +-        if test "x$GST_GL_HAVE_WINDOW_X11" = "x1" -a "x$GST_GL_HAVE_PLATFORM_GLX" = "x1"; then
> ++        if test "x$GST_GL_HAVE_WINDOW_X11" = "x1" -a "x$GST_GL_HAVE_PLATFORM_EGL" = "x1"; then

if test "x$GST_GL_HAVE_WINDOW_X11" = "x1"; then ???

> +           PKG_CHECK_MODULES(QT_X11, Qt5X11Extras, [
> +             AC_DEFINE([HAVE_QT_X11], [], [Define if Qt X11 integration is installed])
> +             QT_CFLAGS="$QT_CFLAGS $QT_X11_CFLAGS"
> +@@ -3032,6 +3032,11 @@ AG_GST_CHECK_FEATURE(QT, [Qt elements], qt, [
> +             HAVE_QT_WINDOWING="yes"
> +           fi
> +         fi
> ++        if test "x$GST_GL_HAVE_WINDOW_FB" = "x1" -a "x$GST_GL_HAVE_PLATFORM_EGL" = "x1"; then
> ++          QT_CFLAGS="$QT_CFLAGS"
> ++          QT_LIBS="$QT_LIBS"
> ++          HAVE_QT_WINDOWING="yes"
> ++        fi

Why is this needed?

It seems we need to enable/disable the Qt support depending on Qt
availability and not this patch.

> +diff --git a/ext/qt/gstqtglutility.cc b/ext/qt/gstqtglutility.cc
> +index 4d6d318..c85465f 100644
> +--- a/ext/qt/gstqtglutility.cc
> ++++ b/ext/qt/gstqtglutility.cc
> +@@ -25,10 +25,10 @@
> + #include "gstqtglutility.h"
> + #include <QtGui/QGuiApplication>
> +
> +-#if GST_GL_HAVE_WINDOW_X11 && GST_GL_HAVE_PLATFORM_GLX && defined (HAVE_QT_X11)
> ++#if GST_GL_HAVE_WINDOW_X11 && GST_GL_HAVE_PLATFORM_EGL && defined (HAVE_QT_X11)
> + #include <QX11Info>
> + #include <gst/gl/x11/gstgldisplay_x11.h>
> +-#include <gst/gl/x11/gstglcontext_glx.h>
> ++#include <gst/gl/egl/gstglcontext_egl.h>
> + #endif

Adding a second block using EGL seems more appropriate so we don't
change non-related code.

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 4/4] gstreamer1.0-plugins-bad: Enable opencv on MX6Q & MX6QP
  2017-05-26  5:32 ` [PATCH 4/4] gstreamer1.0-plugins-bad: Enable opencv on MX6Q & MX6QP Yuqing Zhu
@ 2017-05-28 23:28   ` Otavio Salvador
  2017-05-31  9:09     ` Carol Zhu
  0 siblings, 1 reply; 9+ messages in thread
From: Otavio Salvador @ 2017-05-28 23:28 UTC (permalink / raw)
  To: Yuqing Zhu; +Cc: meta-freescale

On Fri, May 26, 2017 at 2:32 AM, Yuqing Zhu <carol.zhu@nxp.com> wrote:
> Signed-off-by: Yuqing Zhu <carol.zhu@nxp.com>
> ---
>  recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.%.bbappend | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.%.bbappend b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.%.bbappend
> index dccc3a9..7b4008e 100644
> --- a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.%.bbappend
> +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.%.bbappend
> @@ -6,6 +6,8 @@ PACKAGECONFIG_GL_imxgpu2d = "${@bb.utils.contains('DISTRO_FEATURES', 'opengl x11
>
>  PACKAGECONFIG_GL_imxgpu3d = "${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'gles2', '', d)}"
>
> +PACKAGECONFIG_append_mx6q = " opencv"
> +PACKAGECONFIG_append_mx6qp = " opencv"

Adding for imxgpu3d makes more sense to me; why not?

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 4/4] gstreamer1.0-plugins-bad: Enable opencv on MX6Q & MX6QP
  2017-05-28 23:28   ` Otavio Salvador
@ 2017-05-31  9:09     ` Carol Zhu
  0 siblings, 0 replies; 9+ messages in thread
From: Carol Zhu @ 2017-05-31  9:09 UTC (permalink / raw)
  To: Otavio Salvador; +Cc: meta-freescale

Hi Otavio,
     Thanks for your reply.
     Actually the gst opencv plugin has no platform restriction.
     It just depends on opencv.
     But it will cause too much time to compile opencv.
     And for now, one i.MX application needs this gst opencv plugin only on MX6Q & MX6QP as they have better performance.
     


B.R.
Carol

-----Original Message-----
From: Otavio Salvador [mailto:otavio.salvador@ossystems.com.br] 
Sent: Monday, May 29, 2017 7:28 AM
To: Carol Zhu <carol.zhu@nxp.com>
Cc: meta-freescale@yoctoproject.org
Subject: Re: [meta-freescale] [PATCH 4/4] gstreamer1.0-plugins-bad: Enable opencv on MX6Q & MX6QP

On Fri, May 26, 2017 at 2:32 AM, Yuqing Zhu <carol.zhu@nxp.com> wrote:
> Signed-off-by: Yuqing Zhu <carol.zhu@nxp.com>
> ---
>  recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.%.bbappend | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.%.bbappend b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.%.bbappend
> index dccc3a9..7b4008e 100644
> --- a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.%.bbappend
> +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.%.bbappend
> @@ -6,6 +6,8 @@ PACKAGECONFIG_GL_imxgpu2d = "${@bb.utils.contains('DISTRO_FEATURES', 'opengl x11
>
>  PACKAGECONFIG_GL_imxgpu3d = "${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'gles2', '', d)}"
>
> +PACKAGECONFIG_append_mx6q = " opencv"
> +PACKAGECONFIG_append_mx6qp = " opencv"

Adding for imxgpu3d makes more sense to me; why not?

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/4] gstreamer1.0-plugins-bad: Add i.mx specific code about qmlglplugin
  2017-05-28 23:26   ` Otavio Salvador
@ 2017-05-31  9:17     ` Carol Zhu
  0 siblings, 0 replies; 9+ messages in thread
From: Carol Zhu @ 2017-05-31  9:17 UTC (permalink / raw)
  To: Otavio Salvador; +Cc: meta-freescale

Hi Otavio,

    Your idea about adding a second block using EGL is good.
    We will update it in next release.
    Thanks~
  


B.R.
Carol
-----Original Message-----
From: Otavio Salvador [mailto:otavio.salvador@ossystems.com.br] 
Sent: Monday, May 29, 2017 7:27 AM
To: Carol Zhu <carol.zhu@nxp.com>
Cc: meta-freescale@yoctoproject.org
Subject: Re: [meta-freescale] [PATCH 2/4] gstreamer1.0-plugins-bad: Add i.mx specific code about qmlglplugin

On Fri, May 26, 2017 at 2:32 AM, Yuqing Zhu <carol.zhu@nxp.com> wrote:
> *Add FB and X11 support for qml gl plugins *Use Render-to-texture for 
> texture copy since  we use direct viv for GPU download
>
> Signed-off-by: Yuqing Zhu <carol.zhu@nxp.com>
> ---
>  .../0008-qmlglplugin-Add-i.mx-specific-code.patch  | 203 +++++++++++++++++++++
>  .../gstreamer1.0-plugins-bad_1.10.%.bbappend       |   1 +
>  2 files changed, 204 insertions(+)
>  create mode 100755 
> recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0008-qmlglplugin
> -Add-i.mx-specific-code.patch
>
> diff --git 
> a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0008-qmlglplug
> in-Add-i.mx-specific-code.patch 
> b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0008-qmlglplug
> in-Add-i.mx-specific-code.patch
> new file mode 100755
> index 0000000..c5e1775
> --- /dev/null
> +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0008-qmlgl
> +++ plugin-Add-i.mx-specific-code.patch
> @@ -0,0 +1,203 @@
> +From 2afb646ca0cb911a7735ed5512ebc4a8f02ad052 Mon Sep 17 00:00:00 
> +2001
> +From: Haihua Hu <jared.hu@nxp.com>
> +Date: Mon, 14 Nov 2016 14:34:47 +0800
> +Subject: [PATCH 19/24] qmlglplugin: Add i.mx specific code
> +
> +1.Add FB and X11 support for qml gl plugins 2.Use Render-to-texture 
> +for texture copy since we use direct viv
> +  for GPU download.
> +
> +Upstream-Status: Inappropriate [i.MX specific]
> +
> +Signed-off-by: Haihua Hu <jared.hu@nxp.com>
> +---
> + configure.ac             |  9 +++++++--
> + ext/qt/gstqtglutility.cc | 17 +++++++++++++---
> + ext/qt/qtwindow.cc       | 50 +++++++++++++++++++++++++++++++++++++++++++++++-
> + ext/qt/qtwindow.h        |  1 +
> + 4 files changed, 71 insertions(+), 6 deletions(-)
> +
> +diff --git a/configure.ac b/configure.ac index 0876a14..a4cc878 
> +100644
> +--- a/configure.ac
> ++++ b/configure.ac
> +@@ -2967,12 +2967,12 @@ AG_GST_CHECK_FEATURE(QT, [Qt elements], qt, [
> +         HAVE_QT="yes"
> +         HAVE_QT_WINDOWING="no"
> +         QT_VERSION="`$PKG_CONFIG --modversion Qt5Core`"
> +-        QPA_INCLUDE_PATH=`$PKG_CONFIG --variable=includedir Qt5Core`/QtGui/${QT_VERSION}/QtGui
> ++        QPA_INCLUDE_PATH=${STAGING_INCDIR}/../../`$PKG_CONFIG 
> ++ --variable=includedir Qt5Core`/QtGui/${QT_VERSION}/QtGui

This is a hack and should not be part of the patch. PKG_CONFIG behaves well inside OE environment so it is not needed.

> +         AS_IF([test -f "$QPA_INCLUDE_PATH/qpa/qplatformnativeinterface.h"], [
> +           QT_CFLAGS="$QT_CFLAGS -I$QPA_INCLUDE_PATH"
> +           HAVE_QT_QPA_HEADER="yes"
> +         ], [AC_MSG_NOTICE([Cannot find QPA])])
> +-        if test "x$GST_GL_HAVE_WINDOW_X11" = "x1" -a "x$GST_GL_HAVE_PLATFORM_GLX" = "x1"; then
> ++        if test "x$GST_GL_HAVE_WINDOW_X11" = "x1" -a 
> ++ "x$GST_GL_HAVE_PLATFORM_EGL" = "x1"; then

if test "x$GST_GL_HAVE_WINDOW_X11" = "x1"; then ???

> +           PKG_CHECK_MODULES(QT_X11, Qt5X11Extras, [
> +             AC_DEFINE([HAVE_QT_X11], [], [Define if Qt X11 integration is installed])
> +             QT_CFLAGS="$QT_CFLAGS $QT_X11_CFLAGS"
> +@@ -3032,6 +3032,11 @@ AG_GST_CHECK_FEATURE(QT, [Qt elements], qt, [
> +             HAVE_QT_WINDOWING="yes"
> +           fi
> +         fi
> ++        if test "x$GST_GL_HAVE_WINDOW_FB" = "x1" -a "x$GST_GL_HAVE_PLATFORM_EGL" = "x1"; then
> ++          QT_CFLAGS="$QT_CFLAGS"
> ++          QT_LIBS="$QT_LIBS"
> ++          HAVE_QT_WINDOWING="yes"
> ++        fi

Why is this needed?

It seems we need to enable/disable the Qt support depending on Qt availability and not this patch.

> +diff --git a/ext/qt/gstqtglutility.cc b/ext/qt/gstqtglutility.cc 
> +index 4d6d318..c85465f 100644
> +--- a/ext/qt/gstqtglutility.cc
> ++++ b/ext/qt/gstqtglutility.cc
> +@@ -25,10 +25,10 @@
> + #include "gstqtglutility.h"
> + #include <QtGui/QGuiApplication>
> +
> +-#if GST_GL_HAVE_WINDOW_X11 && GST_GL_HAVE_PLATFORM_GLX && defined 
> +(HAVE_QT_X11)
> ++#if GST_GL_HAVE_WINDOW_X11 && GST_GL_HAVE_PLATFORM_EGL && defined 
> ++(HAVE_QT_X11)
> + #include <QX11Info>
> + #include <gst/gl/x11/gstgldisplay_x11.h> -#include 
> +<gst/gl/x11/gstglcontext_glx.h>
> ++#include <gst/gl/egl/gstglcontext_egl.h>
> + #endif

Adding a second block using EGL seems more appropriate so we don't change non-related code.

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-05-31 13:43 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-26  5:32 [PATCH 0/4] Add some Gstreamer patches for v1.10 Yuqing Zhu
2017-05-26  5:32 ` [PATCH 1/4] gstreamer1.0-plugins-base: Don't set async of custom text-sink to false in gstplaysink Yuqing Zhu
2017-05-26  5:32 ` [PATCH 2/4] gstreamer1.0-plugins-bad: Add i.mx specific code about qmlglplugin Yuqing Zhu
2017-05-28 23:26   ` Otavio Salvador
2017-05-31  9:17     ` Carol Zhu
2017-05-26  5:32 ` [PATCH 3/4] gstreamer1.0-plugins-bad: Add some gstplayer API Yuqing Zhu
2017-05-26  5:32 ` [PATCH 4/4] gstreamer1.0-plugins-bad: Enable opencv on MX6Q & MX6QP Yuqing Zhu
2017-05-28 23:28   ` Otavio Salvador
2017-05-31  9:09     ` Carol Zhu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.