QVideoSink 类表示视频数据的一般汇点。 更多...
头: | #include <QVideoSink> |
CMake: |
find_package(Qt6 REQUIRED COMPONENTS Multimedia)
target_link_libraries(mytarget PRIVATE Qt6::Multimedia) |
qmake: | QT += multimedia |
继承: | QObject |
QVideoSink (QObject * parent = nullptr) | |
virtual | ~QVideoSink () |
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 () 信号。
The video frame can then be used to read out the data of those frames and handle them further. When using QPainter , 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.
另请参阅 QMediaPlayer and QMediaCaptureSession .
Returns the current subtitle text.
访问函数:
QString | subtitleText () const |
void | setSubtitleText (const QString & subtitle ) |
通知程序信号:
void | subtitleTextChanged (const QString & 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.
访问函数:
QSize | videoSize () const |
通知程序信号:
void | videoSizeChanged () |
构造新的 QVideoSink 对象采用 parent .
[virtual]
QVideoSink::
~QVideoSink
()
销毁对象。
设置当前 subtitle text.
注意: Setter 函数对于特性 subtitleText .
另请参阅 subtitleText ().
设置当前视频 frame .
另请参阅 videoFrame ().
Returns the current video frame.
另请参阅 setVideoFrame ().
[signal]
void
QVideoSink::
videoFrameChanged
(const
QVideoFrame
&
frame
) const
Signals when the video frame 改变。