diff options
author | Lars Knoll <lars.knoll@qt.io> | 2021-03-23 13:38:05 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2021-04-06 08:11:57 +0000 |
commit | 2caff4509eba3f05785ff09a11abdb929c7bb392 (patch) | |
tree | 8d4b1bb77c95e2caccffa7dad1d2675f118e1ee5 /src/multimedia/video | |
parent | d6e52bea2da1d31bce91d1a175f9b9e84b8e37f5 (diff) |
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 <lars.knoll@qt.io>
Reviewed-by: Doris Verria <doris.verria@qt.io>
Diffstat (limited to 'src/multimedia/video')
-rw-r--r-- | src/multimedia/video/qvideoframe.cpp | 7 | ||||
-rw-r--r-- | src/multimedia/video/qvideoframe.h | 3 | ||||
-rw-r--r-- | src/multimedia/video/qvideosink.cpp | 2 |
3 files changed, 3 insertions, 9 deletions
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<QVideoFramePrivate> 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(); |