diff options
Diffstat (limited to 'src/plugins/videonode')
-rw-r--r-- | src/plugins/videonode/CMakeLists.txt | 8 | ||||
-rw-r--r-- | src/plugins/videonode/imx6/CMakeLists.txt | 43 | ||||
-rw-r--r-- | src/plugins/videonode/imx6/imx6.pro | 28 | ||||
-rw-r--r-- | src/plugins/videonode/imx6/imx6.qrc | 6 | ||||
-rw-r--r-- | src/plugins/videonode/imx6/qsgvivantevideomaterial.cpp | 59 | ||||
-rw-r--r-- | src/plugins/videonode/imx6/qsgvivantevideomaterial.h | 42 | ||||
-rw-r--r-- | src/plugins/videonode/imx6/qsgvivantevideomaterialshader.cpp | 40 | ||||
-rw-r--r-- | src/plugins/videonode/imx6/qsgvivantevideomaterialshader.h | 40 | ||||
-rw-r--r-- | src/plugins/videonode/imx6/qsgvivantevideonode.cpp | 90 | ||||
-rw-r--r-- | src/plugins/videonode/imx6/qsgvivantevideonode.h | 56 | ||||
-rw-r--r-- | src/plugins/videonode/imx6/qsgvivantevideonodefactory.cpp | 50 | ||||
-rw-r--r-- | src/plugins/videonode/imx6/qsgvivantevideonodefactory.h | 44 | ||||
-rwxr-xr-x | src/plugins/videonode/imx6/shaders/compile.bat | 38 | ||||
-rw-r--r-- | src/plugins/videonode/videonode.pro | 6 |
14 files changed, 119 insertions, 431 deletions
diff --git a/src/plugins/videonode/CMakeLists.txt b/src/plugins/videonode/CMakeLists.txt new file mode 100644 index 000000000..176628276 --- /dev/null +++ b/src/plugins/videonode/CMakeLists.txt @@ -0,0 +1,8 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +# Generated from videonode.pro. + +if(QT_FEATURE_gpu_vivante) + add_subdirectory(imx6) +endif() diff --git a/src/plugins/videonode/imx6/CMakeLists.txt b/src/plugins/videonode/imx6/CMakeLists.txt new file mode 100644 index 000000000..659f73469 --- /dev/null +++ b/src/plugins/videonode/imx6/CMakeLists.txt @@ -0,0 +1,43 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +# Generated from imx6.pro. + +##################################################################### +## QSGVivanteVideoNodeFactory Plugin: +##################################################################### + +qt_internal_add_plugin(QSGVivanteVideoNodeFactoryPlugin + OUTPUT_NAME imx6vivantevideonode + PLUGIN_TYPE video/videonode + CLASS_NAME QSGVivanteVideoNodeFactory + SOURCES + qsgvivantevideomaterial.cpp qsgvivantevideomaterial.h + qsgvivantevideomaterialshader.cpp qsgvivantevideomaterialshader.h + qsgvivantevideonode.cpp qsgvivantevideonode.h + qsgvivantevideonodefactory.cpp qsgvivantevideonodefactory.h + LIBRARIES + Qt::Core + Qt::Gui + Qt::MultimediaPrivate + Qt::MultimediaQuickPrivate + GStreamer::GStreamer # special case +) + +# Resources: +set(imx6_resource_files + "shaders/rgba.frag.qsb" + "shaders/rgba.vert.qsb" +) + +qt_internal_add_resource(QSGVivanteVideoNodeFactoryPlugin "imx6" + PREFIX + "/imx6" + FILES + ${imx6_resource_files} +) + + +#### Keys ignored in scope 1:.:.:imx6.pro:<TRUE>: +# OTHER_FILES = "imx6.json" +# PLUGIN_EXTENDS = "quick" diff --git a/src/plugins/videonode/imx6/imx6.pro b/src/plugins/videonode/imx6/imx6.pro deleted file mode 100644 index 4b2a2e720..000000000 --- a/src/plugins/videonode/imx6/imx6.pro +++ /dev/null @@ -1,28 +0,0 @@ -TARGET = imx6vivantevideonode - -QT += multimedia-private qtmultimediaquicktools-private multimediagsttools-private - -QMAKE_USE += gstreamer - -HEADERS += \ - qsgvivantevideonode.h \ - qsgvivantevideomaterialshader.h \ - qsgvivantevideomaterial.h \ - qsgvivantevideonodefactory.h - -SOURCES += \ - qsgvivantevideonode.cpp \ - qsgvivantevideomaterialshader.cpp \ - qsgvivantevideomaterial.cpp \ - qsgvivantevideonodefactory.cpp - -OTHER_FILES += \ - imx6.json - -RESOURCES += \ - imx6.qrc - -PLUGIN_TYPE = video/videonode -PLUGIN_EXTENDS = quick -PLUGIN_CLASS_NAME = QSGVivanteVideoNodeFactory -load(qt_plugin) diff --git a/src/plugins/videonode/imx6/imx6.qrc b/src/plugins/videonode/imx6/imx6.qrc deleted file mode 100644 index c64fa4c64..000000000 --- a/src/plugins/videonode/imx6/imx6.qrc +++ /dev/null @@ -1,6 +0,0 @@ -<RCC> - <qresource prefix="/imx6"> - <file>shaders/rgba.vert.qsb</file> - <file>shaders/rgba.frag.qsb</file> - </qresource> -</RCC> diff --git a/src/plugins/videonode/imx6/qsgvivantevideomaterial.cpp b/src/plugins/videonode/imx6/qsgvivantevideomaterial.cpp index 2e6c712e3..599dbb9e2 100644 --- a/src/plugins/videonode/imx6/qsgvivantevideomaterial.cpp +++ b/src/plugins/videonode/imx6/qsgvivantevideomaterial.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Pelagicore AG -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 Pelagicore AG +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include <GLES2/gl2.h> #include <GLES2/gl2ext.h> @@ -44,6 +8,7 @@ #include "qsgvivantevideomaterialshader.h" #include "qsgvivantevideonode.h" #include "private/qsgvideotexture_p.h" +#include "private/qvideoframe_p.h" #include <QOpenGLContext> #include <QThread> @@ -52,7 +17,9 @@ #include <QtMultimedia/private/qtmultimediaglobal_p.h> #include "private/qgstvideobuffer_p.h" +#if GST_CHECK_VERSION(1,14,0) #include <gst/allocators/gstphysmemory.h> +#endif //#define QT_VIVANTE_VIDEO_DEBUG @@ -60,7 +27,7 @@ QSGVivanteVideoMaterial::QSGVivanteVideoMaterial() : mOpacity(1.0), mWidth(0), mHeight(0), - mFormat(QVideoFrame::Format_Invalid), + mFormat(QVideoFrameFormat::Format_Invalid), mCurrentTexture(0), mMappable(true), mTexDirectTexture(0) @@ -107,7 +74,7 @@ void QSGVivanteVideoMaterial::setCurrentFrame(const QVideoFrame &frame, QSGVideo { QMutexLocker lock(&mFrameMutex); mCurrentFrame = frame; - mMappable = mMapError == GL_NO_ERROR && !flags.testFlag(QSGVideoNode::FrameFiltered); + mMappable = mMapError == GL_NO_ERROR; #ifdef QT_VIVANTE_VIDEO_DEBUG qDebug() << Q_FUNC_INFO << " new frame: " << frame; @@ -176,7 +143,7 @@ GLuint QSGVivanteVideoMaterial::vivanteMapping(QVideoFrame vF) clearTextures(); } - if (vF.map(QAbstractVideoBuffer::ReadOnly)) { + if (vF.map(QtVideo::MapMode::ReadOnly)) { if (mMappable) { if (!mBitsToTextureMap.contains(vF.bits())) { @@ -225,7 +192,7 @@ GLuint QSGVivanteVideoMaterial::vivanteMapping(QVideoFrame vF) GLuint physical = ~0U; #if GST_CHECK_VERSION(1,14,0) - auto buffer = reinterpret_cast<QGstVideoBuffer *>(vF.buffer()); + auto buffer = reinterpret_cast<QGstVideoBuffer *>(QVideoFramePrivate::buffer(vF)); auto mem = gst_buffer_peek_memory(buffer->buffer(), 0); auto phys_addr = gst_is_phys_memory(mem) ? gst_phys_memory_get_phys_addr(mem) : 0; if (phys_addr) @@ -273,14 +240,14 @@ GLuint QSGVivanteVideoMaterial::vivanteMapping(QVideoFrame vF) glBindTexture(GL_TEXTURE_2D, mTexDirectTexture); } switch (mCurrentFrame.pixelFormat()) { - case QVideoFrame::Format_YUV420P: - case QVideoFrame::Format_YV12: + case QVideoFrameFormat::Format_YUV420P: + case QVideoFrameFormat::Format_YV12: memcpy(mTexDirectPlanes[0], mCurrentFrame.bits(0), mCurrentFrame.height() * mCurrentFrame.bytesPerLine(0)); memcpy(mTexDirectPlanes[1], mCurrentFrame.bits(1), mCurrentFrame.height() / 2 * mCurrentFrame.bytesPerLine(1)); memcpy(mTexDirectPlanes[2], mCurrentFrame.bits(2), mCurrentFrame.height() / 2 * mCurrentFrame.bytesPerLine(2)); break; - case QVideoFrame::Format_NV12: - case QVideoFrame::Format_NV21: + case QVideoFrameFormat::Format_NV12: + case QVideoFrameFormat::Format_NV21: memcpy(mTexDirectPlanes[0], mCurrentFrame.bits(0), mCurrentFrame.height() * mCurrentFrame.bytesPerLine(0)); memcpy(mTexDirectPlanes[1], mCurrentFrame.bits(1), mCurrentFrame.height() / 2 * mCurrentFrame.bytesPerLine(1)); break; diff --git a/src/plugins/videonode/imx6/qsgvivantevideomaterial.h b/src/plugins/videonode/imx6/qsgvivantevideomaterial.h index 10fd5447f..0c3976e3a 100644 --- a/src/plugins/videonode/imx6/qsgvivantevideomaterial.h +++ b/src/plugins/videonode/imx6/qsgvivantevideomaterial.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Pelagicore AG -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 Pelagicore AG +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QSGVIDEOMATERIAL_VIVMAP_H #define QSGVIDEOMATERIAL_VIVMAP_H @@ -75,7 +39,7 @@ private: int mWidth; int mHeight; - QVideoFrame::PixelFormat mFormat; + QVideoFrameFormat::PixelFormat mFormat; QMap<const uchar*, GLuint> mBitsToTextureMap; QVideoFrame mCurrentFrame; diff --git a/src/plugins/videonode/imx6/qsgvivantevideomaterialshader.cpp b/src/plugins/videonode/imx6/qsgvivantevideomaterialshader.cpp index 9e529c3df..ed78192b6 100644 --- a/src/plugins/videonode/imx6/qsgvivantevideomaterialshader.cpp +++ b/src/plugins/videonode/imx6/qsgvivantevideomaterialshader.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Pelagicore AG -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 Pelagicore AG +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qsgvivantevideomaterialshader.h" #include "qsgvivantevideonode.h" diff --git a/src/plugins/videonode/imx6/qsgvivantevideomaterialshader.h b/src/plugins/videonode/imx6/qsgvivantevideomaterialshader.h index b0e19d28e..73edff7d2 100644 --- a/src/plugins/videonode/imx6/qsgvivantevideomaterialshader.h +++ b/src/plugins/videonode/imx6/qsgvivantevideomaterialshader.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Pelagicore AG -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 Pelagicore AG +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QSGVIDEOMATERIALSHADER_VIVANTE_H #define QSGVIDEOMATERIALSHADER_VIVANTE_H diff --git a/src/plugins/videonode/imx6/qsgvivantevideonode.cpp b/src/plugins/videonode/imx6/qsgvivantevideonode.cpp index c8d83b4b2..a800c0e62 100644 --- a/src/plugins/videonode/imx6/qsgvivantevideonode.cpp +++ b/src/plugins/videonode/imx6/qsgvivantevideonode.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Pelagicore AG -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 Pelagicore AG +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include <GLES2/gl2.h> #include <GLES2/gl2ext.h> @@ -44,9 +8,9 @@ #include "qsgvivantevideomaterialshader.h" #include "qsgvivantevideomaterial.h" -QMap<QVideoFrame::PixelFormat, GLenum> QSGVivanteVideoNode::static_VideoFormat2GLFormatMap = QMap<QVideoFrame::PixelFormat, GLenum>(); +QMap<QVideoFrameFormat::PixelFormat, GLenum> QSGVivanteVideoNode::static_VideoFormat2GLFormatMap = QMap<QVideoFrameFormat::PixelFormat, GLenum>(); -QSGVivanteVideoNode::QSGVivanteVideoNode(const QVideoSurfaceFormat &format) : +QSGVivanteVideoNode::QSGVivanteVideoNode(const QVideoFrameFormat &format) : mFormat(format) { setFlag(QSGNode::OwnsMaterial, true); @@ -64,40 +28,38 @@ void QSGVivanteVideoNode::setCurrentFrame(const QVideoFrame &frame, FrameFlags f markDirty(DirtyMaterial); } -const QMap<QVideoFrame::PixelFormat, GLenum>& QSGVivanteVideoNode::getVideoFormat2GLFormatMap() +const QMap<QVideoFrameFormat::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); - static_VideoFormat2GLFormatMap.insert(QVideoFrame::Format_UYVY, GL_VIV_UYVY); - static_VideoFormat2GLFormatMap.insert(QVideoFrame::Format_YUYV, GL_VIV_YUY2); - static_VideoFormat2GLFormatMap.insert(QVideoFrame::Format_RGB32, GL_BGRA_EXT); - static_VideoFormat2GLFormatMap.insert(QVideoFrame::Format_ARGB32, GL_BGRA_EXT); - static_VideoFormat2GLFormatMap.insert(QVideoFrame::Format_BGR32, GL_RGBA); - static_VideoFormat2GLFormatMap.insert(QVideoFrame::Format_BGRA32, GL_RGBA); - static_VideoFormat2GLFormatMap.insert(QVideoFrame::Format_RGB565, GL_RGB565); + static_VideoFormat2GLFormatMap.insert(QVideoFrameFormat::Format_YUV420P, GL_VIV_I420); + static_VideoFormat2GLFormatMap.insert(QVideoFrameFormat::Format_YV12, GL_VIV_YV12); + static_VideoFormat2GLFormatMap.insert(QVideoFrameFormat::Format_NV12, GL_VIV_NV12); + static_VideoFormat2GLFormatMap.insert(QVideoFrameFormat::Format_NV21, GL_VIV_NV21); + static_VideoFormat2GLFormatMap.insert(QVideoFrameFormat::Format_UYVY, GL_VIV_UYVY); + static_VideoFormat2GLFormatMap.insert(QVideoFrameFormat::Format_YUYV, GL_VIV_YUY2); + static_VideoFormat2GLFormatMap.insert(QVideoFrameFormat::Format_RGB32, GL_BGRA_EXT); + static_VideoFormat2GLFormatMap.insert(QVideoFrameFormat::Format_ARGB32, GL_BGRA_EXT); + static_VideoFormat2GLFormatMap.insert(QVideoFrameFormat::Format_BGR32, GL_RGBA); + static_VideoFormat2GLFormatMap.insert(QVideoFrameFormat::Format_BGRA32, GL_RGBA); } return static_VideoFormat2GLFormatMap; } -int QSGVivanteVideoNode::getBytesForPixelFormat(QVideoFrame::PixelFormat pixelformat) +int QSGVivanteVideoNode::getBytesForPixelFormat(QVideoFrameFormat::PixelFormat pixelformat) { switch (pixelformat) { - case QVideoFrame::Format_YUV420P: return 1; - case QVideoFrame::Format_YV12: return 1; - case QVideoFrame::Format_NV12: return 1; - case QVideoFrame::Format_NV21: return 1; - case QVideoFrame::Format_UYVY: return 2; - case QVideoFrame::Format_YUYV: return 2; - case QVideoFrame::Format_RGB32: return 4; - case QVideoFrame::Format_ARGB32: return 4; - case QVideoFrame::Format_BGR32: return 4; - case QVideoFrame::Format_BGRA32: return 4; - case QVideoFrame::Format_RGB565: return 2; + case QVideoFrameFormat::Format_YUV420P: return 1; + case QVideoFrameFormat::Format_YV12: return 1; + case QVideoFrameFormat::Format_NV12: return 1; + case QVideoFrameFormat::Format_NV21: return 1; + case QVideoFrameFormat::Format_UYVY: return 2; + case QVideoFrameFormat::Format_YUYV: return 2; + case QVideoFrameFormat::Format_RGB32: return 4; + case QVideoFrameFormat::Format_ARGB32: return 4; + case QVideoFrameFormat::Format_BGR32: return 4; + case QVideoFrameFormat::Format_BGRA32: return 4; default: return 1; } } diff --git a/src/plugins/videonode/imx6/qsgvivantevideonode.h b/src/plugins/videonode/imx6/qsgvivantevideonode.h index 2796f1e44..05ab4f25b 100644 --- a/src/plugins/videonode/imx6/qsgvivantevideonode.h +++ b/src/plugins/videonode/imx6/qsgvivantevideonode.h @@ -1,67 +1,31 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Pelagicore AG -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 Pelagicore AG +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QSGVIDEONODE_VIVANTE_H #define QSGVIDEONODE_VIVANTE_H #include <private/qsgvideonode_p.h> -#include <QVideoSurfaceFormat> +#include <QVideoFrameFormat> class QSGVivanteVideoMaterial; class QSGVivanteVideoNode : public QSGVideoNode { public: - QSGVivanteVideoNode(const QVideoSurfaceFormat &format); + QSGVivanteVideoNode(const QVideoFrameFormat &format); ~QSGVivanteVideoNode(); - QVideoFrame::PixelFormat pixelFormat() const { return mFormat.pixelFormat(); } - QAbstractVideoBuffer::HandleType handleType() const { return QAbstractVideoBuffer::NoHandle; } + QVideoFrameFormat::PixelFormat pixelFormat() const { return mFormat.pixelFormat(); } + QVideoFrame::HandleType handleType() const { return QVideoFrame::NoHandle; } void setCurrentFrame(const QVideoFrame &frame, FrameFlags flags); - static const QMap<QVideoFrame::PixelFormat, GLenum>& getVideoFormat2GLFormatMap(); - static int getBytesForPixelFormat(QVideoFrame::PixelFormat pixelformat); + static const QMap<QVideoFrameFormat::PixelFormat, GLenum>& getVideoFormat2GLFormatMap(); + static int getBytesForPixelFormat(QVideoFrameFormat::PixelFormat pixelformat); private: - QVideoSurfaceFormat mFormat; + QVideoFrameFormat mFormat; QSGVivanteVideoMaterial *mMaterial; - static QMap<QVideoFrame::PixelFormat, GLenum> static_VideoFormat2GLFormatMap; + static QMap<QVideoFrameFormat::PixelFormat, GLenum> static_VideoFormat2GLFormatMap; }; #endif // QSGVIDEONODE_VIVANTE_H diff --git a/src/plugins/videonode/imx6/qsgvivantevideonodefactory.cpp b/src/plugins/videonode/imx6/qsgvivantevideonodefactory.cpp index 55ed57c10..ca6550776 100644 --- a/src/plugins/videonode/imx6/qsgvivantevideonodefactory.cpp +++ b/src/plugins/videonode/imx6/qsgvivantevideonodefactory.cpp @@ -1,57 +1,21 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Pelagicore AG -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 Pelagicore AG +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qsgvivantevideonodefactory.h" #include "qsgvivantevideonode.h" #include <QtGui/QGuiApplication> -QList<QVideoFrame::PixelFormat> QSGVivanteVideoNodeFactory::supportedPixelFormats( - QAbstractVideoBuffer::HandleType handleType) const +QList<QVideoFrameFormat::PixelFormat> QSGVivanteVideoNodeFactory::supportedPixelFormats( + QVideoFrame::HandleType handleType) const { const bool isWebGl = QGuiApplication::platformName() == QLatin1String("webgl"); - if (!isWebGl && handleType == QAbstractVideoBuffer::NoHandle) + if (!isWebGl && handleType == QVideoFrame::NoHandle) return QSGVivanteVideoNode::getVideoFormat2GLFormatMap().keys(); else - return QList<QVideoFrame::PixelFormat>(); + return QList<QVideoFrameFormat::PixelFormat>(); } -QSGVideoNode *QSGVivanteVideoNodeFactory::createNode(const QVideoSurfaceFormat &format) +QSGVideoNode *QSGVivanteVideoNodeFactory::createNode(const QVideoFrameFormat &format) { if (supportedPixelFormats(format.handleType()).contains(format.pixelFormat())) { return new QSGVivanteVideoNode(format); diff --git a/src/plugins/videonode/imx6/qsgvivantevideonodefactory.h b/src/plugins/videonode/imx6/qsgvivantevideonodefactory.h index dfb6a0123..d81582788 100644 --- a/src/plugins/videonode/imx6/qsgvivantevideonodefactory.h +++ b/src/plugins/videonode/imx6/qsgvivantevideonodefactory.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Pelagicore AG -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 Pelagicore AG +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QSGVIDEONODEFACTORY_VIVANTE_H #define QSGVIDEONODEFACTORY_VIVANTE_H @@ -50,7 +14,7 @@ public: Q_PLUGIN_METADATA(IID QSGVideoNodeFactoryInterface_iid FILE "imx6.json") Q_INTERFACES(QSGVideoNodeFactoryInterface) - QList<QVideoFrame::PixelFormat> supportedPixelFormats(QAbstractVideoBuffer::HandleType handleType) const; - QSGVideoNode *createNode(const QVideoSurfaceFormat &format); + QList<QVideoFrameFormat::PixelFormat> supportedPixelFormats(QVideoFrame::HandleType handleType) const; + QSGVideoNode *createNode(const QVideoFrameFormat &format); }; #endif // QSGVIDEONODEFACTORY_VIVANTE_H diff --git a/src/plugins/videonode/imx6/shaders/compile.bat b/src/plugins/videonode/imx6/shaders/compile.bat index 712bee6c5..5827ee9c0 100755 --- a/src/plugins/videonode/imx6/shaders/compile.bat +++ b/src/plugins/videonode/imx6/shaders/compile.bat @@ -1,41 +1,5 @@ -::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: :: Copyright (C) 2020 The Qt Company Ltd. -:: Contact: https://www.qt.io/licensing/ -:: -:: This file is part of the QtQuick module of the Qt Toolkit. -:: -:: $QT_BEGIN_LICENSE:LGPL$ -:: Commercial License Usage -:: Licensees holding valid commercial Qt licenses may use this file in -:: accordance with the commercial license agreement provided with the -:: Software or, alternatively, in accordance with the terms contained in -:: a written agreement between you and The Qt Company. For licensing terms -:: and conditions see https://www.qt.io/terms-conditions. For further -:: information use the contact form at https://www.qt.io/contact-us. -:: -:: GNU Lesser General Public License Usage -:: Alternatively, this file may be used under the terms of the GNU Lesser -:: General Public License version 3 as published by the Free Software -:: Foundation and appearing in the file LICENSE.LGPL3 included in the -:: packaging of this file. Please review the following information to -:: ensure the GNU Lesser General Public License version 3 requirements -:: will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -:: -:: GNU General Public License Usage -:: Alternatively, this file may be used under the terms of the GNU -:: General Public License version 2.0 or (at your option) the GNU General -:: Public license version 3 or any later version approved by the KDE Free -:: Qt Foundation. The licenses are as published by the Free Software -:: Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -:: included in the packaging of this file. Please review the following -:: information to ensure the GNU General Public License requirements will -:: be met: https://www.gnu.org/licenses/gpl-2.0.html and -:: https://www.gnu.org/licenses/gpl-3.0.html. -:: -:: $QT_END_LICENSE$ -:: -::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 qsb -b --glsl "150,120,100 es" --hlsl 50 --msl 12 -o rgba.vert.qsb rgba.vert qsb --glsl "150,120,100 es" --hlsl 50 --msl 12 -o rgba.frag.qsb rgba.frag diff --git a/src/plugins/videonode/videonode.pro b/src/plugins/videonode/videonode.pro deleted file mode 100644 index b8bd43329..000000000 --- a/src/plugins/videonode/videonode.pro +++ /dev/null @@ -1,6 +0,0 @@ -TEMPLATE = subdirs -QT_FOR_CONFIG += gui-private multimedia-private - -qtConfig(gpu_vivante) { - SUBDIRS += imx6 -} |