diff options
author | Mitch Curtis <mitch.curtis@theqtcompany.com> | 2015-08-07 18:12:08 +0200 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@theqtcompany.com> | 2015-08-07 16:22:23 +0000 |
commit | ff91fbfa59cf3434efd6da7109bb46856f6a5105 (patch) | |
tree | b5ff06078b988461b8671ed7d32f15c1992f05fa /tests/manual/gifs/gifrecorder.h | |
parent | 9e1c673cbcb03744920d3663112177c00af1dacb (diff) |
GifRecorder: add a high quality option.
byzanz-record will heavily optimize colors in certain GIFs. The GIF
generated for BusyIndicator, for example, lost all of its
"transparency" that it has in the source image.
The man page says that the .flv format is lossless, so when
setHighQuality(true) is called, we record a video and then
convert it to a bunch of frames with avconv, then to a GIF with
convert.
Finally, to further optimize the GIF, we could run it through gifsicle,
so I haven't updated any GIFs in the docs yet.
Change-Id: I0ccc5e2258d7c6dac52e464bcd6fb61128541e82
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'tests/manual/gifs/gifrecorder.h')
-rw-r--r-- | tests/manual/gifs/gifrecorder.h | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/tests/manual/gifs/gifrecorder.h b/tests/manual/gifs/gifrecorder.h index 546c8669..74469f9b 100644 --- a/tests/manual/gifs/gifrecorder.h +++ b/tests/manual/gifs/gifrecorder.h @@ -54,30 +54,44 @@ public: void setRecordCursor(bool recordCursor); void setDataDirPath(const QString &path); void setOutputDir(const QDir &dir); - void setOutputFileName(const QString &fileName); + void setOutputFileBaseName(const QString &fileBaseName); void setQmlFileName(const QString &fileName); void setView(QQuickView *mView); + void setHighQuality(bool highQuality); void start(); bool hasStarted() const; void waitForFinish(); private slots: - void onError(); - void onFinished(); + void onByzanzError(); + void onByzanzFinished(); private: - const QString mProcessName; - QProcess mProcess; - int mRecordingDuration; - bool mRecordCursor; QString mDataDirPath; QDir mOutputDir; - QString mOutputFileName; + QString mOutputFileBaseName; + QString mByzanzOutputFileName; + QString mGifFileName; QString mQmlInputFileName; QQuickView *mView; - bool mStarted; - bool mFinished; + bool mHighQuality; + int mRecordingDuration; + bool mRecordCursor; + + const QString mByzanzProcessName; + QProcess mByzanzProcess; + bool mByzanzProcessFinished; + + const QString mAvconvProcessName; + QString mAvconvArgs; + QProcess mAvconvProcess; + bool mAvconvProcessFinished; + + const QString mConvertProcessName; + QString mConvertArgs; + QProcess mConvertProcess; + bool mConvertProcessFinished; }; #endif // GIFRECORDER_H |