Files
oak-editor/app/render/indexmanager.h
T
itsmattkc 03bdf01357 decoder/renderer: no longer index automatically as part of the retrieve
functions

Indexing is a lengthy process and had a high chance of getting RenderWorkers
stuck doing it rather than being responsive to cache requests. This commit
introduces a system where workers never index media, but instead signal that
media is not ready to their RenderBackends which ensure that the media gets
indexed and re-queues the affected frames when those indexes are ready.
2020-02-19 11:44:29 +11:00

45 lines
734 B
C++

#ifndef INDEXMANAGER_H
#define INDEXMANAGER_H
#include <QObject>
#include "project/item/footage/stream.h"
#include "task/index/index.h"
class IndexManager : public QObject
{
Q_OBJECT
public:
IndexManager();
static void CreateInstance();
static IndexManager* instance();
static void DestroyInstance();
bool IsIndexing(StreamPtr stream);
public slots:
void StartIndexingStream(StreamPtr stream);
signals:
void StreamIndexUpdated(Stream* stream);
private:
static IndexManager* instance_;
struct StreamThreadPair {
StreamPtr stream;
IndexTask* task;
};
QList<StreamThreadPair> threads_;
private slots:
void IndexTaskFinished();
void StreamIndexUpdatedEvent();
};
#endif // INDEXMANAGER_H