summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/imports/multimedia/plugins.qmltypes1
-rw-r--r--src/imports/multimedia/qdeclarativeaudio.cpp4
-rw-r--r--src/imports/multimedia/qdeclarativemediametadata_p.h5
-rw-r--r--src/multimedia/platform/gstreamer/common/qgst_p.h1
-rw-r--r--src/multimedia/platform/gstreamer/common/qgstutils.cpp19
-rw-r--r--src/multimedia/platform/windows/evr/evrd3dpresentengine.cpp4
-rw-r--r--src/multimedia/platform/windows/player/mfmetadata.cpp2
-rw-r--r--src/multimedia/platform/windows/player/mftvideo.cpp4
-rw-r--r--src/multimedia/qmediametadata.cpp1
-rw-r--r--src/multimedia/video/qvideosurfaceformat.cpp188
-rw-r--r--src/multimedia/video/qvideosurfaceformat.h11
-rw-r--r--src/multimediawidgets/qpaintervideosurface.cpp6
-rw-r--r--src/qtmultimediaquicktools/qdeclarativevideooutput.cpp1
-rw-r--r--src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp16
14 files changed, 17 insertions, 246 deletions
diff --git a/src/imports/multimedia/plugins.qmltypes b/src/imports/multimedia/plugins.qmltypes
index 63dc4f4e2..92cf6834d 100644
--- a/src/imports/multimedia/plugins.qmltypes
+++ b/src/imports/multimedia/plugins.qmltypes
@@ -1326,7 +1326,6 @@ Module {
Property { name: "coverArtUrlSmall"; type: "QVariant" }
Property { name: "coverArtUrlLarge"; type: "QVariant" }
Property { name: "resolution"; type: "QVariant" }
- Property { name: "pixelAspectRatio"; type: "QVariant" }
Property { name: "videoFrameRate"; type: "QVariant" }
Property { name: "videoBitRate"; type: "QVariant" }
Property { name: "videoCodec"; type: "QVariant" }
diff --git a/src/imports/multimedia/qdeclarativeaudio.cpp b/src/imports/multimedia/qdeclarativeaudio.cpp
index 2668cd3fd..c52cc3717 100644
--- a/src/imports/multimedia/qdeclarativeaudio.cpp
+++ b/src/imports/multimedia/qdeclarativeaudio.cpp
@@ -1027,7 +1027,6 @@ void QDeclarativeAudio::_q_mediaChanged(const QUrl &)
\qmlproperty variant QtMultimedia::Audio::metaData.coverArtUrlSmall
\qmlproperty variant QtMultimedia::Audio::metaData.coverArtUrlLarge
\qmlproperty variant QtMultimedia::Audio::metaData.resolution
- \qmlproperty variant QtMultimedia::Audio::metaData.pixelAspectRatio
\qmlproperty variant QtMultimedia::Audio::metaData.videoFrameRate
\qmlproperty variant QtMultimedia::Audio::metaData.videoBitRate
\qmlproperty variant QtMultimedia::Audio::metaData.videoCodec
@@ -1078,7 +1077,6 @@ void QDeclarativeAudio::_q_mediaChanged(const QUrl &)
\li \c metaData.coverArtUrlSmall - the URL of a small cover art image.
\li \c metaData.coverArtUrlLarge - the URL of a large cover art image.
\li \c metaData.resolution - the dimension of an image or video.
- \li \c metaData.pixelAspectRatio - the pixel aspect ratio of an image or video.
\li \c metaData.videoFrameRate - the frame rate of the media's video stream.
\li \c metaData.videoBitRate - the bit rate of the media's video stream in bits per second.
\li \c metaData.videoCodec - the encoding of the media's video stream.
@@ -1559,7 +1557,6 @@ void QDeclarativeAudio::_q_mediaChanged(const QUrl &)
\qmlproperty variant QtMultimedia::MediaPlayer::metaData.coverArtUrlSmall
\qmlproperty variant QtMultimedia::MediaPlayer::metaData.coverArtUrlLarge
\qmlproperty variant QtMultimedia::MediaPlayer::metaData.resolution
- \qmlproperty variant QtMultimedia::MediaPlayer::metaData.pixelAspectRatio
\qmlproperty variant QtMultimedia::MediaPlayer::metaData.videoFrameRate
\qmlproperty variant QtMultimedia::MediaPlayer::metaData.videoBitRate
\qmlproperty variant QtMultimedia::MediaPlayer::metaData.videoCodec
@@ -1610,7 +1607,6 @@ void QDeclarativeAudio::_q_mediaChanged(const QUrl &)
\li \c metaData.coverArtUrlSmall - the URL of a small cover art image.
\li \c metaData.coverArtUrlLarge - the URL of a large cover art image.
\li \c metaData.resolution - the dimension of an image or video.
- \li \c metaData.pixelAspectRatio - the pixel aspect ratio of an image or video.
\li \c metaData.videoFrameRate - the frame rate of the media's video stream.
\li \c metaData.videoBitRate - the bit rate of the media's video stream in bits per second.
\li \c metaData.videoCodec - the encoding of the media's video stream.
diff --git a/src/imports/multimedia/qdeclarativemediametadata_p.h b/src/imports/multimedia/qdeclarativemediametadata_p.h
index f08c14c68..3ed7f49de 100644
--- a/src/imports/multimedia/qdeclarativemediametadata_p.h
+++ b/src/imports/multimedia/qdeclarativemediametadata_p.h
@@ -97,7 +97,6 @@ class QDeclarativeMediaMetaData : public QObject
// Q_PROPERTY(QVariant coverArtUrlSmall READ coverArtUrlSmall WRITE setCoverArtUrlSmall NOTIFY metaDataChanged)
// Q_PROPERTY(QVariant coverArtUrlLarge READ coverArtUrlLarge WRITE setCoverArtUrlLarge NOTIFY metaDataChanged)
// Q_PROPERTY(QVariant resolution READ resolution WRITE setResolution NOTIFY metaDataChanged)
-// Q_PROPERTY(QVariant pixelAspectRatio READ pixelAspectRatio WRITE setPixelAspectRatio NOTIFY metaDataChanged)
// Q_PROPERTY(QVariant videoFrameRate READ videoFrameRate WRITE setVideoFrameRate NOTIFY metaDataChanged)
// Q_PROPERTY(QVariant videoBitRate READ videoBitRate WRITE setVideoBitRate NOTIFY metaDataChanged)
// Q_PROPERTY(QVariant videoCodec READ videoCodec WRITE setVideoCodec NOTIFY metaDataChanged)
@@ -255,10 +254,6 @@ public:
// QVariant resolution() const { return metaData.value(QMediaMetaData::Resolution); }
// void setResolution(const QVariant &resolution) {
// setMetaData(QMediaMetaData::Resolution, resolution); }
-// QVariant pixelAspectRatio() const {
-// return metaData.value(QMediaMetaData::PixelAspectRatio); }
-// void setPixelAspectRatio(const QVariant &ratio) {
-// setMetaData(QMediaMetaData::PixelAspectRatio, ratio); }
// QVariant videoFrameRate() const { return metaData.value(QMediaMetaData::VideoFrameRate); }
// void setVideoFrameRate(const QVariant &rate) {
// setMetaData(QMediaMetaData::VideoFrameRate, rate); }
diff --git a/src/multimedia/platform/gstreamer/common/qgst_p.h b/src/multimedia/platform/gstreamer/common/qgst_p.h
index b779960f9..f4cb5684d 100644
--- a/src/multimedia/platform/gstreamer/common/qgst_p.h
+++ b/src/multimedia/platform/gstreamer/common/qgst_p.h
@@ -154,7 +154,6 @@ public:
Q_MULTIMEDIA_EXPORT QSize resolution() const;
Q_MULTIMEDIA_EXPORT QVideoFrame::PixelFormat pixelFormat() const;
- Q_MULTIMEDIA_EXPORT QSize pixelAspectRatio() const;
Q_MULTIMEDIA_EXPORT QGRange<float> frameRateRange() const;
QByteArray toString() const { return gst_structure_to_string(structure); }
diff --git a/src/multimedia/platform/gstreamer/common/qgstutils.cpp b/src/multimedia/platform/gstreamer/common/qgstutils.cpp
index 1fed48717..ae8a625e0 100644
--- a/src/multimedia/platform/gstreamer/common/qgstutils.cpp
+++ b/src/multimedia/platform/gstreamer/common/qgstutils.cpp
@@ -362,9 +362,6 @@ QVideoSurfaceFormat QGstUtils::formatForCaps(
if (infoPtr->fps_d > 0)
format.setFrameRate(qreal(infoPtr->fps_n) / infoPtr->fps_d);
- if (infoPtr->par_d > 0)
- format.setPixelAspectRatio(infoPtr->par_n, infoPtr->par_d);
-
return format;
}
}
@@ -519,22 +516,6 @@ QVideoFrame::PixelFormat QGstStructure::pixelFormat() const
return pixelFormat;
}
-QSize QGstStructure::pixelAspectRatio() const
-{
- QSize ratio(1, 1);
-
- gint aspectNum = 0;
- gint aspectDenum = 0;
- if (structure && gst_structure_get_fraction(structure, "pixel-aspect-ratio", &aspectNum, &aspectDenum)) {
- if (aspectDenum > 0) {
- ratio.rwidth() = aspectNum;
- ratio.rheight() = aspectDenum;
- }
- }
-
- return ratio;
-}
-
QGRange<float> QGstStructure::frameRateRange() const
{
float minRate = 0.;
diff --git a/src/multimedia/platform/windows/evr/evrd3dpresentengine.cpp b/src/multimedia/platform/windows/evr/evrd3dpresentengine.cpp
index f0cc0ddbe..4f5eadc64 100644
--- a/src/multimedia/platform/windows/evr/evrd3dpresentengine.cpp
+++ b/src/multimedia/platform/windows/evr/evrd3dpresentengine.cpp
@@ -373,10 +373,6 @@ done:
: qt_evr_pixelFormatFromD3DFormat(d3dFormat),
m_useTextureRendering ? QVideoFrame::GLTextureHandle
: QVideoFrame::NoHandle);
- UINT32 horizontal = 1, vertical = 1;
- hr = MFGetAttributeRatio(format, MF_MT_PIXEL_ASPECT_RATIO, &horizontal, &vertical);
- if (SUCCEEDED(hr))
- m_surfaceFormat.setPixelAspectRatio(horizontal, vertical);
} else {
releaseResources();
}
diff --git a/src/multimedia/platform/windows/player/mfmetadata.cpp b/src/multimedia/platform/windows/player/mfmetadata.cpp
index 3800deb67..a6b16e2d4 100644
--- a/src/multimedia/platform/windows/player/mfmetadata.cpp
+++ b/src/multimedia/platform/windows/player/mfmetadata.cpp
@@ -314,8 +314,6 @@ QMediaMetaData MFMetaData::fromNative(IMFMediaSource* mediaSource)
mediaKey = QMediaMetaData::Resolution;
} else if (key == PKEY_Video_Orientation) {
mediaKey = QMediaMetaData::Orientation;
-// } else if (key == PKEY_Video_HorizontalAspectRatio) {
-// mediaKey = QMediaMetaData::PixelAspectRatio;
// } else if (key == PKEY_Video_FrameRate) {
// mediaKey = QMediaMetaData::VideoFrameRate;
} else if (key == PKEY_Video_EncodingBitrate) {
diff --git a/src/multimedia/platform/windows/player/mftvideo.cpp b/src/multimedia/platform/windows/player/mftvideo.cpp
index 8bb2f86be..8d318a6f6 100644
--- a/src/multimedia/platform/windows/player/mftvideo.cpp
+++ b/src/multimedia/platform/windows/player/mftvideo.cpp
@@ -654,10 +654,6 @@ QVideoSurfaceFormat MFTransform::videoFormatForMFMediaType(IMFMediaType *mediaTy
QVideoFrame::PixelFormat pixelFormat = formatFromSubtype(subtype);
QVideoSurfaceFormat format(size, pixelFormat);
- UINT32 num, den;
- if (SUCCEEDED(MFGetAttributeRatio(mediaType, MF_MT_PIXEL_ASPECT_RATIO, &num, &den))) {
- format.setPixelAspectRatio(num, den);
- }
if (SUCCEEDED(MFGetAttributeRatio(mediaType, MF_MT_FRAME_RATE, &num, &den))) {
format.setFrameRate(qreal(num)/den);
}
diff --git a/src/multimedia/qmediametadata.cpp b/src/multimedia/qmediametadata.cpp
index 2e4f335ce..7a2ee634f 100644
--- a/src/multimedia/qmediametadata.cpp
+++ b/src/multimedia/qmediametadata.cpp
@@ -112,7 +112,6 @@ QT_BEGIN_NAMESPACE
\header \li {3,1}
Image and video attributes
\row \li Resolution \li The dimensions of an image or video. \li QSize
- \row \li PixelAspectRatio \li The pixel aspect ratio of an image or video. \li QSize
\row \li Orientation \li Orientation of an image or video. \li int (degrees)
\header \li {3,1}
diff --git a/src/multimedia/video/qvideosurfaceformat.cpp b/src/multimedia/video/qvideosurfaceformat.cpp
index d80389151..05901b679 100644
--- a/src/multimedia/video/qvideosurfaceformat.cpp
+++ b/src/multimedia/video/qvideosurfaceformat.cpp
@@ -59,7 +59,6 @@ public:
: pixelFormat(format)
, handleType(type)
, frameSize(size)
- , pixelAspectRatio(1, 1)
, viewport(QPoint(0, 0), size)
{
}
@@ -70,20 +69,11 @@ public:
&& handleType == other.handleType
&& scanLineDirection == other.scanLineDirection
&& frameSize == other.frameSize
- && pixelAspectRatio == other.pixelAspectRatio
&& viewport == other.viewport
&& frameRatesEqual(frameRate, other.frameRate)
&& ycbcrColorSpace == other.ycbcrColorSpace
- && mirrored == other.mirrored
- && propertyNames.count() == other.propertyNames.count()) {
- for (int i = 0; i < propertyNames.count(); ++i) {
- int j = other.propertyNames.indexOf(propertyNames.at(i));
-
- if (j == -1 || propertyValues.at(i) != other.propertyValues.at(j))
- return false;
- }
+ && mirrored == other.mirrored)
return true;
- }
return false;
}
@@ -97,13 +87,10 @@ public:
QVideoFrame::HandleType handleType = QVideoFrame::NoHandle;
QVideoSurfaceFormat::Direction scanLineDirection = QVideoSurfaceFormat::TopToBottom;
QSize frameSize;
- QSize pixelAspectRatio;
QVideoSurfaceFormat::YCbCrColorSpace ycbcrColorSpace = QVideoSurfaceFormat::YCbCr_Undefined;
QRect viewport;
qreal frameRate = 0.0;
bool mirrored = false;
- QList<QByteArray> propertyNames;
- QList<QVariant> propertyValues;
};
/*!
@@ -129,7 +116,7 @@ public:
than the nearest optimal size of a video frame. For example the width of a frame may be
extended so that the start of each scan line is eight byte aligned.
- Other common properties are the pixelAspectRatio(), scanLineDirection(), and frameRate().
+ Other common properties are the scanLineDirection(), and frameRate().
Additionally a stream may have some additional type specific properties which are listed by the
dynamicPropertyNames() function and can be accessed using the property(), and setProperty()
functions.
@@ -358,32 +345,6 @@ void QVideoSurfaceFormat::setFrameRate(qreal rate)
}
/*!
- Returns a video stream's pixel aspect ratio.
-*/
-QSize QVideoSurfaceFormat::pixelAspectRatio() const
-{
- return d->pixelAspectRatio;
-}
-
-/*!
- Sets a video stream's pixel aspect \a ratio.
-*/
-void QVideoSurfaceFormat::setPixelAspectRatio(const QSize &ratio)
-{
- d->pixelAspectRatio = ratio;
-}
-
-/*!
- \overload
-
- Sets the \a horizontal and \a vertical elements of a video stream's pixel aspect ratio.
-*/
-void QVideoSurfaceFormat::setPixelAspectRatio(int horizontal, int vertical)
-{
- d->pixelAspectRatio = QSize(horizontal, vertical);
-}
-
-/*!
Returns the Y'CbCr color space of a video stream.
*/
QVideoSurfaceFormat::YCbCrColorSpace QVideoSurfaceFormat::yCbCrColorSpace() const
@@ -432,137 +393,13 @@ void QVideoSurfaceFormat::setMirrored(bool 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.
+ This is the same as the size of the viewport.
*/
QSize QVideoSurfaceFormat::sizeHint() const
{
- QSize size = d->viewport.size();
-
- if (d->pixelAspectRatio.height() != 0)
- size.setWidth(size.width() * d->pixelAspectRatio.width() / d->pixelAspectRatio.height());
-
- return size;
+ return d->viewport.size();
}
-/*!
- Returns a list of video format dynamic property names.
-*/
-QList<QByteArray> QVideoSurfaceFormat::propertyNames() const
-{
- return (QList<QByteArray>()
- << "handleType"
- << "pixelFormat"
- << "frameSize"
- << "frameWidth"
- << "viewport"
- << "scanLineDirection"
- << "frameRate"
- << "pixelAspectRatio"
- << "sizeHint"
- << "yCbCrColorSpace"
- << "mirrored")
- + d->propertyNames;
-}
-
-/*!
- Returns the value of the video format's \a name property.
-*/
-QVariant QVideoSurfaceFormat::property(const char *name) const
-{
- if (qstrcmp(name, "handleType") == 0) {
- return QVariant::fromValue(d->handleType);
- } else if (qstrcmp(name, "pixelFormat") == 0) {
- return QVariant::fromValue(d->pixelFormat);
- } else if (qstrcmp(name, "frameSize") == 0) {
- return d->frameSize;
- } else if (qstrcmp(name, "frameWidth") == 0) {
- return d->frameSize.width();
- } else if (qstrcmp(name, "frameHeight") == 0) {
- return d->frameSize.height();
- } else if (qstrcmp(name, "viewport") == 0) {
- return d->viewport;
- } else if (qstrcmp(name, "scanLineDirection") == 0) {
- return QVariant::fromValue(d->scanLineDirection);
- } else if (qstrcmp(name, "frameRate") == 0) {
- return QVariant::fromValue(d->frameRate);
- } else if (qstrcmp(name, "pixelAspectRatio") == 0) {
- return QVariant::fromValue(d->pixelAspectRatio);
- } else if (qstrcmp(name, "sizeHint") == 0) {
- return sizeHint();
- } else if (qstrcmp(name, "yCbCrColorSpace") == 0) {
- return QVariant::fromValue(d->ycbcrColorSpace);
- } else if (qstrcmp(name, "mirrored") == 0) {
- return d->mirrored;
- } else {
- int id = 0;
- for (; id < d->propertyNames.count() && d->propertyNames.at(id) != name; ++id) {}
-
- return id < d->propertyValues.count()
- ? d->propertyValues.at(id)
- : QVariant();
- }
-}
-
-/*!
- Sets the video format's \a name property to \a value.
-
- Trying to set a read only property will be ignored.
-
-*/
-void QVideoSurfaceFormat::setProperty(const char *name, const QVariant &value)
-{
- if (qstrcmp(name, "handleType") == 0) {
- // read only.
- } else if (qstrcmp(name, "pixelFormat") == 0) {
- // read only.
- } else if (qstrcmp(name, "frameSize") == 0) {
- if (value.canConvert<QSize>()) {
- d->frameSize = qvariant_cast<QSize>(value);
- d->viewport = QRect(QPoint(0, 0), d->frameSize);
- }
- } else if (qstrcmp(name, "frameWidth") == 0) {
- // read only.
- } else if (qstrcmp(name, "frameHeight") == 0) {
- // read only.
- } else if (qstrcmp(name, "viewport") == 0) {
- if (value.canConvert<QRect>())
- d->viewport = qvariant_cast<QRect>(value);
- } else if (qstrcmp(name, "scanLineDirection") == 0) {
- if (value.canConvert<Direction>())
- d->scanLineDirection = qvariant_cast<Direction>(value);
- } else if (qstrcmp(name, "frameRate") == 0) {
- if (value.canConvert<qreal>())
- d->frameRate = qvariant_cast<qreal>(value);
- } else if (qstrcmp(name, "pixelAspectRatio") == 0) {
- if (value.canConvert<QSize>())
- d->pixelAspectRatio = qvariant_cast<QSize>(value);
- } else if (qstrcmp(name, "sizeHint") == 0) {
- // read only.
- } else if (qstrcmp(name, "yCbCrColorSpace") == 0) {
- if (value.canConvert<YCbCrColorSpace>())
- d->ycbcrColorSpace = qvariant_cast<YCbCrColorSpace>(value);
- } else if (qstrcmp(name, "mirrored") == 0) {
- if (value.canConvert<bool>())
- d->mirrored = qvariant_cast<bool>(value);
- } else {
- int id = 0;
- for (; id < d->propertyNames.count() && d->propertyNames.at(id) != name; ++id) {}
-
- if (id < d->propertyValues.count()) {
- if (value.isNull()) {
- d->propertyNames.removeAt(id);
- d->propertyValues.removeAt(id);
- } else {
- d->propertyValues[id] = value;
- }
- } else if (!value.isNull()) {
- d->propertyNames.append(QByteArray(name));
- d->propertyValues.append(value);
- }
- }
-}
-
-
#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug dbg, QVideoSurfaceFormat::YCbCrColorSpace cs)
{
@@ -584,9 +421,6 @@ QDebug operator<<(QDebug dbg, QVideoSurfaceFormat::YCbCrColorSpace cs)
case QVideoSurfaceFormat::YCbCr_xvYCC709:
dbg << "YCbCr_xvYCC709";
break;
- case QVideoSurfaceFormat::YCbCr_CustomMatrix:
- dbg << "YCbCr_CustomMatrix";
- break;
default:
dbg << "YCbCr_Undefined";
break;
@@ -614,13 +448,15 @@ QDebug operator<<(QDebug dbg, const QVideoSurfaceFormat &f)
QDebugStateSaver saver(dbg);
dbg.nospace();
dbg << "QVideoSurfaceFormat(" << f.pixelFormat() << ", " << f.frameSize()
- << ", viewport=" << f.viewport() << ", pixelAspectRatio=" << f.pixelAspectRatio()
+ << ", viewport=" << f.viewport()
<< ", handleType=" << f.handleType() << ", yCbCrColorSpace=" << f.yCbCrColorSpace()
- << ')';
-
- const auto propertyNames = f.propertyNames();
- for (const QByteArray& propertyName : propertyNames)
- dbg << "\n " << propertyName.data() << " = " << f.property(propertyName.data());
+ << ')'
+ << "\n pixel format=" << f.pixelFormat()
+ << "\n frame size=" << f.frameSize()
+ << "\n viewport=" << f.viewport()
+ << "\n yCbCrColorSpace=" << f.yCbCrColorSpace()
+ << "\n frameRate=" << f.frameRate()
+ << "\n mirrored=" << f.isMirrored();
return dbg;
}
diff --git a/src/multimedia/video/qvideosurfaceformat.h b/src/multimedia/video/qvideosurfaceformat.h
index 417b53d8f..dca8c808c 100644
--- a/src/multimedia/video/qvideosurfaceformat.h
+++ b/src/multimedia/video/qvideosurfaceformat.h
@@ -71,9 +71,6 @@ public:
YCbCr_xvYCC601,
YCbCr_xvYCC709,
YCbCr_JPEG,
-#ifndef Q_QDOC
- YCbCr_CustomMatrix
-#endif
};
QVideoSurfaceFormat();
@@ -110,10 +107,6 @@ public:
qreal frameRate() const;
void setFrameRate(qreal rate);
- QSize pixelAspectRatio() const;
- void setPixelAspectRatio(const QSize &ratio);
- void setPixelAspectRatio(int width, int height);
-
YCbCrColorSpace yCbCrColorSpace() const;
void setYCbCrColorSpace(YCbCrColorSpace colorSpace);
@@ -122,10 +115,6 @@ public:
QSize sizeHint() const;
- QList<QByteArray> propertyNames() const;
- QVariant property(const char *name) const;
- void setProperty(const char *name, const QVariant &value);
-
private:
QSharedDataPointer<QVideoSurfaceFormatPrivate> d;
};
diff --git a/src/multimediawidgets/qpaintervideosurface.cpp b/src/multimediawidgets/qpaintervideosurface.cpp
index 785980db8..1a48dd88b 100644
--- a/src/multimediawidgets/qpaintervideosurface.cpp
+++ b/src/multimediawidgets/qpaintervideosurface.cpp
@@ -146,7 +146,7 @@ QAbstractVideoSurface::Error QVideoSurfaceGenericPainter::start(const QVideoSurf
m_imageSize = format.frameSize();
m_scanLineDirection = format.scanLineDirection();
- m_mirrored = format.property("mirrored").toBool();
+ m_mirrored = format.isMirrored();
const QVideoFrame::HandleType t = format.handleType();
if (t == QVideoFrame::NoHandle) {
@@ -823,7 +823,7 @@ QAbstractVideoSurface::Error QVideoSurfaceArbFpPainter::start(const QVideoSurfac
} else {
m_handleType = format.handleType();
m_scanLineDirection = format.scanLineDirection();
- m_mirrored = format.property("mirrored").toBool();
+ m_mirrored = format.isMirrored();
m_frameSize = format.frameSize();
m_colorSpace = format.yCbCrColorSpace();
@@ -1182,7 +1182,7 @@ QAbstractVideoSurface::Error QVideoSurfaceGlslPainter::start(const QVideoSurface
} else {
m_handleType = format.handleType();
m_scanLineDirection = format.scanLineDirection();
- m_mirrored = format.property("mirrored").toBool();
+ m_mirrored = format.isMirrored();
m_frameSize = format.frameSize();
m_colorSpace = format.yCbCrColorSpace();
diff --git a/src/qtmultimediaquicktools/qdeclarativevideooutput.cpp b/src/qtmultimediaquicktools/qdeclarativevideooutput.cpp
index 562831a45..7cea41330 100644
--- a/src/qtmultimediaquicktools/qdeclarativevideooutput.cpp
+++ b/src/qtmultimediaquicktools/qdeclarativevideooutput.cpp
@@ -446,7 +446,6 @@ QRectF QDeclarativeVideoOutput::contentRect() const
The orientation setting does not affect this rectangle.
- \sa QVideoSurfaceFormat::pixelAspectRatio()
\sa QVideoSurfaceFormat::viewport()
*/
QRectF QDeclarativeVideoOutput::sourceRect() const
diff --git a/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp b/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp
index bc5747903..58aa840b3 100644
--- a/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp
+++ b/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp
@@ -224,7 +224,7 @@ void QDeclarativeVideoBackend::updateGeometry()
m_sourceTextureRect.setBottom(top);
}
- if (m_surfaceFormat.property("mirrored").toBool()) {
+ if (m_surfaceFormat.isMirrored()) {
qreal left = m_sourceTextureRect.left();
m_sourceTextureRect.setLeft(m_sourceTextureRect.right());
m_sourceTextureRect.setRight(left);
@@ -299,7 +299,6 @@ QSGNode *QDeclarativeVideoBackend::updatePaintNode(QSGNode *oldNode,
// QSGVideoItemSurface supports (logically) anything.
QVideoSurfaceFormat nodeFormat(m_frame.size(), m_frame.pixelFormat(), m_frame.handleType());
nodeFormat.setYCbCrColorSpace(m_surfaceFormat.yCbCrColorSpace());
- nodeFormat.setPixelAspectRatio(m_surfaceFormat.pixelAspectRatio());
nodeFormat.setScanLineDirection(m_surfaceFormat.scanLineDirection());
nodeFormat.setViewport(m_surfaceFormat.viewport());
nodeFormat.setFrameRate(m_surfaceFormat.frameRate());
@@ -352,18 +351,7 @@ QAbstractVideoSurface *QDeclarativeVideoBackend::videoSurface() const
QRectF QDeclarativeVideoBackend::adjustedViewport() const
{
- const QRectF viewport = m_surfaceFormat.viewport();
- const QSizeF pixelAspectRatio = m_surfaceFormat.pixelAspectRatio();
-
- if (pixelAspectRatio.isValid()) {
- const qreal ratio = pixelAspectRatio.width() / pixelAspectRatio.height();
- QRectF result = viewport;
- result.setX(result.x() * ratio);
- result.setWidth(result.width() * ratio);
- return result;
- }
-
- return viewport;
+ return m_surfaceFormat.viewport();
}
#if QT_CONFIG(opengl)