finalized very, very basic OTIO support

Ironed out various project and footage loading issues, and a single
cache invalidation issue.
This commit is contained in:
itsmattkc
2020-10-23 01:26:17 +11:00
parent 9613730ee8
commit bc60c74562
32 changed files with 473 additions and 301 deletions
+9 -2
View File
@@ -46,7 +46,8 @@ RenderBackend::RenderBackend(QObject *parent) :
generate_audio_previews_(false),
render_mode_(RenderMode::kOnline),
autocache_has_changed_(false),
use_custom_autocache_range_(false)
use_custom_autocache_range_(false),
ignore_next_mouse_button_(false)
{
instance_lock_.lock();
instances_.append(this);
@@ -258,6 +259,11 @@ void RenderBackend::SetAudioParams(const AudioParams &params)
audio_params_ = params;
}
void RenderBackend::IgnoreNextMouseButton()
{
ignore_next_mouse_button_ = true;
}
std::list<TimeRange> RenderBackend::SplitRangeIntoChunks(const TimeRange &r)
{
// FIXME: Magic number
@@ -523,7 +529,8 @@ void RenderBackend::AutoCacheVideoInvalidated(const TimeRange &range)
ClearVideoQueue();
// Hash these frames since that should be relatively quick.
if (!(qApp->mouseButtons() & Qt::LeftButton)) {
if (ignore_next_mouse_button_ || !(qApp->mouseButtons() & Qt::LeftButton)) {
ignore_next_mouse_button_ = false;
RenderTicketWatcher* watcher = new RenderTicketWatcher();
QVector<rational> frames = viewer_node_->video_frame_cache()->GetFrameListFromTimeRange({range});
autocache_hash_tasks_.insert(watcher, frames);
+4
View File
@@ -141,6 +141,8 @@ public:
video_download_matrix_ = mat;
}
void IgnoreNextMouseButton();
static std::list<TimeRange> SplitRangeIntoChunks(const TimeRange& r);
public slots:
@@ -223,6 +225,8 @@ private:
QVector<QByteArray> autocache_currently_caching_hashes_;
bool ignore_next_mouse_button_;
private slots:
void WorkerFinished();
+9 -8
View File
@@ -39,24 +39,16 @@ public:
{
}
void Invalidate(const TimeRange& r);
void InvalidateAll();
const rational& GetLength()
{
return length_;
}
void SetLength(const rational& r);
bool IsFullyValidated()
{
return invalidated_.isEmpty();
}
void Shift(const rational& from, const rational& to);
const TimeRangeList& GetInvalidatedRanges()
{
return invalidated_;
@@ -69,6 +61,15 @@ public:
QString GetCacheDirectory() const;
public slots:
void Invalidate(const TimeRange& r);
void InvalidateAll();
void SetLength(const rational& r);
void Shift(const rational& from, const rational& to);
signals:
void Invalidated(const OLIVE_NAMESPACE::TimeRange& r);