Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qabstractvideobuffer.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
5
6#include <qvariant.h>
7#include <rhi/qrhi.h>
8
9#include <QDebug>
10
11
13
85
92
102
107{
108 return m_rhi;
109}
110
157/*
158 \fn int QAbstractPlanarVideoBuffer::map(MapMode mode, int *numBytes, int bytesPerLine[4], uchar *data[4])
159
160 Maps the contents of a video buffer to memory.
161
162 The map \a mode indicates whether the contents of the mapped memory should be read from and/or
163 written to the buffer. If the map mode includes the \c QVideoFrame::ReadOnly flag the
164 mapped memory will be populated with the content of the buffer when initially mapped. If the map
165 mode includes the \c QVideoFrame::WriteOnly flag the content of the possibly modified
166 mapped memory will be written back to the buffer when unmapped.
167
168 When access to the data is no longer needed be sure to call the unmap() function to release the
169 mapped memory and possibly update the buffer contents.
170
171 Returns the number of planes in the mapped video data. For each plane the line stride of that
172 plane will be returned in \a bytesPerLine, and a pointer to the plane data will be returned in
173 \a data. The accumulative size of the mapped data is returned in \a numBytes.
174
175 \sa QAbstractVideoBuffer::map(), QAbstractVideoBuffer::unmap(), QVideoFrame::mapMode()
176*/
177
178#ifndef QT_NO_DEBUG_STREAM
180{
181 QDebugStateSaver saver(dbg);
182 dbg.nospace();
183 switch (mode) {
185 return dbg << "ReadOnly";
187 return dbg << "ReadWrite";
189 return dbg << "WriteOnly";
190 default:
191 return dbg << "NotMapped";
192 }
193}
194#endif
195
QRhi * rhi() const
Returns the QRhi instance.
QVideoFrame::HandleType m_type
QVideoFrame::HandleType handleType() const
Returns the type of a video buffer's handle.
QAbstractVideoBuffer(QVideoFrame::HandleType type, QRhi *rhi=nullptr)
Constructs an abstract video buffer of the given type.
virtual ~QAbstractVideoBuffer()
Destroys an abstract video buffer.
\inmodule QtCore
\inmodule QtCore
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
Definition qrhi.h:1804
MapMode
Enumerates how a video buffer's data is mapped to system memory.
Definition qvideoframe.h:37
HandleType
Identifies the type of a video buffers handle.
Definition qvideoframe.h:31
Combined button and popup list for selecting options.
QDebug operator<<(QDebug dbg, QVideoFrame::MapMode mode)
GLenum mode
GLenum type