Re: [oe] [meta-qt5][PATCH] QtGstreamer recipe with patches for IMX6 support.

2014-07-31 Thread Carlos Rafael Giani
The patches are imx6 specific, so they should not be part of meta-qt5. 
Instead, add them to meta-fsl-arm , write a .bbappend for them.


Also, I am confused. The summary at the beginning lists: 
"0002-Set-playbin-s-flags-as-native-video-audio-in-case-of.patch" , but 
in the recipe I see 
"0002-qtgstreamer-Temporarry-set-native-video-playbin-s-fl.patch" ?




On 07/31/2014 06:37 PM, Ilya Smelykh wrote:

---
  recipes-qt/qt5/qtgstreamer.inc |  12 +
  ...-i.MX6-zero-copy-rendering-implementation.patch | 249 +
  ...-s-flags-as-native-video-audio-in-case-of.patch |  60 +
  recipes-qt/qt5/qtgstreamer_git.bb  |  44 
  4 files changed, 365 insertions(+)
  create mode 100644 recipes-qt/qt5/qtgstreamer.inc
  create mode 100644 
recipes-qt/qt5/qtgstreamer/0001-Added-i.MX6-zero-copy-rendering-implementation.patch
  create mode 100644 
recipes-qt/qt5/qtgstreamer/0002-Set-playbin-s-flags-as-native-video-audio-in-case-of.patch
  create mode 100644 recipes-qt/qt5/qtgstreamer_git.bb

diff --git a/recipes-qt/qt5/qtgstreamer.inc b/recipes-qt/qt5/qtgstreamer.inc
new file mode 100644
index 000..6a8bd57
--- /dev/null
+++ b/recipes-qt/qt5/qtgstreamer.inc
@@ -0,0 +1,12 @@
+require qt5.inc
+
+LICENSE = "GPLv2 & LGPLv2 & LGPLv2.1"
+SECTION = "multimedia"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
+file://COPYING-LGPL-2;md5=5f30f0716dfdd0d91eb439ebec522ec2 
\
+
file://COPYING-LGPL-2.1;md5=fbc093901857fcd118f065f900982c24"
+
+DEPENDS += "qtbase qtdeclarative boost"
+
+PACKAGECONFIG ??= "examples"
+PACKAGECONFIG[examples] = "-DQTGSTREAMER_EXAMPLES=ON, 
-DQTGSTREAMER_EXAMPLES=OFF"
diff --git 
a/recipes-qt/qt5/qtgstreamer/0001-Added-i.MX6-zero-copy-rendering-implementation.patch
 
