-turns out the previous statment on the previous commit is
 incorrect. it is every possible to overlap events. to
 mitigate this, evtHist was added to shared_t to track
 recently copied source vids and remove them from the
 event queued to be written.
This commit is contained in:
Zii 2023-05-30 20:03:22 -04:00
parent 732a604c24
commit 71df7d1eb5
2 changed files with 32 additions and 12 deletions

View File

@ -242,6 +242,11 @@ bool Upkeep::exec()
enforceMaxEvents(shared);
enforceMaxImages();
if (shared->evtHist.size() >= MAX_EVTHIST)
{
shared->evtHist.clear();
}
genHTMLul(".", shared->camName, shared);
genCSS(shared);
@ -273,21 +278,34 @@ bool EventLoop::exec()
vidList += forwardFacingFiles("live", ".ts", event.timeStamp, shared->evMaxSecs / 2);
recLog("attempting write out of event: " + name, shared);
if (wrOutVod(name, vidList))
for (auto &&hist : shared->evtHist)
{
genHTMLvod(name);
if (vidList.contains(hist))
{
vidList.removeAll(hist);
}
}
QProcess proc;
QStringList args;
if (!vidList.isEmpty())
{
shared->evtHist.append(vidList);
args << "convert";
args << event.imgPath;
args << "events/" + name + ".jpg";
recLog("attempting write out of event: " + name, shared);
proc.start("magick", args);
proc.waitForFinished();
if (wrOutVod(name, vidList))
{
genHTMLvod(name);
QProcess proc;
QStringList args;
args << "convert";
args << event.imgPath;
args << "events/" + name + ".jpg";
proc.start("magick", args);
proc.waitForFinished();
}
}
}

View File

@ -28,7 +28,7 @@
using namespace std;
#define APP_VER "3.0.t9"
#define APP_VER "3.0.t10"
#define APP_NAME "Motion Watch"
#define APP_BIN "mow"
#define REC_LOG_NAME "rec_log_lines.html"
@ -37,6 +37,7 @@ using namespace std;
#define DATETIME_FMT "yyyyMMddhhmmss"
#define STRFTIME_FMT "%Y%m%d%H%M%S"
#define MAX_IMAGES 1000
#define MAX_EVTHIST 100
struct evt_t
{
@ -47,6 +48,7 @@ struct evt_t
struct shared_t
{
QList<evt_t> recList;
QStringList evtHist;
QString conf;
QString recLog;
QString detLog;