summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/multimedia/CMakeLists.txt2
-rw-r--r--src/multimedia/camera/qcameraimagecapture.cpp2
-rw-r--r--src/multimedia/camera/qcamerainfo.cpp2
-rw-r--r--src/multimedia/camera/qcamerainfo.h2
-rw-r--r--src/multimedia/camera/qcamerainfo_p.h2
-rw-r--r--src/multimedia/doc/snippets/multimedia-snippets/video.cpp4
-rw-r--r--src/multimedia/platform/android/common/qandroidmultimediautils.cpp22
-rw-r--r--src/multimedia/platform/android/common/qandroidmultimediautils_p.h4
-rw-r--r--src/multimedia/platform/android/common/qandroidvideooutput.cpp4
-rw-r--r--src/multimedia/platform/android/mediacapture/qandroidcamerasession.cpp32
-rw-r--r--src/multimedia/platform/android/mediacapture/qandroidcamerasession_p.h6
-rw-r--r--src/multimedia/platform/android/mediacapture/qandroidcameravideorenderercontrol.cpp16
-rw-r--r--src/multimedia/platform/android/wrappers/jni/androidcamera.cpp4
-rw-r--r--src/multimedia/platform/darwin/avfvideobuffer.mm32
-rw-r--r--src/multimedia/platform/darwin/avfvideobuffer_p.h4
-rw-r--r--src/multimedia/platform/darwin/camera/avfcameraimagecapture.mm2
-rw-r--r--src/multimedia/platform/darwin/camera/avfcamerarenderer.mm10
-rw-r--r--src/multimedia/platform/darwin/mediaplayer/avfvideorenderercontrol.mm4
-rw-r--r--src/multimedia/platform/darwin/qdarwindevicemanager.mm2
-rw-r--r--src/multimedia/platform/gstreamer/common/qgst_p.h4
-rw-r--r--src/multimedia/platform/gstreamer/common/qgstutils.cpp66
-rw-r--r--src/multimedia/platform/gstreamer/common/qgstutils_p.h4
-rw-r--r--src/multimedia/platform/gstreamer/common/qgstvideorenderersink.cpp68
-rw-r--r--src/multimedia/platform/gstreamer/common/qgstvideorenderersink_p.h4
-rw-r--r--src/multimedia/platform/gstreamer/mediacapture/qgstreamercameraimagecapture.cpp2
-rw-r--r--src/multimedia/platform/qnx/camera/bbcamerasession.cpp6
-rw-r--r--src/multimedia/platform/qnx/mediaplayer/mmrendererplayervideorenderercontrol.cpp4
-rw-r--r--src/multimedia/platform/windows/evr/evrcustompresenter.cpp34
-rw-r--r--src/multimedia/platform/windows/evr/evrcustompresenter_p.h2
-rw-r--r--src/multimedia/platform/windows/evr/evrd3dpresentengine.cpp6
-rw-r--r--src/multimedia/platform/windows/evr/evrd3dpresentengine_p.h6
-rw-r--r--src/multimedia/platform/windows/evr/evrhelpers.cpp44
-rw-r--r--src/multimedia/platform/windows/evr/evrhelpers_p.h4
-rw-r--r--src/multimedia/platform/windows/player/mfplayersession_p.h2
-rw-r--r--src/multimedia/platform/windows/player/mftvideo.cpp30
-rw-r--r--src/multimedia/platform/windows/player/mftvideo_p.h8
-rw-r--r--src/multimedia/platform/windows/player/mfvideorenderercontrol.cpp54
-rw-r--r--src/multimedia/platform/windows/qwindowsdevicemanager.cpp2
-rw-r--r--src/multimedia/video/qvideoframe.cpp82
-rw-r--r--src/multimedia/video/qvideoframe.h10
-rw-r--r--src/multimedia/video/qvideoframeconversionhelper.cpp22
-rw-r--r--src/multimedia/video/qvideoframeconversionhelper_p.h2
-rw-r--r--src/multimedia/video/qvideoframeformat.cpp (renamed from src/multimedia/video/qvideosurfaceformat.cpp)234
-rw-r--r--src/multimedia/video/qvideoframeformat.h (renamed from src/multimedia/video/qvideosurfaceformat.h)32
-rw-r--r--src/multimedia/video/qvideosink.cpp10
-rw-r--r--src/multimedia/video/qvideosink.h2
-rw-r--r--src/multimedia/video/qvideotexturehelper.cpp126
-rw-r--r--src/multimedia/video/qvideotexturehelper_p.h10
-rw-r--r--src/multimedia/video/video.pri4
-rw-r--r--src/multimediawidgets/qgraphicsvideoitem.cpp2
-rw-r--r--src/multimediawidgets/qgraphicsvideoitem.h2
-rw-r--r--src/multimediawidgets/qvideowidget.cpp2
-rw-r--r--src/plugins/videonode/imx6/qsgvivantevideomaterial.cpp10
-rw-r--r--src/plugins/videonode/imx6/qsgvivantevideomaterial.h2
-rw-r--r--src/plugins/videonode/imx6/qsgvivantevideonode.cpp48
-rw-r--r--src/plugins/videonode/imx6/qsgvivantevideonode.h14
-rw-r--r--src/plugins/videonode/imx6/qsgvivantevideonodefactory.cpp6
-rw-r--r--src/plugins/videonode/imx6/qsgvivantevideonodefactory.h4
-rw-r--r--src/qtmultimediaquicktools/qdeclarativevideooutput.cpp4
-rw-r--r--src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp4
-rw-r--r--src/qtmultimediaquicktools/qdeclarativevideooutput_render_p.h2
-rw-r--r--src/qtmultimediaquicktools/qsgvideonode_p.cpp14
-rw-r--r--src/qtmultimediaquicktools/qsgvideonode_p.h8
63 files changed, 581 insertions, 581 deletions
diff --git a/src/multimedia/CMakeLists.txt b/src/multimedia/CMakeLists.txt
index f1f8a27a3..eab2f49e8 100644
--- a/src/multimedia/CMakeLists.txt
+++ b/src/multimedia/CMakeLists.txt
@@ -69,7 +69,7 @@ qt_internal_add_module(Multimedia
video/qvideotexturehelper.cpp video/qvideotexturehelper_p.h
video/qvideoframeconversionhelper.cpp video/qvideoframeconversionhelper_p.h
video/qvideooutputorientationhandler.cpp video/qvideooutputorientationhandler_p.h
- video/qvideosurfaceformat.cpp video/qvideosurfaceformat.h
+ video/qvideoframeformat.cpp video/qvideoframeformat.h
INCLUDE_DIRECTORIES
audio
camera
diff --git a/src/multimedia/camera/qcameraimagecapture.cpp b/src/multimedia/camera/qcameraimagecapture.cpp
index 80ce85259..b20d63a50 100644
--- a/src/multimedia/camera/qcameraimagecapture.cpp
+++ b/src/multimedia/camera/qcameraimagecapture.cpp
@@ -342,7 +342,7 @@ int QCameraImageCapture::captureToBuffer()
*/
/*!
- \fn QCameraImageCapture::bufferFormatChanged(QVideoSurfaceFormat::PixelFormat format)
+ \fn QCameraImageCapture::bufferFormatChanged(QVideoFrameFormat::PixelFormat format)
Signal emitted when the buffer \a format for the buffer image capture has changed.
*/
diff --git a/src/multimedia/camera/qcamerainfo.cpp b/src/multimedia/camera/qcamerainfo.cpp
index ca8ab59be..c18b5c1ac 100644
--- a/src/multimedia/camera/qcamerainfo.cpp
+++ b/src/multimedia/camera/qcamerainfo.cpp
@@ -49,7 +49,7 @@ QCameraFormat &QCameraFormat::operator=(const QCameraFormat &other) = default;
QCameraFormat::~QCameraFormat() = default;
-QVideoSurfaceFormat::PixelFormat QCameraFormat::pixelFormat() const
+QVideoFrameFormat::PixelFormat QCameraFormat::pixelFormat() const
{
return d->pixelFormat;
}
diff --git a/src/multimedia/camera/qcamerainfo.h b/src/multimedia/camera/qcamerainfo.h
index eab517e30..6577bbbfb 100644
--- a/src/multimedia/camera/qcamerainfo.h
+++ b/src/multimedia/camera/qcamerainfo.h
@@ -54,7 +54,7 @@ public:
QCameraFormat &operator=(const QCameraFormat &other);
~QCameraFormat();
- QVideoSurfaceFormat::PixelFormat pixelFormat() const;
+ QVideoFrameFormat::PixelFormat pixelFormat() const;
QSize resolution() const;
float minFrameRate() const;
float maxFrameRate() const;
diff --git a/src/multimedia/camera/qcamerainfo_p.h b/src/multimedia/camera/qcamerainfo_p.h
index 8d81e46a1..db6f7edd1 100644
--- a/src/multimedia/camera/qcamerainfo_p.h
+++ b/src/multimedia/camera/qcamerainfo_p.h
@@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE
class QCameraFormatPrivate : public QSharedData
{
public:
- QVideoSurfaceFormat::PixelFormat pixelFormat;
+ QVideoFrameFormat::PixelFormat pixelFormat;
QSize resolution;
float minFrameRate = 0;
float maxFrameRate = 0;
diff --git a/src/multimedia/doc/snippets/multimedia-snippets/video.cpp b/src/multimedia/doc/snippets/multimedia-snippets/video.cpp
index 83f1fd26d..a04363248 100644
--- a/src/multimedia/doc/snippets/multimedia-snippets/video.cpp
+++ b/src/multimedia/doc/snippets/multimedia-snippets/video.cpp
@@ -44,7 +44,7 @@
#include "qvideowindowcontrol.h"
#include "qgraphicsvideoitem.h"
#include "qmediaplaylist.h"
-#include "qvideosurfaceformat.h"
+#include "qvideoframeformat.h"
#include <QFormLayout>
#include <QGraphicsView>
@@ -128,7 +128,7 @@ void VideoExample::VideoSurface()
{
//! [Widget Surface]
QImage img = QImage("images/qt-logo.png").convertToFormat(QImage::Format_ARGB32);
- QVideoSurfaceFormat format(img.size(), QVideoSurfaceFormat::Format_ARGB32);
+ QVideoFrameFormat format(img.size(), QVideoFrameFormat::Format_ARGB32);
videoWidget = new QVideoWidget;
videoWidget->videoSurface()->start(format);
videoWidget->videoSurface()->present(img);
diff --git a/src/multimedia/platform/android/common/qandroidmultimediautils.cpp b/src/multimedia/platform/android/common/qandroidmultimediautils.cpp
index 16cfdafac..738303099 100644
--- a/src/multimedia/platform/android/common/qandroidmultimediautils.cpp
+++ b/src/multimedia/platform/android/common/qandroidmultimediautils.cpp
@@ -77,32 +77,32 @@ bool qt_sizeLessThan(const QSize &s1, const QSize &s2)
return s1.width() * s1.height() < s2.width() * s2.height();
}
-QVideoSurfaceFormat::PixelFormat qt_pixelFormatFromAndroidImageFormat(AndroidCamera::ImageFormat f)
+QVideoFrameFormat::PixelFormat qt_pixelFormatFromAndroidImageFormat(AndroidCamera::ImageFormat f)
{
switch (f) {
case AndroidCamera::NV21:
- return QVideoSurfaceFormat::Format_NV21;
+ return QVideoFrameFormat::Format_NV21;
case AndroidCamera::YV12:
- return QVideoSurfaceFormat::Format_YV12;
+ return QVideoFrameFormat::Format_YV12;
case AndroidCamera::YUY2:
- return QVideoSurfaceFormat::Format_YUYV;
+ return QVideoFrameFormat::Format_YUYV;
case AndroidCamera::JPEG:
- return QVideoSurfaceFormat::Format_Jpeg;
+ return QVideoFrameFormat::Format_Jpeg;
default:
- return QVideoSurfaceFormat::Format_Invalid;
+ return QVideoFrameFormat::Format_Invalid;
}
}
-AndroidCamera::ImageFormat qt_androidImageFormatFromPixelFormat(QVideoSurfaceFormat::PixelFormat f)
+AndroidCamera::ImageFormat qt_androidImageFormatFromPixelFormat(QVideoFrameFormat::PixelFormat f)
{
switch (f) {
- case QVideoSurfaceFormat::Format_NV21:
+ case QVideoFrameFormat::Format_NV21:
return AndroidCamera::NV21;
- case QVideoSurfaceFormat::Format_YV12:
+ case QVideoFrameFormat::Format_YV12:
return AndroidCamera::YV12;
- case QVideoSurfaceFormat::Format_YUYV:
+ case QVideoFrameFormat::Format_YUYV:
return AndroidCamera::YUY2;
- case QVideoSurfaceFormat::Format_Jpeg:
+ case QVideoFrameFormat::Format_Jpeg:
return AndroidCamera::JPEG;
default:
return AndroidCamera::UnknownImageFormat;
diff --git a/src/multimedia/platform/android/common/qandroidmultimediautils_p.h b/src/multimedia/platform/android/common/qandroidmultimediautils_p.h
index af91de75d..544ae6402 100644
--- a/src/multimedia/platform/android/common/qandroidmultimediautils_p.h
+++ b/src/multimedia/platform/android/common/qandroidmultimediautils_p.h
@@ -63,8 +63,8 @@ int qt_findClosestValue(const QList<int> &list, int value);
bool qt_sizeLessThan(const QSize &s1, const QSize &s2);
-QVideoSurfaceFormat::PixelFormat qt_pixelFormatFromAndroidImageFormat(AndroidCamera::ImageFormat f);
-AndroidCamera::ImageFormat qt_androidImageFormatFromPixelFormat(QVideoSurfaceFormat::PixelFormat f);
+QVideoFrameFormat::PixelFormat qt_pixelFormatFromAndroidImageFormat(AndroidCamera::ImageFormat f);
+AndroidCamera::ImageFormat qt_androidImageFormatFromPixelFormat(QVideoFrameFormat::PixelFormat f);
bool qt_androidRequestCameraPermission();
bool qt_androidRequestRecordingPermission();
diff --git a/src/multimedia/platform/android/common/qandroidvideooutput.cpp b/src/multimedia/platform/android/common/qandroidvideooutput.cpp
index a9c879c1a..119cf7972 100644
--- a/src/multimedia/platform/android/common/qandroidvideooutput.cpp
+++ b/src/multimedia/platform/android/common/qandroidvideooutput.cpp
@@ -42,7 +42,7 @@
#include "androidsurfacetexture_p.h"
#include <qvideosink.h>
#include "private/qabstractvideobuffer_p.h"
-#include <QVideoSurfaceFormat>
+#include <QVideoFrameFormat>
#include <qvideosink.h>
#include <qevent.h>
@@ -320,7 +320,7 @@ void QAndroidTextureVideoOutput::onFrameAvailable()
return;
QAbstractVideoBuffer *buffer = new AndroidTextureVideoBuffer(this, m_nativeSize);
- QVideoFrame frame(buffer, QVideoSurfaceFormat(m_nativeSize, QVideoSurfaceFormat::Format_ABGR32));
+ QVideoFrame frame(buffer, QVideoFrameFormat(m_nativeSize, QVideoFrameFormat::Format_ABGR32));
m_sink->newVideoFrame(frame);
}
diff --git a/src/multimedia/platform/android/mediacapture/qandroidcamerasession.cpp b/src/multimedia/platform/android/mediacapture/qandroidcamerasession.cpp
index a566211f9..99de472ff 100644
--- a/src/multimedia/platform/android/mediacapture/qandroidcamerasession.cpp
+++ b/src/multimedia/platform/android/mediacapture/qandroidcamerasession.cpp
@@ -336,9 +336,9 @@ QList<QSize> QAndroidCameraSession::getSupportedPreviewSizes() const
return m_camera ? m_camera->getSupportedPreviewSizes() : QList<QSize>();
}
-QList<QVideoSurfaceFormat::PixelFormat> QAndroidCameraSession::getSupportedPixelFormats() const
+QList<QVideoFrameFormat::PixelFormat> QAndroidCameraSession::getSupportedPixelFormats() const
{
- QList<QVideoSurfaceFormat::PixelFormat> formats;
+ QList<QVideoFrameFormat::PixelFormat> formats;
if (!m_camera)
return formats;
@@ -348,8 +348,8 @@ QList<QVideoSurfaceFormat::PixelFormat> QAndroidCameraSession::getSupportedPixel
formats.reserve(nativeFormats.size());
for (AndroidCamera::ImageFormat nativeFormat : nativeFormats) {
- QVideoSurfaceFormat::PixelFormat format = QtPixelFormatFromAndroidImageFormat(nativeFormat);
- if (format != QVideoSurfaceFormat::Format_Invalid)
+ QVideoFrameFormat::PixelFormat format = QtPixelFormatFromAndroidImageFormat(nativeFormat);
+ if (format != QVideoFrameFormat::Format_Invalid)
formats.append(format);
}
@@ -699,37 +699,37 @@ void QAndroidCameraSession::processCapturedImage(int id,
emit imageCaptureError(id, QCameraImageCapture::ResourceError, errorMessage);
}
} else {
- QVideoFrame frame(new QMemoryVideoBuffer(data, -1), QVideoSurfaceFormat(resolution, QVideoSurfaceFormat::Format_Jpeg));
+ QVideoFrame frame(new QMemoryVideoBuffer(data, -1), QVideoFrameFormat(resolution, QVideoFrameFormat::Format_Jpeg));
emit imageAvailable(id, frame);
}
}
-QVideoSurfaceFormat::PixelFormat QAndroidCameraSession::QtPixelFormatFromAndroidImageFormat(AndroidCamera::ImageFormat format)
+QVideoFrameFormat::PixelFormat QAndroidCameraSession::QtPixelFormatFromAndroidImageFormat(AndroidCamera::ImageFormat format)
{
switch (format) {
case AndroidCamera::NV21:
- return QVideoSurfaceFormat::Format_NV21;
+ return QVideoFrameFormat::Format_NV21;
case AndroidCamera::YUY2:
- return QVideoSurfaceFormat::Format_YUYV;
+ return QVideoFrameFormat::Format_YUYV;
case AndroidCamera::JPEG:
- return QVideoSurfaceFormat::Format_Jpeg;
+ return QVideoFrameFormat::Format_Jpeg;
case AndroidCamera::YV12:
- return QVideoSurfaceFormat::Format_YV12;
+ return QVideoFrameFormat::Format_YV12;
default:
- return QVideoSurfaceFormat::Format_Invalid;
+ return QVideoFrameFormat::Format_Invalid;
}
}
-AndroidCamera::ImageFormat QAndroidCameraSession::AndroidImageFormatFromQtPixelFormat(QVideoSurfaceFormat::PixelFormat format)
+AndroidCamera::ImageFormat QAndroidCameraSession::AndroidImageFormatFromQtPixelFormat(QVideoFrameFormat::PixelFormat format)
{
switch (format) {
- case QVideoSurfaceFormat::Format_NV21:
+ case QVideoFrameFormat::Format_NV21:
return AndroidCamera::NV21;
- case QVideoSurfaceFormat::Format_YUYV:
+ case QVideoFrameFormat::Format_YUYV:
return AndroidCamera::YUY2;
- case QVideoSurfaceFormat::Format_Jpeg:
+ case QVideoFrameFormat::Format_Jpeg:
return AndroidCamera::JPEG;
- case QVideoSurfaceFormat::Format_YV12:
+ case QVideoFrameFormat::Format_YV12:
return AndroidCamera::YV12;
default:
return AndroidCamera::UnknownImageFormat;
diff --git a/src/multimedia/platform/android/mediacapture/qandroidcamerasession_p.h b/src/multimedia/platform/android/mediacapture/qandroidcamerasession_p.h
index ec4f91c63..5bace963f 100644
--- a/src/multimedia/platform/android/mediacapture/qandroidcamerasession_p.h
+++ b/src/multimedia/platform/android/mediacapture/qandroidcamerasession_p.h
@@ -92,7 +92,7 @@ public:
void setVideoOutput(QAndroidVideoOutput *output);
QList<QSize> getSupportedPreviewSizes() const;
- QList<QVideoSurfaceFormat::PixelFormat> getSupportedPixelFormats() const;
+ QList<QVideoFrameFormat::PixelFormat> getSupportedPixelFormats() const;
QList<AndroidCamera::FpsRange> getSupportedPreviewFpsRange() const;
QImageEncoderSettings imageSettings() const { return m_actualImageSettings; }
@@ -165,8 +165,8 @@ private:
bool captureToBuffer,
const QString &fileName);
- static QVideoSurfaceFormat::PixelFormat QtPixelFormatFromAndroidImageFormat(AndroidCamera::ImageFormat);
- static AndroidCamera::ImageFormat AndroidImageFormatFromQtPixelFormat(QVideoSurfaceFormat::PixelFormat);
+ static QVideoFrameFormat::PixelFormat QtPixelFormatFromAndroidImageFormat(AndroidCamera::ImageFormat);
+ static AndroidCamera::ImageFormat AndroidImageFormatFromQtPixelFormat(QVideoFrameFormat::PixelFormat);
void setActiveHelper(bool active);
diff --git a/src/multimedia/platform/android/mediacapture/qandroidcameravideorenderercontrol.cpp b/src/multimedia/platform/android/mediacapture/qandroidcameravideorenderercontrol.cpp
index 4952573ac..a2779f15a 100644
--- a/src/multimedia/platform/android/mediacapture/qandroidcameravideorenderercontrol.cpp
+++ b/src/multimedia/platform/android/mediacapture/qandroidcameravideorenderercontrol.cpp
@@ -44,7 +44,7 @@
#include "androidsurfaceview_p.h"
#include "qandroidmultimediautils_p.h"
#include <qvideosink.h>
-#include <qvideosurfaceformat.h>
+#include <qvideoframeformat.h>
#include <qcoreapplication.h>
#include <qthread.h>
@@ -76,14 +76,14 @@ private:
QAndroidCameraVideoRendererControl *m_control;
AndroidSurfaceView *m_surfaceView;
QMutex m_mutex;
- QVideoSurfaceFormat::PixelFormat m_pixelFormat;
+ QVideoFrameFormat::PixelFormat m_pixelFormat;
QVideoFrame m_lastFrame;
};
QAndroidCameraDataVideoOutput::QAndroidCameraDataVideoOutput(QAndroidCameraVideoRendererControl *control)
: QAndroidVideoOutput(control)
, m_control(control)
- , m_pixelFormat(QVideoSurfaceFormat::Format_Invalid)
+ , m_pixelFormat(QVideoFrameFormat::Format_Invalid)
{
// The camera preview cannot be started unless we set a SurfaceTexture or a
// SurfaceHolder. In this case we don't actually care about either of these, but since
@@ -127,21 +127,21 @@ void QAndroidCameraDataVideoOutput::onSurfaceCreated()
void QAndroidCameraDataVideoOutput::configureFormat()
{
- m_pixelFormat = QVideoSurfaceFormat::Format_Invalid;
+ m_pixelFormat = QVideoFrameFormat::Format_Invalid;
if (!m_control->cameraSession()->camera())
return;
QList<AndroidCamera::ImageFormat> previewFormats = m_control->cameraSession()->camera()->getSupportedPreviewFormats();
for (int i = 0; i < previewFormats.size(); ++i) {
- QVideoSurfaceFormat::PixelFormat pixFormat = qt_pixelFormatFromAndroidImageFormat(previewFormats.at(i));
- if (pixFormat != QVideoSurfaceFormat::Format_Invalid) {
+ QVideoFrameFormat::PixelFormat pixFormat = qt_pixelFormatFromAndroidImageFormat(previewFormats.at(i));
+ if (pixFormat != QVideoFrameFormat::Format_Invalid) {
m_pixelFormat = pixFormat;
break;
}
}
- if (m_pixelFormat == QVideoSurfaceFormat::Format_Invalid) {
+ if (m_pixelFormat == QVideoFrameFormat::Format_Invalid) {
m_control->cameraSession()->setPreviewCallback(nullptr);
qWarning("The video surface is not compatible with any format supported by the camera");
} else {
@@ -194,7 +194,7 @@ void QAndroidCameraDataVideoOutput::presentFrame()
if (m_control->surface() && m_lastFrame.isValid() && m_lastFrame.pixelFormat() == m_pixelFormat) {
- QVideoSurfaceFormat format(m_lastFrame.surfaceFormat());
+ QVideoFrameFormat format(m_lastFrame.surfaceFormat());
// Front camera frames are automatically mirrored when using SurfaceTexture or SurfaceView,
// but the buffers we get from the data callback are not. Tell the QAbstractVideoSurface
// that it needs to mirror the frames.
diff --git a/src/multimedia/platform/android/wrappers/jni/androidcamera.cpp b/src/multimedia/platform/android/wrappers/jni/androidcamera.cpp
index 952f1e4e9..2cfff0e05 100644
--- a/src/multimedia/platform/android/wrappers/jni/androidcamera.cpp
+++ b/src/multimedia/platform/android/wrappers/jni/androidcamera.cpp
@@ -149,7 +149,7 @@ static void notifyNewPreviewFrame(JNIEnv *env, jobject, int id, jbyteArray data,
env->GetByteArrayRegion(data, 0, arrayLength, (jbyte*)bytes.data());
QVideoFrame frame(new QMemoryVideoBuffer(bytes, bpl),
- QVideoSurfaceFormat(QSize(width, height),
+ QVideoFrameFormat(QSize(width, height),
qt_pixelFormatFromAndroidImageFormat(AndroidCamera::ImageFormat(format))));
Q_EMIT (*it)->newPreviewFrame(frame);
@@ -1642,7 +1642,7 @@ void AndroidCameraPrivate::fetchLastPreviewFrame()
const int bpl = m_cameraListener.callMethod<jint>("previewBytesPerLine");
QVideoFrame frame(new QMemoryVideoBuffer(bytes, bpl),
- QVideoSurfaceFormat(QSize(width, height),
+ QVideoFrameFormat(QSize(width, height),
qt_pixelFormatFromAndroidImageFormat(AndroidCamera::ImageFormat(format))));
emit lastPreviewFrameFetched(frame);
diff --git a/src/multimedia/platform/darwin/avfvideobuffer.mm b/src/multimedia/platform/darwin/avfvideobuffer.mm
index a0052bb04..d18a4cdc4 100644
--- a/src/multimedia/platform/darwin/avfvideobuffer.mm
+++ b/src/multimedia/platform/darwin/avfvideobuffer.mm
@@ -240,56 +240,56 @@ quint64 AVFVideoBuffer::textureHandle(int plane) const
}
-QVideoSurfaceFormat::PixelFormat AVFVideoBuffer::fromCVPixelFormat(unsigned avPixelFormat)
+QVideoFrameFormat::PixelFormat AVFVideoBuffer::fromCVPixelFormat(unsigned avPixelFormat)
{
// BGRA <-> ARGB "swap" is intentional:
// to work correctly with GL_RGBA, color swap shaders
// (in QSG node renderer etc.).
switch (avPixelFormat) {
case kCVPixelFormatType_32ARGB:
- return QVideoSurfaceFormat::Format_BGRA32;
+ return QVideoFrameFormat::Format_BGRA32;
case kCVPixelFormatType_32BGRA:
- return QVideoSurfaceFormat::Format_ARGB32;
+ return QVideoFrameFormat::Format_ARGB32;
case kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange:
case kCVPixelFormatType_420YpCbCr8BiPlanarFullRange:
- return QVideoSurfaceFormat::Format_NV12;
+ return QVideoFrameFormat::Format_NV12;
case kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange:
case kCVPixelFormatType_420YpCbCr10BiPlanarFullRange:
- return QVideoSurfaceFormat::Format_P010;
+ return QVideoFrameFormat::Format_P010;
case kCVPixelFormatType_422YpCbCr8:
- return QVideoSurfaceFormat::Format_UYVY;
+ return QVideoFrameFormat::Format_UYVY;
case kCVPixelFormatType_422YpCbCr8_yuvs:
- return QVideoSurfaceFormat::Format_YUYV;
+ return QVideoFrameFormat::Format_YUYV;
case kCMVideoCodecType_JPEG:
case kCMVideoCodecType_JPEG_OpenDML:
- return QVideoSurfaceFormat::Format_Jpeg;
+ return QVideoFrameFormat::Format_Jpeg;
default:
- return QVideoSurfaceFormat::Format_Invalid;
+ return QVideoFrameFormat::Format_Invalid;
}
}
-bool AVFVideoBuffer::toCVPixelFormat(QVideoSurfaceFormat::PixelFormat qtFormat, unsigned &conv)
+bool AVFVideoBuffer::toCVPixelFormat(QVideoFrameFormat::PixelFormat qtFormat, unsigned &conv)
{
// BGRA <-> ARGB "swap" is intentional:
// to work correctly with GL_RGBA, color swap shaders
// (in QSG node renderer etc.).
switch (qtFormat) {
- case QVideoSurfaceFormat::Format_ARGB32:
+ case QVideoFrameFormat::Format_ARGB32:
conv = kCVPixelFormatType_32BGRA;
break;
- case QVideoSurfaceFormat::Format_BGRA32:
+ case QVideoFrameFormat::Format_BGRA32:
conv = kCVPixelFormatType_32ARGB;
break;
- case QVideoSurfaceFormat::Format_NV12:
+ case QVideoFrameFormat::Format_NV12:
conv = kCVPixelFormatType_420YpCbCr8BiPlanarFullRange;
break;
- case QVideoSurfaceFormat::Format_P010:
+ case QVideoFrameFormat::Format_P010:
conv = kCVPixelFormatType_420YpCbCr10BiPlanarFullRange;
break;
- case QVideoSurfaceFormat::Format_UYVY:
+ case QVideoFrameFormat::Format_UYVY:
conv = kCVPixelFormatType_422YpCbCr8;
break;
- case QVideoSurfaceFormat::Format_YUYV:
+ case QVideoFrameFormat::Format_YUYV:
conv = kCVPixelFormatType_422YpCbCr8_yuvs;
break;
default:
diff --git a/src/multimedia/platform/darwin/avfvideobuffer_p.h b/src/multimedia/platform/darwin/avfvideobuffer_p.h
index 000dab709..558b90959 100644
--- a/src/multimedia/platform/darwin/avfvideobuffer_p.h
+++ b/src/multimedia/platform/darwin/avfvideobuffer_p.h
@@ -74,8 +74,8 @@ public:
AVFVideoBuffer(QRhi *rhi, CVImageBufferRef buffer);
~AVFVideoBuffer();
- static QVideoSurfaceFormat::PixelFormat fromCVPixelFormat(unsigned avPixelFormat);
- static bool toCVPixelFormat(QVideoSurfaceFormat::PixelFormat qtFormat, unsigned &conv);
+ static QVideoFrameFormat::PixelFormat fromCVPixelFormat(unsigned avPixelFormat);
+ static bool toCVPixelFormat(QVideoFrameFormat::PixelFormat qtFormat, unsigned &conv);
QVideoFrame::MapMode mapMode() const { return m_mode; }
diff --git a/src/multimedia/platform/darwin/camera/avfcameraimagecapture.mm b/src/multimedia/platform/darwin/camera/avfcameraimagecapture.mm
index c4404c4e8..b370959ac 100644
--- a/src/multimedia/platform/darwin/camera/avfcameraimagecapture.mm
+++ b/src/multimedia/platform/darwin/camera/avfcameraimagecapture.mm
@@ -154,7 +154,7 @@ int AVFCameraImageCapture::doCapture(const QString &actualFileName)
QImageReader reader(&data, "JPEG");
QSize size = reader.size();
QVideoFrame frame(new QMemoryVideoBuffer(QByteArray(jpgData.constData(), jpgData.size()), -1),
- QVideoSurfaceFormat(size, QVideoSurfaceFormat::Format_Jpeg));
+ QVideoFrameFormat(size, QVideoFrameFormat::Format_Jpeg));
QMetaObject::invokeMethod(this, "imageAvailable", Qt::QueuedConnection,
Q_ARG(int, request.captureId),
Q_ARG(QVideoFrame, frame));
diff --git a/src/multimedia/platform/darwin/camera/avfcamerarenderer.mm b/src/multimedia/platform/darwin/camera/avfcamerarenderer.mm
index 339543a0a..ab0e3b503 100644
--- a/src/multimedia/platform/darwin/camera/avfcamerarenderer.mm
+++ b/src/multimedia/platform/darwin/camera/avfcamerarenderer.mm
@@ -55,7 +55,7 @@
#include <private/qabstractvideobuffer_p.h>
-#include <QtMultimedia/qvideosurfaceformat.h>
+#include <QtMultimedia/qvideoframeformat.h>
QT_USE_NAMESPACE
@@ -98,13 +98,13 @@ QT_USE_NAMESPACE
int width = CVPixelBufferGetWidth(imageBuffer);
int height = CVPixelBufferGetHeight(imageBuffer);
- QVideoSurfaceFormat::PixelFormat format =
+ QVideoFrameFormat::PixelFormat format =
AVFVideoBuffer::fromCVPixelFormat(CVPixelBufferGetPixelFormatType(imageBuffer));
- if (format == QVideoSurfaceFormat::Format_Invalid)
+ if (format == QVideoFrameFormat::Format_Invalid)
return;
QVideoFrame frame(new AVFVideoBuffer(nullptr, imageBuffer),
- QVideoSurfaceFormat(QSize(width, height), format));
+ QVideoFrameFormat(QSize(width, height), format));
m_renderer->syncHandleViewfinderFrame(frame);
}
@@ -223,7 +223,7 @@ void AVFCameraRenderer::handleViewfinderFrame()
if (m_sink && frame.isValid()) {
// ### pass format to surface
- QVideoSurfaceFormat format = frame.surfaceFormat();
+ QVideoFrameFormat format = frame.surfaceFormat();
if (m_needsHorizontalMirroring)
format.setMirrored(true);
diff --git a/src/multimedia/platform/darwin/mediaplayer/avfvideorenderercontrol.mm b/src/multimedia/platform/darwin/mediaplayer/avfvideorenderercontrol.mm
index f54aa007a..87248fa6e 100644
--- a/src/multimedia/platform/darwin/mediaplayer/avfvideorenderercontrol.mm
+++ b/src/multimedia/platform/darwin/mediaplayer/avfvideorenderercontrol.mm
@@ -42,7 +42,7 @@
#include <private/avfvideobuffer_p.h>
#include <private/qabstractvideobuffer_p.h>
-#include <QtMultimedia/qvideosurfaceformat.h>
+#include <QtMultimedia/qvideoframeformat.h>
#include <private/qimagevideobuffer_p.h>
#include <private/avfvideosink_p.h>
@@ -129,7 +129,7 @@ void AVFVideoRendererControl::updateVideoFrame(const CVTimeStamp &ts)
// qDebug() << "Got pixelbuffer with format" << fmt;
CVPixelBufferRelease(pixelBuffer);
- QVideoSurfaceFormat format(QSize(width, height), fmt);
+ QVideoFrameFormat format(QSize(width, height), fmt);
frame = QVideoFrame(buffer, format);
m_sink->videoSink()->newVideoFrame(frame);
diff --git a/src/multimedia/platform/darwin/qdarwindevicemanager.mm b/src/multimedia/platform/darwin/qdarwindevicemanager.mm
index 2b4f050c0..e699268cc 100644
--- a/src/multimedia/platform/darwin/qdarwindevicemanager.mm
+++ b/src/multimedia/platform/darwin/qdarwindevicemanager.mm
@@ -267,7 +267,7 @@ void QDarwinDeviceManager::updateCameraDevices()
auto encoding = CMVideoFormatDescriptionGetCodecType(format.formatDescription);
auto pixelFormat = AVFVideoBuffer::fromCVPixelFormat(encoding);
// Ignore pixel formats we can't handle
- if (pixelFormat == QVideoSurfaceFormat::Format_Invalid)
+ if (pixelFormat == QVideoFrameFormat::Format_Invalid)
continue;
for (AVFrameRateRange *frameRateRange in format.videoSupportedFrameRateRanges) {
diff --git a/src/multimedia/platform/gstreamer/common/qgst_p.h b/src/multimedia/platform/gstreamer/common/qgst_p.h
index e8245ee66..906f0089e 100644
--- a/src/multimedia/platform/gstreamer/common/qgst_p.h
+++ b/src/multimedia/platform/gstreamer/common/qgst_p.h
@@ -175,7 +175,7 @@ public:
}
Q_MULTIMEDIA_EXPORT QSize resolution() const;
- Q_MULTIMEDIA_EXPORT QVideoSurfaceFormat::PixelFormat pixelFormat() const;
+ Q_MULTIMEDIA_EXPORT QVideoFrameFormat::PixelFormat pixelFormat() const;
Q_MULTIMEDIA_EXPORT QGRange<float> frameRateRange() const;
QByteArray toString() const { return gst_structure_to_string(structure); }
@@ -237,7 +237,7 @@ public:
caps = gst_caps_new_empty();
}
- void addPixelFormats(const QList<QVideoSurfaceFormat::PixelFormat> &formats, const char *modifier = nullptr);
+ void addPixelFormats(const QList<QVideoFrameFormat::PixelFormat> &formats, const char *modifier = nullptr);
bool isNull() const { return !caps; }
diff --git a/src/multimedia/platform/gstreamer/common/qgstutils.cpp b/src/multimedia/platform/gstreamer/common/qgstutils.cpp
index 9efef6796..0ed867bf9 100644
--- a/src/multimedia/platform/gstreamer/common/qgstutils.cpp
+++ b/src/multimedia/platform/gstreamer/common/qgstutils.cpp
@@ -51,7 +51,7 @@
#include <QtGui/qimage.h>
#include <qaudioformat.h>
#include <QtCore/qelapsedtimer.h>
-#include <QtMultimedia/qvideosurfaceformat.h>
+#include <QtMultimedia/qvideoframeformat.h>
#include <private/qmultimediautils_p.h>
#include <gst/audio/audio.h>
@@ -165,41 +165,41 @@ namespace {
struct VideoFormat
{
- QVideoSurfaceFormat::PixelFormat pixelFormat;
+ QVideoFrameFormat::PixelFormat pixelFormat;
GstVideoFormat gstFormat;
};
static const VideoFormat qt_videoFormatLookup[] =
{
- { QVideoSurfaceFormat::Format_YUV420P, GST_VIDEO_FORMAT_I420 },
- { QVideoSurfaceFormat::Format_YUV422P, GST_VIDEO_FORMAT_Y42B },
- { QVideoSurfaceFormat::Format_YV12 , GST_VIDEO_FORMAT_YV12 },
- { QVideoSurfaceFormat::Format_UYVY , GST_VIDEO_FORMAT_UYVY },
- { QVideoSurfaceFormat::Format_YUYV , GST_VIDEO_FORMAT_YUY2 },
- { QVideoSurfaceFormat::Format_NV12 , GST_VIDEO_FORMAT_NV12 },
- { QVideoSurfaceFormat::Format_NV21 , GST_VIDEO_FORMAT_NV21 },
- { QVideoSurfaceFormat::Format_AYUV444, GST_VIDEO_FORMAT_AYUV },
- { QVideoSurfaceFormat::Format_Y8 , GST_VIDEO_FORMAT_GRAY8 },
+ { QVideoFrameFormat::Format_YUV420P, GST_VIDEO_FORMAT_I420 },
+ { QVideoFrameFormat::Format_YUV422P, GST_VIDEO_FORMAT_Y42B },
+ { QVideoFrameFormat::Format_YV12 , GST_VIDEO_FORMAT_YV12 },
+ { QVideoFrameFormat::Format_UYVY , GST_VIDEO_FORMAT_UYVY },
+ { QVideoFrameFormat::Format_YUYV , GST_VIDEO_FORMAT_YUY2 },
+ { QVideoFrameFormat::Format_NV12 , GST_VIDEO_FORMAT_NV12 },
+ { QVideoFrameFormat::Format_NV21 , GST_VIDEO_FORMAT_NV21 },
+ { QVideoFrameFormat::Format_AYUV444, GST_VIDEO_FORMAT_AYUV },
+ { QVideoFrameFormat::Format_Y8 , GST_VIDEO_FORMAT_GRAY8 },
#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
- { QVideoSurfaceFormat::Format_RGB32 , GST_VIDEO_FORMAT_BGRx },
- { QVideoSurfaceFormat::Format_BGR32 , GST_VIDEO_FORMAT_RGBx },
- { QVideoSurfaceFormat::Format_ARGB32, GST_VIDEO_FORMAT_BGRA },
- { QVideoSurfaceFormat::Format_ABGR32, GST_VIDEO_FORMAT_RGBA },
- { QVideoSurfaceFormat::Format_BGRA32, GST_VIDEO_FORMAT_ARGB },
- { QVideoSurfaceFormat::Format_Y16 , GST_VIDEO_FORMAT_GRAY16_LE },
- { QVideoSurfaceFormat::Format_P010 , GST_VIDEO_FORMAT_P010_10LE },
+ { QVideoFrameFormat::Format_RGB32 , GST_VIDEO_FORMAT_BGRx },
+ { QVideoFrameFormat::Format_BGR32 , GST_VIDEO_FORMAT_RGBx },
+ { QVideoFrameFormat::Format_ARGB32, GST_VIDEO_FORMAT_BGRA },
+ { QVideoFrameFormat::Format_ABGR32, GST_VIDEO_FORMAT_RGBA },
+ { QVideoFrameFormat::Format_BGRA32, GST_VIDEO_FORMAT_ARGB },
+ { QVideoFrameFormat::Format_Y16 , GST_VIDEO_FORMAT_GRAY16_LE },
+ { QVideoFrameFormat::Format_P010 , GST_VIDEO_FORMAT_P010_10LE },
#else
- { QVideoSurfaceFormat::Format_RGB32 , GST_VIDEO_FORMAT_xRGB },
- { QVideoSurfaceFormat::Format_BGR32 , GST_VIDEO_FORMAT_xBGR },
- { QVideoSurfaceFormat::Format_ARGB32, GST_VIDEO_FORMAT_ARGB },
- { QVideoSurfaceFormat::Format_ABGR32, GST_VIDEO_FORMAT_ABGR },
- { QVideoSurfaceFormat::Format_BGRA32, GST_VIDEO_FORMAT_BGRA },
- { QVideoSurfaceFormat::Format_Y16 , GST_VIDEO_FORMAT_GRAY16_BE },
- { QVideoSurfaceFormat::Format_P010 , GST_VIDEO_FORMAT_P010_10BE },
+ { QVideoFrameFormat::Format_RGB32 , GST_VIDEO_FORMAT_xRGB },
+ { QVideoFrameFormat::Format_BGR32 , GST_VIDEO_FORMAT_xBGR },
+ { QVideoFrameFormat::Format_ARGB32, GST_VIDEO_FORMAT_ARGB },
+ { QVideoFrameFormat::Format_ABGR32, GST_VIDEO_FORMAT_ABGR },
+ { QVideoFrameFormat::Format_BGRA32, GST_VIDEO_FORMAT_BGRA },
+ { QVideoFrameFormat::Format_Y16 , GST_VIDEO_FORMAT_GRAY16_BE },
+ { QVideoFrameFormat::Format_P010 , GST_VIDEO_FORMAT_P010_10BE },
#endif
};
-static int indexOfVideoFormat(QVideoSurfaceFormat::PixelFormat format)
+static int indexOfVideoFormat(QVideoFrameFormat::PixelFormat format)
{
for (int i = 0; i < lengthOf(qt_videoFormatLookup); ++i)
if (qt_videoFormatLookup[i].pixelFormat == format)
@@ -219,7 +219,7 @@ static int indexOfVideoFormat(GstVideoFormat format)
}
-QVideoSurfaceFormat QGstUtils::formatForCaps(
+QVideoFrameFormat QGstUtils::formatForCaps(
GstCaps *caps, GstVideoInfo *info)
{
GstVideoInfo vidInfo;
@@ -229,7 +229,7 @@ QVideoSurfaceFormat QGstUtils::formatForCaps(
int index = indexOfVideoFormat(infoPtr->finfo->format);
if (index != -1) {
- QVideoSurfaceFormat format(
+ QVideoFrameFormat format(
QSize(infoPtr->width, infoPtr->height),
qt_videoFormatLookup[index].pixelFormat);
@@ -239,15 +239,15 @@ QVideoSurfaceFormat QGstUtils::formatForCaps(
return format;
}
}
- return QVideoSurfaceFormat();
+ return QVideoFrameFormat();
}
-void QGstMutableCaps::addPixelFormats(const QList<QVideoSurfaceFormat::PixelFormat> &formats, const char *modifier)
+void QGstMutableCaps::addPixelFormats(const QList<QVideoFrameFormat::PixelFormat> &formats, const char *modifier)
{
GValue list = {};
g_value_init(&list, GST_TYPE_LIST);
- for (QVideoSurfaceFormat::PixelFormat format : formats) {
+ for (QVideoFrameFormat::PixelFormat format : formats) {
int index = indexOfVideoFormat(format);
if (index == -1)
continue;
@@ -300,9 +300,9 @@ QSize QGstStructure::resolution() const
return size;
}
-QVideoSurfaceFormat::PixelFormat QGstStructure::pixelFormat() const
+QVideoFrameFormat::PixelFormat QGstStructure::pixelFormat() const
{
- QVideoSurfaceFormat::PixelFormat pixelFormat = QVideoSurfaceFormat::Format_Invalid;
+ QVideoFrameFormat::PixelFormat pixelFormat = QVideoFrameFormat::Format_Invalid;
if (!structure)
return pixelFormat;
diff --git a/src/multimedia/platform/gstreamer/common/qgstutils_p.h b/src/multimedia/platform/gstreamer/common/qgstutils_p.h
index b71f016a4..e2bc35531 100644
--- a/src/multimedia/platform/gstreamer/common/qgstutils_p.h
+++ b/src/multimedia/platform/gstreamer/common/qgstutils_p.h
@@ -68,13 +68,13 @@ class QSize;
class QVariant;
class QByteArray;
class QImage;
-class QVideoSurfaceFormat;
+class QVideoFrameFormat;
namespace QGstUtils {
Q_MULTIMEDIA_EXPORT QAudioFormat audioFormatForSample(GstSample *sample);
Q_MULTIMEDIA_EXPORT GstCaps *capsForAudioFormat(const QAudioFormat &format);
- Q_MULTIMEDIA_EXPORT QVideoSurfaceFormat formatForCaps(
+ Q_MULTIMEDIA_EXPORT QVideoFrameFormat formatForCaps(
GstCaps *caps,
GstVideoInfo *info = 0);
diff --git a/src/multimedia/platform/gstreamer/common/qgstvideorenderersink.cpp b/src/multimedia/platform/gstreamer/common/qgstvideorenderersink.cpp
index 5c2479da5..817981328 100644
--- a/src/multimedia/platform/gstreamer/common/qgstvideorenderersink.cpp
+++ b/src/multimedia/platform/gstreamer/common/qgstvideorenderersink.cpp
@@ -96,23 +96,23 @@ QGstMutableCaps QGstVideoRenderer::getCaps()
#if QT_CONFIG(gstreamer_gl)
QRhi *rhi = m_sink->rhi();
if (rhi && rhi->backend() == QRhi::OpenGLES2) {
- auto formats = QList<QVideoSurfaceFormat::PixelFormat>()
-// << QVideoSurfaceFormat::Format_YUV420P
-// << QVideoSurfaceFormat::Format_YUV422P
-// << QVideoSurfaceFormat::Format_YV12
- << QVideoSurfaceFormat::Format_UYVY
- << QVideoSurfaceFormat::Format_YUYV
-// << QVideoSurfaceFormat::Format_NV12
-// << QVideoSurfaceFormat::Format_NV21
- << QVideoSurfaceFormat::Format_AYUV444
-// << QVideoSurfaceFormat::Format_P010
- << QVideoSurfaceFormat::Format_RGB32
- << QVideoSurfaceFormat::Format_BGR32
- << QVideoSurfaceFormat::Format_ARGB32
- << QVideoSurfaceFormat::Format_ABGR32
- << QVideoSurfaceFormat::Format_BGRA32
-// << QVideoSurfaceFormat::Format_Y8
-// << QVideoSurfaceFormat::Format_Y16
+ auto formats = QList<QVideoFrameFormat::PixelFormat>()
+// << QVideoFrameFormat::Format_YUV420P
+// << QVideoFrameFormat::Format_YUV422P
+// << QVideoFrameFormat::Format_YV12
+ << QVideoFrameFormat::Format_UYVY
+ << QVideoFrameFormat::Format_YUYV
+// << QVideoFrameFormat::Format_NV12
+// << QVideoFrameFormat::Format_NV21
+ << QVideoFrameFormat::Format_AYUV444
+// << QVideoFrameFormat::Format_P010
+ << QVideoFrameFormat::Format_RGB32
+ << QVideoFrameFormat::Format_BGR32
+ << QVideoFrameFormat::Format_ARGB32
+ << QVideoFrameFormat::Format_ABGR32
+ << QVideoFrameFormat::Format_BGRA32
+// << QVideoFrameFormat::Format_Y8
+// << QVideoFrameFormat::Format_Y16
;
// Even if the surface does not support gl textures,
// glupload will be added to the pipeline and GLMemory will be requested.
@@ -124,23 +124,23 @@ QGstMutableCaps QGstVideoRenderer::getCaps()
// caps.addPixelFormats(formats, GST_CAPS_FEATURE_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META);
}
#endif
- auto formats = QList<QVideoSurfaceFormat::PixelFormat>()
- << QVideoSurfaceFormat::Format_YUV420P
- << QVideoSurfaceFormat::Format_YUV422P
- << QVideoSurfaceFormat::Format_YV12
- << QVideoSurfaceFormat::Format_UYVY
- << QVideoSurfaceFormat::Format_YUYV
- << QVideoSurfaceFormat::Format_NV12
- << QVideoSurfaceFormat::Format_NV21
- << QVideoSurfaceFormat::Format_AYUV444
- << QVideoSurfaceFormat::Format_P010
- << QVideoSurfaceFormat::Format_RGB32
- << QVideoSurfaceFormat::Format_BGR32
- << QVideoSurfaceFormat::Format_ARGB32
- << QVideoSurfaceFormat::Format_ABGR32
- << QVideoSurfaceFormat::Format_BGRA32
- << QVideoSurfaceFormat::Format_Y8
- << QVideoSurfaceFormat::Format_Y16
+ auto formats = QList<QVideoFrameFormat::PixelFormat>()
+ << QVideoFrameFormat::Format_YUV420P
+ << QVideoFrameFormat::Format_YUV422P
+ << QVideoFrameFormat::Format_YV12
+ << QVideoFrameFormat::Format_UYVY
+ << QVideoFrameFormat::Format_YUYV
+ << QVideoFrameFormat::Format_NV12
+ << QVideoFrameFormat::Format_NV21
+ << QVideoFrameFormat::Format_AYUV444
+ << QVideoFrameFormat::Format_P010
+ << QVideoFrameFormat::Format_RGB32
+ << QVideoFrameFormat::Format_BGR32
+ << QVideoFrameFormat::Format_ARGB32
+ << QVideoFrameFormat::Format_ABGR32
+ << QVideoFrameFormat::Format_BGRA32
+ << QVideoFrameFormat::Format_Y8
+ << QVideoFrameFormat::Format_Y16
;
caps.addPixelFormats(formats);
qDebug() << "CAPS:" << caps.toString();
diff --git a/src/multimedia/platform/gstreamer/common/qgstvideorenderersink_p.h b/src/multimedia/platform/gstreamer/common/qgstvideorenderersink_p.h
index 6833b468d..c0bc83882 100644
--- a/src/multimedia/platform/gstreamer/common/qgstvideorenderersink_p.h
+++ b/src/multimedia/platform/gstreamer/common/qgstvideorenderersink_p.h
@@ -60,7 +60,7 @@
#include <QtCore/qqueue.h>
#include <QtCore/qpointer.h>
#include <QtCore/qwaitcondition.h>
-#include <qvideosurfaceformat.h>
+#include <qvideoframeformat.h>
#include <qvideoframe.h>
#include <private/qgstvideobuffer_p.h>
#include <private/qgst_p.h>
@@ -92,7 +92,7 @@ public:
private:
QVideoSink *m_sink = nullptr;
- QVideoSurfaceFormat m_format;
+ QVideoFrameFormat m_format;
GstVideoInfo m_videoInfo;
bool m_flushed = true;
QGstVideoBuffer::BufferFormat bufferFormat = QGstVideoBuffer::Memory;
diff --git a/src/multimedia/platform/gstreamer/mediacapture/qgstreamercameraimagecapture.cpp b/src/multimedia/platform/gstreamer/mediacapture/qgstreamercameraimagecapture.cpp
index da3cbe260..82ae37dae 100644
--- a/src/multimedia/platform/gstreamer/mediacapture/qgstreamercameraimagecapture.cpp
+++ b/src/multimedia/platform/gstreamer/mediacapture/qgstreamercameraimagecapture.cpp
@@ -41,7 +41,7 @@
#include "qplatformcamera_p.h"
#include <private/qgstvideobuffer_p.h>
#include <private/qgstutils_p.h>
-#include <qvideosurfaceformat.h>
+#include <qvideoframeformat.h>
#include <QtCore/QDebug>
#include <QtCore/QDir>
diff --git a/src/multimedia/platform/qnx/camera/bbcamerasession.cpp b/src/multimedia/platform/qnx/camera/bbcamerasession.cpp
index 109708eff..623dce93b 100644
--- a/src/multimedia/platform/qnx/camera/bbcamerasession.cpp
+++ b/src/multimedia/platform/qnx/camera/bbcamerasession.cpp
@@ -45,7 +45,7 @@
#include <QDebug>
#include <QImage>
#include <QUrl>
-#include <QVideoSurfaceFormat>
+#include <QVideoFrameFormat>
#include <qmath.h>
#include <algorithm>
@@ -732,7 +732,7 @@ void BbCameraSession::viewfinderFrameGrabbed(const QImage &image)
if (m_surface) {
if (frame.size() != m_surface->surfaceFormat().frameSize()) {
m_surface->stop();
- m_surface->start(QVideoSurfaceFormat(frame.size(), QVideoSurfaceFormat::Format_ARGB32));
+ m_surface->start(QVideoFrameFormat(frame.size(), QVideoFrameFormat::Format_ARGB32));
}
QVideoFrame videoFrame(frame);
@@ -850,7 +850,7 @@ bool BbCameraSession::startViewFinder()
m_surfaceMutex.lock();
if (m_surface) {
- const bool ok = m_surface->start(QVideoSurfaceFormat(rotatedSize, QVideoSurfaceFormat::Format_ARGB32));
+ const bool ok = m_surface->start(QVideoFrameFormat(rotatedSize, QVideoFrameFormat::Format_ARGB32));
if (!ok)
qWarning() << "Unable to start camera viewfinder surface";
}
diff --git a/src/multimedia/platform/qnx/mediaplayer/mmrendererplayervideorenderercontrol.cpp b/src/multimedia/platform/qnx/mediaplayer/mmrendererplayervideorenderercontrol.cpp
index 8399c6ea5..7c731c404 100644
--- a/src/multimedia/platform/qnx/mediaplayer/mmrendererplayervideorenderercontrol.cpp
+++ b/src/multimedia/platform/qnx/mediaplayer/mmrendererplayervideorenderercontrol.cpp
@@ -43,7 +43,7 @@
#include <QCoreApplication>
#include <QDebug>
-#include <QVideoSurfaceFormat>
+#include <QVideoFrameFormat>
#include <QOpenGLContext>
#include <mm/renderer.h>
@@ -174,7 +174,7 @@ void MmRendererPlayerVideoRendererControl::updateScene(const QSize &size)
// handle or a copy of the image data
if (m_windowGrabber->eglImageSupported()) {
QnxTextureBuffer *textBuffer = new QnxTextureBuffer(m_windowGrabber);
- QVideoFrame actualFrame(textBuffer, QVideoSurfaceFormat(size, QVideoSurfaceFormat::Format_BGR32));
+ QVideoFrame actualFrame(textBuffer, QVideoFrameFormat(size, QVideoFrameFormat::Format_BGR32));
m_sink->newVideoFrame(actualFrame);
} else {
m_sink->newVideoFrame(m_windowGrabber->getNextImage().copy());
diff --git a/src/multimedia/platform/windows/evr/evrcustompresenter.cpp b/src/multimedia/platform/windows/evr/evrcustompresenter.cpp
index f5416c9ba..16e87eb51 100644
--- a/src/multimedia/platform/windows/evr/evrcustompresenter.cpp
+++ b/src/multimedia/platform/windows/evr/evrcustompresenter.cpp
@@ -66,7 +66,7 @@ static const LONG ONE_MSEC = 1000;
static HRESULT setDesiredSampleTime(IMFSample *sample, const LONGLONG& hnsSampleTime, const LONGLONG& hnsDuration);
static HRESULT clearDesiredSampleTime(IMFSample *sample);
static HRESULT setMixerSourceRect(IMFTransform *mixer, const MFVideoNormalizedRect& nrcSource);
-static QVideoSurfaceFormat::PixelFormat pixelFormatFromMediaType(IMFMediaType *type);
+static QVideoFrameFormat::PixelFormat pixelFormatFromMediaType(IMFMediaType *type);
static inline LONG MFTimeToMsec(const LONGLONG& time)
{
@@ -1029,9 +1029,9 @@ void EVRCustomPresenter::supportedFormatsChanged()
m_presentEngine->setHint(D3DPresentEngine::RenderToTexture, true);
m_canRenderToSurface = true;
} else {
- for (int f = 0; f < QVideoSurfaceFormat::NPixelFormats; ++f) {
+ for (int f = 0; f < QVideoFrameFormat::NPixelFormats; ++f) {
// ### set a better preference order
- QVideoSurfaceFormat::PixelFormat format = QVideoSurfaceFormat::PixelFormat(f);
+ QVideoFrameFormat::PixelFormat format = QVideoFrameFormat::PixelFormat(f);
if (SUCCEEDED(m_presentEngine->checkFormat(qt_evr_D3DFormatFromPixelFormat(format)))) {
m_canRenderToSurface = true;
break;
@@ -1466,8 +1466,8 @@ HRESULT EVRCustomPresenter::isMediaTypeSupported(IMFMediaType *proposed)
if (FAILED(hr))
return hr;
- QVideoSurfaceFormat::PixelFormat pixelFormat = pixelFormatFromMediaType(proposed);
- if (pixelFormat == QVideoSurfaceFormat::Format_Invalid)
+ QVideoFrameFormat::PixelFormat pixelFormat = pixelFormatFromMediaType(proposed);
+ if (pixelFormat == QVideoFrameFormat::Format_Invalid)
return MF_E_INVALIDMEDIATYPE;
// Reject compressed media types.
@@ -1983,34 +1983,34 @@ HRESULT setMixerSourceRect(IMFTransform *mixer, const MFVideoNormalizedRect &sou
return hr;
}
-static QVideoSurfaceFormat::PixelFormat pixelFormatFromMediaType(IMFMediaType *type)
+static QVideoFrameFormat::PixelFormat pixelFormatFromMediaType(IMFMediaType *type)
{
GUID majorType;
if (FAILED(type->GetMajorType(&majorType)))
- return QVideoSurfaceFormat::Format_Invalid;
+ return QVideoFrameFormat::Format_Invalid;
if (majorType != MFMediaType_Video)
- return QVideoSurfaceFormat::Format_Invalid;
+ return QVideoFrameFormat::Format_Invalid;
GUID subtype;
if (FAILED(type->GetGUID(MF_MT_SUBTYPE, &subtype)))
- return QVideoSurfaceFormat::Format_Invalid;
+ return QVideoFrameFormat::Format_Invalid;
if (subtype == MFVideoFormat_RGB32)
- return QVideoSurfaceFormat::Format_RGB32;
+ return QVideoFrameFormat::Format_RGB32;
if (subtype == MFVideoFormat_ARGB32)
- return QVideoSurfaceFormat::Format_ARGB32;
+ return QVideoFrameFormat::Format_ARGB32;
if (subtype == MFVideoFormat_AYUV)
- return QVideoSurfaceFormat::Format_AYUV444;
+ return QVideoFrameFormat::Format_AYUV444;
if (subtype == MFVideoFormat_I420)
- return QVideoSurfaceFormat::Format_YUV420P;
+ return QVideoFrameFormat::Format_YUV420P;
if (subtype == MFVideoFormat_UYVY)
- return QVideoSurfaceFormat::Format_UYVY;
+ return QVideoFrameFormat::Format_UYVY;
if (subtype == MFVideoFormat_YV12)
- return QVideoSurfaceFormat::Format_YV12;
+ return QVideoFrameFormat::Format_YV12;
if (subtype == MFVideoFormat_NV12)
- return QVideoSurfaceFormat::Format_NV12;
+ return QVideoFrameFormat::Format_NV12;
- return QVideoSurfaceFormat::Format_Invalid;
+ return QVideoFrameFormat::Format_Invalid;
}
QT_END_NAMESPACE
diff --git a/src/multimedia/platform/windows/evr/evrcustompresenter_p.h b/src/multimedia/platform/windows/evr/evrcustompresenter_p.h
index 33efff89c..9b34e449f 100644
--- a/src/multimedia/platform/windows/evr/evrcustompresenter_p.h
+++ b/src/multimedia/platform/windows/evr/evrcustompresenter_p.h
@@ -55,7 +55,7 @@
#include <qmutex.h>
#include <qqueue.h>
#include <qevent.h>
-#include <qvideosurfaceformat.h>
+#include <qvideoframeformat.h>
#include <qvideosink.h>
#include "evrdefs_p.h"
diff --git a/src/multimedia/platform/windows/evr/evrd3dpresentengine.cpp b/src/multimedia/platform/windows/evr/evrd3dpresentengine.cpp
index b7f96d42a..9cc2e967c 100644
--- a/src/multimedia/platform/windows/evr/evrd3dpresentengine.cpp
+++ b/src/multimedia/platform/windows/evr/evrd3dpresentengine.cpp
@@ -254,7 +254,7 @@ bool D3DPresentEngine::isValid() const
void D3DPresentEngine::releaseResources()
{
- m_surfaceFormat = QVideoSurfaceFormat();
+ m_surfaceFormat = QVideoFrameFormat();
}
HRESULT D3DPresentEngine::getService(REFGUID, REFIID riid, void** ppv)
@@ -367,8 +367,8 @@ HRESULT D3DPresentEngine::createVideoSamples(IMFMediaType *format, QList<IMFSamp
done:
if (SUCCEEDED(hr)) {
- m_surfaceFormat = QVideoSurfaceFormat(QSize(width, height),
- m_useTextureRendering ? QVideoSurfaceFormat::Format_RGB32
+ m_surfaceFormat = QVideoFrameFormat(QSize(width, height),
+ m_useTextureRendering ? QVideoFrameFormat::Format_RGB32
: qt_evr_pixelFormatFromD3DFormat(d3dFormat));
} else {
releaseResources();
diff --git a/src/multimedia/platform/windows/evr/evrd3dpresentengine_p.h b/src/multimedia/platform/windows/evr/evrd3dpresentengine_p.h
index 2c1ab8f83..e4a4503ff 100644
--- a/src/multimedia/platform/windows/evr/evrd3dpresentengine_p.h
+++ b/src/multimedia/platform/windows/evr/evrd3dpresentengine_p.h
@@ -52,7 +52,7 @@
//
#include <QMutex>
-#include <QVideoSurfaceFormat>
+#include <QVideoFrameFormat>
#include <d3d9.h>
@@ -126,7 +126,7 @@ public:
bool isTextureRenderingEnabled() const { return m_useTextureRendering; }
HRESULT createVideoSamples(IMFMediaType *format, QList<IMFSample*>& videoSampleQueue);
- QVideoSurfaceFormat videoSurfaceFormat() const { return m_surfaceFormat; }
+ QVideoFrameFormat videoSurfaceFormat() const { return m_surfaceFormat; }
QVideoFrame makeVideoFrame(IMFSample* sample);
void releaseResources();
@@ -143,7 +143,7 @@ private:
IDirect3DDevice9Ex *m_device;
IDirect3DDeviceManager9 *m_deviceManager;
- QVideoSurfaceFormat m_surfaceFormat;
+ QVideoFrameFormat m_surfaceFormat;
bool m_useTextureRendering;
diff --git a/src/multimedia/platform/windows/evr/evrhelpers.cpp b/src/multimedia/platform/windows/evr/evrhelpers.cpp
index 52498b9a4..868189e2a 100644
--- a/src/multimedia/platform/windows/evr/evrhelpers.cpp
+++ b/src/multimedia/platform/windows/evr/evrhelpers.cpp
@@ -117,55 +117,55 @@ bool qt_evr_isSampleTimePassed(IMFClock *clock, IMFSample *sample)
return false;
}
-QVideoSurfaceFormat::PixelFormat qt_evr_pixelFormatFromD3DFormat(DWORD format)
+QVideoFrameFormat::PixelFormat qt_evr_pixelFormatFromD3DFormat(DWORD format)
{
switch (format) {
case D3DFMT_A8R8G8B8:
- return QVideoSurfaceFormat::Format_ARGB32;
+ return QVideoFrameFormat::Format_ARGB32;
case D3DFMT_X8R8G8B8:
- return QVideoSurfaceFormat::Format_RGB32;
+ return QVideoFrameFormat::Format_RGB32;
case D3DFMT_A8:
- return QVideoSurfaceFormat::Format_Y8;
+ return QVideoFrameFormat::Format_Y8;
case D3DFMT_A8B8G8R8:
- return QVideoSurfaceFormat::Format_BGRA32;
+ return QVideoFrameFormat::Format_BGRA32;
case D3DFMT_X8B8G8R8:
- return QVideoSurfaceFormat::Format_BGR32;
+ return QVideoFrameFormat::Format_BGR32;
case D3DFMT_UYVY:
- return QVideoSurfaceFormat::Format_UYVY;
+ return QVideoFrameFormat::Format_UYVY;
case D3DFMT_YUY2:
- return QVideoSurfaceFormat::Format_YUYV;
+ return QVideoFrameFormat::Format_YUYV;
case D3DFMT_NV12:
- return QVideoSurfaceFormat::Format_NV12;
+ return QVideoFrameFormat::Format_NV12;
case D3DFMT_YV12:
- return QVideoSurfaceFormat::Format_YV12;
+ return QVideoFrameFormat::Format_YV12;
case D3DFMT_UNKNOWN:
default:
- return QVideoSurfaceFormat::Format_Invalid;
+ return QVideoFrameFormat::Format_Invalid;
}
}
-D3DFORMAT qt_evr_D3DFormatFromPixelFormat(QVideoSurfaceFormat::PixelFormat format)
+D3DFORMAT qt_evr_D3DFormatFromPixelFormat(QVideoFrameFormat::PixelFormat format)
{
switch (format) {
- case QVideoSurfaceFormat::Format_ARGB32:
+ case QVideoFrameFormat::Format_ARGB32:
return D3DFMT_A8R8G8B8;
- case QVideoSurfaceFormat::Format_RGB32:
+ case QVideoFrameFormat::Format_RGB32:
return D3DFMT_X8R8G8B8;
- case QVideoSurfaceFormat::Format_Y8:
+ case QVideoFrameFormat::Format_Y8:
return D3DFMT_A8;
- case QVideoSurfaceFormat::Format_BGRA32:
+ case QVideoFrameFormat::Format_BGRA32:
return D3DFMT_A8B8G8R8;
- case QVideoSurfaceFormat::Format_BGR32:
+ case QVideoFrameFormat::Format_BGR32:
return D3DFMT_X8B8G8R8;
- case QVideoSurfaceFormat::Format_UYVY:
+ case QVideoFrameFormat::Format_UYVY:
return D3DFMT_UYVY;
- case QVideoSurfaceFormat::Format_YUYV:
+ case QVideoFrameFormat::Format_YUYV:
return D3DFMT_YUY2;
- case QVideoSurfaceFormat::Format_NV12:
+ case QVideoFrameFormat::Format_NV12:
return D3DFMT_NV12;
- case QVideoSurfaceFormat::Format_YV12:
+ case QVideoFrameFormat::Format_YV12:
return D3DFMT_YV12;
- case QVideoSurfaceFormat::Format_Invalid:
+ case QVideoFrameFormat::Format_Invalid:
default:
return D3DFMT_UNKNOWN;
}
diff --git a/src/multimedia/platform/windows/evr/evrhelpers_p.h b/src/multimedia/platform/windows/evr/evrhelpers_p.h
index 34e992624..340658571 100644
--- a/src/multimedia/platform/windows/evr/evrhelpers_p.h
+++ b/src/multimedia/platform/windows/evr/evrhelpers_p.h
@@ -103,8 +103,8 @@ inline HRESULT qt_evr_getFrameRate(IMFMediaType *pType, MFRatio *pRatio)
reinterpret_cast<UINT32*>(&pRatio->Denominator));
}
-QVideoSurfaceFormat::PixelFormat qt_evr_pixelFormatFromD3DFormat(DWORD format);
-D3DFORMAT qt_evr_D3DFormatFromPixelFormat(QVideoSurfaceFormat::PixelFormat format);
+QVideoFrameFormat::PixelFormat qt_evr_pixelFormatFromD3DFormat(DWORD format);
+D3DFORMAT qt_evr_D3DFormatFromPixelFormat(QVideoFrameFormat::PixelFormat format);
QT_END_NAMESPACE
diff --git a/src/multimedia/platform/windows/player/mfplayersession_p.h b/src/multimedia/platform/windows/player/mfplayersession_p.h
index 08aaf577e..493a2f68f 100644
--- a/src/multimedia/platform/windows/player/mfplayersession_p.h
+++ b/src/multimedia/platform/windows/player/mfplayersession_p.h
@@ -62,7 +62,7 @@
#include <QtCore/qurl.h>
#include <QtCore/qwaitcondition.h>
#include <QtMultimedia/qaudioformat.h>
-#include <QtMultimedia/qvideosurfaceformat.h>
+#include <QtMultimedia/qvideoframeformat.h>
#include <qaudiodeviceinfo.h>
#include "mfplayercontrol_p.h"
diff --git a/src/multimedia/platform/windows/player/mftvideo.cpp b/src/multimedia/platform/windows/player/mftvideo.cpp
index 360796584..1807bf7ac 100644
--- a/src/multimedia/platform/windows/player/mftvideo.cpp
+++ b/src/multimedia/platform/windows/player/mftvideo.cpp
@@ -603,32 +603,32 @@ HRESULT MFTransform::OnFlush()
return S_OK;
}
-QVideoSurfaceFormat::PixelFormat MFTransform::formatFromSubtype(const GUID& subtype)
+QVideoFrameFormat::PixelFormat MFTransform::formatFromSubtype(const GUID& subtype)
{
if (subtype == MFVideoFormat_ARGB32)
- return QVideoSurfaceFormat::Format_ARGB32;
+ return QVideoFrameFormat::Format_ARGB32;
else if (subtype == MFVideoFormat_RGB32)
- return QVideoSurfaceFormat::Format_RGB32;
+ return QVideoFrameFormat::Format_RGB32;
else if (subtype == MFVideoFormat_AYUV)
- return QVideoSurfaceFormat::Format_AYUV444;
+ return QVideoFrameFormat::Format_AYUV444;
else if (subtype == MFVideoFormat_I420)
- return QVideoSurfaceFormat::Format_YUV420P;
+ return QVideoFrameFormat::Format_YUV420P;
else if (subtype == MFVideoFormat_UYVY)
- return QVideoSurfaceFormat::Format_UYVY;
+ return QVideoFrameFormat::Format_UYVY;
else if (subtype == MFVideoFormat_YV12)
- return QVideoSurfaceFormat::Format_YV12;
+ return QVideoFrameFormat::Format_YV12;
else if (subtype == MFVideoFormat_NV12)
- return QVideoSurfaceFormat::Format_NV12;
+ return QVideoFrameFormat::Format_NV12;
- return QVideoSurfaceFormat::Format_Invalid;
+ return QVideoFrameFormat::Format_Invalid;
}
-QVideoSurfaceFormat MFTransform::videoFormatForMFMediaType(IMFMediaType *mediaType, int *bytesPerLine)
+QVideoFrameFormat MFTransform::videoFormatForMFMediaType(IMFMediaType *mediaType, int *bytesPerLine)
{
UINT32 stride;
if (FAILED(mediaType->GetUINT32(MF_MT_DEFAULT_STRIDE, &stride))) {
*bytesPerLine = 0;
- return QVideoSurfaceFormat();
+ return QVideoFrameFormat();
}
*bytesPerLine = (int)stride;
@@ -636,17 +636,17 @@ QVideoSurfaceFormat MFTransform::videoFormatForMFMediaType(IMFMediaType *mediaTy
QSize size;
UINT32 width, height;
if (FAILED(MFGetAttributeSize(mediaType, MF_MT_FRAME_SIZE, &width, &height)))
- return QVideoSurfaceFormat();
+ return QVideoFrameFormat();
size.setWidth(width);
size.setHeight(height);
GUID subtype = GUID_NULL;
if (FAILED(mediaType->GetGUID(MF_MT_SUBTYPE, &subtype)))
- return QVideoSurfaceFormat();
+ return QVideoFrameFormat();
- QVideoSurfaceFormat::PixelFormat pixelFormat = formatFromSubtype(subtype);
- QVideoSurfaceFormat format(size, pixelFormat);
+ QVideoFrameFormat::PixelFormat pixelFormat = formatFromSubtype(subtype);
+ QVideoFrameFormat format(size, pixelFormat);
quint32 num, den;
if (SUCCEEDED(MFGetAttributeRatio(mediaType, MF_MT_FRAME_RATE, &num, &den))) {
diff --git a/src/multimedia/platform/windows/player/mftvideo_p.h b/src/multimedia/platform/windows/player/mftvideo_p.h
index 548c9ba6a..e08945047 100644
--- a/src/multimedia/platform/windows/player/mftvideo_p.h
+++ b/src/multimedia/platform/windows/player/mftvideo_p.h
@@ -55,7 +55,7 @@
#include <mfidl.h>
#include <QtCore/qlist.h>
#include <QtCore/qmutex.h>
-#include <QtMultimedia/qvideosurfaceformat.h>
+#include <QtMultimedia/qvideoframeformat.h>
QT_USE_NAMESPACE
@@ -73,7 +73,7 @@ public:
void setVideoSink(IUnknown *videoSink);
- static QVideoSurfaceFormat::PixelFormat formatFromSubtype(const GUID& subtype);
+ static QVideoFrameFormat::PixelFormat formatFromSubtype(const GUID& subtype);
// IUnknown methods
STDMETHODIMP QueryInterface(REFIID iid, void** ppv);
@@ -107,7 +107,7 @@ public:
private:
HRESULT OnFlush();
- static QVideoSurfaceFormat videoFormatForMFMediaType(IMFMediaType *mediaType, int *bytesPerLine);
+ static QVideoFrameFormat videoFormatForMFMediaType(IMFMediaType *mediaType, int *bytesPerLine);
QVideoFrame makeVideoFrame();
QByteArray dataFromBuffer(IMFMediaBuffer *buffer, int height, int *bytesPerLine);
bool isMediaTypeSupported(IMFMediaType *type);
@@ -123,7 +123,7 @@ private:
// QList<MFVideoProbeControl*> m_videoProbes;
QMutex m_videoProbeMutex;
- QVideoSurfaceFormat m_format;
+ QVideoFrameFormat m_format;
int m_bytesPerLine;
};
diff --git a/src/multimedia/platform/windows/player/mfvideorenderercontrol.cpp b/src/multimedia/platform/windows/player/mfvideorenderercontrol.cpp
index 8abbc2504..a0f3e393b 100644
--- a/src/multimedia/platform/windows/player/mfvideorenderercontrol.cpp
+++ b/src/multimedia/platform/windows/player/mfvideorenderercontrol.cpp
@@ -44,7 +44,7 @@
#include <private/qabstractvideobuffer_p.h>
#include <qvideosink.h>
-#include <qvideosurfaceformat.h>
+#include <qvideoframeformat.h>
#include <qtcore/qtimer.h>
#include <qtcore/qmutex.h>
#include <qtcore/qcoreevent.h>
@@ -566,7 +566,7 @@ namespace
m_currentFormatIndex = index;
int width = int(HI32(size));
int height = int(LO32(size));
- QVideoSurfaceFormat format(QSize(width, height), m_pixelFormats[index]);
+ QVideoFrameFormat format(QSize(width, height), m_pixelFormats[index]);
m_surfaceFormat = format;
MFVideoArea viewport;
@@ -792,8 +792,8 @@ namespace
clearMediaTypes();
if (!m_videoSink)
return;
- for (int f = 0; f < QVideoSurfaceFormat::NPixelFormats; ++f) {
- QVideoSurfaceFormat::PixelFormat format = QVideoSurfaceFormat::PixelFormat(f);
+ for (int f = 0; f < QVideoFrameFormat::NPixelFormats; ++f) {
+ QVideoFrameFormat::PixelFormat format = QVideoFrameFormat::PixelFormat(f);
IMFMediaType *mediaType;
if (FAILED(MFCreateMediaType(&mediaType))) {
qWarning("Failed to create mf media type!");
@@ -804,27 +804,27 @@ namespace
mediaType->SetUINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, TRUE);
mediaType->SetGUID(MF_MT_MAJOR_TYPE, MFMediaType_Video);
switch (format) {
- case QVideoSurfaceFormat::Format_ARGB32:
- case QVideoSurfaceFormat::Format_ARGB32_Premultiplied:
+ case QVideoFrameFormat::Format_ARGB32:
+ case QVideoFrameFormat::Format_ARGB32_Premultiplied:
mediaType->SetGUID(MF_MT_SUBTYPE, MFVideoFormat_ARGB32);
break;
- case QVideoSurfaceFormat::Format_RGB32:
+ case QVideoFrameFormat::Format_RGB32:
mediaType->SetGUID(MF_MT_SUBTYPE, MFVideoFormat_RGB32);
break;
- case QVideoSurfaceFormat::Format_AYUV444:
- case QVideoSurfaceFormat::Format_AYUV444_Premultiplied:
+ case QVideoFrameFormat::Format_AYUV444:
+ case QVideoFrameFormat::Format_AYUV444_Premultiplied:
mediaType->SetGUID(MF_MT_SUBTYPE, MFVideoFormat_AYUV);
break;
- case QVideoSurfaceFormat::Format_YUV420P:
+ case QVideoFrameFormat::Format_YUV420P:
mediaType->SetGUID(MF_MT_SUBTYPE, MFVideoFormat_I420);
break;
- case QVideoSurfaceFormat::Format_UYVY:
+ case QVideoFrameFormat::Format_UYVY:
mediaType->SetGUID(MF_MT_SUBTYPE, MFVideoFormat_UYVY);
break;
- case QVideoSurfaceFormat::Format_YV12:
+ case QVideoFrameFormat::Format_YV12:
mediaType->SetGUID(MF_MT_SUBTYPE, MFVideoFormat_YV12);
break;
- case QVideoSurfaceFormat::Format_NV12:
+ case QVideoFrameFormat::Format_NV12:
mediaType->SetGUID(MF_MT_SUBTYPE, MFVideoFormat_NV12);
break;
default:
@@ -997,10 +997,10 @@ namespace
bool m_shutdown;
QList<IMFMediaType*> m_mediaTypes;
- QList<QVideoSurfaceFormat::PixelFormat> m_pixelFormats;
+ QList<QVideoFrameFormat::PixelFormat> m_pixelFormats;
int m_currentFormatIndex;
int m_bytesPerLine;
- QVideoSurfaceFormat m_surfaceFormat;
+ QVideoFrameFormat m_surfaceFormat;
QVideoSink *m_videoSink;
MFVideoRendererControl *m_rendererControl;
@@ -1032,25 +1032,25 @@ namespace
return -1;
}
- int getBytesPerLine(const QVideoSurfaceFormat &format)
+ int getBytesPerLine(const QVideoFrameFormat &format)
{
switch (format.pixelFormat()) {
// 32 bpp packed formats.
- case QVideoSurfaceFormat::Format_RGB32:
- case QVideoSurfaceFormat::Format_AYUV444:
+ case QVideoFrameFormat::Format_RGB32:
+ case QVideoFrameFormat::Format_AYUV444:
return format.frameWidth() * 4;
// 16 bpp packed formats.
- case QVideoSurfaceFormat::Format_YUYV:
- case QVideoSurfaceFormat::Format_UYVY:
+ case QVideoFrameFormat::Format_YUYV:
+ case QVideoFrameFormat::Format_UYVY:
return PAD_TO_DWORD(format.frameWidth() * 2);
// Planar formats.
- case QVideoSurfaceFormat::Format_IMC1:
- case QVideoSurfaceFormat::Format_IMC2:
- case QVideoSurfaceFormat::Format_IMC3:
- case QVideoSurfaceFormat::Format_IMC4:
- case QVideoSurfaceFormat::Format_YV12:
- case QVideoSurfaceFormat::Format_NV12:
- case QVideoSurfaceFormat::Format_YUV420P:
+ case QVideoFrameFormat::Format_IMC1:
+ case QVideoFrameFormat::Format_IMC2:
+ case QVideoFrameFormat::Format_IMC3:
+ case QVideoFrameFormat::Format_IMC4:
+ case QVideoFrameFormat::Format_YV12:
+ case QVideoFrameFormat::Format_NV12:
+ case QVideoFrameFormat::Format_YUV420P:
return PAD_TO_DWORD(format.frameWidth());
default:
return 0;
diff --git a/src/multimedia/platform/windows/qwindowsdevicemanager.cpp b/src/multimedia/platform/windows/qwindowsdevicemanager.cpp
index 6567bb665..2604a6f52 100644
--- a/src/multimedia/platform/windows/qwindowsdevicemanager.cpp
+++ b/src/multimedia/platform/windows/qwindowsdevicemanager.cpp
@@ -227,7 +227,7 @@ QList<QCameraInfo> QWindowsDeviceManager::videoInputs() const
if (mediaFormatResult == MF_E_NO_MORE_TYPES)
break;
else if (SUCCEEDED(mediaFormatResult)) {
- QVideoSurfaceFormat::PixelFormat pixelFormat = QVideoSurfaceFormat::Format_Invalid;
+ QVideoFrameFormat::PixelFormat pixelFormat = QVideoFrameFormat::Format_Invalid;
QSize resolution;
float minFr = .0;
float maxFr = .0;
diff --git a/src/multimedia/video/qvideoframe.cpp b/src/multimedia/video/qvideoframe.cpp
index 28516c60a..9995b9708 100644
--- a/src/multimedia/video/qvideoframe.cpp
+++ b/src/multimedia/video/qvideoframe.cpp
@@ -42,7 +42,7 @@
#include "qimagevideobuffer_p.h"
#include "qmemoryvideobuffer_p.h"
#include "qvideoframeconversionhelper_p.h"
-#include "qvideosurfaceformat.h"
+#include "qvideoframeformat.h"
#include <qimage.h>
#include <qmutex.h>
@@ -54,7 +54,7 @@
#include <QDebug>
QT_BEGIN_NAMESPACE
-static bool pixelFormatHasAlpha[QVideoSurfaceFormat::NPixelFormats] =
+static bool pixelFormatHasAlpha[QVideoFrameFormat::NPixelFormats] =
{
false, //Format_Invalid,
true, //Format_ARGB32,
@@ -93,7 +93,7 @@ class QVideoFramePrivate : public QSharedData
{
public:
QVideoFramePrivate() = default;
- QVideoFramePrivate(const QVideoSurfaceFormat &format)
+ QVideoFramePrivate(const QVideoFrameFormat &format)
: format(format)
{
}
@@ -106,7 +106,7 @@ public:
qint64 startTime = -1;
qint64 endTime = -1;
QAbstractVideoBuffer::MapData mapData;
- QVideoSurfaceFormat format;
+ QVideoFrameFormat format;
QAbstractVideoBuffer *buffer = nullptr;
int mappedCount = 0;
QMutex mapMutex;
@@ -149,7 +149,7 @@ private:
*/
/*!
- \enum QVideoSurfaceFormat::PixelFormat
+ \enum QVideoFrameFormat::PixelFormat
Enumerates video data types.
@@ -267,7 +267,7 @@ QVideoFrame::QVideoFrame()
\note This doesn't increment the reference count of the video buffer.
*/
-QVideoFrame::QVideoFrame(QAbstractVideoBuffer *buffer, const QVideoSurfaceFormat &format)
+QVideoFrame::QVideoFrame(QAbstractVideoBuffer *buffer, const QVideoFrameFormat &format)
: d(new QVideoFramePrivate(format))
{
d->buffer = buffer;
@@ -279,7 +279,7 @@ QVideoFrame::QVideoFrame(QAbstractVideoBuffer *buffer, const QVideoSurfaceFormat
The \a bytesPerLine (stride) is the length of each scan line in bytes, and \a bytes is the total
number of bytes that must be allocated for the frame.
*/
-QVideoFrame::QVideoFrame(int bytes, int bytesPerLine, const QVideoSurfaceFormat &format)
+QVideoFrame::QVideoFrame(int bytes, int bytesPerLine, const QVideoFrameFormat &format)
: d(new QVideoFramePrivate(format))
{
if (bytes > 0) {
@@ -301,8 +301,8 @@ QVideoFrame::QVideoFrame(int bytes, int bytesPerLine, const QVideoSurfaceFormat
\sa pixelFormatFromImageFormat()
*/
QVideoFrame::QVideoFrame(const QImage &image)
- : d(new QVideoFramePrivate(QVideoSurfaceFormat(image.size(),
- QVideoSurfaceFormat::pixelFormatFromImageFormat(image.format()))))
+ : d(new QVideoFramePrivate(QVideoFrameFormat(image.size(),
+ QVideoFrameFormat::pixelFormatFromImageFormat(image.format()))))
{
d->buffer = new QImageVideoBuffer(image);
}
@@ -372,7 +372,7 @@ bool QVideoFrame::isValid() const
/*!
Returns the pixel format of this video frame.
*/
-QVideoSurfaceFormat::PixelFormat QVideoFrame::pixelFormat() const
+QVideoFrameFormat::PixelFormat QVideoFrame::pixelFormat() const
{
return d->format.pixelFormat();
}
@@ -380,7 +380,7 @@ QVideoSurfaceFormat::PixelFormat QVideoFrame::pixelFormat() const
/*!
Returns the surface format of this video frame.
*/
-QVideoSurfaceFormat QVideoFrame::surfaceFormat() const
+QVideoFrameFormat QVideoFrame::surfaceFormat() const
{
return d->format;
}
@@ -544,26 +544,26 @@ bool QVideoFrame::map(QVideoFrame::MapMode mode)
auto pixelFmt = d->format.pixelFormat();
// If the plane count is 1 derive the additional planes for planar formats.
switch (pixelFmt) {
- case QVideoSurfaceFormat::Format_Invalid:
- case QVideoSurfaceFormat::Format_ARGB32:
- case QVideoSurfaceFormat::Format_ARGB32_Premultiplied:
- case QVideoSurfaceFormat::Format_RGB32:
- case QVideoSurfaceFormat::Format_BGRA32:
- case QVideoSurfaceFormat::Format_BGRA32_Premultiplied:
- case QVideoSurfaceFormat::Format_ABGR32:
- case QVideoSurfaceFormat::Format_BGR32:
- case QVideoSurfaceFormat::Format_AYUV444:
- case QVideoSurfaceFormat::Format_AYUV444_Premultiplied:
- case QVideoSurfaceFormat::Format_UYVY:
- case QVideoSurfaceFormat::Format_YUYV:
- case QVideoSurfaceFormat::Format_Y8:
- case QVideoSurfaceFormat::Format_Y16:
- case QVideoSurfaceFormat::Format_Jpeg:
+ case QVideoFrameFormat::Format_Invalid:
+ case QVideoFrameFormat::Format_ARGB32:
+ case QVideoFrameFormat::Format_ARGB32_Premultiplied:
+ case QVideoFrameFormat::Format_RGB32:
+ case QVideoFrameFormat::Format_BGRA32:
+ case QVideoFrameFormat::Format_BGRA32_Premultiplied:
+ case QVideoFrameFormat::Format_ABGR32:
+ case QVideoFrameFormat::Format_BGR32:
+ case QVideoFrameFormat::Format_AYUV444:
+ case QVideoFrameFormat::Format_AYUV444_Premultiplied:
+ case QVideoFrameFormat::Format_UYVY:
+ case QVideoFrameFormat::Format_YUYV:
+ case QVideoFrameFormat::Format_Y8:
+ case QVideoFrameFormat::Format_Y16:
+ case QVideoFrameFormat::Format_Jpeg:
// Single plane or opaque format.
break;
- case QVideoSurfaceFormat::Format_YUV420P:
- case QVideoSurfaceFormat::Format_YUV422P:
- case QVideoSurfaceFormat::Format_YV12: {
+ case QVideoFrameFormat::Format_YUV420P:
+ case QVideoFrameFormat::Format_YUV422P:
+ case QVideoFrameFormat::Format_YV12: {
// The UV stride is usually half the Y stride and is 32-bit aligned.
// However it's not always the case, at least on Windows where the
// UV planes are sometimes not aligned.
@@ -571,7 +571,7 @@ bool QVideoFrame::map(QVideoFrame::MapMode mode)
// have a correct stride.
const int height = this->height();
const int yStride = d->mapData.bytesPerLine[0];
- const int uvHeight = pixelFmt == QVideoSurfaceFormat::Format_YUV422P ? height : height / 2;
+ const int uvHeight = pixelFmt == QVideoFrameFormat::Format_YUV422P ? height : height / 2;
const int uvStride = (d->mapData.nBytes - (yStride * height)) / uvHeight / 2;
// Three planes, the second and third vertically (and horizontally for other than Format_YUV422P formats) subsampled.
@@ -581,20 +581,20 @@ bool QVideoFrame::map(QVideoFrame::MapMode mode)
d->mapData.data[2] = d->mapData.data[1] + (uvStride * uvHeight);
break;
}
- case QVideoSurfaceFormat::Format_NV12:
- case QVideoSurfaceFormat::Format_NV21:
- case QVideoSurfaceFormat::Format_IMC2:
- case QVideoSurfaceFormat::Format_IMC4:
- case QVideoSurfaceFormat::Format_P010:
- case QVideoSurfaceFormat::Format_P016: {
+ case QVideoFrameFormat::Format_NV12:
+ case QVideoFrameFormat::Format_NV21:
+ case QVideoFrameFormat::Format_IMC2:
+ case QVideoFrameFormat::Format_IMC4:
+ case QVideoFrameFormat::Format_P010:
+ case QVideoFrameFormat::Format_P016: {
// Semi planar, Full resolution Y plane with interleaved subsampled U and V planes.
d->mapData.nPlanes = 2;
d->mapData.bytesPerLine[1] = d->mapData.bytesPerLine[0];
d->mapData.data[1] = d->mapData.data[0] + (d->mapData.bytesPerLine[0] * height());
break;
}
- case QVideoSurfaceFormat::Format_IMC1:
- case QVideoSurfaceFormat::Format_IMC3: {
+ case QVideoFrameFormat::Format_IMC1:
+ case QVideoFrameFormat::Format_IMC3: {
// Three planes, the second and third vertically and horizontally subsumpled,
// but with lines padded to the width of the first plane.
d->mapData.nPlanes = 3;
@@ -644,7 +644,7 @@ void QVideoFrame::unmap()
Returns the number of bytes in a scan line.
\note For planar formats this is the bytes per line of the first plane only. The bytes per line of subsequent
- planes should be calculated as per the frame \l{QVideoSurfaceFormat::PixelFormat}{pixel format}.
+ planes should be calculated as per the frame \l{QVideoFrameFormat::PixelFormat}{pixel format}.
This value is only valid while the frame data is \l {map()}{mapped}.
@@ -824,13 +824,13 @@ QImage QVideoFrame::toImage() const
return result;
// Formats supported by QImage don't need conversion
- QImage::Format imageFormat = QVideoSurfaceFormat::imageFormatFromPixelFormat(frame.pixelFormat());
+ QImage::Format imageFormat = QVideoFrameFormat::imageFormatFromPixelFormat(frame.pixelFormat());
if (imageFormat != QImage::Format_Invalid) {
result = QImage(frame.bits(), frame.width(), frame.height(), frame.bytesPerLine(), imageFormat).copy();
}
// Load from JPG
- else if (frame.pixelFormat() == QVideoSurfaceFormat::Format_Jpeg) {
+ else if (frame.pixelFormat() == QVideoFrameFormat::Format_Jpeg) {
result.loadFromData(frame.bits(), frame.mappedBytes(), "JPG");
}
diff --git a/src/multimedia/video/qvideoframe.h b/src/multimedia/video/qvideoframe.h
index d2c371c3f..2d5e2d57e 100644
--- a/src/multimedia/video/qvideoframe.h
+++ b/src/multimedia/video/qvideoframe.h
@@ -41,7 +41,7 @@
#define QVIDEOFRAME_H
#include <QtMultimedia/qtmultimediaglobal.h>
-#include <QtMultimedia/qvideosurfaceformat.h>
+#include <QtMultimedia/qvideoframeformat.h>
#include <QtCore/qmetatype.h>
#include <QtCore/qshareddata.h>
@@ -76,8 +76,8 @@ public:
};
QVideoFrame();
- QVideoFrame(QAbstractVideoBuffer *buffer, const QVideoSurfaceFormat &format);
- QVideoFrame(int bytes, int bytesPerLine, const QVideoSurfaceFormat &format);
+ QVideoFrame(QAbstractVideoBuffer *buffer, const QVideoFrameFormat &format);
+ QVideoFrame(int bytes, int bytesPerLine, const QVideoFrameFormat &format);
QVideoFrame(const QImage &image);
QVideoFrame(const QVideoFrame &other);
~QVideoFrame();
@@ -88,9 +88,9 @@ public:
bool isValid() const;
- QVideoSurfaceFormat::PixelFormat pixelFormat() const;
+ QVideoFrameFormat::PixelFormat pixelFormat() const;
- QVideoSurfaceFormat surfaceFormat() const;
+ QVideoFrameFormat surfaceFormat() const;
QVideoFrame::HandleType handleType() const;
QSize size() const;
diff --git a/src/multimedia/video/qvideoframeconversionhelper.cpp b/src/multimedia/video/qvideoframeconversionhelper.cpp
index 346880a29..68cfbccec 100644
--- a/src/multimedia/video/qvideoframeconversionhelper.cpp
+++ b/src/multimedia/video/qvideoframeconversionhelper.cpp
@@ -471,7 +471,7 @@ static void QT_FASTCALL qt_convert_P016_to_ARGB32(const QVideoFrame &frame, ucha
}
-static VideoFrameConvertFunc qConvertFuncs[QVideoSurfaceFormat::NPixelFormats] = {
+static VideoFrameConvertFunc qConvertFuncs[QVideoFrameFormat::NPixelFormats] = {
/* Format_Invalid */ nullptr, // Not needed
/* Format_ARGB32 */ nullptr, // Not needed
/* Format_ARGB32_Premultiplied */ nullptr, // Not needed
@@ -505,30 +505,30 @@ static void qInitConvertFuncsAsm()
#ifdef QT_COMPILER_SUPPORTS_SSE2
extern void QT_FASTCALL qt_convert_BGRA32_to_ARGB32_sse2(const QVideoFrame&, uchar*);
if (qCpuHasFeature(SSE2)){
- qConvertFuncs[QVideoSurfaceFormat::Format_BGRA32] = qt_convert_BGRA32_to_ARGB32_sse2;
- qConvertFuncs[QVideoSurfaceFormat::Format_BGRA32_Premultiplied] = qt_convert_BGRA32_to_ARGB32_sse2;
- qConvertFuncs[QVideoSurfaceFormat::Format_BGR32] = qt_convert_BGRA32_to_ARGB32_sse2;
+ qConvertFuncs[QVideoFrameFormat::Format_BGRA32] = qt_convert_BGRA32_to_ARGB32_sse2;
+ qConvertFuncs[QVideoFrameFormat::Format_BGRA32_Premultiplied] = qt_convert_BGRA32_to_ARGB32_sse2;
+ qConvertFuncs[QVideoFrameFormat::Format_BGR32] = qt_convert_BGRA32_to_ARGB32_sse2;
}
#endif
#ifdef QT_COMPILER_SUPPORTS_SSSE3
extern void QT_FASTCALL qt_convert_BGRA32_to_ARGB32_ssse3(const QVideoFrame&, uchar*);
if (qCpuHasFeature(SSSE3)){
- qConvertFuncs[QVideoSurfaceFormat::Format_BGRA32] = qt_convert_BGRA32_to_ARGB32_ssse3;
- qConvertFuncs[QVideoSurfaceFormat::Format_BGRA32_Premultiplied] = qt_convert_BGRA32_to_ARGB32_ssse3;
- qConvertFuncs[QVideoSurfaceFormat::Format_BGR32] = qt_convert_BGRA32_to_ARGB32_ssse3;
+ qConvertFuncs[QVideoFrameFormat::Format_BGRA32] = qt_convert_BGRA32_to_ARGB32_ssse3;
+ qConvertFuncs[QVideoFrameFormat::Format_BGRA32_Premultiplied] = qt_convert_BGRA32_to_ARGB32_ssse3;
+ qConvertFuncs[QVideoFrameFormat::Format_BGR32] = qt_convert_BGRA32_to_ARGB32_ssse3;
}
#endif
#ifdef QT_COMPILER_SUPPORTS_AVX2
extern void QT_FASTCALL qt_convert_BGRA32_to_ARGB32_avx2(const QVideoFrame&, uchar*);
if (qCpuHasFeature(AVX2)){
- qConvertFuncs[QVideoSurfaceFormat::Format_BGRA32] = qt_convert_BGRA32_to_ARGB32_avx2;
- qConvertFuncs[QVideoSurfaceFormat::Format_BGRA32_Premultiplied] = qt_convert_BGRA32_to_ARGB32_avx2;
- qConvertFuncs[QVideoSurfaceFormat::Format_BGR32] = qt_convert_BGRA32_to_ARGB32_avx2;
+ qConvertFuncs[QVideoFrameFormat::Format_BGRA32] = qt_convert_BGRA32_to_ARGB32_avx2;
+ qConvertFuncs[QVideoFrameFormat::Format_BGRA32_Premultiplied] = qt_convert_BGRA32_to_ARGB32_avx2;
+ qConvertFuncs[QVideoFrameFormat::Format_BGR32] = qt_convert_BGRA32_to_ARGB32_avx2;
}
#endif
}
-VideoFrameConvertFunc qConverterForFormat(QVideoSurfaceFormat::PixelFormat format)
+VideoFrameConvertFunc qConverterForFormat(QVideoFrameFormat::PixelFormat format)
{
static bool initAsmFuncsDone = false;
if (!initAsmFuncsDone) {
diff --git a/src/multimedia/video/qvideoframeconversionhelper_p.h b/src/multimedia/video/qvideoframeconversionhelper_p.h
index 5ec919d9f..06e0d9a6d 100644
--- a/src/multimedia/video/qvideoframeconversionhelper_p.h
+++ b/src/multimedia/video/qvideoframeconversionhelper_p.h
@@ -57,7 +57,7 @@
// Converts to RGB32 or ARGB32_Premultiplied
typedef void (QT_FASTCALL *VideoFrameConvertFunc)(const QVideoFrame &frame, uchar *output);
-VideoFrameConvertFunc qConverterForFormat(QVideoSurfaceFormat::PixelFormat format);
+VideoFrameConvertFunc qConverterForFormat(QVideoFrameFormat::PixelFormat format);
inline quint32 qConvertBGRA32ToARGB32(quint32 bgra)
{
diff --git a/src/multimedia/video/qvideosurfaceformat.cpp b/src/multimedia/video/qvideoframeformat.cpp
index 6177ba0a6..02a679a09 100644
--- a/src/multimedia/video/qvideosurfaceformat.cpp
+++ b/src/multimedia/video/qvideoframeformat.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include "qvideosurfaceformat.h"
+#include "qvideoframeformat.h"
#include "qvideotexturehelper_p.h"
#include <qdebug.h>
@@ -53,21 +53,21 @@ static void initResource() {
Q_INIT_RESOURCE(shaders);
}
-class QVideoSurfaceFormatPrivate : public QSharedData
+class QVideoFrameFormatPrivate : public QSharedData
{
public:
- QVideoSurfaceFormatPrivate() = default;
+ QVideoFrameFormatPrivate() = default;
- QVideoSurfaceFormatPrivate(
+ QVideoFrameFormatPrivate(
const QSize &size,
- QVideoSurfaceFormat::PixelFormat format)
+ QVideoFrameFormat::PixelFormat format)
: pixelFormat(format)
, frameSize(size)
, viewport(QPoint(0, 0), size)
{
}
- bool operator ==(const QVideoSurfaceFormatPrivate &other) const
+ bool operator ==(const QVideoFrameFormatPrivate &other) const
{
if (pixelFormat == other.pixelFormat
&& scanLineDirection == other.scanLineDirection
@@ -86,18 +86,18 @@ public:
return qAbs(r1 - r2) <= 0.00001 * qMin(qAbs(r1), qAbs(r2));
}
- QVideoSurfaceFormat::PixelFormat pixelFormat = QVideoSurfaceFormat::Format_Invalid;
- QVideoSurfaceFormat::Direction scanLineDirection = QVideoSurfaceFormat::TopToBottom;
+ QVideoFrameFormat::PixelFormat pixelFormat = QVideoFrameFormat::Format_Invalid;
+ QVideoFrameFormat::Direction scanLineDirection = QVideoFrameFormat::TopToBottom;
QSize frameSize;
- QVideoSurfaceFormat::YCbCrColorSpace ycbcrColorSpace = QVideoSurfaceFormat::YCbCr_Undefined;
+ QVideoFrameFormat::YCbCrColorSpace ycbcrColorSpace = QVideoFrameFormat::YCbCr_Undefined;
QRect viewport;
qreal frameRate = 0.0;
bool mirrored = false;
};
/*!
- \class QVideoSurfaceFormat
- \brief The QVideoSurfaceFormat class specifies the stream format of a video presentation
+ \class QVideoFrameFormat
+ \brief The QVideoFrameFormat class specifies the stream format of a video presentation
surface.
\inmodule QtMultimedia
@@ -125,7 +125,7 @@ public:
*/
/*!
- \enum QVideoSurfaceFormat::Direction
+ \enum QVideoFrameFormat::Direction
Enumerates the layout direction of video scan lines.
@@ -134,7 +134,7 @@ public:
*/
/*!
- \enum QVideoSurfaceFormat::YCbCrColorSpace
+ \enum QVideoFrameFormat::YCbCrColorSpace
Enumerates the Y'CbCr color space of video frames.
@@ -165,8 +165,8 @@ public:
/*!
Constructs a null video stream format.
*/
-QVideoSurfaceFormat::QVideoSurfaceFormat()
- : d(new QVideoSurfaceFormatPrivate)
+QVideoFrameFormat::QVideoFrameFormat()
+ : d(new QVideoFrameFormatPrivate)
{
initResource();
}
@@ -175,33 +175,33 @@ QVideoSurfaceFormat::QVideoSurfaceFormat()
Contructs a description of stream which receives stream of \a type buffers with given frame
\a size and pixel \a format.
*/
-QVideoSurfaceFormat::QVideoSurfaceFormat(
- const QSize& size, QVideoSurfaceFormat::PixelFormat format)
- : d(new QVideoSurfaceFormatPrivate(size, format))
+QVideoFrameFormat::QVideoFrameFormat(
+ const QSize& size, QVideoFrameFormat::PixelFormat format)
+ : d(new QVideoFrameFormatPrivate(size, format))
{
}
/*!
Constructs a copy of \a other.
*/
-QVideoSurfaceFormat::QVideoSurfaceFormat(const QVideoSurfaceFormat &other) = default;
+QVideoFrameFormat::QVideoFrameFormat(const QVideoFrameFormat &other) = default;
/*!
Assigns the values of \a other to this object.
*/
-QVideoSurfaceFormat &QVideoSurfaceFormat::operator =(const QVideoSurfaceFormat &other) = default;
+QVideoFrameFormat &QVideoFrameFormat::operator =(const QVideoFrameFormat &other) = default;
/*!
Destroys a video stream description.
*/
-QVideoSurfaceFormat::~QVideoSurfaceFormat() = default;
+QVideoFrameFormat::~QVideoFrameFormat() = default;
/*!
Identifies if a video surface format has a valid pixel format and frame size.
Returns true if the format is valid, and false otherwise.
*/
-bool QVideoSurfaceFormat::isValid() const
+bool QVideoFrameFormat::isValid() const
{
return d->pixelFormat != Format_Invalid && d->frameSize.isValid();
}
@@ -209,7 +209,7 @@ bool QVideoSurfaceFormat::isValid() const
/*!
Returns true if \a other is the same as this video format, and false if they are different.
*/
-bool QVideoSurfaceFormat::operator ==(const QVideoSurfaceFormat &other) const
+bool QVideoFrameFormat::operator ==(const QVideoFrameFormat &other) const
{
return d == other.d || *d == *other.d;
}
@@ -217,7 +217,7 @@ bool QVideoSurfaceFormat::operator ==(const QVideoSurfaceFormat &other) const
/*!
Returns true if \a other is different to this video format, and false if they are the same.
*/
-bool QVideoSurfaceFormat::operator !=(const QVideoSurfaceFormat &other) const
+bool QVideoFrameFormat::operator !=(const QVideoFrameFormat &other) const
{
return d != other.d && !(*d == *other.d);
}
@@ -225,7 +225,7 @@ bool QVideoSurfaceFormat::operator !=(const QVideoSurfaceFormat &other) const
/*!
Returns the pixel format of frames in a video stream.
*/
-QVideoSurfaceFormat::PixelFormat QVideoSurfaceFormat::pixelFormat() const
+QVideoFrameFormat::PixelFormat QVideoFrameFormat::pixelFormat() const
{
return d->pixelFormat;
}
@@ -235,7 +235,7 @@ QVideoSurfaceFormat::PixelFormat QVideoSurfaceFormat::pixelFormat() const
\sa frameWidth(), frameHeight()
*/
-QSize QVideoSurfaceFormat::frameSize() const
+QSize QVideoFrameFormat::frameSize() const
{
return d->frameSize;
}
@@ -245,7 +245,7 @@ QSize QVideoSurfaceFormat::frameSize() const
\sa frameSize(), frameHeight()
*/
-int QVideoSurfaceFormat::frameWidth() const
+int QVideoFrameFormat::frameWidth() const
{
return d->frameSize.width();
}
@@ -253,12 +253,12 @@ int QVideoSurfaceFormat::frameWidth() const
/*!
Returns the height of frame in a video stream.
*/
-int QVideoSurfaceFormat::frameHeight() const
+int QVideoFrameFormat::frameHeight() const
{
return d->frameSize.height();
}
-int QVideoSurfaceFormat::nPlanes() const
+int QVideoFrameFormat::nPlanes() const
{
return QVideoTextureHelper::textureDescription(d->pixelFormat)->nplanes;
}
@@ -268,7 +268,7 @@ int QVideoSurfaceFormat::nPlanes() const
This will reset the viewport() to fill the entire frame.
*/
-void QVideoSurfaceFormat::setFrameSize(const QSize &size)
+void QVideoFrameFormat::setFrameSize(const QSize &size)
{
d->frameSize = size;
d->viewport = QRect(QPoint(0, 0), size);
@@ -281,7 +281,7 @@ void QVideoSurfaceFormat::setFrameSize(const QSize &size)
This will reset the viewport() to fill the entire frame.
*/
-void QVideoSurfaceFormat::setFrameSize(int width, int height)
+void QVideoFrameFormat::setFrameSize(int width, int height)
{
d->frameSize = QSize(width, height);
d->viewport = QRect(0, 0, width, height);
@@ -294,7 +294,7 @@ void QVideoSurfaceFormat::setFrameSize(int width, int height)
By default the viewport covers an entire frame.
*/
-QRect QVideoSurfaceFormat::viewport() const
+QRect QVideoFrameFormat::viewport() const
{
return d->viewport;
}
@@ -302,7 +302,7 @@ QRect QVideoSurfaceFormat::viewport() const
/*!
Sets the viewport of a video stream to \a viewport.
*/
-void QVideoSurfaceFormat::setViewport(const QRect &viewport)
+void QVideoFrameFormat::setViewport(const QRect &viewport)
{
d->viewport = viewport;
}
@@ -310,7 +310,7 @@ void QVideoSurfaceFormat::setViewport(const QRect &viewport)
/*!
Returns the direction of scan lines.
*/
-QVideoSurfaceFormat::Direction QVideoSurfaceFormat::scanLineDirection() const
+QVideoFrameFormat::Direction QVideoFrameFormat::scanLineDirection() const
{
return d->scanLineDirection;
}
@@ -318,7 +318,7 @@ QVideoSurfaceFormat::Direction QVideoSurfaceFormat::scanLineDirection() const
/*!
Sets the \a direction of scan lines.
*/
-void QVideoSurfaceFormat::setScanLineDirection(Direction direction)
+void QVideoFrameFormat::setScanLineDirection(Direction direction)
{
d->scanLineDirection = direction;
}
@@ -326,7 +326,7 @@ void QVideoSurfaceFormat::setScanLineDirection(Direction direction)
/*!
Returns the frame rate of a video stream in frames per second.
*/
-qreal QVideoSurfaceFormat::frameRate() const
+qreal QVideoFrameFormat::frameRate() const
{
return d->frameRate;
}
@@ -334,7 +334,7 @@ qreal QVideoSurfaceFormat::frameRate() const
/*!
Sets the frame \a rate of a video stream in frames per second.
*/
-void QVideoSurfaceFormat::setFrameRate(qreal rate)
+void QVideoFrameFormat::setFrameRate(qreal rate)
{
d->frameRate = rate;
}
@@ -342,7 +342,7 @@ void QVideoSurfaceFormat::setFrameRate(qreal rate)
/*!
Returns the Y'CbCr color space of a video stream.
*/
-QVideoSurfaceFormat::YCbCrColorSpace QVideoSurfaceFormat::yCbCrColorSpace() const
+QVideoFrameFormat::YCbCrColorSpace QVideoFrameFormat::yCbCrColorSpace() const
{
return d->ycbcrColorSpace;
}
@@ -351,7 +351,7 @@ QVideoSurfaceFormat::YCbCrColorSpace QVideoSurfaceFormat::yCbCrColorSpace() cons
Sets the Y'CbCr color \a space of a video stream.
It is only used with raw YUV frame types.
*/
-void QVideoSurfaceFormat::setYCbCrColorSpace(QVideoSurfaceFormat::YCbCrColorSpace space)
+void QVideoFrameFormat::setYCbCrColorSpace(QVideoFrameFormat::YCbCrColorSpace space)
{
d->ycbcrColorSpace = space;
}
@@ -365,7 +365,7 @@ void QVideoSurfaceFormat::setYCbCrColorSpace(QVideoSurfaceFormat::YCbCrColorSpac
\since 5.11
*/
-bool QVideoSurfaceFormat::isMirrored() const
+bool QVideoFrameFormat::isMirrored() const
{
return d->mirrored;
}
@@ -380,7 +380,7 @@ bool QVideoSurfaceFormat::isMirrored() const
\since 5.11
*/
-void QVideoSurfaceFormat::setMirrored(bool mirrored)
+void QVideoFrameFormat::setMirrored(bool mirrored)
{
d->mirrored = mirrored;
}
@@ -390,22 +390,22 @@ void QVideoSurfaceFormat::setMirrored(bool mirrored)
This is the same as the size of the viewport.
*/
-QSize QVideoSurfaceFormat::sizeHint() const
+QSize QVideoFrameFormat::sizeHint() const
{
return d->viewport.size();
}
-QString QVideoSurfaceFormat::vertexShaderFileName() const
+QString QVideoFrameFormat::vertexShaderFileName() const
{
return QVideoTextureHelper::vertexShaderFileName(d->pixelFormat);
}
-QString QVideoSurfaceFormat::fragmentShaderFileName() const
+QString QVideoFrameFormat::fragmentShaderFileName() const
{
return QVideoTextureHelper::fragmentShaderFileName(d->pixelFormat);
}
-QByteArray QVideoSurfaceFormat::uniformData(const QMatrix4x4 &transform, float opacity) const
+QByteArray QVideoFrameFormat::uniformData(const QMatrix4x4 &transform, float opacity) const
{
return QVideoTextureHelper::uniformData(*this, transform, opacity);
}
@@ -418,24 +418,24 @@ QByteArray QVideoSurfaceFormat::uniformData(const QMatrix4x4 &transform, float o
\note In general \l QImage does not handle YUV formats.
*/
-QVideoSurfaceFormat::PixelFormat QVideoSurfaceFormat::pixelFormatFromImageFormat(QImage::Format format)
+QVideoFrameFormat::PixelFormat QVideoFrameFormat::pixelFormatFromImageFormat(QImage::Format format)
{
switch (format) {
case QImage::Format_RGB32:
case QImage::Format_RGBX8888:
- return QVideoSurfaceFormat::Format_RGB32;
+ return QVideoFrameFormat::Format_RGB32;
case QImage::Format_ARGB32:
case QImage::Format_RGBA8888:
- return QVideoSurfaceFormat::Format_ARGB32;
+ return QVideoFrameFormat::Format_ARGB32;
case QImage::Format_ARGB32_Premultiplied:
case QImage::Format_RGBA8888_Premultiplied:
- return QVideoSurfaceFormat::Format_ARGB32_Premultiplied;
+ return QVideoFrameFormat::Format_ARGB32_Premultiplied;
case QImage::Format_Grayscale8:
- return QVideoSurfaceFormat::Format_Y8;
+ return QVideoFrameFormat::Format_Y8;
case QImage::Format_Grayscale16:
- return QVideoSurfaceFormat::Format_Y16;
+ return QVideoFrameFormat::Format_Y16;
default:
- return QVideoSurfaceFormat::Format_Invalid;
+ return QVideoFrameFormat::Format_Invalid;
}
}
@@ -446,64 +446,64 @@ QVideoSurfaceFormat::PixelFormat QVideoSurfaceFormat::pixelFormatFromImageFormat
\note In general \l QImage does not handle YUV formats.
*/
-QImage::Format QVideoSurfaceFormat::imageFormatFromPixelFormat(QVideoSurfaceFormat::PixelFormat format)
+QImage::Format QVideoFrameFormat::imageFormatFromPixelFormat(QVideoFrameFormat::PixelFormat format)
{
switch (format) {
- case QVideoSurfaceFormat::Format_ARGB32:
+ case QVideoFrameFormat::Format_ARGB32:
return QImage::Format_ARGB32;
- case QVideoSurfaceFormat::Format_ARGB32_Premultiplied:
+ case QVideoFrameFormat::Format_ARGB32_Premultiplied:
return QImage::Format_ARGB32_Premultiplied;
- case QVideoSurfaceFormat::Format_RGB32:
+ case QVideoFrameFormat::Format_RGB32:
return QImage::Format_RGB32;
- case QVideoSurfaceFormat::Format_Y8:
+ case QVideoFrameFormat::Format_Y8:
return QImage::Format_Grayscale8;
- case QVideoSurfaceFormat::Format_Y16:
+ case QVideoFrameFormat::Format_Y16:
return QImage::Format_Grayscale16;
- case QVideoSurfaceFormat::Format_ABGR32:
- case QVideoSurfaceFormat::Format_BGRA32:
- case QVideoSurfaceFormat::Format_BGRA32_Premultiplied:
- case QVideoSurfaceFormat::Format_BGR32:
- case QVideoSurfaceFormat::Format_AYUV444:
- case QVideoSurfaceFormat::Format_AYUV444_Premultiplied:
- case QVideoSurfaceFormat::Format_YUV420P:
- case QVideoSurfaceFormat::Format_YUV422P:
- case QVideoSurfaceFormat::Format_YV12:
- case QVideoSurfaceFormat::Format_UYVY:
- case QVideoSurfaceFormat::Format_YUYV:
- case QVideoSurfaceFormat::Format_NV12:
- case QVideoSurfaceFormat::Format_NV21:
- case QVideoSurfaceFormat::Format_IMC1:
- case QVideoSurfaceFormat::Format_IMC2:
- case QVideoSurfaceFormat::Format_IMC3:
- case QVideoSurfaceFormat::Format_IMC4:
- case QVideoSurfaceFormat::Format_P010:
- case QVideoSurfaceFormat::Format_P016:
- case QVideoSurfaceFormat::Format_Jpeg:
- case QVideoSurfaceFormat::Format_Invalid:
+ case QVideoFrameFormat::Format_ABGR32:
+ case QVideoFrameFormat::Format_BGRA32:
+ case QVideoFrameFormat::Format_BGRA32_Premultiplied:
+ case QVideoFrameFormat::Format_BGR32:
+ case QVideoFrameFormat::Format_AYUV444:
+ case QVideoFrameFormat::Format_AYUV444_Premultiplied:
+ case QVideoFrameFormat::Format_YUV420P:
+ case QVideoFrameFormat::Format_YUV422P:
+ case QVideoFrameFormat::Format_YV12:
+ case QVideoFrameFormat::Format_UYVY:
+ case QVideoFrameFormat::Format_YUYV:
+ case QVideoFrameFormat::Format_NV12:
+ case QVideoFrameFormat::Format_NV21:
+ case QVideoFrameFormat::Format_IMC1:
+ case QVideoFrameFormat::Format_IMC2:
+ case QVideoFrameFormat::Format_IMC3:
+ case QVideoFrameFormat::Format_IMC4:
+ case QVideoFrameFormat::Format_P010:
+ case QVideoFrameFormat::Format_P016:
+ case QVideoFrameFormat::Format_Jpeg:
+ case QVideoFrameFormat::Format_Invalid:
return QImage::Format_Invalid;
}
return QImage::Format_Invalid;
}
#ifndef QT_NO_DEBUG_STREAM
-QDebug operator<<(QDebug dbg, QVideoSurfaceFormat::YCbCrColorSpace cs)
+QDebug operator<<(QDebug dbg, QVideoFrameFormat::YCbCrColorSpace cs)
{
QDebugStateSaver saver(dbg);
dbg.nospace();
switch (cs) {
- case QVideoSurfaceFormat::YCbCr_BT601:
+ case QVideoFrameFormat::YCbCr_BT601:
dbg << "YCbCr_BT601";
break;
- case QVideoSurfaceFormat::YCbCr_BT709:
+ case QVideoFrameFormat::YCbCr_BT709:
dbg << "YCbCr_BT709";
break;
- case QVideoSurfaceFormat::YCbCr_JPEG:
+ case QVideoFrameFormat::YCbCr_JPEG:
dbg << "YCbCr_JPEG";
break;
- case QVideoSurfaceFormat::YCbCr_xvYCC601:
+ case QVideoFrameFormat::YCbCr_xvYCC601:
dbg << "YCbCr_xvYCC601";
break;
- case QVideoSurfaceFormat::YCbCr_xvYCC709:
+ case QVideoFrameFormat::YCbCr_xvYCC709:
dbg << "YCbCr_xvYCC709";
break;
default:
@@ -513,26 +513,26 @@ QDebug operator<<(QDebug dbg, QVideoSurfaceFormat::YCbCrColorSpace cs)
return dbg;
}
-QDebug operator<<(QDebug dbg, QVideoSurfaceFormat::Direction dir)
+QDebug operator<<(QDebug dbg, QVideoFrameFormat::Direction dir)
{
QDebugStateSaver saver(dbg);
dbg.nospace();
switch (dir) {
- case QVideoSurfaceFormat::BottomToTop:
+ case QVideoFrameFormat::BottomToTop:
dbg << "BottomToTop";
break;
- case QVideoSurfaceFormat::TopToBottom:
+ case QVideoFrameFormat::TopToBottom:
dbg << "TopToBottom";
break;
}
return dbg;
}
-QDebug operator<<(QDebug dbg, const QVideoSurfaceFormat &f)
+QDebug operator<<(QDebug dbg, const QVideoFrameFormat &f)
{
QDebugStateSaver saver(dbg);
dbg.nospace();
- dbg << "QVideoSurfaceFormat(" << f.pixelFormat() << ", " << f.frameSize()
+ dbg << "QVideoFrameFormat(" << f.pixelFormat() << ", " << f.frameSize()
<< ", viewport=" << f.viewport()
<< ", yCbCrColorSpace=" << f.yCbCrColorSpace()
<< ')'
@@ -546,62 +546,62 @@ QDebug operator<<(QDebug dbg, const QVideoSurfaceFormat &f)
return dbg;
}
-QDebug operator<<(QDebug dbg, QVideoSurfaceFormat::PixelFormat pf)
+QDebug operator<<(QDebug dbg, QVideoFrameFormat::PixelFormat pf)
{
QDebugStateSaver saver(dbg);
dbg.nospace();
switch (pf) {
- case QVideoSurfaceFormat::Format_Invalid:
+ case QVideoFrameFormat::Format_Invalid:
return dbg << "Format_Invalid";
- case QVideoSurfaceFormat::Format_ARGB32:
+ case QVideoFrameFormat::Format_ARGB32:
return dbg << "Format_ARGB32";
- case QVideoSurfaceFormat::Format_ARGB32_Premultiplied:
+ case QVideoFrameFormat::Format_ARGB32_Premultiplied:
return dbg << "Format_ARGB32_Premultiplied";
- case QVideoSurfaceFormat::Format_RGB32:
+ case QVideoFrameFormat::Format_RGB32:
return dbg << "Format_RGB32";
- case QVideoSurfaceFormat::Format_BGRA32:
+ case QVideoFrameFormat::Format_BGRA32:
return dbg << "Format_BGRA32";
- case QVideoSurfaceFormat::Format_BGRA32_Premultiplied:
+ case QVideoFrameFormat::Format_BGRA32_Premultiplied:
return dbg << "Format_BGRA32_Premultiplied";
- case QVideoSurfaceFormat::Format_ABGR32:
+ case QVideoFrameFormat::Format_ABGR32:
return dbg << "Format_ABGR32";
- case QVideoSurfaceFormat::Format_BGR32:
+ case QVideoFrameFormat::Format_BGR32:
return dbg << "Format_BGR32";
- case QVideoSurfaceFormat::Format_AYUV444:
+ case QVideoFrameFormat::Format_AYUV444:
return dbg << "Format_AYUV444";
- case QVideoSurfaceFormat::Format_AYUV444_Premultiplied:
+ case QVideoFrameFormat::Format_AYUV444_Premultiplied:
return dbg << "Format_AYUV444_Premultiplied";
- case QVideoSurfaceFormat::Format_YUV420P:
+ case QVideoFrameFormat::Format_YUV420P:
return dbg << "Format_YUV420P";
- case QVideoSurfaceFormat::Format_YUV422P:
+ case QVideoFrameFormat::Format_YUV422P:
return dbg << "Format_YUV422P";
- case QVideoSurfaceFormat::Format_YV12:
+ case QVideoFrameFormat::Format_YV12:
return dbg << "Format_YV12";
- case QVideoSurfaceFormat::Format_UYVY:
+ case QVideoFrameFormat::Format_UYVY:
return dbg << "Format_UYVY";
- case QVideoSurfaceFormat::Format_YUYV:
+ case QVideoFrameFormat::Format_YUYV:
return dbg << "Format_YUYV";
- case QVideoSurfaceFormat::Format_NV12:
+ case QVideoFrameFormat::Format_NV12:
return dbg << "Format_NV12";
- case QVideoSurfaceFormat::Format_NV21:
+ case QVideoFrameFormat::Format_NV21:
return dbg << "Format_NV21";
- case QVideoSurfaceFormat::Format_IMC1:
+ case QVideoFrameFormat::Format_IMC1:
return dbg << "Format_IMC1";
- case QVideoSurfaceFormat::Format_IMC2:
+ case QVideoFrameFormat::Format_IMC2:
return dbg << "Format_IMC2";
- case QVideoSurfaceFormat::Format_IMC3:
+ case QVideoFrameFormat::Format_IMC3:
return dbg << "Format_IMC3";
- case QVideoSurfaceFormat::Format_IMC4:
+ case QVideoFrameFormat::Format_IMC4:
return dbg << "Format_IMC4";
- case QVideoSurfaceFormat::Format_Y8:
+ case QVideoFrameFormat::Format_Y8:
return dbg << "Format_Y8";
- case QVideoSurfaceFormat::Format_Y16:
+ case QVideoFrameFormat::Format_Y16:
return dbg << "Format_Y16";
- case QVideoSurfaceFormat::Format_P010:
+ case QVideoFrameFormat::Format_P010:
return dbg << "Format_P010";
- case QVideoSurfaceFormat::Format_P016:
+ case QVideoFrameFormat::Format_P016:
return dbg << "Format_P016";
- case QVideoSurfaceFormat::Format_Jpeg:
+ case QVideoFrameFormat::Format_Jpeg:
return dbg << "Format_Jpeg";
default:
diff --git a/src/multimedia/video/qvideosurfaceformat.h b/src/multimedia/video/qvideoframeformat.h
index e3551501a..e9be55ca1 100644
--- a/src/multimedia/video/qvideosurfaceformat.h
+++ b/src/multimedia/video/qvideoframeformat.h
@@ -53,10 +53,10 @@ QT_BEGIN_NAMESPACE
class QDebug;
-class QVideoSurfaceFormatPrivate;
+class QVideoFrameFormatPrivate;
class QMatrix4x4;
-class Q_MULTIMEDIA_EXPORT QVideoSurfaceFormat
+class Q_MULTIMEDIA_EXPORT QVideoFrameFormat
{
public:
enum PixelFormat
@@ -111,21 +111,21 @@ public:
YCbCr_JPEG,
};
- QVideoSurfaceFormat();
- QVideoSurfaceFormat(
+ QVideoFrameFormat();
+ QVideoFrameFormat(
const QSize &size,
- QVideoSurfaceFormat::PixelFormat pixelFormat);
- QVideoSurfaceFormat(const QVideoSurfaceFormat &format);
- ~QVideoSurfaceFormat();
+ QVideoFrameFormat::PixelFormat pixelFormat);
+ QVideoFrameFormat(const QVideoFrameFormat &format);
+ ~QVideoFrameFormat();
- QVideoSurfaceFormat &operator =(const QVideoSurfaceFormat &format);
+ QVideoFrameFormat &operator =(const QVideoFrameFormat &format);
- bool operator ==(const QVideoSurfaceFormat &format) const;
- bool operator !=(const QVideoSurfaceFormat &format) const;
+ bool operator ==(const QVideoFrameFormat &format) const;
+ bool operator !=(const QVideoFrameFormat &format) const;
bool isValid() const;
- QVideoSurfaceFormat::PixelFormat pixelFormat() const;
+ QVideoFrameFormat::PixelFormat pixelFormat() const;
QSize frameSize() const;
void setFrameSize(const QSize &size);
@@ -161,14 +161,14 @@ public:
static QImage::Format imageFormatFromPixelFormat(PixelFormat format);
private:
- QSharedDataPointer<QVideoSurfaceFormatPrivate> d;
+ QSharedDataPointer<QVideoFrameFormatPrivate> d;
};
#ifndef QT_NO_DEBUG_STREAM
-Q_MULTIMEDIA_EXPORT QDebug operator<<(QDebug, const QVideoSurfaceFormat &);
-Q_MULTIMEDIA_EXPORT QDebug operator<<(QDebug, QVideoSurfaceFormat::Direction);
-Q_MULTIMEDIA_EXPORT QDebug operator<<(QDebug, QVideoSurfaceFormat::YCbCrColorSpace);
-Q_MULTIMEDIA_EXPORT QDebug operator<<(QDebug, QVideoSurfaceFormat::PixelFormat);
+Q_MULTIMEDIA_EXPORT QDebug operator<<(QDebug, const QVideoFrameFormat &);
+Q_MULTIMEDIA_EXPORT QDebug operator<<(QDebug, QVideoFrameFormat::Direction);
+Q_MULTIMEDIA_EXPORT QDebug operator<<(QDebug, QVideoFrameFormat::YCbCrColorSpace);
+Q_MULTIMEDIA_EXPORT QDebug operator<<(QDebug, QVideoFrameFormat::PixelFormat);
#endif
QT_END_NAMESPACE
diff --git a/src/multimedia/video/qvideosink.cpp b/src/multimedia/video/qvideosink.cpp
index 541d9058a..93308112e 100644
--- a/src/multimedia/video/qvideosink.cpp
+++ b/src/multimedia/video/qvideosink.cpp
@@ -39,7 +39,7 @@
#include "qvideosink.h"
-#include "qvideosurfaceformat.h"
+#include "qvideoframeformat.h"
#include "qvideoframe.h"
#include <qvariant.h>
@@ -65,7 +65,7 @@ public:
QVideoSink *q_ptr = nullptr;
QPlatformVideoSink *videoSink = nullptr;
QVideoSink::GraphicsType type = QVideoSink::Memory;
- QVideoSurfaceFormat surfaceFormat;
+ QVideoFrameFormat surfaceFormat;
QSize nativeResolution;
bool active = false;
WId window = 0;
@@ -283,13 +283,13 @@ void QVideoSink::paint(QPainter *painter, const QVideoFrame &f)
return;
}
- auto imageFormat = QVideoSurfaceFormat::imageFormatFromPixelFormat(frame.pixelFormat());
+ auto imageFormat = QVideoFrameFormat::imageFormatFromPixelFormat(frame.pixelFormat());
// Do not render into ARGB32 images using QPainter.
// Using QImage::Format_ARGB32_Premultiplied is significantly faster.
if (imageFormat == QImage::Format_ARGB32)
imageFormat = QImage::Format_ARGB32_Premultiplied;
- QVideoSurfaceFormat::Direction scanLineDirection = QVideoSurfaceFormat::TopToBottom;//format.scanLineDirection();
+ QVideoFrameFormat::Direction scanLineDirection = QVideoFrameFormat::TopToBottom;//format.scanLineDirection();
bool mirrored = false;//format.isMirrored();
QSizeF size = frame.size();
@@ -332,7 +332,7 @@ void QVideoSink::paint(QPainter *painter, const QVideoFrame &f)
const QTransform oldTransform = painter->transform();
QTransform transform = oldTransform;
- if (scanLineDirection == QVideoSurfaceFormat::BottomToTop) {
+ if (scanLineDirection == QVideoFrameFormat::BottomToTop) {
transform.scale(1, -1);
transform.translate(0, -targetRect.bottom());
targetRect = QRectF(targetRect.x(), 0, targetRect.width(), targetRect.height());
diff --git a/src/multimedia/video/qvideosink.h b/src/multimedia/video/qvideosink.h
index 524a2af14..e88a288c5 100644
--- a/src/multimedia/video/qvideosink.h
+++ b/src/multimedia/video/qvideosink.h
@@ -47,7 +47,7 @@
QT_BEGIN_NAMESPACE
class QRectF;
-class QVideoSurfaceFormat;
+class QVideoFrameFormat;
class QVideoFrame;
class QVideoSinkPrivate;
diff --git a/src/multimedia/video/qvideotexturehelper.cpp b/src/multimedia/video/qvideotexturehelper.cpp
index f0797b039..706844022 100644
--- a/src/multimedia/video/qvideotexturehelper.cpp
+++ b/src/multimedia/video/qvideotexturehelper.cpp
@@ -43,7 +43,7 @@
namespace QVideoTextureHelper
{
-static const TextureDescription descriptions[QVideoSurfaceFormat::NPixelFormats] = {
+static const TextureDescription descriptions[QVideoFrameFormat::NPixelFormats] = {
// Format_Invalid
{ 0,
{ QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat},
@@ -180,76 +180,76 @@ static const TextureDescription descriptions[QVideoSurfaceFormat::NPixelFormats]
};
-const TextureDescription *textureDescription(QVideoSurfaceFormat::PixelFormat format)
+const TextureDescription *textureDescription(QVideoFrameFormat::PixelFormat format)
{
return descriptions + format;
}
-QString vertexShaderFileName(QVideoSurfaceFormat::PixelFormat /*format*/)
+QString vertexShaderFileName(QVideoFrameFormat::PixelFormat /*format*/)
{
return QStringLiteral(":/qt-project.org/multimedia/shaders/vertex.vert.qsb");
}
-QString fragmentShaderFileName(QVideoSurfaceFormat::PixelFormat format)
+QString fragmentShaderFileName(QVideoFrameFormat::PixelFormat format)
{
switch (format) {
- case QVideoSurfaceFormat::Format_Invalid:
- case QVideoSurfaceFormat::Format_Jpeg:
+ case QVideoFrameFormat::Format_Invalid:
+ case QVideoFrameFormat::Format_Jpeg:
return QString();
- case QVideoSurfaceFormat::Format_Y8:
- case QVideoSurfaceFormat::Format_Y16:
+ case QVideoFrameFormat::Format_Y8:
+ case QVideoFrameFormat::Format_Y16:
return QStringLiteral(":/qt-project.org/multimedia/shaders/y.frag.qsb");
- case QVideoSurfaceFormat::Format_AYUV444:
- case QVideoSurfaceFormat::Format_AYUV444_Premultiplied:
+ case QVideoFrameFormat::Format_AYUV444:
+ case QVideoFrameFormat::Format_AYUV444_Premultiplied:
return QStringLiteral(":/qt-project.org/multimedia/shaders/ayuv.frag.qsb");
- case QVideoSurfaceFormat::Format_ARGB32:
- case QVideoSurfaceFormat::Format_ARGB32_Premultiplied:
- case QVideoSurfaceFormat::Format_RGB32:
+ case QVideoFrameFormat::Format_ARGB32:
+ case QVideoFrameFormat::Format_ARGB32_Premultiplied:
+ case QVideoFrameFormat::Format_RGB32:
return QStringLiteral(":/qt-project.org/multimedia/shaders/argb.frag.qsb");
- case QVideoSurfaceFormat::Format_BGRA32:
- case QVideoSurfaceFormat::Format_BGRA32_Premultiplied:
+ case QVideoFrameFormat::Format_BGRA32:
+ case QVideoFrameFormat::Format_BGRA32_Premultiplied:
return QStringLiteral(":/qt-project.org/multimedia/shaders/bgra.frag.qsb");
- case QVideoSurfaceFormat::Format_ABGR32:
- case QVideoSurfaceFormat::Format_BGR32:
+ case QVideoFrameFormat::Format_ABGR32:
+ case QVideoFrameFormat::Format_BGR32:
return QStringLiteral(":/qt-project.org/multimedia/shaders/abgr.frag.qsb");
- case QVideoSurfaceFormat::Format_YUV420P:
- case QVideoSurfaceFormat::Format_YUV422P:
- case QVideoSurfaceFormat::Format_IMC3:
+ case QVideoFrameFormat::Format_YUV420P:
+ case QVideoFrameFormat::Format_YUV422P:
+ case QVideoFrameFormat::Format_IMC3:
return QStringLiteral(":/qt-project.org/multimedia/shaders/yuv_triplanar.frag.qsb");
- case QVideoSurfaceFormat::Format_YV12:
- case QVideoSurfaceFormat::Format_IMC1:
+ case QVideoFrameFormat::Format_YV12:
+ case QVideoFrameFormat::Format_IMC1:
return QStringLiteral(":/qt-project.org/multimedia/shaders/yvu_triplanar.frag.qsb");
- case QVideoSurfaceFormat::Format_IMC2:
+ case QVideoFrameFormat::Format_IMC2:
return QStringLiteral(":/qt-project.org/multimedia/shaders/imc2.frag.qsb");
- case QVideoSurfaceFormat::Format_IMC4:
+ case QVideoFrameFormat::Format_IMC4:
return QStringLiteral(":/qt-project.org/multimedia/shaders/imc4.frag.qsb");
- case QVideoSurfaceFormat::Format_UYVY:
+ case QVideoFrameFormat::Format_UYVY:
return QStringLiteral(":/qt-project.org/multimedia/shaders/uyvy.frag.qsb");
- case QVideoSurfaceFormat::Format_YUYV:
+ case QVideoFrameFormat::Format_YUYV:
return QStringLiteral(":/qt-project.org/multimedia/shaders/yuyv.frag.qsb");
- case QVideoSurfaceFormat::Format_NV12:
- case QVideoSurfaceFormat::Format_P010:
- case QVideoSurfaceFormat::Format_P016:
+ case QVideoFrameFormat::Format_NV12:
+ case QVideoFrameFormat::Format_P010:
+ case QVideoFrameFormat::Format_P016:
// P010/P016 have the same layout as NV12, just 16 instead of 8 bits per pixel
return QStringLiteral(":/qt-project.org/multimedia/shaders/nv12.frag.qsb");
- case QVideoSurfaceFormat::Format_NV21:
+ case QVideoFrameFormat::Format_NV21:
return QStringLiteral(":/qt-project.org/multimedia/shaders/nv21.frag.qsb");
}
}
-static QMatrix4x4 colorMatrix(QVideoSurfaceFormat::YCbCrColorSpace colorSpace)
+static QMatrix4x4 colorMatrix(QVideoFrameFormat::YCbCrColorSpace colorSpace)
{
switch (colorSpace) {
- case QVideoSurfaceFormat::YCbCr_JPEG:
+ case QVideoFrameFormat::YCbCr_JPEG:
return QMatrix4x4(
1.0f, 0.000f, 1.402f, -0.701f,
1.0f, -0.344f, -0.714f, 0.529f,
1.0f, 1.772f, 0.000f, -0.886f,
0.0f, 0.000f, 0.000f, 1.0000f);
- case QVideoSurfaceFormat::YCbCr_BT709:
- case QVideoSurfaceFormat::YCbCr_xvYCC709:
+ case QVideoFrameFormat::YCbCr_BT709:
+ case QVideoFrameFormat::YCbCr_xvYCC709:
return QMatrix4x4(
1.164f, 0.000f, 1.793f, -0.5727f,
1.164f, -0.534f, -0.213f, 0.3007f,
@@ -298,40 +298,40 @@ static QMatrix4x4 yuvColorCorrectionMatrix(float brightness, float contrast, flo
}
#endif
-QByteArray uniformData(const QVideoSurfaceFormat &format, const QMatrix4x4 &transform, float opacity)
+QByteArray uniformData(const QVideoFrameFormat &format, const QMatrix4x4 &transform, float opacity)
{
QMatrix4x4 cmat;
switch (format.pixelFormat()) {
- case QVideoSurfaceFormat::Format_Invalid:
- case QVideoSurfaceFormat::Format_Jpeg:
+ case QVideoFrameFormat::Format_Invalid:
+ case QVideoFrameFormat::Format_Jpeg:
return QByteArray();
- case QVideoSurfaceFormat::Format_ARGB32:
- case QVideoSurfaceFormat::Format_ARGB32_Premultiplied:
- case QVideoSurfaceFormat::Format_RGB32:
- case QVideoSurfaceFormat::Format_BGRA32:
- case QVideoSurfaceFormat::Format_BGRA32_Premultiplied:
- case QVideoSurfaceFormat::Format_ABGR32:
- case QVideoSurfaceFormat::Format_BGR32:
+ case QVideoFrameFormat::Format_ARGB32:
+ case QVideoFrameFormat::Format_ARGB32_Premultiplied:
+ case QVideoFrameFormat::Format_RGB32:
+ case QVideoFrameFormat::Format_BGRA32:
+ case QVideoFrameFormat::Format_BGRA32_Premultiplied:
+ case QVideoFrameFormat::Format_ABGR32:
+ case QVideoFrameFormat::Format_BGR32:
- case QVideoSurfaceFormat::Format_Y8:
- case QVideoSurfaceFormat::Format_Y16:
+ case QVideoFrameFormat::Format_Y8:
+ case QVideoFrameFormat::Format_Y16:
break;
- case QVideoSurfaceFormat::Format_IMC1:
- case QVideoSurfaceFormat::Format_IMC2:
- case QVideoSurfaceFormat::Format_IMC3:
- case QVideoSurfaceFormat::Format_IMC4:
- case QVideoSurfaceFormat::Format_AYUV444:
- case QVideoSurfaceFormat::Format_AYUV444_Premultiplied:
- case QVideoSurfaceFormat::Format_YUV420P:
- case QVideoSurfaceFormat::Format_YUV422P:
- case QVideoSurfaceFormat::Format_YV12:
- case QVideoSurfaceFormat::Format_UYVY:
- case QVideoSurfaceFormat::Format_YUYV:
- case QVideoSurfaceFormat::Format_NV12:
- case QVideoSurfaceFormat::Format_NV21:
- case QVideoSurfaceFormat::Format_P010:
- case QVideoSurfaceFormat::Format_P016:
+ case QVideoFrameFormat::Format_IMC1:
+ case QVideoFrameFormat::Format_IMC2:
+ case QVideoFrameFormat::Format_IMC3:
+ case QVideoFrameFormat::Format_IMC4:
+ case QVideoFrameFormat::Format_AYUV444:
+ case QVideoFrameFormat::Format_AYUV444_Premultiplied:
+ case QVideoFrameFormat::Format_YUV420P:
+ case QVideoFrameFormat::Format_YUV422P:
+ case QVideoFrameFormat::Format_YV12:
+ case QVideoFrameFormat::Format_UYVY:
+ case QVideoFrameFormat::Format_YUYV:
+ case QVideoFrameFormat::Format_NV12:
+ case QVideoFrameFormat::Format_NV21:
+ case QVideoFrameFormat::Format_P010:
+ case QVideoFrameFormat::Format_P016:
cmat = colorMatrix(format.yCbCrColorSpace());
break;
}
@@ -348,8 +348,8 @@ QByteArray uniformData(const QVideoSurfaceFormat &format, const QMatrix4x4 &tran
int updateRhiTextures(QVideoFrame frame, QRhi *rhi, QRhiResourceUpdateBatch *resourceUpdates, QRhiTexture **textures)
{
- QVideoSurfaceFormat fmt = frame.surfaceFormat();
- QVideoSurfaceFormat::PixelFormat pixelFormat = fmt.pixelFormat();
+ QVideoFrameFormat fmt = frame.surfaceFormat();
+ QVideoFrameFormat::PixelFormat pixelFormat = fmt.pixelFormat();
QSize size = fmt.frameSize();
const TextureDescription *description = descriptions + pixelFormat;
diff --git a/src/multimedia/video/qvideotexturehelper_p.h b/src/multimedia/video/qvideotexturehelper_p.h
index 4b369594a..153752010 100644
--- a/src/multimedia/video/qvideotexturehelper_p.h
+++ b/src/multimedia/video/qvideotexturehelper_p.h
@@ -40,7 +40,7 @@
#ifndef QVIDEOTEXTUREHELPER_H
#define QVIDEOTEXTUREHELPER_H
-#include <qvideosurfaceformat.h>
+#include <qvideoframeformat.h>
#include <private/qrhi_p.h>
QT_BEGIN_NAMESPACE
@@ -63,11 +63,11 @@ struct TextureDescription
SizeScale sizeScale[maxPlanes];
};
-Q_MULTIMEDIA_EXPORT const TextureDescription *textureDescription(QVideoSurfaceFormat::PixelFormat format);
+Q_MULTIMEDIA_EXPORT const TextureDescription *textureDescription(QVideoFrameFormat::PixelFormat format);
-Q_MULTIMEDIA_EXPORT QString vertexShaderFileName(QVideoSurfaceFormat::PixelFormat format);
-Q_MULTIMEDIA_EXPORT QString fragmentShaderFileName(QVideoSurfaceFormat::PixelFormat format);
-Q_MULTIMEDIA_EXPORT QByteArray uniformData(const QVideoSurfaceFormat &format, const QMatrix4x4 &transform, float opacity);
+Q_MULTIMEDIA_EXPORT QString vertexShaderFileName(QVideoFrameFormat::PixelFormat format);
+Q_MULTIMEDIA_EXPORT QString fragmentShaderFileName(QVideoFrameFormat::PixelFormat format);
+Q_MULTIMEDIA_EXPORT QByteArray uniformData(const QVideoFrameFormat &format, const QMatrix4x4 &transform, float opacity);
Q_MULTIMEDIA_EXPORT int updateRhiTextures(QVideoFrame frame, QRhi *rhi,
QRhiResourceUpdateBatch *resourceUpdates, QRhiTexture **textures);
diff --git a/src/multimedia/video/video.pri b/src/multimedia/video/video.pri
index 50d1a260b..c6ba59c2b 100644
--- a/src/multimedia/video/video.pri
+++ b/src/multimedia/video/video.pri
@@ -4,7 +4,7 @@ INCLUDEPATH += video
PUBLIC_HEADERS += \
video/qabstractvideosurface.h \
video/qvideoframe.h \
- video/qvideosurfaceformat.h \
+ video/qvideoframeformat.h \
PRIVATE_HEADERS += \
video/qabstractvideobuffer_p.h \
@@ -21,7 +21,7 @@ SOURCES += \
video/qmemoryvideobuffer.cpp \
video/qvideoframe.cpp \
video/qvideooutputorientationhandler.cpp \
- video/qvideosurfaceformat.cpp \
+ video/qvideoframeformat.cpp \
video/qvideoframeconversionhelper.cpp \
video/qvideosurfaces.cpp
diff --git a/src/multimediawidgets/qgraphicsvideoitem.cpp b/src/multimediawidgets/qgraphicsvideoitem.cpp
index b224c9701..240a9eb32 100644
--- a/src/multimediawidgets/qgraphicsvideoitem.cpp
+++ b/src/multimediawidgets/qgraphicsvideoitem.cpp
@@ -42,7 +42,7 @@
#include <qobject.h>
#include <qvideoframe.h>
-#include <qvideosurfaceformat.h>
+#include <qvideoframeformat.h>
#include <QtCore/qcoreevent.h>
#include <QtCore/qpointer.h>
diff --git a/src/multimediawidgets/qgraphicsvideoitem.h b/src/multimediawidgets/qgraphicsvideoitem.h
index c331763e0..96c67c876 100644
--- a/src/multimediawidgets/qgraphicsvideoitem.h
+++ b/src/multimediawidgets/qgraphicsvideoitem.h
@@ -48,7 +48,7 @@
QT_BEGIN_NAMESPACE
-class QVideoSurfaceFormat;
+class QVideoFrameFormat;
class QGraphicsVideoItemPrivate;
class Q_MULTIMEDIAWIDGETS_EXPORT QGraphicsVideoItem : public QGraphicsObject
{
diff --git a/src/multimediawidgets/qvideowidget.cpp b/src/multimediawidgets/qvideowidget.cpp
index e7b20a76d..cd15b6275 100644
--- a/src/multimediawidgets/qvideowidget.cpp
+++ b/src/multimediawidgets/qvideowidget.cpp
@@ -45,7 +45,7 @@
#include <qvideosink.h>
#include <qobject.h>
-#include <qvideosurfaceformat.h>
+#include <qvideoframeformat.h>
#include <qpainter.h>
#include <qapplication.h>
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
diff --git a/src/qtmultimediaquicktools/qdeclarativevideooutput.cpp b/src/qtmultimediaquicktools/qdeclarativevideooutput.cpp
index 1ccea41e1..fc6d8d755 100644
--- a/src/qtmultimediaquicktools/qdeclarativevideooutput.cpp
+++ b/src/qtmultimediaquicktools/qdeclarativevideooutput.cpp
@@ -434,7 +434,7 @@ QRectF QDeclarativeVideoOutput::contentRect() const
The orientation setting does not affect this rectangle.
- \sa QVideoSurfaceFormat::viewport()
+ \sa QVideoFrameFormat::viewport()
*/
QRectF QDeclarativeVideoOutput::sourceRect() const
{
@@ -451,7 +451,7 @@ QRectF QDeclarativeVideoOutput::sourceRect() const
// Take the viewport into account for the top left position.
// m_nativeSize is already adjusted to the viewport, as it originats
- // from QVideoSurfaceFormat::sizeHint(), which includes pixel aspect
+ // from QVideoFrameFormat::sizeHint(), which includes pixel aspect
// ratio and viewport.
const QRectF viewport = m_backend->adjustedViewport();
Q_ASSERT(viewport.size() == size);
diff --git a/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp b/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp
index 17dd61706..b112c752e 100644
--- a/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp
+++ b/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp
@@ -136,7 +136,7 @@ void QDeclarativeVideoBackend::updateGeometry()
}
}
- if (m_surfaceFormat.scanLineDirection() == QVideoSurfaceFormat::BottomToTop) {
+ if (m_surfaceFormat.scanLineDirection() == QVideoFrameFormat::BottomToTop) {
qreal top = m_sourceTextureRect.top();
m_sourceTextureRect.setTop(m_sourceTextureRect.bottom());
m_sourceTextureRect.setBottom(top);
@@ -208,7 +208,7 @@ QVideoSink *QDeclarativeVideoBackend::videoSink() const
if (!m_sink) {
m_sink = new QVideoSink(q);
m_sink->setRhi(QQuickWindowPrivate::get(q->window())->rhi);
- qRegisterMetaType<QVideoSurfaceFormat>();
+ qRegisterMetaType<QVideoFrameFormat>();
QObject::connect(m_sink, SIGNAL(newVideoFrame(const QVideoFrame &)),
q, SLOT(_q_newFrame(const QVideoFrame &)), Qt::QueuedConnection);
}
diff --git a/src/qtmultimediaquicktools/qdeclarativevideooutput_render_p.h b/src/qtmultimediaquicktools/qdeclarativevideooutput_render_p.h
index b23b74da2..625ba010f 100644
--- a/src/qtmultimediaquicktools/qdeclarativevideooutput_render_p.h
+++ b/src/qtmultimediaquicktools/qdeclarativevideooutput_render_p.h
@@ -88,7 +88,7 @@ private:
QDeclarativeVideoOutput *q;
mutable QVideoSink *m_sink = nullptr;
- QVideoSurfaceFormat m_surfaceFormat;
+ QVideoFrameFormat m_surfaceFormat;
QVideoFrame m_frame;
QVideoFrame m_frameOnFlush;
diff --git a/src/qtmultimediaquicktools/qsgvideonode_p.cpp b/src/qtmultimediaquicktools/qsgvideonode_p.cpp
index eb6a31d31..fc952e09b 100644
--- a/src/qtmultimediaquicktools/qsgvideonode_p.cpp
+++ b/src/qtmultimediaquicktools/qsgvideonode_p.cpp
@@ -125,7 +125,7 @@ void QSGVideoNode::setTexturedRectGeometry(const QRectF &rect, const QRectF &tex
class QSGVideoMaterialRhiShader : public QSGMaterialShader
{
public:
- QSGVideoMaterialRhiShader(const QVideoSurfaceFormat &format)
+ QSGVideoMaterialRhiShader(const QVideoFrameFormat &format)
: m_format(format)
{
setShaderFileName(VertexStage, m_format.vertexShaderFileName());
@@ -139,7 +139,7 @@ public:
QSGMaterial *newMaterial, QSGMaterial *oldMaterial) override;
protected:
- QVideoSurfaceFormat m_format;
+ QVideoFrameFormat m_format;
float m_planeWidth[3] = {0, 0, 0};
QMatrix4x4 m_colorMatrix;
};
@@ -147,10 +147,10 @@ protected:
class QSGVideoMaterial : public QSGMaterial
{
public:
- QSGVideoMaterial(const QVideoSurfaceFormat &format);
+ QSGVideoMaterial(const QVideoFrameFormat &format);
[[nodiscard]] QSGMaterialType *type() const override {
- static QSGMaterialType type[QVideoSurfaceFormat::NPixelFormats];
+ static QSGMaterialType type[QVideoFrameFormat::NPixelFormats];
return &type[m_format.pixelFormat()];
}
@@ -183,7 +183,7 @@ public:
void updateTextures(QRhi *rhi, QRhiResourceUpdateBatch *resourceUpdates);
- QVideoSurfaceFormat m_format;
+ QVideoFrameFormat m_format;
float m_planeWidth[3];
float m_opacity;
@@ -253,7 +253,7 @@ void QSGVideoMaterialRhiShader::updateSampledImage(RenderState &state, int bindi
*texture = m->m_textures[binding - 1].data();
}
-QSGVideoMaterial::QSGVideoMaterial(const QVideoSurfaceFormat &format) :
+QSGVideoMaterial::QSGVideoMaterial(const QVideoFrameFormat &format) :
m_format(format),
m_opacity(1.0)
{
@@ -264,7 +264,7 @@ QSGVideoMaterial::QSGVideoMaterial(const QVideoSurfaceFormat &format) :
setFlag(Blending, false);
}
-QSGVideoNode::QSGVideoNode(const QVideoSurfaceFormat &format)
+QSGVideoNode::QSGVideoNode(const QVideoFrameFormat &format)
: m_orientation(-1),
m_format(format)
{
diff --git a/src/qtmultimediaquicktools/qsgvideonode_p.h b/src/qtmultimediaquicktools/qsgvideonode_p.h
index 2422f1388..f6b9a562d 100644
--- a/src/qtmultimediaquicktools/qsgvideonode_p.h
+++ b/src/qtmultimediaquicktools/qsgvideonode_p.h
@@ -55,7 +55,7 @@
#include <private/qtmultimediaquickdefs_p.h>
#include <QtMultimedia/qvideoframe.h>
-#include <QtMultimedia/qvideosurfaceformat.h>
+#include <QtMultimedia/qvideoframeformat.h>
#include <QtGui/qopenglfunctions.h>
QT_BEGIN_NAMESPACE
@@ -65,9 +65,9 @@ class QSGVideoMaterial;
class QSGVideoNode : public QSGGeometryNode
{
public:
- QSGVideoNode(const QVideoSurfaceFormat &format);
+ QSGVideoNode(const QVideoFrameFormat &format);
- QVideoSurfaceFormat::PixelFormat pixelFormat() const {
+ QVideoFrameFormat::PixelFormat pixelFormat() const {
return m_format.pixelFormat();
}
void setCurrentFrame(const QVideoFrame &frame);
@@ -79,7 +79,7 @@ private:
QRectF m_textureRect;
int m_orientation;
- QVideoSurfaceFormat m_format;
+ QVideoFrameFormat m_format;
QSGVideoMaterial *m_material;
};