diff options
author | Lars Knoll <lars.knoll@qt.io> | 2021-03-02 13:11:36 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2021-03-16 07:41:44 +0000 |
commit | 5671ab651d9c938a0ff2df3a9c0baef9891e7e23 (patch) | |
tree | 4c5c6fde332af93b3d5f5cb4198df1ee0668434a /examples/multimedia/video/qmlvideofilter_opencl/rgbframehelper.h | |
parent | e7702afc9dfa6e69b1b05d68a38248ccc6b6dd87 (diff) |
Move HandleType and MapMode from QAbstractVideoBuffer to QVideoFrame
QAbstractVideoBuffer is a class that is only required inside our
implementation, so we can make it private. This change prepares
for it.
Change-Id: I4ba4542c1eab742f2fc93231e2e5063dbc5d5e94
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'examples/multimedia/video/qmlvideofilter_opencl/rgbframehelper.h')
-rw-r--r-- | examples/multimedia/video/qmlvideofilter_opencl/rgbframehelper.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/multimedia/video/qmlvideofilter_opencl/rgbframehelper.h b/examples/multimedia/video/qmlvideofilter_opencl/rgbframehelper.h index 638337ea4..ea82b267e 100644 --- a/examples/multimedia/video/qmlvideofilter_opencl/rgbframehelper.h +++ b/examples/multimedia/video/qmlvideofilter_opencl/rgbframehelper.h @@ -60,21 +60,21 @@ /* Returns a QImage that wraps the given video frame. - This is suitable only for QAbstractVideoBuffer::NoHandle frames with RGB (or BGR) + This is suitable only for QVideoFrame::NoHandle frames with RGB (or BGR) data. YUV is not supported here. The QVideoFrame must be mapped and kept mapped as long as the wrapping QImage exists. As a convenience the function also supports frames with a handle type of - QAbstractVideoBuffer::GLTextureHandle. This allows creating a system memory backed + QVideoFrame::GLTextureHandle. This allows creating a system memory backed QVideoFrame containing the image data from an OpenGL texture. However, readback is a slow operation and may stall the GPU pipeline and should be avoided in production code. */ QImage imageWrapper(const QVideoFrame &frame) { #ifndef QT_NO_OPENGL - if (frame.handleType() == QAbstractVideoBuffer::GLTextureHandle) { + if (frame.handleType() == QVideoFrame::GLTextureHandle) { // Slow and inefficient path. Ideally what's on the GPU should remain on the GPU, instead of readbacks like this. QImage img(frame.width(), frame.height(), QImage::Format_RGBA8888); GLuint textureId = frame.handle().toUInt(); |