116 return d ? d->
buffer :
nullptr;
480 qWarning() <<
"QVideoFrame::unmap() was called more times then QVideoFrame::map()";
732 if (targetRect.
top() >
rect.top()) {
736 if (targetRect.
left() >
rect.left()) {
780#ifndef QT_NO_DEBUG_STREAM
790 const int s_millis =
start % 1000000;
792 const int s_seconds =
start % 60;
794 const int s_minutes =
start % 60;
824 const int e_millis =
end % 1000000;
826 const int e_seconds =
end % 60;
828 const int e_minutes =
end % 60;
856 return dbg <<
"NoHandle";
858 return dbg <<
"RhiTextureHandle";
867 dbg <<
"QVideoFrame(" <<
f.size() <<
", "
868 <<
f.pixelFormat() <<
", "
869 <<
f.handleType() <<
", "
870 <<
f.mapMode() <<
", "
The QAbstractVideoBuffer class is an abstraction for video data. \inmodule QtMultimedia.
virtual void unmap()=0
Releases the memory mapped by the map() function.
virtual MapData map(QVideoFrame::MapMode mode)=0
Independently maps the planes of a video buffer to memory.
virtual QVideoFrame::MapMode mapMode() const =0
QVideoFrame::HandleType handleType() const
Returns the type of a video buffer's handle.
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
bool isNull() const
Returns true if it is a null image, otherwise returns false.
void update()
Updates the layout for parentWidget().
The QMemoryVideoBuffer class provides a system memory allocated video data buffer.
The QPainter class performs low-level painting on widgets and other paint devices.
void drawImage(const QRectF &targetRect, const QImage &image, const QRectF &sourceRect, Qt::ImageConversionFlags flags=Qt::AutoColor)
Draws the rectangular portion source of the given image into the target rectangle in the paint device...
const QTransform & transform() const
Alias for worldTransform().
void fillRect(const QRectF &, const QBrush &)
Fills the given rectangle with the brush specified.
void setTransform(const QTransform &transform, bool combine=false)
constexpr qreal x() const noexcept
Returns the x coordinate of this point.
constexpr qreal y() const noexcept
Returns the y coordinate of this point.
\inmodule QtCore\reentrant
constexpr void moveCenter(const QPointF &p) noexcept
Moves the rectangle, leaving the center point at the given position.
constexpr qreal bottom() const noexcept
Returns the y-coordinate of the rectangle's bottom edge.
constexpr qreal height() const noexcept
Returns the height of the rectangle.
constexpr qreal left() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr QPointF topLeft() const noexcept
Returns the position of the rectangle's top-left corner.
constexpr QPointF center() const noexcept
Returns the center point of the rectangle.
constexpr QSizeF size() const noexcept
Returns the size of the rectangle.
constexpr qreal top() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr qreal right() const noexcept
Returns the x-coordinate of the rectangle's right edge.
\inmodule QtCore\reentrant
constexpr QSize toSize() const noexcept
Returns an integer based copy of this size.
void transpose() noexcept
Swaps the width and height values.
constexpr int height() const noexcept
Returns the height.
constexpr int width() const noexcept
Returns the width.
\macro QT_RESTRICTED_CAST_FROM_ASCII
QByteArray toLatin1() const &
QString & replace(qsizetype i, qsizetype len, QChar after)
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QString arg(qlonglong a, int fieldwidth=0, int base=10, QChar fillChar=u' ') const
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QVideoFramePrivate(const QVideoFrameFormat &format)
QAbstractVideoBuffer::MapData mapData
QVideoFramePrivate()=default
QAbstractVideoBuffer * buffer
QVideoFrame::RotationAngle rotationAngle
The QVideoFrame class represents a frame of video data.
QVideoFrame::HandleType handleType() const
Returns the type of a video frame's handle.
MapMode
Enumerates how a video buffer's data is mapped to system memory.
QVideoFrame()
Constructs a null video frame.
void setRotationAngle(RotationAngle)
Sets the angle the frame should be rotated clockwise before displaying.
QAbstractVideoBuffer * videoBuffer() const
RotationAngle
The angle of the clockwise rotation that should be applied to a video frame before displaying.
bool operator==(const QVideoFrame &other) const
qint64 startTime() const
Returns the presentation time (in microseconds) when the frame should be displayed.
void unmap()
Releases the memory mapped by the map() function.
void setMirrored(bool)
Sets the mirrored flag for the frame.
int planeCount() const
Returns the number of planes in the video frame.
bool mirrored() const
Returns whether the frame should be mirrored before displaying.
void paint(QPainter *painter, const QRectF &rect, const PaintOptions &options)
Uses a QPainter, {painter}, to render this QVideoFrame to rect.
QVideoFrameFormat surfaceFormat() const
Returns the surface format of this video frame.
QString subtitleText() const
Returns the subtitle text that should be rendered together with this video frame.
bool isMapped() const
Identifies if a video frame's contents are currently mapped to system memory.
QImage toImage() const
Based on the pixel format converts current video frame to image.
QSize size() const
Returns the dimensions of a video frame.
bool isReadable() const
Identifies if the mapped contents of a video frame were read from the frame when it was mapped.
int height() const
Returns the height of a video frame.
void setEndTime(qint64 time)
Sets the presentation time (in microseconds) when a frame should stop being displayed.
uchar * bits(int plane)
Returns a pointer to the start of the frame data buffer for a plane.
void setSubtitleText(const QString &text)
Sets the subtitle text that should be rendered together with this video frame to text.
bool map(QVideoFrame::MapMode mode)
Maps the contents of a video frame to system (CPU addressable) memory.
bool operator!=(const QVideoFrame &other) const
HandleType
Identifies the type of a video buffers handle.
QVideoFrame::MapMode mapMode() const
Returns the mode a video frame was mapped to system memory in.
QVideoFrameFormat::PixelFormat pixelFormat() const
Returns the pixel format of this video frame.
QVideoFrame & operator=(const QVideoFrame &other)
Moves other into this QVideoFrame.
bool isWritable() const
Identifies if the mapped contents of a video frame will be persisted when the frame is unmapped.
bool isValid() const
Identifies whether a video frame is valid.
int width() const
Returns the width of a video frame.
RotationAngle rotationAngle() const
Returns the angle the frame should be rotated clockwise before displaying.
qint64 endTime() const
Returns the presentation time (in microseconds) when a frame should stop being displayed.
int mappedBytes(int plane) const
Returns the number of bytes occupied by plane plane of the mapped frame data.
void setStartTime(qint64 time)
Sets the presentation time (in microseconds) when the frame should initially be displayed.
~QVideoFrame()
Destroys a video frame.
int bytesPerLine(int plane) const
Returns the number of bytes in a scan line of a plane.
QMap< QString, QString > map
[6]
Combined button and popup list for selecting options.
const TextureDescription * textureDescription(QVideoFrameFormat::PixelFormat format)
GLint GLsizei GLsizei height
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLdouble GLdouble GLdouble GLdouble top
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLint GLsizei GLsizei GLenum format
GLuint GLenum GLenum transform
#define QT_DEFINE_QESDP_SPECIALIZATION_DTOR(Class)
QLatin1StringView QLatin1String
QDebug operator<<(QDebug dbg, QVideoFrame::HandleType type)
static QString qFormatTimeStamps(qint64 start, qint64 end)
QImage qImageFromVideoFrame(const QVideoFrame &frame, QVideoFrame::RotationAngle rotation, bool mirrorX, bool mirrorY)
\inmodule QtCore \reentrant
Qt::AspectRatioMode aspectRatioMode
int bytesForSize(QSize s) const
int strideForWidth(int width) const