88 return d ? d->
buffer.get() :
nullptr;
133 auto buffer = std::make_unique<QImageVideoBuffer>(
image);
140 if (bufferImage.isNull())
504 qWarning() <<
"QVideoFrame::unmap() was called more times then QVideoFrame::map()";
649#if QT_DEPRECATED_SINCE(6, 7)
791 targetRect.moveCenter(
rect.center());
794 if (targetRect.top() >
rect.top()) {
798 if (targetRect.left() >
rect.left()) {
799 QRectF top(
rect.left(), targetRect.top(), targetRect.left() -
rect.left(), targetRect.height());
802 if (targetRect.right() <
rect.right()) {
803 QRectF top(targetRect.right(), targetRect.top(),
rect.right() - targetRect.right(), targetRect.height());
806 if (targetRect.bottom() <
rect.bottom()) {
817 targetRect.center().y() -
size.height()/2);
842#ifndef QT_NO_DEBUG_STREAM
852 const int s_millis =
start % 1000000;
854 const int s_seconds =
start % 60;
856 const int s_minutes =
start % 60;
886 const int e_millis =
end % 1000000;
888 const int e_seconds =
end % 60;
890 const int e_minutes =
end % 60;
918 return dbg <<
"NoHandle";
920 return dbg <<
"RhiTextureHandle";
929 dbg <<
"QVideoFrame(" <<
f.size() <<
", "
930 <<
f.pixelFormat() <<
", "
931 <<
f.handleType() <<
", "
932 <<
f.mapMode() <<
", "
The QAbstractVideoBuffer class is an abstraction for video data. \inmodule QtMultimedia.
void resize(qsizetype size)
Sets the size of the byte array to size bytes.
bool isNull() const
Returns true if it is a null image, otherwise returns false.
void update()
Updates the layout for parentWidget().
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)
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
constexpr int height() const noexcept
Returns the height.
constexpr int width() const noexcept
Returns the width.
\macro QT_RESTRICTED_CAST_FROM_ASCII
QString & replace(qsizetype i, qsizetype len, QChar after)
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
QAbstractVideoBuffer::MapData mapData
std::unique_ptr< QAbstractVideoBuffer > buffer
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 setRotation(QtVideo::Rotation angle)
Sets the angle the frame should be rotated clockwise before displaying.
qreal streamFrameRate() const
Returns the frame rate of a video stream in frames per second.
QAbstractVideoBuffer * videoBuffer() const
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 and sets the flag to the underlying \l surfaceFormat.
QtVideo::Rotation rotation() const
Returns the angle the frame should be rotated clockwise before displaying.
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.
void setStreamFrameRate(qreal rate)
Sets the frame rate of a video stream in frames per second.
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.
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
#define QStringLiteral(str)
QDebug operator<<(QDebug dbg, QVideoFrame::HandleType type)
static QString qFormatTimeStamps(qint64 start, qint64 end)
QImage qImageFromVideoFrame(const QVideoFrame &frame, QtVideo::Rotation rotation, bool mirrorX, bool mirrorY)
\inmodule QtCore \reentrant
Qt::AspectRatioMode aspectRatioMode
int bytesForSize(QSize s) const
int strideForWidth(int width) const