b/recipes-qt/qt5/qtgstreamer/0001-Added-i.MX6-zero-copy-rendering-implementation.patch
new file mode 100644
index 000..dd5658a
--- /dev/null
+++ 
b/recipes-qt/qt5/qtgstreamer/0001-Added-i.MX6-zero-copy-rendering-implementation.patch
@@ -0,0 +1,249 @@
+From c36ea48f3f4f0ad1b07a18c3717bd049ac24e32c Mon Sep 17 00:00:00 2001
+From: Benjamin Federau 
+Date: Mon, 12 May 2014 17:31:12 +0200
+Subject: [PATCH] Added i.MX6 zero-copy rendering implementation
+
+---
+ CMakeLists.txt |   11 +++
+ elements/gstqtvideosink/CMakeLists.txt |4 +
+ elements/gstqtvideosink/painters/videomaterial.cpp |   84 
+ elements/gstqtvideosink/painters/videomaterial.h   |8 ++
+ 4 files changed, 107 insertions(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 9304fc3..86dbd46 100644
+--- a/CMakeLists.txt
 b/CMakeLists.txt
+@@ -19,6 +19,8 @@ option(USE_QT_PLUGIN_DIR "Install qt plugins at the system 
location" ON)
+ include(GNUInstallDirs)
+ include(MacroLogFeature)
+
++set(HW_PLATFORM "none" CACHE STRING "Specific hardware platform used for the 
build")
++
+ set(Qt4_MIN_VERSION 4.7)
+ set(Qt5_MIN_VERSION 5.0.0)
+ find_package(Qt4or5 COMPONENTS Core Gui Widgets OPTIONAL_COMPONENTS OpenGL 
Quick1 Quick2 Qml Test)
+@@ -173,6 +175,15 @@ else()
+ endif()
+ endif()
+
++# Enable hardware specific functionality
++if (${HW_PLATFORM} STREQUAL "imx6")
++message(STATUS "Enabled hardware platform: Freescale i.MX6")
++set(USE_HW_PLATFORM TRUE)
++set(QTGSTREAMER_HW_PLATFORM "-DHW_PLATFORM_IMX6")
++else()
++set(USE_HW_PLATFORM FALSE)
++endif()
++
+
+ if (QTGSTREAMER_CODEGEN AND FLEX_FOUND AND BISON_FOUND)
+ add_subdirectory(codegen)
+diff --git a/elements/gstqtvideosink/CMakeLists.txt 
b/elements/gstqtvideosink/CMakeLists.txt
+index ddb3da9..307c434 100644
+--- a/elements/gstqtvideosink/CMakeLists.txt
 b/elements/gstqtvideosink/CMakeLists.txt
+@@ -57,6 +57,10 @@ add_definitions(
+ -DQWIDGETVIDEOSINK_NAME="${QWIDGETVIDEOSINK_NAME}"
+ )
+
++if (USE_HW_PLATFORM)
++add_definitions(${QTGSTREAMER_HW_PLATFORM})
++endif()
++
+ if (GstQtVideoSink_LINK_OPENGL)
+ if (OPENGLES2_FOUND)
+ set(GstQtVideoSink_GL_LIBS ${OPENGLES2_LIBRARY})
+diff --git a/elements/gstqtvideosink/painters/videomaterial.cpp 
b/elements/gstqtvideosink/painters/videomaterial.cpp
+index 7711415..b9a83f7 100644
+--- a/elements/gstqtvideosink/painters/videomaterial.cpp
 b/elements/gstqtvideosink/painters/videomaterial.cpp
+@@ -95,6 +95,18 @@ inline const char * const 
qtvideosink_glsl_yuvPlanarFragmentShader()
+ "}\n";
+ }
+
++inline const char * const qtvideosink_glsl_vivanteFragmentShader()
++{
++return
++"uniform sampler2D texture;\n"
++"uniform lowp float opacity;\n"
++"varying highp vec2 qt_TexCoord;\n"
++"void main(void)\n"
++"{\n"
++"gl_FragColor = texture2D( texture, qt_TexCoord ) * opacity;\n"
++"}\n";
++}
++
+ class VideoMaterialShader : public QSGMaterialShader
+ {
+ public:
+@@ -104,6 +116,10 @@ public:
+ Q_UNUSED(oldMaterial);
+
+ VideoMaterial *material = static_cast(newMaterial);
++
++#ifdef HW_PLATFO

[oe] [meta-qt5][PATCH] QtGstreamer recipe with patches for IMX6 support.

2014-07-31 Thread Ilya Smelykh
---
 recipes-qt/qt5/qtgstreamer.inc |  12 +
 ...-i.MX6-zero-copy-rendering-implementation.patch | 249 +
 ...-s-flags-as-native-video-audio-in-case-of.patch |  60 +
 recipes-qt/qt5/qtgstreamer_git.bb  |  44 
 4 files changed, 365 insertions(+)
 create mode 100644 recipes-qt/qt5/qtgstreamer.inc
 create mode 100644 
recipes-qt/qt5/qtgstreamer/0001-Added-i.MX6-zero-copy-rendering-implementation.patch
 create mode 100644 
recipes-qt/qt5/qtgstreamer/0002-Set-playbin-s-flags-as-native-video-audio-in-case-of.patch
 create mode 100644 recipes-qt/qt5/qtgstreamer_git.bb

diff --git a/recipes-qt/qt5/qtgstreamer.inc b/recipes-qt/qt5/qtgstreamer.inc
new file mode 100644
index 000..6a8bd57
--- /dev/null
+++ b/recipes-qt/qt5/qtgstreamer.inc
@@ -0,0 +1,12 @@
+require qt5.inc
+
+LICENSE = "GPLv2 & LGPLv2 & LGPLv2.1"
+SECTION = "multimedia"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
+file://COPYING-LGPL-2;md5=5f30f0716dfdd0d91eb439ebec522ec2 
\
+
file://COPYING-LGPL-2.1;md5=fbc093901857fcd118f065f900982c24"
+
+DEPENDS += "qtbase qtdeclarative boost"
+
+PACKAGECONFIG ??= "examples"
+PACKAGECONFIG[examples] = "-DQTGSTREAMER_EXAMPLES=ON, 
-DQTGSTREAMER_EXAMPLES=OFF"
diff --git 
a/recipes-qt/qt5/qtgstreamer/0001-Added-i.MX6-zero-copy-rendering-implementation.patch
 
b/recipes-qt/qt5/qtgstreamer/0001-Added-i.MX6-zero-copy-rendering-implementation.patch
new file mode 100644
index 000..dd5658a
--- /dev/null
+++ 
b/recipes-qt/qt5/qtgstreamer/0001-Added-i.MX6-zero-copy-rendering-implementation.patch
@@ -0,0 +1,249 @@
+From c36ea48f3f4f0ad1b07a18c3717bd049ac24e32c Mon Sep 17 00:00:00 2001
+From: Benjamin Federau 
+Date: Mon, 12 May 2014 17:31:12 +0200
+Subject: [PATCH] Added i.MX6 zero-copy rendering implementation
+
+---
+ CMakeLists.txt |   11 +++
+ elements/gstqtvideosink/CMakeLists.txt |4 +
+ elements/gstqtvideosink/painters/videomaterial.cpp |   84 
+ elements/gstqtvideosink/painters/videomaterial.h   |8 ++
+ 4 files changed, 107 insertions(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 9304fc3..86dbd46 100644
+--- a/CMakeLists.txt
 b/CMakeLists.txt
+@@ -19,6 +19,8 @@ option(USE_QT_PLUGIN_DIR "Install qt plugins at the system 
location" ON)
+ include(GNUInstallDirs)
+ include(MacroLogFeature)
+ 
++set(HW_PLATFORM "none" CACHE STRING "Specific hardware platform used for the 
build")
++
+ set(Qt4_MIN_VERSION 4.7)
+ set(Qt5_MIN_VERSION 5.0.0)
+ find_package(Qt4or5 COMPONENTS Core Gui Widgets OPTIONAL_COMPONENTS OpenGL 
Quick1 Quick2 Qml Test)
+@@ -173,6 +175,15 @@ else()
+ endif()
+ endif()
+ 
++# Enable hardware specific functionality
++if (${HW_PLATFORM} STREQUAL "imx6")
++message(STATUS "Enabled hardware platform: Freescale i.MX6")
++set(USE_HW_PLATFORM TRUE)
++set(QTGSTREAMER_HW_PLATFORM "-DHW_PLATFORM_IMX6")
++else()
++set(USE_HW_PLATFORM FALSE)
++endif()
++
+ 
+ if (QTGSTREAMER_CODEGEN AND FLEX_FOUND AND BISON_FOUND)
+ add_subdirectory(codegen)
+diff --git a/elements/gstqtvideosink/CMakeLists.txt 
b/elements/gstqtvideosink/CMakeLists.txt
+index ddb3da9..307c434 100644
+--- a/elements/gstqtvideosink/CMakeLists.txt
 b/elements/gstqtvideosink/CMakeLists.txt
+@@ -57,6 +57,10 @@ add_definitions(
+ -DQWIDGETVIDEOSINK_NAME="${QWIDGETVIDEOSINK_NAME}"
+ )
+ 
++if (USE_HW_PLATFORM)
++add_definitions(${QTGSTREAMER_HW_PLATFORM})
++endif()
++
+ if (GstQtVideoSink_LINK_OPENGL)
+ if (OPENGLES2_FOUND)
+ set(GstQtVideoSink_GL_LIBS ${OPENGLES2_LIBRARY})
+diff --git a/elements/gstqtvideosink/painters/videomaterial.cpp 
b/elements/gstqtvideosink/painters/videomaterial.cpp
+index 7711415..b9a83f7 100644
+--- a/elements/gstqtvideosink/painters/videomaterial.cpp
 b/elements/gstqtvideosink/painters/videomaterial.cpp
+@@ -95,6 +95,18 @@ inline const char * const 
qtvideosink_glsl_yuvPlanarFragmentShader()
+ "}\n";
+ }
+ 
++inline const char * const qtvideosink_glsl_vivanteFragmentShader()
++{
++return
++"uniform sampler2D texture;\n"
++"uniform lowp float opacity;\n"
++"varying highp vec2 qt_TexCoord;\n"
++"void main(void)\n"
++"{\n"
++"gl_FragColor = texture2D( texture, qt_TexCoord ) * opacity;\n"
++"}\n";
++}
++
+ class VideoMaterialShader : public QSGMaterialShader
+ {
+ public:
+@@ -104,6 +116,10 @@ public:
+ Q_UNUSED(oldMaterial);
+ 
+ VideoMaterial *material = static_cast(newMaterial);
++
++#ifdef HW_PLATFORM_IMX6
++program()->setUniformValue(m_id_texture, 0);
++#else
+ if (m_id_rgbTexture > 0) {
+ program()->setUniformValue(m_id_rgbTexture, 0);
+ } else {
+@@ -111,6 +127,7 @@ public:
+ program()->setUniformValue(m_id_uTexture, 1);
+ program()->setUniformValue(m_id_vTexture, 2);
+ }
++#endif
+ 
+ if (state.isOpacityDirty()) {
+