From 2caff4509eba3f05785ff09a11abdb929c7bb392 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 23 Mar 2021 13:38:05 +0100 Subject: Smaller API cleanups in QVideoFrame Get rid of the buffer method. It's not used, and QAbstractVideoBuffer is private anyway. Use map() to access the data. Rename image() to toImage() to make it explicit that we're doing a conversion here. Change-Id: Ie2735bc1a5131c09098fa80c9df7bf5b165b557c Reviewed-by: Lars Knoll Reviewed-by: Doris Verria --- src/multimedia/video/qvideoframe.cpp | 7 +------ src/multimedia/video/qvideoframe.h | 3 +-- src/multimedia/video/qvideosink.cpp | 2 +- 3 files changed, 3 insertions(+), 9 deletions(-) (limited to 'src/multimedia/video') diff --git a/src/multimedia/video/qvideoframe.cpp b/src/multimedia/video/qvideoframe.cpp index f9b15e0df..0ff9d2ace 100644 --- a/src/multimedia/video/qvideoframe.cpp +++ b/src/multimedia/video/qvideoframe.cpp @@ -397,11 +397,6 @@ QVideoFrame::~QVideoFrame() \return underlying video buffer or \c null if there is none. \since 5.13 */ -QAbstractVideoBuffer *QVideoFrame::buffer() const -{ - return d->buffer; -} - /*! Identifies whether a video frame is valid. @@ -874,7 +869,7 @@ void QVideoFrame::setEndTime(qint64 time) Based on the pixel format converts current video frame to image. \since 5.15 */ -QImage QVideoFrame::image() const +QImage QVideoFrame::toImage() const { QVideoFrame frame = *this; QImage result; diff --git a/src/multimedia/video/qvideoframe.h b/src/multimedia/video/qvideoframe.h index 028286426..c3eba5585 100644 --- a/src/multimedia/video/qvideoframe.h +++ b/src/multimedia/video/qvideoframe.h @@ -84,7 +84,6 @@ public: bool operator==(const QVideoFrame &other) const; bool operator!=(const QVideoFrame &other) const; - QAbstractVideoBuffer *buffer() const; bool isValid() const; QVideoSurfaceFormat::PixelFormat pixelFormat() const; @@ -123,7 +122,7 @@ public: qint64 endTime() const; void setEndTime(qint64 time); - QImage image() const; + QImage toImage() const; private: QExplicitlySharedDataPointer d; diff --git a/src/multimedia/video/qvideosink.cpp b/src/multimedia/video/qvideosink.cpp index fa9177e21..639d00583 100644 --- a/src/multimedia/video/qvideosink.cpp +++ b/src/multimedia/video/qvideosink.cpp @@ -278,7 +278,7 @@ void QVideoSink::paint(QPainter *painter, const QVideoFrame &f) } if (frame.map(QVideoFrame::ReadOnly)) { - QImage image = frame.image(); + QImage image = frame.toImage(); auto oldOpacity = painter->opacity(); const QTransform oldTransform = painter->transform(); -- cgit v1.2.3