2#ifndef PREVIEW_GENERATOR_H_
3#define PREVIEW_GENERATOR_H_
5#include <QWaitCondition>
31 long long previewFrameNumber,
32 std::chrono::seconds previewSeconds,
34 const QString &infile,
35 const QString &outfile);
45 kLocalAndRemote = 0x3,
56 { m_captureTime = time; m_captureFrame = frame; }
58 { SetPreviewTime(seconds, -1); }
60 { SetPreviewTime(-1s, frame_number); }
61 void SetOutputFilename(
const QString &fileName);
64 QString
GetToken(
void)
const {
return m_token; }
66 void run(
void)
override;
69 void AttachSignals(QObject *obj);
76 void TeardownAll(
void);
78 bool RemotePreviewRun(
void);
79 bool LocalPreviewRun(
void);
80 bool IsLocal(
void)
const;
84 static uint8_t *GetScreenGrab(
const ProgramInfo &pginfo,
86 std::chrono::seconds seektime,
93 static bool SavePreview(
const QString &
filename,
94 const unsigned char *data,
95 uint width,
uint height,
float aspect,
96 int desired_width,
int desired_height,
97 const QString &format);
100 static QString CreateAccessibleFilename(
101 const QString &pathname,
const QString &outFileName);
103 bool event(QEvent *e)
override;
104 bool SaveOutFile(
const QByteArray &data,
const QDateTime &dt);
112 QObject *m_listener {
nullptr};
116 std::chrono::seconds m_captureTime {-1s};
117 long long m_captureFrame {-1};
119 QSize m_outSize {0,0};
120 QString m_outFormat {
"PNG"};
123 bool m_gotReply {
false};
124 bool m_pixmapOk {
false};
This is a wrapper around QThread that does several additional things.
virtual void run(void)
Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead.
Class for communcating between myth backends and frontends.
This class creates a preview image of a recording.
QString GetToken(void) const
void SetOutputSize(const QSize size)
void SetPreviewTimeAsSeconds(std::chrono::seconds seconds)
void SetPreviewTimeAsFrameNumber(long long frame_number)
QWaitCondition m_previewWaitCondition
ProgramInfo m_programInfo
void SetPreviewTime(std::chrono::seconds time, long long frame)
Holds information on recordings and videos.
int preview_helper(uint chanid, QDateTime starttime, long long previewFrameNumber, std::chrono::seconds previewSeconds, const QSize previewSize, const QString &infile, const QString &outfile)
QMap< QString, QDateTime > FileTimeStampMap