summaryrefslogtreecommitdiffstats
path: root/src/multimedia/video
diff options
context:
space:
mode:
Diffstat (limited to 'src/multimedia/video')
-rw-r--r--src/multimedia/video/qabstractvideofilter.h2
-rw-r--r--src/multimedia/video/qabstractvideosurface.h2
-rw-r--r--src/multimedia/video/qimagevideobuffer.cpp2
-rw-r--r--src/multimedia/video/qvideoframe.cpp38
-rw-r--r--src/multimedia/video/qvideoprobe.h2
-rw-r--r--src/multimedia/video/qvideosurfaceformat.cpp29
-rw-r--r--src/multimedia/video/qvideosurfaceformat.h3
7 files changed, 55 insertions, 23 deletions
diff --git a/src/multimedia/video/qabstractvideofilter.h b/src/multimedia/video/qabstractvideofilter.h
index 7e125fac4..6263f4730 100644
--- a/src/multimedia/video/qabstractvideofilter.h
+++ b/src/multimedia/video/qabstractvideofilter.h
@@ -68,7 +68,7 @@ class Q_MULTIMEDIA_EXPORT QAbstractVideoFilter : public QObject
Q_PROPERTY(bool active READ isActive WRITE setActive NOTIFY activeChanged)
public:
- explicit QAbstractVideoFilter(QObject *parent = Q_NULLPTR);
+ explicit QAbstractVideoFilter(QObject *parent = nullptr);
~QAbstractVideoFilter();
bool isActive() const;
diff --git a/src/multimedia/video/qabstractvideosurface.h b/src/multimedia/video/qabstractvideosurface.h
index f3d3e0799..391c9e696 100644
--- a/src/multimedia/video/qabstractvideosurface.h
+++ b/src/multimedia/video/qabstractvideosurface.h
@@ -64,7 +64,7 @@ public:
ResourceError
};
- explicit QAbstractVideoSurface(QObject *parent = Q_NULLPTR);
+ explicit QAbstractVideoSurface(QObject *parent = nullptr);
~QAbstractVideoSurface();
virtual QList<QVideoFrame::PixelFormat> supportedPixelFormats(
diff --git a/src/multimedia/video/qimagevideobuffer.cpp b/src/multimedia/video/qimagevideobuffer.cpp
index 59f708fed..f407e02d0 100644
--- a/src/multimedia/video/qimagevideobuffer.cpp
+++ b/src/multimedia/video/qimagevideobuffer.cpp
@@ -89,7 +89,7 @@ uchar *QImageVideoBuffer::map(MapMode mode, int *numBytes, int *bytesPerLine)
d->mapMode = mode;
if (numBytes)
- *numBytes = d->image.byteCount();
+ *numBytes = int(d->image.sizeInBytes());
if (bytesPerLine)
*bytesPerLine = d->image.bytesPerLine();
diff --git a/src/multimedia/video/qvideoframe.cpp b/src/multimedia/video/qvideoframe.cpp
index 8578eee1c..bbb87b63b 100644
--- a/src/multimedia/video/qvideoframe.cpp
+++ b/src/multimedia/video/qvideoframe.cpp
@@ -1025,23 +1025,23 @@ extern void QT_FASTCALL qt_convert_NV12_to_ARGB32(const QVideoFrame&, uchar*);
extern void QT_FASTCALL qt_convert_NV21_to_ARGB32(const QVideoFrame&, uchar*);
static VideoFrameConvertFunc qConvertFuncs[QVideoFrame::NPixelFormats] = {
- /* Format_Invalid */ Q_NULLPTR, // Not needed
- /* Format_ARGB32 */ Q_NULLPTR, // Not needed
- /* Format_ARGB32_Premultiplied */ Q_NULLPTR, // Not needed
- /* Format_RGB32 */ Q_NULLPTR, // Not needed
- /* Format_RGB24 */ Q_NULLPTR, // Not needed
- /* Format_RGB565 */ Q_NULLPTR, // Not needed
- /* Format_RGB555 */ Q_NULLPTR, // Not needed
- /* Format_ARGB8565_Premultiplied */ Q_NULLPTR, // Not needed
+ /* Format_Invalid */ nullptr, // Not needed
+ /* Format_ARGB32 */ nullptr, // Not needed
+ /* Format_ARGB32_Premultiplied */ nullptr, // Not needed
+ /* Format_RGB32 */ nullptr, // Not needed
+ /* Format_RGB24 */ nullptr, // Not needed
+ /* Format_RGB565 */ nullptr, // Not needed
+ /* Format_RGB555 */ nullptr, // Not needed
+ /* Format_ARGB8565_Premultiplied */ nullptr, // Not needed
/* Format_BGRA32 */ qt_convert_BGRA32_to_ARGB32,
/* Format_BGRA32_Premultiplied */ qt_convert_BGRA32_to_ARGB32,
/* Format_BGR32 */ qt_convert_BGRA32_to_ARGB32,
/* Format_BGR24 */ qt_convert_BGR24_to_ARGB32,
/* Format_BGR565 */ qt_convert_BGR565_to_ARGB32,
/* Format_BGR555 */ qt_convert_BGR555_to_ARGB32,
- /* Format_BGRA5658_Premultiplied */ Q_NULLPTR,
+ /* Format_BGRA5658_Premultiplied */ nullptr,
/* Format_AYUV444 */ qt_convert_AYUV444_to_ARGB32,
- /* Format_AYUV444_Premultiplied */ Q_NULLPTR,
+ /* Format_AYUV444_Premultiplied */ nullptr,
/* Format_YUV444 */ qt_convert_YUV444_to_ARGB32,
/* Format_YUV420P */ qt_convert_YUV420P_to_ARGB32,
/* Format_YV12 */ qt_convert_YV12_to_ARGB32,
@@ -1049,15 +1049,15 @@ static VideoFrameConvertFunc qConvertFuncs[QVideoFrame::NPixelFormats] = {
/* Format_YUYV */ qt_convert_YUYV_to_ARGB32,
/* Format_NV12 */ qt_convert_NV12_to_ARGB32,
/* Format_NV21 */ qt_convert_NV21_to_ARGB32,
- /* Format_IMC1 */ Q_NULLPTR,
- /* Format_IMC2 */ Q_NULLPTR,
- /* Format_IMC3 */ Q_NULLPTR,
- /* Format_IMC4 */ Q_NULLPTR,
- /* Format_Y8 */ Q_NULLPTR,
- /* Format_Y16 */ Q_NULLPTR,
- /* Format_Jpeg */ Q_NULLPTR, // Not needed
- /* Format_CameraRaw */ Q_NULLPTR,
- /* Format_AdobeDng */ Q_NULLPTR
+ /* Format_IMC1 */ nullptr,
+ /* Format_IMC2 */ nullptr,
+ /* Format_IMC3 */ nullptr,
+ /* Format_IMC4 */ nullptr,
+ /* Format_Y8 */ nullptr,
+ /* Format_Y16 */ nullptr,
+ /* Format_Jpeg */ nullptr, // Not needed
+ /* Format_CameraRaw */ nullptr,
+ /* Format_AdobeDng */ nullptr
};
static void qInitConvertFuncsAsm()
diff --git a/src/multimedia/video/qvideoprobe.h b/src/multimedia/video/qvideoprobe.h
index 854e71272..93ba4d2f5 100644
--- a/src/multimedia/video/qvideoprobe.h
+++ b/src/multimedia/video/qvideoprobe.h
@@ -53,7 +53,7 @@ class Q_MULTIMEDIA_EXPORT QVideoProbe : public QObject
{
Q_OBJECT
public:
- explicit QVideoProbe(QObject *parent = Q_NULLPTR);
+ explicit QVideoProbe(QObject *parent = nullptr);
~QVideoProbe();
bool setSource(QMediaObject *source);
diff --git a/src/multimedia/video/qvideosurfaceformat.cpp b/src/multimedia/video/qvideosurfaceformat.cpp
index c31c52ff7..384ab4e53 100644
--- a/src/multimedia/video/qvideosurfaceformat.cpp
+++ b/src/multimedia/video/qvideosurfaceformat.cpp
@@ -450,6 +450,35 @@ void QVideoSurfaceFormat::setYCbCrColorSpace(QVideoSurfaceFormat::YCbCrColorSpac
}
/*!
+ Returns \c true if the surface is mirrored around its vertical axis.
+ This is typically needed for video frames coming from a front camera of a mobile device.
+
+ \note The mirroring here differs from QImage::mirrored, as a vertically mirrored QImage
+ will be mirrored around its x-axis.
+
+ \since 5.11
+ */
+bool QVideoSurfaceFormat::isMirrored() const
+{
+ return d->mirrored;
+}
+
+/*!
+ Sets if the surface is mirrored around its vertical axis.
+ This is typically needed for video frames coming from a front camera of a mobile device.
+ Default value is false.
+
+ \note The mirroring here differs from QImage::mirrored, as a vertically mirrored QImage
+ will be mirrored around its x-axis.
+
+ \since 5.11
+ */
+void QVideoSurfaceFormat::setMirrored(bool mirrored)
+{
+ d->mirrored = mirrored;
+}
+
+/*!
Returns a suggested size in pixels for the video stream.
This is the size of the viewport scaled according to the pixel aspect ratio.
diff --git a/src/multimedia/video/qvideosurfaceformat.h b/src/multimedia/video/qvideosurfaceformat.h
index 83785ac0a..175b199a7 100644
--- a/src/multimedia/video/qvideosurfaceformat.h
+++ b/src/multimedia/video/qvideosurfaceformat.h
@@ -117,6 +117,9 @@ public:
YCbCrColorSpace yCbCrColorSpace() const;
void setYCbCrColorSpace(YCbCrColorSpace colorSpace);
+ bool isMirrored() const;
+ void setMirrored(bool mirrored);
+
QSize sizeHint() const;
QList<QByteArray> propertyNames() const;