QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
QGCQVideoSinkController Class Reference

#include <QGCQVideoSinkController.h>

+ Inheritance diagram for QGCQVideoSinkController:
+ Collaboration diagram for QGCQVideoSinkController:

Public Slots

void refreshLatency ()
 

Signals

void frameCountsChanged ()
 
void negotiationChanged ()
 

Public Member Functions

 QGCQVideoSinkController (GstElement *element, QObject *parent=nullptr)
 
 ~QGCQVideoSinkController () override
 
void setActive (bool active)
 
void setVideoSink (QPointer< QVideoSink > sink)
 
void prepareForRelease ()
 
const GstElementelement () const noexcept
 
void updateNegotiation (const QString &format, const QSize &resolution)
 
quint64 frameCount () const noexcept
 
QString negotiatedFormat () const
 
QSize negotiatedResolution () const
 

Static Public Member Functions

static QList< QGCQVideoSinkController * > controllersOf (const QObject *receiver)
 A receiver's owning controllers — direct children only, never a deep QObject-tree walk.
 
static void syncActiveToWindowVisibility (QObject *receiver, QQuickVideoOutput *videoOutput)
 

Detailed Description

GUI-thread companion for the GstQgcQVideoSink element: mirrors negotiation/telemetry into Q_PROPERTYs for QML and owns the 1 Hz timer polling frames-delivered. Driven by GstVideoReceiver's bus pump. Ownership: parent owns the controller; the controller owns one GstElement ref so deferred QObject teardown can still clear the element binding.

Definition at line 20 of file QGCQVideoSinkController.h.

Constructor & Destructor Documentation

◆ QGCQVideoSinkController()

QGCQVideoSinkController::QGCQVideoSinkController ( GstElement element,
QObject *  parent = nullptr 
)

element is the GstQgcQVideoSink to control. Controller takes a ref so QObject teardown can safely clear the element binding even if the parent bin is released first.

Definition at line 16 of file QGCQVideoSinkController.cc.

◆ ~QGCQVideoSinkController()

QGCQVideoSinkController::~QGCQVideoSinkController ( )
override

Definition at line 25 of file QGCQVideoSinkController.cc.

Member Function Documentation

◆ controllersOf()

QList< QGCQVideoSinkController * > QGCQVideoSinkController::controllersOf ( const QObject *  receiver)
static

A receiver's owning controllers — direct children only, never a deep QObject-tree walk.

Definition at line 35 of file QGCQVideoSinkController.cc.

Referenced by GStreamer::setupQVideoSinkElement(), and syncActiveToWindowVisibility().

◆ element()

const GstElement * QGCQVideoSinkController::element ( ) const
noexcept

Definition at line 72 of file QGCQVideoSinkController.cc.

◆ frameCount()

quint64 QGCQVideoSinkController::frameCount ( ) const
noexcept

Definition at line 165 of file QGCQVideoSinkController.cc.

References delivered.

◆ frameCountsChanged

void QGCQVideoSinkController::frameCountsChanged ( )
signal

◆ negotiatedFormat()

QString QGCQVideoSinkController::negotiatedFormat ( ) const

Definition at line 174 of file QGCQVideoSinkController.cc.

◆ negotiatedResolution()

QSize QGCQVideoSinkController::negotiatedResolution ( ) const

Definition at line 180 of file QGCQVideoSinkController.cc.

◆ negotiationChanged

void QGCQVideoSinkController::negotiationChanged ( )
signal

Referenced by updateNegotiation().

◆ prepareForRelease()

void QGCQVideoSinkController::prepareForRelease ( )

Stop the poll timer synchronously ahead of deleteLater so a deferred destruction can't keep binding the element while a replacement controller is installed on it. Idempotent.

Definition at line 155 of file QGCQVideoSinkController.cc.

◆ refreshLatency

void QGCQVideoSinkController::refreshLatency ( )
slot

Re-prime sink-side latency after a pipeline latency recalculation (e.g. RTSP jitter-buffer reconfigure). Re-queries the element latency and pushes it back.

Definition at line 101 of file QGCQVideoSinkController.cc.

References GStreamer::adoptQuery().

◆ setActive()

void QGCQVideoSinkController::setActive ( bool  active)

Definition at line 117 of file QGCQVideoSinkController.cc.

◆ setVideoSink()

void QGCQVideoSinkController::setVideoSink ( QPointer< QVideoSink >  sink)

Definition at line 128 of file QGCQVideoSinkController.cc.

References setVideoSink().

Referenced by setVideoSink().

◆ syncActiveToWindowVisibility()

void QGCQVideoSinkController::syncActiveToWindowVisibility ( QObject *  receiver,
QQuickVideoOutput *  videoOutput 
)
static

Sync every controller owned by receiver to videoOutput's window visibility (drop frames while hidden/minimized), re-wiring across windowChanged. Wiring is parented to receiver.

Definition at line 41 of file QGCQVideoSinkController.cc.

References controllersOf().

Referenced by GStreamer::attachAppSink().

◆ updateNegotiation()

void QGCQVideoSinkController::updateNegotiation ( const QString &  format,
const QSize &  resolution 
)

Definition at line 77 of file QGCQVideoSinkController.cc.

References negotiationChanged().


The documentation for this class was generated from the following files: