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

#include <VideoRecordingService.h>

Inheritance diagram for VideoRecordingService:
Collaboration diagram for VideoRecordingService:

Signals

void recordingChanged (bool recording)

Public Member Functions

 VideoRecordingService (const QList< VideoStreamController * > &sources, QObject *parent=nullptr)
 ~VideoRecordingService () override
void addSource (VideoStreamController *source)
 Follows source as well, for as long as it exists.
bool recording () const
 True while any source records.
void startRecording (const QString &baseName=QString())
void stopRecording ()

Static Public Member Functions

static QString recordingFile (const QString &directory, const QString &baseName, const VideoStreamController *source, VideoReceiver::FileFormat format)
static QString uniqueBaseName (const QString &directory, const QDateTime &time)
 time as "yyyy-MM-dd_hh.mm.ss", suffixed "_2", "_3"... while files of that name exist in directory.
static QStringList pruneStorage (const QString &directory, quint64 maxBytes, const QStringList &openFiles={})

Friends

class VideoRecordingServiceTest

Detailed Description

Records the video sources of the main picture: the primary stream or the USB camera, and the thermal stream. Names the files, keeps the recordings within the storage limit as one starts and while it runs, writes the telemetry subtitles of the video on display (the primary stream or the USB camera) and reports recording failures to the user. The sources in tiles aren't recorded; a recording goes on for a source that moves to a tile meanwhile.

Definition at line 20 of file VideoRecordingService.h.

Constructor & Destructor Documentation

◆ VideoRecordingService()

VideoRecordingService::VideoRecordingService ( const QList< VideoStreamController * > & sources,
QObject * parent = nullptr )
explicit

Definition at line 29 of file VideoRecordingService.cc.

References addSource().

◆ ~VideoRecordingService()

VideoRecordingService::~VideoRecordingService ( )
overridedefault

Member Function Documentation

◆ addSource()

void VideoRecordingService::addSource ( VideoStreamController * source)

Follows source as well, for as long as it exists.

Definition at line 43 of file VideoRecordingService.cc.

References VideoStreamController::role().

Referenced by VideoRecordingService().

◆ pruneStorage()

QStringList VideoRecordingService::pruneStorage ( const QString & directory,
quint64 maxBytes,
const QStringList & openFiles = {} )
static

Deletes the oldest recordings and subtitle files in directory until they use less than maxBytes. Leaves the files being written: openFiles, and any written within the last minute, as a recording's file is before it reports its first frame. Returns the deleted files.

Definition at line 191 of file VideoRecordingService.cc.

References VideoReceiver::fileExtension(), VideoReceiver::Mkv, VideoReceiver::Mov, and VideoReceiver::Mp4.

◆ recording()

bool VideoRecordingService::recording ( ) const
inline

True while any source records.

Definition at line 34 of file VideoRecordingService.h.

Referenced by recordingChanged().

◆ recordingChanged

void VideoRecordingService::recordingChanged ( bool recording)
signal

References recording().

◆ recordingFile()

QString VideoRecordingService::recordingFile ( const QString & directory,
const QString & baseName,
const VideoStreamController * source,
VideoReceiver::FileFormat format )
static

◆ startRecording()

void VideoRecordingService::startRecording ( const QString & baseName = QString())

Records every active source that isn't in a tile into the video save directory as "<baseName>.<ext>", the thermal stream as "<baseName>.thermalVideo.<ext>". An empty baseName picks an unused timestamped name.

Definition at line 131 of file VideoRecordingService.cc.

References VideoStreamController::active(), SettingsManager::appSettings(), SettingsManager::instance(), VideoReceiver::isValidFileFormat(), recordingFile(), QGC::showAppMessage(), VideoStreamController::startRecording(), VideoStreamController::tile(), uniqueBaseName(), AppSettings::videoSavePath(), and SettingsManager::videoSettings().

◆ stopRecording()

void VideoRecordingService::stopRecording ( )

Definition at line 166 of file VideoRecordingService.cc.

References VideoStreamController::stopRecording().

◆ uniqueBaseName()

QString VideoRecordingService::uniqueBaseName ( const QString & directory,
const QDateTime & time )
static

time as "yyyy-MM-dd_hh.mm.ss", suffixed "_2", "_3"... while files of that name exist in directory.

Definition at line 180 of file VideoRecordingService.cc.

Referenced by startRecording().

◆ VideoRecordingServiceTest

friend class VideoRecordingServiceTest
friend

Definition at line 24 of file VideoRecordingService.h.

References VideoRecordingServiceTest.

Referenced by VideoRecordingServiceTest.


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