From 33d4ef6367ad49c40ec77af69ab1165989a65064 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 23 Mar 2021 12:59:28 +0100 Subject: Remove the handle type from QVideoSurfaceFormat This is a property of the individual QVideoFrame, and doesn't belong here. Change-Id: I85f180ff46023f6a48ef856a356d9c45c3f6be1b Reviewed-by: Lars Knoll Reviewed-by: Doris Verria --- src/multimedia/video/qabstractvideosurface.cpp | 2 +- src/multimedia/video/qvideosurfaceformat.cpp | 25 ++++--------------------- src/multimedia/video/qvideosurfaceformat.h | 4 +--- 3 files changed, 6 insertions(+), 25 deletions(-) (limited to 'src/multimedia/video') diff --git a/src/multimedia/video/qabstractvideosurface.cpp b/src/multimedia/video/qabstractvideosurface.cpp index a6100cc37..74347ce27 100644 --- a/src/multimedia/video/qabstractvideosurface.cpp +++ b/src/multimedia/video/qabstractvideosurface.cpp @@ -147,7 +147,7 @@ QAbstractVideoSurface::~QAbstractVideoSurface() = default; */ bool QAbstractVideoSurface::isFormatSupported(const QVideoSurfaceFormat &format) const { - return supportedPixelFormats(format.handleType()).contains(format.pixelFormat()); + return supportedPixelFormats(QVideoFrame::NoHandle).contains(format.pixelFormat()); } /*! diff --git a/src/multimedia/video/qvideosurfaceformat.cpp b/src/multimedia/video/qvideosurfaceformat.cpp index 05901b679..986734a65 100644 --- a/src/multimedia/video/qvideosurfaceformat.cpp +++ b/src/multimedia/video/qvideosurfaceformat.cpp @@ -54,10 +54,8 @@ public: QVideoSurfaceFormatPrivate( const QSize &size, - QVideoFrame::PixelFormat format, - QVideoFrame::HandleType type) + QVideoFrame::PixelFormat format) : pixelFormat(format) - , handleType(type) , frameSize(size) , viewport(QPoint(0, 0), size) { @@ -66,7 +64,6 @@ public: bool operator ==(const QVideoSurfaceFormatPrivate &other) const { if (pixelFormat == other.pixelFormat - && handleType == other.handleType && scanLineDirection == other.scanLineDirection && frameSize == other.frameSize && viewport == other.viewport @@ -84,7 +81,6 @@ public: } QVideoFrame::PixelFormat pixelFormat = QVideoFrame::Format_Invalid; - QVideoFrame::HandleType handleType = QVideoFrame::NoHandle; QVideoSurfaceFormat::Direction scanLineDirection = QVideoSurfaceFormat::TopToBottom; QSize frameSize; QVideoSurfaceFormat::YCbCrColorSpace ycbcrColorSpace = QVideoSurfaceFormat::YCbCr_Undefined; @@ -173,8 +169,8 @@ QVideoSurfaceFormat::QVideoSurfaceFormat() \a size and pixel \a format. */ QVideoSurfaceFormat::QVideoSurfaceFormat( - const QSize& size, QVideoFrame::PixelFormat format, QVideoFrame::HandleType type) - : d(new QVideoSurfaceFormatPrivate(size, format, type)) + const QSize& size, QVideoFrame::PixelFormat format) + : d(new QVideoSurfaceFormatPrivate(size, format)) { } @@ -227,19 +223,6 @@ QVideoFrame::PixelFormat QVideoSurfaceFormat::pixelFormat() const return d->pixelFormat; } -/*! - Returns the type of handle the surface uses to present the frame data. - - If the handle type is \c QVideoFrame::NoHandle, buffers with any handle type are valid - provided they can be \l {QVideoFrame::map()}{mapped} with the - QVideoFrame::ReadOnly flag. If the handleType() is not QVideoFrame::NoHandle - then the handle type of the buffer must be the same as that of the surface format. -*/ -QVideoFrame::HandleType QVideoSurfaceFormat::handleType() const -{ - return d->handleType; -} - /*! Returns the dimensions of frames in a video stream. @@ -449,7 +432,7 @@ QDebug operator<<(QDebug dbg, const QVideoSurfaceFormat &f) dbg.nospace(); dbg << "QVideoSurfaceFormat(" << f.pixelFormat() << ", " << f.frameSize() << ", viewport=" << f.viewport() - << ", handleType=" << f.handleType() << ", yCbCrColorSpace=" << f.yCbCrColorSpace() + << ", yCbCrColorSpace=" << f.yCbCrColorSpace() << ')' << "\n pixel format=" << f.pixelFormat() << "\n frame size=" << f.frameSize() diff --git a/src/multimedia/video/qvideosurfaceformat.h b/src/multimedia/video/qvideosurfaceformat.h index dca8c808c..694dd9a79 100644 --- a/src/multimedia/video/qvideosurfaceformat.h +++ b/src/multimedia/video/qvideosurfaceformat.h @@ -76,8 +76,7 @@ public: QVideoSurfaceFormat(); QVideoSurfaceFormat( const QSize &size, - QVideoFrame::PixelFormat pixelFormat, - QVideoFrame::HandleType handleType = QVideoFrame::NoHandle); + QVideoFrame::PixelFormat pixelFormat); QVideoSurfaceFormat(const QVideoSurfaceFormat &format); ~QVideoSurfaceFormat(); @@ -89,7 +88,6 @@ public: bool isValid() const; QVideoFrame::PixelFormat pixelFormat() const; - QVideoFrame::HandleType handleType() const; QSize frameSize() const; void setFrameSize(const QSize &size); -- cgit v1.2.3