En esta página

QVideoSink Class

La clase QVideoSink representa un destino genérico para datos de vídeo. Más información...

Encabezado: #include <QVideoSink>
CMake: find_package(Qt6 REQUIRED COMPONENTS Multimedia)
target_link_libraries(mytarget PRIVATE Qt6::Multimedia)
qmake: QT += multimedia
Heredado de: QObject

Propiedades

Funciones públicas

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

Señales

void subtitleTextChanged(const QString &subtitleText) const
void videoFrameChanged(const QVideoFrame &frame) const
void videoSizeChanged()

Descripción detallada

La clase QVideoSink se puede utilizar para recuperar datos de vídeo fotograma a fotograma desde Qt Multimedia.

QVideoSink proporcionará fotogramas de vídeo individuales al desarrollador de la aplicación a través de la señal « videoFrameChanged()».

A continuación, el fotograma de vídeo puede utilizarse para leer los datos de dichos fotogramas y procesarlos posteriormente. Al utilizar ` QPainter`, se puede dibujar el objeto ` QVideoFrame ` mediante el método ` paint()`.

QVideoFrame Los objetos pueden consumir una cantidad significativa de memoria o de recursos del sistema, por lo que no deben mantenerse más tiempo del que requiera la aplicación.

Véase también QMediaPlayer y QMediaCaptureSession.

Documentación de propiedades

subtitleText : QString

Devuelve el texto del subtítulo actual.

Funciones de acceso:

QString subtitleText() const
void setSubtitleText(const QString &subtitle)

Señal de notificación:

void subtitleTextChanged(const QString &subtitleText) const

[read-only] videoSize : QSize

Devuelve el tamaño del vídeo que se está reproduciendo en ese momento. Si no se está reproduciendo ningún vídeo, este método devuelve un tamaño no válido.

Funciones de acceso:

QSize videoSize() const

Señal de notificador:

void videoSizeChanged()

Documentación de funciones de miembro

QVideoSink::QVideoSink(QObject *parent = nullptr)

Crea un nuevo objeto QVideoSink con ` parent`.

[override virtual noexcept] QVideoSink::~QVideoSink()

Destruye el objeto.

QRhi *QVideoSink::rhi() const

Devuelve la instancia de ` QRhi ` que se está utilizando para crear datos de textura en los fotogramas de vídeo.

void QVideoSink::setSubtitleText(const QString &subtitle)

Establece el texto actual de la propiedad « subtitle ».

Nota: Funciónde asignación para la propiedad subtitleText.

Véase también subtitleText().

void QVideoSink::setVideoFrame(const QVideoFrame &frame)

Establece el vídeo actual frame.

Nota: Esta función es segura para subprocesos.

Véase también videoFrame().

QVideoFrame QVideoSink::videoFrame() const

Devuelve el fotograma de vídeo actual.

Nota: Esta función es segura para subprocesos.

Véase también setVideoFrame().

[signal] void QVideoSink::videoFrameChanged(const QVideoFrame &frame) const

Avisa cuando cambia el vídeo frame.

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.