QVideoSink Class▲
-
Header: QVideoSink
-
CMake:
find_package(Qt6 REQUIRED COMPONENTS Multimedia)
target_link_libraries(mytarget PRIVATE Qt6::Multimedia)
-
qmake: QT += multimedia
-
Inherits: QObject
-
Group: QVideoSink is part of multimedia, multimedia_video
Detailed Description▲
The QVideoSink class can be used to retrieve video data on a frame by frame basis from Qt Multimedia.
QVideoSink will provide individual video frames to the application developer through the videoFrameChanged() signal.
The video frame can then be used to read out the data of those frames and handle them further. When using QPainter, the QVideoFrame can be drawing using the paint() method in QVideoSink.
QVideoFrame objects can consume a significant amount of memory or system resources and should thus not be held for longer than required by the application.
See Also▲
See also QMediaPlayer, QMediaCaptureSession
Property Documentation▲
subtitleText : QString▲
Returns the current subtitle text.
Access functions:
-
subtitleText() const
-
void setSubtitleText(const &subtitle)
Notifier signal:
-
void subtitleTextChanged(const &subtitleText) const
[read-only] videoSize : const QSize▲
Returns the size of the video currently being played back. If no video is being played, this method returns an invalid size.
Access functions:
-
videoSize() const
Notifier signal:
-
void videoSizeChanged()
Member Function Documentation▲
QVideoSink::QVideoSink(QObject *parent = nullptr)▲
Constructs a new QVideoSink object with parent.
[virtual] QVideoSink::~QVideoSink()▲
Destroys the object.
void QVideoSink::setSubtitleText(const QString &subtitle)▲
Sets the current subtitle text.
Setter function for property subtitleText.
See Also▲
See also subtitleText()
void QVideoSink::setVideoFrame(const QVideoFrame &frame)▲
QVideoFrame QVideoSink::videoFrame() const▲
void QVideoSink::videoFrameChanged(const QVideoFrame &frame) const▲
Signals when the video frame changes.