try to index media immediately on import

Since indexing is supplemental, it can be made a background task that can occur
at more or less any time. So we run it as soon as possible.
This commit is contained in:
itsmattkc
2020-01-17 03:58:29 +11:00
parent 63b3c60017
commit 653709dc84
28 changed files with 410 additions and 735 deletions
+14
View File
@@ -26,6 +26,8 @@
#include "codec/ffmpeg/ffmpegdecoder.h"
#include "codec/oiio/oiiodecoder.h"
#include "task/index/index.h"
#include "task/taskmanager.h"
Decoder::Decoder() :
open_(false),
@@ -126,6 +128,14 @@ bool Decoder::ProbeMedia(Footage *f)
// FIXME: Cache the results so we don't have to probe if this media is added a second time
// Start an index task
foreach (StreamPtr stream, f->streams()) {
qDebug() << "Starting index task on" << stream->footage()->filename() << stream->index();
IndexTask* index_task = new IndexTask(stream);
TaskManager::instance()->AddTask(index_task);
}
return true;
}
}
@@ -161,3 +171,7 @@ void Decoder::Conform(const AudioRenderingParams &params)
qCritical() << "Conform called on an audio decoder that does not have a handler for it:" << id();
abort();
}
void Decoder::Index()
{
}