QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
VideoStreamResolver Namespace Reference

Maps the video settings and a camera's advertised stream to what a stream source's VideoReceiver plays. More...

Classes

struct  Settings
 The video settings resolve() reads, and what they depend on. More...

Enumerations

enum class  Role : uint8_t { Primary , Thermal , Camera , Tile }
 What a video source, each with a VideoStreamController, is. VideoSourceRole.Primary, ... in QML. More...

Functions

Settings snapshot (VideoSettings *videoSettings)
std::optional< VideoReceiver::Config > resolve (const Settings &settings, const QGCVideoStreamInfo *streamInfo, Role role)
VideoReceiver::DisplayConfig displayConfig (const Settings &settings)
 The display sink settings: GPU zero-copy unless the CPU path or a software decoder is forced.
bool isAutoStream (const QGCVideoStreamInfo *streamInfo)
 True when streamInfo advertises a URI, which then takes precedence over the manual settings.
bool isNetworkSource (const QString &videoSource)
 True for the manual sources that are network streams (not "disabled", not a local camera).
QString transportName (const QString &uri)

Detailed Description

Maps the video settings and a camera's advertised stream to what a stream source's VideoReceiver plays.

Enumeration Type Documentation

◆ Role

enum class VideoStreamResolver::Role : uint8_t
strong

What a video source, each with a VideoStreamController, is. VideoSourceRole.Primary, ... in QML.

Enumerator
Primary 

The stream to display: a vehicle's current camera's current one, else the one the settings configure.

Thermal 

The thermal stream a vehicle's current camera advertises.

Camera 

The local camera: the one the video source setting names or, beside a stream, the one for a tile.

Tile 

Another stream a vehicle's cameras advertise, shown in a tile.

Definition at line 23 of file VideoStreamResolver.h.

Function Documentation

◆ displayConfig()

VideoReceiver::DisplayConfig VideoStreamResolver::displayConfig ( const Settings & settings)

◆ isAutoStream()

bool VideoStreamResolver::isAutoStream ( const QGCVideoStreamInfo * streamInfo)

True when streamInfo advertises a URI, which then takes precedence over the manual settings.

Definition at line 166 of file VideoStreamResolver.cc.

References QGCVideoStreamInfo::uri().

Referenced by resolve().

◆ isNetworkSource()

bool VideoStreamResolver::isNetworkSource ( const QString & videoSource)

True for the manual sources that are network streams (not "disabled", not a local camera).

Definition at line 171 of file VideoStreamResolver.cc.

◆ resolve()

std::optional< VideoReceiver::Config > VideoStreamResolver::resolve ( const Settings & settings,
const QGCVideoStreamInfo * streamInfo,
Role role )

What the source of role plays: the stream streamInfo advertises, or else, for the primary role only, the manually configured one. nullopt when there is none, as for the camera role, which plays no stream. Reads only its arguments: a camera's stream never changes the user's settings.

Definition at line 141 of file VideoStreamResolver.cc.

References VideoReceiver::Config::autoReconnect, VideoStreamResolver::Settings::autoReconnect, isAutoStream(), VideoReceiver::Config::lowLatency, VideoStreamResolver::Settings::lowLatency, Primary, VideoReceiver::Config::rtpJitterLatencyMs, VideoStreamResolver::Settings::rtpJitterLatencyMs, VideoStreamUri::Rtsp, VideoStreamResolver::Settings::rtspTimeoutSec, VideoReceiver::Config::timeout, VideoStreamUri::transportFor(), and VideoReceiver::Config::uri.

◆ snapshot()

◆ transportName()

QString VideoStreamResolver::transportName ( const QString & uri)

How a stream arrives, from its URI scheme: "RTSP", "RTP/UDP (H.264)", "MPEG-TS/TCP", ...; the upper-cased scheme for one resolve() never produces, empty for an empty uri.

Definition at line 176 of file VideoStreamResolver.cc.

References VideoStreamUri::transportFor().

Referenced by VideoStreamController::transport().