Support YUV420P in the i.MX6 video node
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>
Mon, 5 Jan 2015 14:43:51 +0000 (15:43 +0100)
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>
Tue, 6 Jan 2015 10:46:13 +0000 (11:46 +0100)
Camera input is often in this format. Until now the lack of GL_VIV_I420 (which
was presumably missing in older versions of the extension?) in the format list
resulted in falling back to the built-in i420 node instead of the zero-copy imx6
one. This is now corrected by adding the correct format mapping.

Change-Id: I6e891bb3bb07d64ccd5b2d170b052f677c8bd19c
Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com>
src/plugins/videonode/imx6/qsgvivantevideonode.cpp

index a42b577..1c1c100 100644 (file)
@@ -61,6 +61,7 @@ void QSGVivanteVideoNode::setCurrentFrame(const QVideoFrame &frame)
 const QMap<QVideoFrame::PixelFormat, GLenum>& QSGVivanteVideoNode::getVideoFormat2GLFormatMap()
 {
     if (static_VideoFormat2GLFormatMap.isEmpty()) {
+        static_VideoFormat2GLFormatMap.insert(QVideoFrame::Format_YUV420P,  GL_VIV_I420);
         static_VideoFormat2GLFormatMap.insert(QVideoFrame::Format_YV12,     GL_VIV_YV12);
         static_VideoFormat2GLFormatMap.insert(QVideoFrame::Format_NV12,     GL_VIV_NV12);
         static_VideoFormat2GLFormatMap.insert(QVideoFrame::Format_NV21,     GL_VIV_NV21);