From 0b946f5ad09d782af6b06f0251c6c2607b734635 Mon Sep 17 00:00:00 2001 From: Jochen Seemann Date: Sun, 9 Apr 2017 20:32:38 +0200 Subject: 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 --- src/multimedia/video/qvideosurfaceformat.cpp | 29 ++++++++++++++++++++++++++++ src/multimedia/video/qvideosurfaceformat.h | 3 +++ 2 files changed, 32 insertions(+) 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 @@ -449,6 +449,35 @@ void QVideoSurfaceFormat::setYCbCrColorSpace(QVideoSurfaceFormat::YCbCrColorSpac d->ycbcrColorSpace = space; } +/*! + 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. 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 propertyNames() const; -- cgit v1.2.3