summaryrefslogtreecommitdiffstats
path: root/recipes-qt
diff options
context:
space:
mode:
authorOtavio Salvador <otavio@ossystems.com.br>2015-07-15 17:14:27 -0300
committerOtavio Salvador <otavio@ossystems.com.br>2015-07-16 15:01:29 -0300
commitf8517afc7a5ada4538b3b7d397fa32586d57ffe5 (patch)
tree79349f091306d1760fd4687e62336ffa8fb8c721 /recipes-qt
parentc92b415d653afc55f33b6b93fb9248193bfd4fa0 (diff)
downloadmeta-freescale-f8517afc7a5ada4538b3b7d397fa32586d57ffe5.tar.gz
Move meta-fsl-arm content to layer root
The meta-fsl-arm is going to be used as the base for this layer. It contains a clean history and allowing a more granullar set of changes. This commit is just a rename of all contents of meta-fsl-arm subdirectory to this layer's root, subsequent changes are based on top of that. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Diffstat (limited to 'recipes-qt')
-rw-r--r--recipes-qt/qt4/qt4-embedded_%.bbappend1
-rw-r--r--recipes-qt/qt4/qt4-imx-support.inc28
-rw-r--r--recipes-qt/qt4/qt4-x11-free_%.bbappend1
-rw-r--r--recipes-qt/qt4/qt4/0001-Add-support-for-i.MX-codecs-to-phonon.patch468
-rw-r--r--recipes-qt/qt4/qt4/0002-i.MX-video-renderer-Allow-v4l-device-from-environmen.patch46
-rw-r--r--recipes-qt/qt4/qt4/0003-i.MX6-force-egl-visual-ID-33.patch35
-rw-r--r--recipes-qt/qt4/qt4/mx6/g++.conf40
-rw-r--r--recipes-qt/qt4/qt4/mx6/linux.conf66
8 files changed, 685 insertions, 0 deletions
diff --git a/recipes-qt/qt4/qt4-embedded_%.bbappend b/recipes-qt/qt4/qt4-embedded_%.bbappend
new file mode 100644
index 00000000..14324ca1
--- /dev/null
+++ b/recipes-qt/qt4/qt4-embedded_%.bbappend
@@ -0,0 +1 @@
include qt4-imx-support.inc
diff --git a/recipes-qt/qt4/qt4-imx-support.inc b/recipes-qt/qt4/qt4-imx-support.inc
new file mode 100644
index 00000000..69ad67ba
--- /dev/null
+++ b/recipes-qt/qt4/qt4-imx-support.inc
@@ -0,0 +1,28 @@
1FILESEXTRAPATHS_prepend := "${THISDIR}/qt4:"
2
3python __anonymous () {
4 families = ['mx5', 'mx6']
5 cur_families = (d.getVar('SOC_FAMILY', True) or '').split(':')
6 if any(map(lambda x: x in cur_families,
7 families)):
8 d.appendVarFlag('do_configure', 'depends', ' virtual/kernel:do_shared_workdir')
9}
10
11SRC_URI_append_mx5 += "file://0001-Add-support-for-i.MX-codecs-to-phonon.patch"
12SRC_URI_append_mx6 += " \
13 file://0001-Add-support-for-i.MX-codecs-to-phonon.patch \
14 file://0002-i.MX-video-renderer-Allow-v4l-device-from-environmen.patch \
15 file://0003-i.MX6-force-egl-visual-ID-33.patch \
16"
17
18DEPENDS_append_mx5 = " virtual/kernel virtual/libgles2"
19QT_GLFLAGS_mx5 = "-opengl es2 -openvg"
20QT_CONFIG_FLAGS_append_mx5 = " -I${STAGING_KERNEL_DIR}/include/"
21
22DEPENDS_append_mx6 = " virtual/kernel virtual/libgles2"
23QT_GLFLAGS_mx6 = "-opengl es2 -openvg"
24QT_CONFIG_FLAGS_append_mx6 = " -I${STAGING_KERNEL_DIR}/include/uapi \
25 -I${STAGING_KERNEL_DIR}/include/ \
26 -DLINUX=1 -DEGL_API_FB=1 \
27 -DQT_QPA_EXPERIMENTAL_TOUCHEVENT=1"
28
diff --git a/recipes-qt/qt4/qt4-x11-free_%.bbappend b/recipes-qt/qt4/qt4-x11-free_%.bbappend
new file mode 100644
index 00000000..14324ca1
--- /dev/null
+++ b/recipes-qt/qt4/qt4-x11-free_%.bbappend
@@ -0,0 +1 @@
include qt4-imx-support.inc
diff --git a/recipes-qt/qt4/qt4/0001-Add-support-for-i.MX-codecs-to-phonon.patch b/recipes-qt/qt4/qt4/0001-Add-support-for-i.MX-codecs-to-phonon.patch
new file mode 100644
index 00000000..1213650c
--- /dev/null
+++ b/recipes-qt/qt4/qt4/0001-Add-support-for-i.MX-codecs-to-phonon.patch
@@ -0,0 +1,468 @@
1From 2ff5682e42771519757756dedbf27b7a9e8e25d9 Mon Sep 17 00:00:00 2001
2From: Rogerio Pimentel <rogerio.pimentel@freescale.com>
3Date: Tue, 24 Jul 2012 13:47:01 -0300
4Subject: [PATCH] Add support for i.MX codecs to phonon
5
6Add support for i.MX codecs to phonon
7
8Signed-off-by: Daniele Dall'Acqua <daniele.d@freescale.com>
9Signed-off-by: Rogerio Pimentel <rogerio.pimentel@freescale.com>
10---
11 src/3rdparty/phonon/gstreamer/abstractrenderer.h | 1 +
12 src/3rdparty/phonon/gstreamer/mediaobject.cpp | 4 +
13 src/3rdparty/phonon/gstreamer/videowidget.cpp | 60 ++------
14 src/3rdparty/phonon/gstreamer/videowidget.h | 1 +
15 src/3rdparty/phonon/gstreamer/widgetrenderer.cpp | 169 ++++++++++++++--------
16 src/3rdparty/phonon/gstreamer/widgetrenderer.h | 17 ++-
17 src/3rdparty/phonon/gstreamer/x11renderer.cpp | 22 +---
18 7 files changed, 141 insertions(+), 133 deletions(-)
19
20diff --git a/src/3rdparty/phonon/gstreamer/abstractrenderer.h b/src/3rdparty/phonon/gstreamer/abstractrenderer.h
21index 10a2822..fa0d87d 100644
22--- a/src/3rdparty/phonon/gstreamer/abstractrenderer.h
23+++ b/src/3rdparty/phonon/gstreamer/abstractrenderer.h
24@@ -49,6 +49,7 @@ public:
25 virtual bool eventFilter(QEvent *) = 0;
26 virtual void handlePaint(QPaintEvent *) {}
27 virtual bool paintsOnWidget() { return true; } // Controls overlays
28+ virtual void handleMove(QMoveEvent * event ) {};
29
30 protected:
31 VideoWidget *m_videoWidget;
32diff --git a/src/3rdparty/phonon/gstreamer/mediaobject.cpp b/src/3rdparty/phonon/gstreamer/mediaobject.cpp
33index 23a60c0..f806d64 100644
34--- a/src/3rdparty/phonon/gstreamer/mediaobject.cpp
35+++ b/src/3rdparty/phonon/gstreamer/mediaobject.cpp
36@@ -515,6 +515,9 @@ void MediaObject::createPipeline()
37 // reduce buffer overruns as these are not gracefully handled at the moment.
38 m_audioPipe = gst_element_factory_make("queue", NULL);
39 g_object_set(G_OBJECT(m_audioPipe), "max-size-time", MAX_QUEUE_TIME, (const char*)NULL);
40+ g_object_set(G_OBJECT(m_audioPipe), "max-size-time", 0, (const char*)NULL);
41+ g_object_set(G_OBJECT(m_audioPipe), "max-size-buffers", 0, (const char*)NULL);
42+ g_object_set(G_OBJECT(m_audioPipe), "max-size-bytes", 0, (const char*)NULL);
43 gst_bin_add(GST_BIN(m_audioGraph), m_audioPipe);
44 GstPad *audiopad = gst_element_get_pad (m_audioPipe, "sink");
45 gst_element_add_pad (m_audioGraph, gst_ghost_pad_new ("sink", audiopad));
46@@ -527,6 +530,7 @@ void MediaObject::createPipeline()
47
48 m_videoPipe = gst_element_factory_make("queue", NULL);
49 g_object_set(G_OBJECT(m_videoPipe), "max-size-time", MAX_QUEUE_TIME, (const char*)NULL);
50+ g_object_set(G_OBJECT(m_videoPipe), "max-size-time", 33000, (const char*)NULL);
51 gst_bin_add(GST_BIN(m_videoGraph), m_videoPipe);
52 GstPad *videopad = gst_element_get_pad (m_videoPipe, "sink");
53 gst_element_add_pad (m_videoGraph, gst_ghost_pad_new ("sink", videopad));
54diff --git a/src/3rdparty/phonon/gstreamer/videowidget.cpp b/src/3rdparty/phonon/gstreamer/videowidget.cpp
55index a4c6f79..3682d3f 100644
56--- a/src/3rdparty/phonon/gstreamer/videowidget.cpp
57+++ b/src/3rdparty/phonon/gstreamer/videowidget.cpp
58@@ -83,50 +83,16 @@ void VideoWidget::setupVideoBin()
59 Q_ASSERT(m_videoBin);
60 gst_object_ref (GST_OBJECT (m_videoBin)); //Take ownership
61 gst_object_sink (GST_OBJECT (m_videoBin));
62-
63- //The videoplug element is the final element before the pluggable videosink
64- m_videoplug = gst_element_factory_make ("identity", NULL);
65-
66- //Colorspace ensures that the output of the stream matches the input format accepted by our video sink
67- m_colorspace = gst_element_factory_make ("ffmpegcolorspace", NULL);
68-
69- //Video scale is used to prepare the correct aspect ratio and scale.
70- GstElement *videoScale = gst_element_factory_make ("videoscale", NULL);
71-
72- //We need a queue to support the tee from parent node
73- GstElement *queue = gst_element_factory_make ("queue", NULL);
74-
75- if (queue && m_videoBin && videoScale && m_colorspace && videoSink && m_videoplug) {
76- //Ensure that the bare essentials are prepared
77- gst_bin_add_many (GST_BIN (m_videoBin), queue, m_colorspace, m_videoplug, videoScale, videoSink, (const char*)NULL);
78- bool success = false;
79- //Video balance controls color/sat/hue in the YUV colorspace
80- m_videoBalance = gst_element_factory_make ("videobalance", NULL);
81- if (m_videoBalance) {
82- // For video balance to work we have to first ensure that the video is in YUV colorspace,
83- // then hand it off to the videobalance filter before finally converting it back to RGB.
84- // Hence we nede a videoFilter to convert the colorspace before and after videobalance
85- GstElement *m_colorspace2 = gst_element_factory_make ("ffmpegcolorspace", NULL);
86- gst_bin_add_many(GST_BIN(m_videoBin), m_videoBalance, m_colorspace2, (const char*)NULL);
87- success = gst_element_link_many(queue, m_colorspace, m_videoBalance, m_colorspace2, videoScale, m_videoplug, videoSink, (const char*)NULL);
88- } else {
89- //If video balance is not available, just connect to sink directly
90- success = gst_element_link_many(queue, m_colorspace, videoScale, m_videoplug, videoSink, (const char*)NULL);
91- }
92-
93- if (success) {
94- GstPad *videopad = gst_element_get_pad (queue, "sink");
95- gst_element_add_pad (m_videoBin, gst_ghost_pad_new ("sink", videopad));
96- gst_object_unref (videopad);
97-#ifndef Q_WS_QPA
98- QWidget *parentWidget = qobject_cast<QWidget*>(parent());
99- if (parentWidget)
100- parentWidget->winId(); // Due to some existing issues with alien in 4.4,
101- // we must currently force the creation of a parent widget.
102-#endif
103- m_isValid = true; //initialization ok, accept input
104- }
105- }
106+ gst_bin_add_many (GST_BIN (m_videoBin), videoSink, NULL);
107+ GstPad *videopad = gst_element_get_pad (videoSink,"sink");
108+ gst_element_add_pad (m_videoBin, gst_ghost_pad_new ("sink", videopad));
109+ gst_object_unref (videopad);
110+ QWidget *parentWidget = qobject_cast<QWidget*>(parent());
111+
112+ if (parentWidget)
113+ parentWidget->winId(); // Due to some existing issues with alien in 4.4,
114+ // we must currently force the creation of a parent widget.
115+ m_isValid = true; //initialization ok, accept input
116 }
117
118 void VideoWidget::paintEvent(QPaintEvent *event)
119@@ -135,6 +101,12 @@ void VideoWidget::paintEvent(QPaintEvent *event)
120 m_renderer->handlePaint(event);
121 }
122
123+void VideoWidget::moveEvent(QMoveEvent * event )
124+{
125+ Q_ASSERT(m_renderer);
126+ m_renderer->handleMove(event);
127+}
128+
129 void VideoWidget::setVisible(bool val) {
130 Q_ASSERT(m_renderer);
131
132diff --git a/src/3rdparty/phonon/gstreamer/videowidget.h b/src/3rdparty/phonon/gstreamer/videowidget.h
133index 8603f6a..38c7b17 100644
134--- a/src/3rdparty/phonon/gstreamer/videowidget.h
135+++ b/src/3rdparty/phonon/gstreamer/videowidget.h
136@@ -65,6 +65,7 @@ public:
137 qreal saturation() const;
138 void setSaturation(qreal);
139 void setMovieSize(const QSize &size);
140+ void moveEvent(QMoveEvent * event );
141 QSize sizeHint() const;
142 QRect scaleToAspect(QRect srcRect, int w, int h) const;
143 QRect calculateDrawFrameRect() const;
144diff --git a/src/3rdparty/phonon/gstreamer/widgetrenderer.cpp b/src/3rdparty/phonon/gstreamer/widgetrenderer.cpp
145index 423af9d..aa4925a 100644
146--- a/src/3rdparty/phonon/gstreamer/widgetrenderer.cpp
147+++ b/src/3rdparty/phonon/gstreamer/widgetrenderer.cpp
148@@ -15,7 +15,9 @@
149 along with this library. If not, see <http://www.gnu.org/licenses/>.
150 */
151
152+#include <QMouseEvent>
153 #include <QtGui/QPainter>
154+#include <QPaintEvent>
155 #include <gst/gst.h>
156 #include "common.h"
157 #include "message.h"
158@@ -24,6 +26,18 @@
159 #include "widgetrenderer.h"
160 #include "qrgb.h"
161
162+#include <stdio.h>
163+#include <stdlib.h>
164+#include <errno.h>
165+#include <stdint.h>
166+#include <fcntl.h>
167+#include <sys/ioctl.h>
168+#include <unistd.h>
169+#include <linux/mxcfb.h>
170+
171+#define MXCFB_GBL_ALPHA 255
172+#define MXCFB_CLR_KEY 0x00000000 // ARGB8888
173+
174 // support old OpenGL installations (1.2)
175 // assume that if TEXTURE0 isn't defined, none are
176 #ifndef GL_TEXTURE0
177@@ -35,26 +49,6 @@
178 #ifndef QT_NO_PHONON_VIDEO
179 QT_BEGIN_NAMESPACE
180
181-static void frameRendered()
182-{
183- static QString displayFps = qgetenv("PHONON_GST_FPS");
184- if (displayFps.isEmpty())
185- return;
186-
187- static int frames = 0;
188- static QTime lastTime = QTime::currentTime();
189- QTime time = QTime::currentTime();
190-
191- int delta = lastTime.msecsTo(time);
192- if (delta > 2000) {
193- printf("FPS: %f\n", 1000.0 * frames / qreal(delta));
194- lastTime = time;
195- frames = 0;
196- }
197-
198- ++frames;
199-}
200-
201 namespace Phonon
202 {
203 namespace Gstreamer
204@@ -62,17 +56,11 @@ namespace Gstreamer
205
206 WidgetRenderer::WidgetRenderer(VideoWidget *videoWidget)
207 : AbstractRenderer(videoWidget)
208- , m_width(0)
209- , m_height(0)
210 {
211- videoWidget->backend()->logMessage("Creating QWidget renderer");
212- if ((m_videoSink = GST_ELEMENT(g_object_new(get_type_RGB(), NULL)))) {
213- gst_object_ref (GST_OBJECT (m_videoSink)); //Take ownership
214+ if ((m_videoSink = gst_element_factory_make("mfw_v4lsink", NULL)) && m_videoSink != NULL) {
215+
216+ gst_object_ref (GST_OBJECT (m_videoSink)); //Take ownership
217 gst_object_sink (GST_OBJECT (m_videoSink));
218-
219- QWidgetVideoSinkBase* sink = reinterpret_cast<QWidgetVideoSinkBase*>(m_videoSink);
220- // Let the videosink know which widget to direct frame updates to
221- sink->renderWidget = videoWidget;
222 }
223
224 // Clear the background with black by default
225@@ -84,67 +72,124 @@ WidgetRenderer::WidgetRenderer(VideoWidget *videoWidget)
226 m_videoWidget->setAttribute(Qt::WA_PaintOnScreen, false);
227 }
228
229-void WidgetRenderer::setNextFrame(const QByteArray &array, int w, int h)
230+WidgetRenderer::~WidgetRenderer()
231 {
232- if (m_videoWidget->root()->state() == Phonon::LoadingState)
233- return;
234-
235- m_frame = QImage();
236- {
237- m_frame = QImage((uchar *)array.constData(), w, h, QImage::Format_RGB32);
238- }
239+ if (m_videoSink) {
240+ gst_object_unref (GST_OBJECT (m_videoSink));
241+ m_videoSink = 0;
242+ }
243+}
244
245- m_array = array;
246- m_width = w;
247- m_height = h;
248+void WidgetRenderer::setVideoSize(void)
249+{
250
251- m_videoWidget->update();
252+ int adj_x;
253+ int adj_y;
254+
255+ QSize wSize = m_videoWidget->size();
256+ m_drawFrameRect = m_videoWidget->calculateDrawFrameRect();
257+ framePos = m_videoWidget->mapToGlobal(QPoint(0,0));
258+
259+ //Center the video in the widget
260+
261+ adj_x = (wSize.width()/2) - (m_drawFrameRect.width()/2);
262+ adj_y = (wSize.height()/2) - (m_drawFrameRect.height()/2);
263+ g_object_set(G_OBJECT(m_videoSink), "axis-left",adj_x + framePos.x(),(const char*)NULL);
264+ g_object_set(G_OBJECT(m_videoSink), "axis-top", adj_y + framePos.y(), (const char*)NULL);
265+ g_object_set(G_OBJECT(m_videoSink), "disp-width", m_drawFrameRect.width(), (const char*)NULL);
266+ g_object_set(G_OBJECT(m_videoSink), "disp-height", m_drawFrameRect.height(), (const char*)NULL);
267+ g_object_set(G_OBJECT(m_videoSink), "setpara", 1, (const char*)NULL);
268 }
269
270 void WidgetRenderer::handleMediaNodeEvent(const MediaNodeEvent *event)
271 {
272 switch (event->type()) {
273- case MediaNodeEvent::SourceChanged:
274- {
275- clearFrame();
276- break;
277- }
278 default:
279 break;
280 }
281 }
282
283-void WidgetRenderer::clearFrame()
284+void WidgetRenderer::handlePaint(QPaintEvent *event)
285 {
286- m_frame = QImage();
287- m_array = QByteArray();
288- m_videoWidget->update();
289+ Q_UNUSED(event);
290+ QPainter painter(m_videoWidget);
291+ painter.fillRect(m_videoWidget->rect(), m_videoWidget->palette().background());
292 }
293
294-const QImage &WidgetRenderer::currentFrame() const
295+int WidgetRenderer::setOverlay(void)
296 {
297- return m_frame;
298+ struct mxcfb_color_key color_key;
299+ struct mxcfb_gbl_alpha alpha;
300+ int fd_fb;
301+
302+ if ((fd_fb = open("/dev/fb0", O_RDWR, 0)) < 0)
303+ {
304+ printf("Unable to open %s\n", "/dev/fb0");
305+ return -1;
306+
307+ }
308+
309+ alpha.alpha = MXCFB_GBL_ALPHA;
310+ alpha.enable = 1;
311+
312+ if (ioctl(fd_fb, MXCFB_SET_GBL_ALPHA, &alpha) < 0) {
313+ printf("Error in applying Alpha\n");
314+ }
315+
316+ color_key.color_key = MXCFB_CLR_KEY & 0x00FFFFFF;
317+ color_key.enable = 1;
318+ if ( ioctl(fd_fb, MXCFB_SET_CLR_KEY, &color_key) < 0) {
319+
320+ printf("Error in applying Color Key\n");
321+ return -1;
322+ }
323+
324+ close (fd_fb);
325+
326+ return 0;
327 }
328
329-void WidgetRenderer::handlePaint(QPaintEvent *event)
330+void WidgetRenderer::handleMove( QMoveEvent * event)
331 {
332- Q_UNUSED(event);
333- QPainter painter(m_videoWidget);
334- m_drawFrameRect = m_videoWidget->calculateDrawFrameRect();
335- painter.drawImage(drawFrameRect(), currentFrame());
336- frameRendered();
337+ Q_UNUSED(event);
338+
339+ if (framePos != m_videoWidget->mapToGlobal(QPoint(0,0)))
340+ setVideoSize();
341 }
342
343 bool WidgetRenderer::eventFilter(QEvent * event)
344 {
345- if (event->type() == QEvent::User) {
346- NewFrameEvent *frameEvent= static_cast <NewFrameEvent *>(event);
347- setNextFrame(frameEvent->frame, frameEvent->width, frameEvent->height);
348- return true;
349+ if (event->type() == QEvent::Show) {
350+
351+ setOverlay();
352+ return true;
353+
354+ } else if (event->type() == QEvent::Resize) {
355+
356+ setVideoSize();
357+ return true;
358 }
359+ if (framePos != m_videoWidget->mapToGlobal(QPoint(0,0)))
360+ setVideoSize();
361 return false;
362 }
363
364+void WidgetRenderer::aspectRatioChanged(Phonon::VideoWidget::AspectRatio)
365+{
366+ setVideoSize();
367+}
368+
369+void WidgetRenderer::scaleModeChanged(Phonon::VideoWidget::ScaleMode)
370+{
371+ setVideoSize();
372+}
373+
374+void WidgetRenderer::movieSizeChanged(const QSize &movieSize)
375+{
376+ Q_UNUSED(movieSize);
377+ setVideoSize();
378+}
379+
380 }
381 } //namespace Phonon::Gstreamer
382
383diff --git a/src/3rdparty/phonon/gstreamer/widgetrenderer.h b/src/3rdparty/phonon/gstreamer/widgetrenderer.h
384index 03ee9c0..6de1a03 100644
385--- a/src/3rdparty/phonon/gstreamer/widgetrenderer.h
386+++ b/src/3rdparty/phonon/gstreamer/widgetrenderer.h
387@@ -40,20 +40,21 @@ class WidgetRenderer : public AbstractRenderer
388 {
389 public:
390 WidgetRenderer(VideoWidget *videoWidget);
391+ ~WidgetRenderer(void);
392 bool eventFilter(QEvent * event);
393 void handlePaint(QPaintEvent *paintEvent);
394 void handleMediaNodeEvent(const MediaNodeEvent *event);
395- const QImage& currentFrame() const;
396 QRect drawFrameRect() const { return m_drawFrameRect; }
397- void setNextFrame(const QByteArray &array, int width, int height);
398- bool frameIsSet() { return !m_array.isNull(); }
399- void clearFrame();
400+ void aspectRatioChanged(Phonon::VideoWidget::AspectRatio aspectRatio);
401+ void scaleModeChanged(Phonon::VideoWidget::ScaleMode scaleMode);
402+ void movieSizeChanged(const QSize &movieSize);
403+ void setVideoSize(void);
404+ int setOverlay(void);
405+ void handleMove(QMoveEvent* event);
406 private:
407- mutable QImage m_frame;
408- QByteArray m_array;
409- int m_width;
410- int m_height;
411+ void paintEvent ( QPaintEvent * event );
412 QRect m_drawFrameRect;
413+ QPoint framePos;
414 };
415
416 }
417diff --git a/src/3rdparty/phonon/gstreamer/x11renderer.cpp b/src/3rdparty/phonon/gstreamer/x11renderer.cpp
418index 968f3a8..c4662e7 100644
419--- a/src/3rdparty/phonon/gstreamer/x11renderer.cpp
420+++ b/src/3rdparty/phonon/gstreamer/x11renderer.cpp
421@@ -31,6 +31,8 @@
422 #include "mediaobject.h"
423 #include "message.h"
424
425+#define FSL_GSTREAMER 1
426+
427 QT_BEGIN_NAMESPACE
428
429 namespace Phonon
430@@ -78,31 +80,16 @@ X11Renderer::~X11Renderer()
431 {
432 m_renderWidget->setAttribute(Qt::WA_PaintOnScreen, false);
433 m_renderWidget->setAttribute(Qt::WA_NoSystemBackground, false);
434+ if (m_videoSink) {
435+ gst_object_unref (GST_OBJECT (m_videoSink));
436+ }
437 delete m_renderWidget;
438 }
439
440 GstElement* X11Renderer::createVideoSink()
441 {
442- GstElement *videoSink = gst_element_factory_make ("xvimagesink", NULL);
443- if (videoSink) {
444- // Check if the xv sink is usable
445- if (gst_element_set_state(videoSink, GST_STATE_READY) != GST_STATE_CHANGE_SUCCESS) {
446- gst_object_unref(GST_OBJECT(videoSink));
447- videoSink = 0;
448- } else {
449- // Note that this should not really be necessary as these are
450- // default values, though under certain conditions values are retained
451- // even between application instances. (reproducible on 0.10.16/Gutsy)
452- g_object_set(G_OBJECT(videoSink), "brightness", 0, (const char*)NULL);
453- g_object_set(G_OBJECT(videoSink), "contrast", 0, (const char*)NULL);
454- g_object_set(G_OBJECT(videoSink), "hue", 0, (const char*)NULL);
455- g_object_set(G_OBJECT(videoSink), "saturation", 0, (const char*)NULL);
456- }
457- }
458-
459- if (!videoSink)
460- videoSink = gst_element_factory_make ("ximagesink", NULL);
461
462+ GstElement *videoSink = gst_element_factory_make ("mfw_v4lsink", NULL);
463 gst_object_ref (GST_OBJECT (videoSink)); //Take ownership
464 gst_object_sink (GST_OBJECT (videoSink));
465
466--
4671.7.1
468
diff --git a/recipes-qt/qt4/qt4/0002-i.MX-video-renderer-Allow-v4l-device-from-environmen.patch b/recipes-qt/qt4/qt4/0002-i.MX-video-renderer-Allow-v4l-device-from-environmen.patch
new file mode 100644
index 00000000..0226db59
--- /dev/null
+++ b/recipes-qt/qt4/qt4/0002-i.MX-video-renderer-Allow-v4l-device-from-environmen.patch
@@ -0,0 +1,46 @@
1From 023befba9aad60ef58177fd987a6aa40c357b2b2 Mon Sep 17 00:00:00 2001
2From: Eric Nelson <eric.nelson@boundarydevices.com>
3Date: Fri, 16 Aug 2013 11:42:23 -0700
4Subject: [PATCH] i.MX video renderer: Allow v4l device from environment
5
6The i.MX6 supports multiple IPUs and multiple V4L2 output
7devices for each.
8
9Devices are numbered starting with /dev/video16 and defined
10for each configured display. In general, /dev/video16 will
11correspond to the RGB (background) layer for /dev/fb0.
12If a display is the first on an IPU, an additional V4L2
13output will be defined that corresponds to the normally
14YUV overlay (foreground) layer.
15
16This patch allows association of the proper device for
17a particular session for use in multi-headed applications.
18The default is /dev/video17:
19 export v4lsinkdev=/dev/video17
20
21Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
22---
23 src/3rdparty/phonon/gstreamer/widgetrenderer.cpp | 5 ++++-
24 1 file changed, 4 insertions(+), 1 deletion(-)
25
26diff --git a/src/3rdparty/phonon/gstreamer/widgetrenderer.cpp b/src/3rdparty/phonon/gstreamer/widgetrenderer.cpp
27index aa4925a..a502ccd 100644
28--- a/src/3rdparty/phonon/gstreamer/widgetrenderer.cpp
29+++ b/src/3rdparty/phonon/gstreamer/widgetrenderer.cpp
30@@ -58,9 +58,12 @@ WidgetRenderer::WidgetRenderer(VideoWidget *videoWidget)
31 : AbstractRenderer(videoWidget)
32 {
33 if ((m_videoSink = gst_element_factory_make("mfw_v4lsink", NULL)) && m_videoSink != NULL) {
34-
35+ char *videodev;
36 gst_object_ref (GST_OBJECT (m_videoSink)); //Take ownership
37 gst_object_sink (GST_OBJECT (m_videoSink));
38+ videodev=getenv("v4lsinkdev");
39+ if (videodev)
40+ g_object_set (G_OBJECT (m_videoSink), "device", videodev, NULL);
41 }
42
43 // Clear the background with black by default
44--
451.8.1.2
46
diff --git a/recipes-qt/qt4/qt4/0003-i.MX6-force-egl-visual-ID-33.patch b/recipes-qt/qt4/qt4/0003-i.MX6-force-egl-visual-ID-33.patch
new file mode 100644
index 00000000..9aa158d7
--- /dev/null
+++ b/recipes-qt/qt4/qt4/0003-i.MX6-force-egl-visual-ID-33.patch
@@ -0,0 +1,35 @@
1From: Javier Viguera <javier.viguera@digi.com>
2Date: Mon, 3 Mar 2014 17:10:41 +0100
3Subject: [PATCH] i.MX6: force egl visual ID 33
4
5Workaround mismatch between EGL binary libraries and QT for FSL MX6
6based platforms.
7
8Error:
9Warning: EGL suggested using X Visual ID 33 (ARGB0888) for EGL config 28 (ARGB0444), but this is incompatable
10Unable to find an X11 visual which matches EGL config 28
11
12Patch adapted from:
13
14http://wiki.wandboard.org/index.php/Integrate_Qt5_into_yocto_sato_image_on_Wandboard
15
16Upstream-Status: Inappropriate [workaround]
17
18Signed-off-by: Javier Viguera <javier.viguera@digi.com>
19---
20 src/gui/egl/qegl_x11.cpp | 2 +-
21 1 file changed, 1 insertion(+), 1 deletion(-)
22
23diff --git a/src/gui/egl/qegl_x11.cpp b/src/gui/egl/qegl_x11.cpp
24index 196d0f77bf2d..8acf5a6c99d4 100644
25--- a/src/gui/egl/qegl_x11.cpp
26+++ b/src/gui/egl/qegl_x11.cpp
27@@ -319,7 +319,7 @@ VisualID QEgl::getCompatibleVisualId(EGLConfig config)
28 }
29
30 qWarning("Unable to find an X11 visual which matches EGL config %d", configId);
31- return (VisualID)0;
32+ return (VisualID)33;
33 }
34
35 void qt_set_winid_on_widget(QWidget* w, Qt::HANDLE id)
diff --git a/recipes-qt/qt4/qt4/mx6/g++.conf b/recipes-qt/qt4/qt4/mx6/g++.conf
new file mode 100644
index 00000000..915ecba0
--- /dev/null
+++ b/recipes-qt/qt4/qt4/mx6/g++.conf
@@ -0,0 +1,40 @@
1#
2# qmake configuration for common gcc
3#
4
5QMAKE_COMPILER = gcc
6
7QMAKE_CC = $(OE_QMAKE_CC)
8QMAKE_CFLAGS += $(OE_QMAKE_CFLAGS) -DLINUX=1 -DEGL_API_FB=1
9QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $(OE_QMAKE_CFLAGS)
10QMAKE_CFLAGS_PRECOMPILE += -x c-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT}
11QMAKE_CFLAGS_USE_PRECOMPILE += -include ${QMAKE_PCH_OUTPUT_BASE}
12
13QMAKE_CXX = $(OE_QMAKE_CXX)
14QMAKE_CXXFLAGS += $(OE_QMAKE_CXXFLAGS) -DLINUX=1 -DEGL_API_FB=1
15QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO
16QMAKE_CXXFLAGS_PRECOMPILE += -x c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT}
17QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
18
19QMAKE_LINK = $(OE_QMAKE_LINK)
20QMAKE_LINK_SHLIB = $(OE_QMAKE_LINK)
21QMAKE_LINK_C = $(OE_QMAKE_LINK)
22QMAKE_LINK_C_SHLIB = $(OE_QMAKE_LINK)
23QMAKE_LFLAGS += $(OE_QMAKE_LDFLAGS)
24QMAKE_LFLAGS_NOUNDEF += -Wl,--no-undefined
25QMAKE_LFLAGS_RPATH = -Wl,-rpath-link,
26
27QMAKE_PCH_OUTPUT_EXT = .gch
28
29# -Bsymbolic-functions (ld) support
30QMAKE_LFLAGS_BSYMBOLIC_FUNC = -Wl,-Bsymbolic-functions
31QMAKE_LFLAGS_DYNAMIC_LIST = -Wl,--dynamic-list,
32
33# do not depend on gdb
34CONFIG -= gdb_dwarf_index
35
36# some linking helper...
37CONFIG += rpath_libdirs
38
39# for the SDK
40isEmpty(QMAKE_QT_CONFIG):QMAKE_QT_CONFIG = $(OE_QMAKE_QT_CONFIG)
diff --git a/recipes-qt/qt4/qt4/mx6/linux.conf b/recipes-qt/qt4/qt4/mx6/linux.conf
new file mode 100644
index 00000000..c644d8ba
--- /dev/null
+++ b/recipes-qt/qt4/qt4/mx6/linux.conf
@@ -0,0 +1,66 @@
1#
2# qmake configuration for common linux
3#
4
5QMAKE_CFLAGS_THREAD += -D_REENTRANT
6QMAKE_CXXFLAGS_THREAD += $$QMAKE_CFLAGS_THREAD
7
8QMAKE_INCDIR =
9QMAKE_LIBDIR =
10QMAKE_INCDIR_X11 =
11QMAKE_LIBDIR_X11 =
12QMAKE_INCDIR_QT = $(OE_QMAKE_INCDIR_QT)
13QMAKE_LIBDIR_QT = $(OE_QMAKE_LIBDIR_QT)
14QMAKE_INCDIR_OPENGL =
15QMAKE_LIBDIR_OPENGL =
16QMAKE_INCDIR_OPENGL_ES1 = $$QMAKE_INCDIR_OPENGL
17QMAKE_LIBDIR_OPENGL_ES1 = $$QMAKE_LIBDIR_OPENGL
18QMAKE_INCDIR_OPENGL_ES2 = $$QMAKE_INCDIR_OPENGL
19QMAKE_LIBDIR_OPENGL_ES2 = $$QMAKE_LIBDIR_OPENGL
20QMAKE_INCDIR_EGL =
21QMAKE_LIBDIR_EGL =
22QMAKE_INCDIR_OPENVG =
23QMAKE_LIBDIR_OPENVG =
24
25
26QMAKE_LIBS =
27QMAKE_LIBS_DYNLOAD = -ldl
28QMAKE_LIBS_X11 = $(OE_QMAKE_LIBS_X11)
29QMAKE_LIBS_X11SM = $(OE_QMAKE_LIBS_X11SM)
30QMAKE_LIBS_NIS = -lnsl
31QMAKE_LIBS_EGL = -lEGL -lGAL -DLINUX=1 -DEGL_API_FB=1
32QMAKE_LIBS_OPENGL = -lGL
33QMAKE_LIBS_OPENGL_QT = -lGL
34QMAKE_LIBS_OPENGL_ES1 = -lGLES_CM
35QMAKE_LIBS_OPENGL_ES2 = -lGLESv2 -lGAL -lEGL -DLINUX=1 -DEGL_API_FB=1
36QMAKE_LIBS_OPENVG = -lOpenVG -lGAL -lEGL -DLINUX=1 -DEGL_API_FB=1
37QMAKE_LIBS_THREAD = -lpthread
38
39QMAKE_MOC = $(OE_QMAKE_MOC)
40QMAKE_UIC = $(OE_QMAKE_UIC)
41QMAKE_UIC3 = $(OE_QMAKE_UIC3)
42QMAKE_RCC = $(OE_QMAKE_RCC)
43QMAKE_QDBUSCPP2XML = $(OE_QMAKE_QDBUSCPP2XML)
44QMAKE_QDBUSXML2CPP = $(OE_QMAKE_QDBUSXML2CPP)
45
46QMAKE_AR = $(OE_QMAKE_AR) cqs
47QMAKE_OBJCOPY = objcopy
48QMAKE_RANLIB =
49
50QMAKE_TAR = tar -cf
51QMAKE_GZIP = gzip -9f
52
53QMAKE_COPY = cp -f
54QMAKE_COPY_FILE = $(COPY)
55QMAKE_COPY_DIR = $(COPY) -r
56QMAKE_MOVE = mv -f
57QMAKE_DEL_FILE = rm -f
58QMAKE_DEL_DIR = rmdir
59QMAKE_STRIP = $(OE_QMAKE_STRIP)
60QMAKE_STRIPFLAGS_LIB += --strip-unneeded
61QMAKE_CHK_DIR_EXISTS = test -d
62QMAKE_MKDIR = mkdir -p
63QMAKE_INSTALL_FILE = install -m 644 -p
64QMAKE_INSTALL_PROGRAM = install -m 755 -p
65
66include(unix.conf)