6#include <QtCore/QString>
19 using Clock = std::chrono::steady_clock;
35 int part()
const {
return _part; }
41 bool opened()
const {
return _opened; }
44 bool onFileOpened(
const QString& file, Clock::time_point now = Clock::now());
48 bool partDue(Clock::time_point now = Clock::now())
const;
54 qint64
recordingMs(Clock::time_point now = Clock::now())
const;
61 std::chrono::milliseconds _maxPartDuration;
64 std::optional<Clock::time_point> _startedAt;
66 Clock::time_point _partStartedAt;
69 qint64 _closedBytes = 0;
static QString partFile(const QString &file, int part)
"<base>_part<part>.<ext>" for file "<base>.<ext>"; file itself for part 1.
bool onFileOpened(const QString &file, Clock::time_point now=Clock::now())
file got its first frame at now. False, changing nothing, unless it is the current part's file.
RecordingPlan(const QString &file, VideoReceiver::FileFormat format, std::chrono::milliseconds maxPartDuration=kMaxPartDuration)
qint64 recordingMs(Clock::time_point now=Clock::now()) const
For VideoStreamStats::recordingMs: since the first part got its first frame; -1 before.
std::chrono::steady_clock Clock
bool partDue(Clock::time_point now=Clock::now()) const
The current part has recorded for its maximum duration by now.
QString currentFile() const
The file the current part records to.
static QString insertBeforeExtension(const QString &file, const QString &tag)
"<base><tag>.<ext>" for file "<base>.<ext>", and "<file><tag>" for one without an extension.
bool opened() const
The current part got a frame.
static constexpr std::chrono::minutes kMaxPartDuration
qint64 bytesWritten() const
For VideoStreamStats::recordingBytes: what the parts' files held when they closed,...
VideoReceiver::FileFormat format() const
void onFileClosed(const QString &file)
file is closed. Counts for the one that opened last only: a file of an earlier recording can close la...
FileFormat
Values are persisted by VideoSettings::recordingFormat.