Go to the documentation of this file.
2 #ifndef PREVIEW_GENERATOR_QUEUE_H
3 #define PREVIEW_GENERATOR_QUEUE_H
73 static void CreatePreviewGeneratorQueue(
75 uint maxAttempts, std::chrono::seconds minBlockSeconds);
76 static void TeardownPreviewGeneratorQueue();
91 GetPreviewImage(pginfo, QSize(0,0),
"", -1s, -1, token);
93 static void GetPreviewImage(
const ProgramInfo &pginfo, QSize outputsize,
94 const QString &outputfile,
95 std::chrono::seconds time,
long long frame,
96 const QString& token);
97 static void AddListener(QObject *listener);
98 static void RemoveListener(QObject *listener);
102 uint maxAttempts, std::chrono::seconds minBlockSeconds);
105 QString GeneratePreviewImage(
ProgramInfo &pginfo, QSize size,
106 const QString &outputfile,
107 std::chrono::seconds time,
long long frame,
108 const QString& token);
110 void GetInfo(
const QString &key,
uint &queue_depth,
uint &token_cnt);
112 void IncPreviewGeneratorPriority(
const QString &key,
const QString& token);
113 void UpdatePreviewGeneratorThreads(
void);
114 bool IsGeneratingPreview(
const QString &key)
const;
115 uint IncPreviewGeneratorAttempts(
const QString &key);
116 void ClearPreviewGeneratorAttempts(
const QString &key);
118 bool event(QEvent *e)
override;
121 const QString &eventname,
123 const QString &token,
125 const QDateTime &dt);
160 #endif // PREVIEW_GENERATOR_QUEUE_H
This class holds all the state information related to a specific preview generator.
PreviewGenState()=default
std::chrono::seconds m_lastBlockTime
The amount of time (in seconds) that this generator was blocked before it could start.
This class creates a preview image of a recording.
QDateTime m_blockRetryUntil
Any request to generate an image will be ignored until after this time.
static int SendEvent(const MythUtilCommandLineParser &cmdline)
uint m_maxAttempts
How many times total will the code attempt to generate a preview for a specific file,...
PreviewGenerator::Mode m_mode
QSet< QString > m_tokens
The full set of tokens for all callers that have requested this preview.
QMutex m_lock
The thread interlock for this data structure.
QMap< QString, PreviewGenState > PreviewMap
std::chrono::seconds m_minBlockSeconds
How long after a failed preview generation attempt will the code ignore subsequent requests.
PreviewGenerator * m_gen
A pointer to the generator that this state object describes.
uint m_attempts
How many attempts have been made to generate a preview for this file.
PreviewMap m_previewMap
A mapping from the generated preview name to the state information on the progress of generating the ...
QSet< QObject * > m_listeners
The set of all listeners that want messages when a preview request is queued or finishes.
Holds information on recordings and videos.
static void GetPreviewImage(const ProgramInfo &pginfo, const QString &token)
Submit a request for the generation of a preview image.
bool m_genStarted
The preview generator for this file is currently running.
This is a wrapper around QThread that does several additional things.
QStringList m_queue
The queue of previews to be generated.
static PreviewGeneratorQueue * s_pgq
The singleton queue.
This class implements a queue of preview generation requests.
QMap< QString, QString > m_tokenToKeyMap
A mapping from requestor tokens to internal keys.