v3.3.t6
-detectloop now operates on a minimum of 3 clips and then grabs only the second and third to last clips. this insures only finished clips from the stream are grabbed.
This commit is contained in:
parent
4f0c37b92b
commit
5b444fd754
|
@ -183,35 +183,23 @@ void DetectLoop::updated(const QString &path)
|
||||||
{
|
{
|
||||||
auto clips = lsFilesInDir(path, shared->streamExt);
|
auto clips = lsFilesInDir(path, shared->streamExt);
|
||||||
|
|
||||||
if (clips.isEmpty())
|
if (clips.size() < 3)
|
||||||
{
|
{
|
||||||
thread()->sleep(5); reset();
|
thread()->sleep(5); reset();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
auto latestPath = path + "/" + clips.last();
|
vidAPath = shared->buffPath + "/live/" + clips[clips.size() - 3];
|
||||||
|
vidBPath = shared->buffPath + "/live/" + clips[clips.size() - 2];
|
||||||
|
|
||||||
if (vidAPath.isEmpty())
|
exec(); thread()->sleep(1);
|
||||||
{
|
|
||||||
vidAPath = latestPath;
|
|
||||||
}
|
|
||||||
else if (latestPath == vidAPath)
|
|
||||||
{
|
|
||||||
thread()->usleep(500);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
vidBPath = latestPath;
|
|
||||||
|
|
||||||
thread()->sleep(1);
|
|
||||||
|
|
||||||
exec();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DetectLoop::pcBreak()
|
void DetectLoop::pcBreak()
|
||||||
{
|
{
|
||||||
|
prevClips.clear();
|
||||||
|
|
||||||
if (!shared->postCmd.isEmpty())
|
if (!shared->postCmd.isEmpty())
|
||||||
{
|
{
|
||||||
QTextStream(stdout) << "---POST_BREAK---" << Qt::endl;
|
QTextStream(stdout) << "---POST_BREAK---" << Qt::endl;
|
||||||
|
@ -370,12 +358,6 @@ void DetectLoop::exec()
|
||||||
eventQue.vidList.append(vidBPath);
|
eventQue.vidList.append(vidBPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
QTextStream(stdout) << "why?" << Qt::endl;
|
|
||||||
QTextStream(stdout) << "imgAPath: " << imgAPath << Qt::endl;
|
|
||||||
QTextStream(stdout) << "imgBPath: " << imgBPath << Qt::endl;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
vidAPath.clear();
|
vidAPath.clear();
|
||||||
|
|
|
@ -62,6 +62,7 @@ private:
|
||||||
|
|
||||||
QString vidAPath;
|
QString vidAPath;
|
||||||
QString vidBPath;
|
QString vidBPath;
|
||||||
|
QStringList prevClips;
|
||||||
QTimer *pcTimer;
|
QTimer *pcTimer;
|
||||||
evt_t eventQue;
|
evt_t eventQue;
|
||||||
shared_t *shared;
|
shared_t *shared;
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
#define APP_VER "3.3.t5"
|
#define APP_VER "3.3.t6"
|
||||||
#define APP_NAME "Motion Watch"
|
#define APP_NAME "Motion Watch"
|
||||||
#define APP_BIN "mow"
|
#define APP_BIN "mow"
|
||||||
#define DATETIME_FMT "yyyyMMddhhmmss"
|
#define DATETIME_FMT "yyyyMMddhhmmss"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user