En esta página

QVideoSink Class

La clase QVideoSink representa un sumidero genérico para datos de vídeo. Más...

Cabecera: #include <QVideoSink>
CMake: find_package(Qt6 REQUIRED COMPONENTS Multimedia)
target_link_libraries(mytarget PRIVATE Qt6::Multimedia)
qmake: QT += multimedia
Hereda: 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 puede ser utilizada para recuperar datos de video cuadro por cuadro 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 se puede utilizar para leer los datos de esos fotogramas y manejarlos posteriormente. Cuando se utiliza QPainter, el QVideoFrame se puede dibujar utilizando 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 durante más tiempo del requerido por la aplicación.

Véase también QMediaPlayer y QMediaCaptureSession.

Documentación de propiedades

subtitleText : QString

Devuelve el texto actual de los subtítulos.

Funciones de acceso:

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

Señal del notificador:

void subtitleTextChanged(const QString &subtitleText) const

[read-only] videoSize : QSize

Devuelve el tamaño del vídeo que se está reproduciendo actualmente. 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 del notificador:

void videoSizeChanged()

Documentación de la función miembro

QVideoSink::QVideoSink(QObject *parent = nullptr)

Construye 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 subtitle.

Nota: Función Setter para la propiedad subtitleText.

Véase también subtitleText().

void QVideoSink::setVideoFrame(const QVideoFrame &frame)

Establece el vídeo actual frame.

Véase también videoFrame().

QVideoFrame QVideoSink::videoFrame() const

Devuelve el fotograma de vídeo actual.

Véase también setVideoFrame().

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

Señala 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.