QVideoSink 类

QVideoSink 类表示视频数据的一般汇点。 更多...

头: #include <QVideoSink>
CMake: find_package(Qt6 COMPONENTS Multimedia REQUIRED)
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

详细描述

QVideoSink 类可以用于从 Qt Multimedia 逐帧检索视频数据。

QVideoSink can operate in two modes. In the first mode, it can render the video stream to a native window of the underlying windowing system. In the other mode, it 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 QVideoFrame 可以绘制使用 paint() 方法在 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 .

成员函数文档编制

QVideoSink:: QVideoSink ( QObject * parent = nullptr)

构造新的 QVideoSink 对象采用 parent .

[虚拟] QVideoSink:: ~QVideoSink ()

销毁对象。

void QVideoSink:: setSubtitleText (const QString & subtitle )

设置当前 subtitle 文本。

另请参阅 subtitleText ().

void QVideoSink:: setVideoFrame (const QVideoFrame & frame )

设置当前视频 frame .

另请参阅 videoFrame ().

QString QVideoSink:: subtitleText () const

返回当前字幕文本。

另请参阅 setSubtitleText ().

QVideoFrame QVideoSink:: videoFrame () const

返回当前视频帧。

另请参阅 setVideoFrame ().

QSize QVideoSink:: videoSize () const

Returns the size of the video currently being played back. If no video is being played, this method returns an invalid size.