The QVideoSink class represents a generic sink for video data. More...
| Header: | #include <QVideoSink> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Multimedia)target_link_libraries(mytarget PRIVATE Qt6::Multimedia) |
| qmake: | QT += multimedia |
| Inherits: | QObject |
| QVideoSink(QObject *parent = nullptr) | |
| virtual | ~QVideoSink() override |
| QRhi * | rhi() const |
| void | setSubtitleText(const QString &subtitle) |
| void | setVideoFrame(const QVideoFrame &frame) |
| QString | subtitleText() const |
| QVideoFrame | videoFrame() const |
| QSize | videoSize() const |
| void | subtitleTextChanged(const QString &subtitleText) const |
| void | videoFrameChanged(const QVideoFrame &frame) const |
| void | videoSizeChanged() |
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 QMediaPlayer and QMediaCaptureSession.
Returns the current subtitle text.
Access functions:
| QString | subtitleText() const |
| void | setSubtitleText(const QString &subtitle) |
Notifier signal:
| void | subtitleTextChanged(const QString &subtitleText) const |
[read-only] videoSize : const QSizeReturns the size of the video currently being played back. If no video is being played, this method returns an invalid size.
Access functions:
| QSize | videoSize() const |
Notifier signal:
| void | videoSizeChanged() |
Constructs a new QVideoSink object with parent.
[override virtual noexcept] QVideoSink::~QVideoSink()Destroys the object.
Returns the QRhi instance being used to create texture data in the video frames.
Sets the current subtitle text.
Note: Setter function for property subtitleText.
See also subtitleText().
Sets the current video frame.
See also videoFrame().
Returns the current video frame.
See also setVideoFrame().
[signal] void QVideoSink::videoFrameChanged(const QVideoFrame &frame) constSignals when the video frame changes.