feat(streamhub): parse +Recorder config and add recorder WS commands

Parse the optional +Recorder block in Initialise (Enabled/AutoStart/
Directory/MaxFileMB/KeepFiles/StagingMB/FlushIntervalSec/MinDiskFreeMB/
Signals, MB->bytes), apply it to each session before Start (static and
dynamic sources). Drive recorder disk I/O from the push loop via
RecorderFlushTick, and add recStart/recStop/recInfo WS commands plus a
recStatus broadcast/snapshot.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Martino Ferrari
2026-06-25 01:13:23 +02:00
parent 93fc11c88f
commit 19e649aa38
2 changed files with 165 additions and 1 deletions
+17
View File
@@ -146,6 +146,20 @@ private:
void HandleSetMaxPoints(const char *json);
void HandlePing(uint32 slotIdx);
/* ---- Binary recorder commands --------------------------------------- */
/** Arm recording on all enabled sessions (optional "sourceId" filter). */
void HandleRecStart(const char *json);
/** Disarm recording on all enabled sessions (optional "sourceId" filter). */
void HandleRecStop(const char *json);
/** Unicast a {"type":"recStatus",...} snapshot to one client. */
void HandleRecInfo(uint32 slotIdx);
/** Broadcast a {"type":"recStatus",...} snapshot to all clients. */
void BroadcastRecStatus();
/** Append the full recStatus message body into a growable buffer. */
void AppendRecStatusJSON(char *&buf, uint32 &off, uint32 &cap);
/* ---- Sources persistence (Go SourceConfig schema) --------------------- */
/**
@@ -191,6 +205,9 @@ private:
TriggerEngine trigger_;
HistoryWriter history_;
/* Recorder configuration (parsed once, applied to each session). */
RecorderConfig recorderCfg_;
/* Configuration */
uint16 wsPort_;
uint32 maxPoints_;