cache: added cache task that can be manually invoked

This commit is contained in:
itsmattkc
2020-05-15 18:36:02 +10:00
parent 7c2280944b
commit 53a2956350
13 changed files with 346 additions and 76 deletions
+7 -2
View File
@@ -116,6 +116,11 @@ void FrameHashCache::SaveCacheFrame(const QByteArray& hash,
}
}
void FrameHashCache::SaveCacheFrame(const QByteArray &hash, FramePtr frame)
{
SaveCacheFrame(hash, frame->data(), frame->video_params());
}
void FrameHashCache::LengthChangedEvent(const rational &old, const rational &newlen)
{
if (newlen < old) {
@@ -174,8 +179,8 @@ bool FrameHashCache::SaveCacheFrame(const QString &filename, char *data, const V
// Attempt to keep this write to one thread
out->threads(1);
out->open(fn_std, OIIO::ImageSpec(vparam.width(),
vparam.height(),
out->open(fn_std, OIIO::ImageSpec(vparam.effective_width(),
vparam.effective_height(),
PixelFormat::ChannelCount(vparam.format()),
PixelFormat::GetOIIOTypeDesc(vparam.format())));
+1
View File
@@ -62,6 +62,7 @@ public:
static bool SaveCacheFrame(const QString& filename, char *data, const VideoRenderingParams &vparam);
static void SaveCacheFrame(const QByteArray& hash, char *data, const VideoRenderingParams &vparam);
static void SaveCacheFrame(const QByteArray& hash, FramePtr frame);
static QString GetFormatExtension(const PixelFormat::Format& f);
+4 -4
View File
@@ -29,7 +29,7 @@ OLIVE_NAMESPACE_ENTER
class PlaybackCache : public QObject
{
Q_OBJECT
Q_OBJECT
public:
PlaybackCache();
@@ -50,11 +50,11 @@ public:
}
signals:
void Invalidated(const TimeRange& r);
void Invalidated(const OLIVE_NAMESPACE::TimeRange& r);
void Validated(const TimeRange& r);
void Validated(const OLIVE_NAMESPACE::TimeRange& r);
void LengthChanged(const rational& r);
void LengthChanged(const OLIVE_NAMESPACE::rational& r);
protected:
void Validate(const TimeRange& r);