diff options
author | Lars Knoll <lars.knoll@qt.io> | 2021-04-12 09:36:05 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2021-04-14 14:01:10 +0000 |
commit | 2656b64825f702e25b564d42e27b40d060c65bb0 (patch) | |
tree | 520ac81b60cd27e191cb593ed6ea831c8e98da33 /src/plugins/videonode | |
parent | 50309974fd82f52877f96ee3cfffafa24600d397 (diff) |
Rename QVideoSurfaceFormat to QVideoFrameFormat
The class is used exclusively together with video frames to
describe their format, so the name should reflect that.
Change-Id: I10bec7a0556b22c69ac790a99282e1376ce4af97
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/plugins/videonode')
6 files changed, 42 insertions, 42 deletions
diff --git a/src/plugins/videonode/imx6/qsgvivantevideomaterial.cpp b/src/plugins/videonode/imx6/qsgvivantevideomaterial.cpp index 320ad9b86..4e8a4e5d2 100644 --- a/src/plugins/videonode/imx6/qsgvivantevideomaterial.cpp +++ b/src/plugins/videonode/imx6/qsgvivantevideomaterial.cpp @@ -60,7 +60,7 @@ QSGVivanteVideoMaterial::QSGVivanteVideoMaterial() : mOpacity(1.0), mWidth(0), mHeight(0), - mFormat(QVideoSurfaceFormat::Format_Invalid), + mFormat(QVideoFrameFormat::Format_Invalid), mCurrentTexture(0), mMappable(true), mTexDirectTexture(0) @@ -273,14 +273,14 @@ GLuint QSGVivanteVideoMaterial::vivanteMapping(QVideoFrame vF) glBindTexture(GL_TEXTURE_2D, mTexDirectTexture); } switch (mCurrentFrame.pixelFormat()) { - case QVideoSurfaceFormat::Format_YUV420P: - case QVideoSurfaceFormat::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 QVideoSurfaceFormat::Format_NV12: - case QVideoSurfaceFormat::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 5fe567814..36397eaa9 100644 --- a/src/plugins/videonode/imx6/qsgvivantevideomaterial.h +++ b/src/plugins/videonode/imx6/qsgvivantevideomaterial.h @@ -75,7 +75,7 @@ private: int mWidth; int mHeight; - QVideoSurfaceFormat::PixelFormat mFormat; + QVideoFrameFormat::PixelFormat mFormat; QMap<const uchar*, GLuint> mBitsToTextureMap; QVideoFrame mCurrentFrame; diff --git a/src/plugins/videonode/imx6/qsgvivantevideonode.cpp b/src/plugins/videonode/imx6/qsgvivantevideonode.cpp index d286eaa0c..b879c1435 100644 --- a/src/plugins/videonode/imx6/qsgvivantevideonode.cpp +++ b/src/plugins/videonode/imx6/qsgvivantevideonode.cpp @@ -44,9 +44,9 @@ #include "qsgvivantevideomaterialshader.h" #include "qsgvivantevideomaterial.h" -QMap<QVideoSurfaceFormat::PixelFormat, GLenum> QSGVivanteVideoNode::static_VideoFormat2GLFormatMap = QMap<QVideoSurfaceFormat::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,38 +64,38 @@ void QSGVivanteVideoNode::setCurrentFrame(const QVideoFrame &frame, FrameFlags f markDirty(DirtyMaterial); } -const QMap<QVideoSurfaceFormat::PixelFormat, GLenum>& QSGVivanteVideoNode::getVideoFormat2GLFormatMap() +const QMap<QVideoFrameFormat::PixelFormat, GLenum>& QSGVivanteVideoNode::getVideoFormat2GLFormatMap() { if (static_VideoFormat2GLFormatMap.isEmpty()) { - static_VideoFormat2GLFormatMap.insert(QVideoSurfaceFormat::Format_YUV420P, GL_VIV_I420); - static_VideoFormat2GLFormatMap.insert(QVideoSurfaceFormat::Format_YV12, GL_VIV_YV12); - static_VideoFormat2GLFormatMap.insert(QVideoSurfaceFormat::Format_NV12, GL_VIV_NV12); - static_VideoFormat2GLFormatMap.insert(QVideoSurfaceFormat::Format_NV21, GL_VIV_NV21); - static_VideoFormat2GLFormatMap.insert(QVideoSurfaceFormat::Format_UYVY, GL_VIV_UYVY); - static_VideoFormat2GLFormatMap.insert(QVideoSurfaceFormat::Format_YUYV, GL_VIV_YUY2); - static_VideoFormat2GLFormatMap.insert(QVideoSurfaceFormat::Format_RGB32, GL_BGRA_EXT); - static_VideoFormat2GLFormatMap.insert(QVideoSurfaceFormat::Format_ARGB32, GL_BGRA_EXT); - static_VideoFormat2GLFormatMap.insert(QVideoSurfaceFormat::Format_BGR32, GL_RGBA); - static_VideoFormat2GLFormatMap.insert(QVideoSurfaceFormat::Format_BGRA32, GL_RGBA); + 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(QVideoSurfaceFormat::PixelFormat pixelformat) +int QSGVivanteVideoNode::getBytesForPixelFormat(QVideoFrameFormat::PixelFormat pixelformat) { switch (pixelformat) { - case QVideoSurfaceFormat::Format_YUV420P: return 1; - case QVideoSurfaceFormat::Format_YV12: return 1; - case QVideoSurfaceFormat::Format_NV12: return 1; - case QVideoSurfaceFormat::Format_NV21: return 1; - case QVideoSurfaceFormat::Format_UYVY: return 2; - case QVideoSurfaceFormat::Format_YUYV: return 2; - case QVideoSurfaceFormat::Format_RGB32: return 4; - case QVideoSurfaceFormat::Format_ARGB32: return 4; - case QVideoSurfaceFormat::Format_BGR32: return 4; - case QVideoSurfaceFormat::Format_BGRA32: return 4; + 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 f0a11f22a..24b9ee492 100644 --- a/src/plugins/videonode/imx6/qsgvivantevideonode.h +++ b/src/plugins/videonode/imx6/qsgvivantevideonode.h @@ -41,27 +41,27 @@ #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(); - QVideoSurfaceFormat::PixelFormat pixelFormat() const { return mFormat.pixelFormat(); } + QVideoFrameFormat::PixelFormat pixelFormat() const { return mFormat.pixelFormat(); } QVideoFrame::HandleType handleType() const { return QVideoFrame::NoHandle; } void setCurrentFrame(const QVideoFrame &frame, FrameFlags flags); - static const QMap<QVideoSurfaceFormat::PixelFormat, GLenum>& getVideoFormat2GLFormatMap(); - static int getBytesForPixelFormat(QVideoSurfaceFormat::PixelFormat pixelformat); + static const QMap<QVideoFrameFormat::PixelFormat, GLenum>& getVideoFormat2GLFormatMap(); + static int getBytesForPixelFormat(QVideoFrameFormat::PixelFormat pixelformat); private: - QVideoSurfaceFormat mFormat; + QVideoFrameFormat mFormat; QSGVivanteVideoMaterial *mMaterial; - static QMap<QVideoSurfaceFormat::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 5369bfd2b..8086f0190 100644 --- a/src/plugins/videonode/imx6/qsgvivantevideonodefactory.cpp +++ b/src/plugins/videonode/imx6/qsgvivantevideonodefactory.cpp @@ -41,17 +41,17 @@ #include "qsgvivantevideonode.h" #include <QtGui/QGuiApplication> -QList<QVideoSurfaceFormat::PixelFormat> QSGVivanteVideoNodeFactory::supportedPixelFormats( +QList<QVideoFrameFormat::PixelFormat> QSGVivanteVideoNodeFactory::supportedPixelFormats( QVideoFrame::HandleType handleType) const { const bool isWebGl = QGuiApplication::platformName() == QLatin1String("webgl"); if (!isWebGl && handleType == QVideoFrame::NoHandle) return QSGVivanteVideoNode::getVideoFormat2GLFormatMap().keys(); else - return QList<QVideoSurfaceFormat::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 1f24251ad..0e90d89d8 100644 --- a/src/plugins/videonode/imx6/qsgvivantevideonodefactory.h +++ b/src/plugins/videonode/imx6/qsgvivantevideonodefactory.h @@ -50,7 +50,7 @@ public: Q_PLUGIN_METADATA(IID QSGVideoNodeFactoryInterface_iid FILE "imx6.json") Q_INTERFACES(QSGVideoNodeFactoryInterface) - QList<QVideoSurfaceFormat::PixelFormat> supportedPixelFormats(QVideoFrame::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 |