In questa pagina

QVideoSink Class

La classe QVideoSink rappresenta un sink generico per i dati video. Per saperne di più...

Intestazione: #include <QVideoSink>
CMake: find_package(Qt6 REQUIRED COMPONENTS Multimedia)
target_link_libraries(mytarget PRIVATE Qt6::Multimedia)
qmake: QT += multimedia
Eredita da: QObject

Proprietà

Funzioni pubbliche

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

Segnali

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

Descrizione dettagliata

La classe QVideoSink può essere utilizzata per recuperare i dati video fotogramma per fotogramma da Qt Multimedia.

QVideoSink fornirà i singoli fotogrammi video allo sviluppatore dell'applicazione tramite il segnale videoFrameChanged().

Il fotogramma video può quindi essere utilizzato per leggere i dati di quei fotogrammi e gestirli ulteriormente. Quando si utilizza ` QPainter`, l'QVideoFrame e può essere disegnato utilizzando il metodo ` paint()`.

QVideoFrame Gli oggetti possono consumare una quantità significativa di memoria o risorse di sistema e non dovrebbero quindi essere mantenuti in memoria più a lungo di quanto richiesto dall’applicazione.

Vedi anche QMediaPlayer e QMediaCaptureSession.

Documentazione sulle proprietà

subtitleText : QString

Restituisce il testo del sottotitolo corrente.

Funzioni di accesso:

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

Segnale di notifica:

void subtitleTextChanged(const QString &subtitleText) const

[read-only] videoSize : QSize

Restituisce la dimensione del video attualmente in riproduzione. Se non è in riproduzione alcun video, questo metodo restituisce una dimensione non valida.

Funzioni di accesso:

QSize videoSize() const

Segnale di notifica:

void videoSizeChanged()

Documentazione delle funzioni membro

QVideoSink::QVideoSink(QObject *parent = nullptr)

Crea un nuovo oggetto QVideoSink con ` parent`.

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

Elimina l'oggetto.

QRhi *QVideoSink::rhi() const

Restituisce l'istanza di ` QRhi ` utilizzata per creare i dati delle texture nei fotogrammi video.

void QVideoSink::setSubtitleText(const QString &subtitle)

Imposta il testo corrente della proprietà " subtitle ".

Nota: funzionesetter per la proprietà subtitleText.

Vedi anche subtitleText().

void QVideoSink::setVideoFrame(const QVideoFrame &frame)

Imposta l'frame e video corrente.

Nota: questa funzione è thread-safe.

Vedi anche videoFrame().

QVideoFrame QVideoSink::videoFrame() const

Restituisce il fotogramma video corrente.

Nota: questa funzione è thread-safe.

Vedi anche setVideoFrame().

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

Segnala quando cambia il video 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.