summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJochen Seemann <seemann.jochen@gmail.com>2017-04-09 20:32:38 +0200
committerJochen Seemann <seemann.jochen@gmail.com>2018-02-01 19:37:53 +0000
commit0b946f5ad09d782af6b06f0251c6c2607b734635 (patch)
tree45cf0385ff55238cbd7601f5af8d44ab3c963e8c
parent6026ebd7af864912aa37faa3c15d43195c650d82 (diff)
add mirrored API to QVideoSurfaceFormat
Adds setters and getters for the already implemented property of QVideoSurfaceFormat. Task-number: QTBUG-47606 Change-Id: Icf509af80c13e80568645d90c6a621cd30cf776c Reviewed-by: Christian Stromme <christian.stromme@qt.io>
-rw-r--r--src/multimedia/video/qvideosurfaceformat.cpp29
-rw-r--r--src/multimedia/video/qvideosurfaceformat.h3
2 files changed, 32 insertions, 0 deletions
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;