project: replaced proxy with pre-cache
Removed proxy task and replaced with a true honest-to-god pre-cache for footage. This footage is pre-cached to a sequence and therefore 100% ready for use in it once the task is done.
This commit is contained in:
@@ -18,7 +18,6 @@ add_subdirectory(cache)
|
||||
add_subdirectory(conform)
|
||||
add_subdirectory(export)
|
||||
add_subdirectory(project)
|
||||
add_subdirectory(proxy)
|
||||
add_subdirectory(render)
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
|
||||
Vendored
+2
@@ -18,5 +18,7 @@ set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
task/cache/cache.h
|
||||
task/cache/cache.cpp
|
||||
task/cache/footagecache.h
|
||||
task/cache/footagecache.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
Vendored
+1
-2
@@ -36,10 +36,9 @@ public:
|
||||
const AudioParams &aparams,
|
||||
bool in_out_only);
|
||||
|
||||
public slots:
|
||||
protected:
|
||||
virtual bool Run() override;
|
||||
|
||||
protected:
|
||||
virtual QFuture<void> DownloadFrame(FramePtr frame, const QByteArray &hash) override;
|
||||
|
||||
virtual void FrameDownloaded(const QByteArray& hash, const std::list<rational>& times) override;
|
||||
|
||||
Vendored
+53
@@ -0,0 +1,53 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
#include "footagecache.h"
|
||||
|
||||
#include "common/timecodefunctions.h"
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
FootageCacheTask::FootageCacheTask(VideoStreamPtr footage, Sequence *sequence) :
|
||||
CacheTask(new ViewerOutput(), sequence->video_params(), sequence->audio_params(), false),
|
||||
footage_(footage)
|
||||
{
|
||||
viewer()->set_video_params(sequence->video_params());
|
||||
viewer()->set_audio_params(sequence->audio_params());
|
||||
backend()->SetVideoParams(sequence->video_params());
|
||||
backend()->SetAudioParams(sequence->audio_params());
|
||||
|
||||
video_node_ = new VideoInput();
|
||||
video_node_->SetFootage(footage);
|
||||
|
||||
NodeParam::ConnectEdge(video_node_->output(), viewer()->texture_input());
|
||||
|
||||
SetTitle(tr("Pre-caching %1:%2").arg(footage->footage()->filename(),
|
||||
QString::number(footage->index())));
|
||||
|
||||
backend()->ProcessUpdateQueue();
|
||||
}
|
||||
|
||||
FootageCacheTask::~FootageCacheTask()
|
||||
{
|
||||
delete viewer();
|
||||
delete video_node_;
|
||||
}
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
+13
-11
@@ -18,29 +18,31 @@
|
||||
|
||||
***/
|
||||
|
||||
#ifndef PROXYTASK_H
|
||||
#define PROXYTASK_H
|
||||
#ifndef FOOTAGECACHETASK_H
|
||||
#define FOOTAGECACHETASK_H
|
||||
|
||||
#include "project/item/footage/videostream.h"
|
||||
#include "task/task.h"
|
||||
#include "cache.h"
|
||||
#include "node/input/media/video/video.h"
|
||||
#include "project/item/footage/footage.h"
|
||||
#include "project/item/sequence/sequence.h"
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
class ProxyTask : public Task
|
||||
class FootageCacheTask : public CacheTask
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ProxyTask(VideoStreamPtr stream, int divider);
|
||||
FootageCacheTask(VideoStreamPtr footage, Sequence* sequence);
|
||||
|
||||
public slots:
|
||||
virtual bool Run() override;
|
||||
virtual ~FootageCacheTask() override;
|
||||
|
||||
private:
|
||||
VideoStreamPtr stream_;
|
||||
VideoStreamPtr footage_;
|
||||
|
||||
int divider_;
|
||||
VideoInput* video_node_;
|
||||
|
||||
};
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
|
||||
#endif // PROXYTASK_H
|
||||
#endif // FOOTAGECACHETASK_H
|
||||
@@ -32,7 +32,7 @@ class ConformTask : public Task
|
||||
public:
|
||||
ConformTask(AudioStreamPtr stream, const AudioParams& params);
|
||||
|
||||
public slots:
|
||||
protected:
|
||||
virtual bool Run() override;
|
||||
|
||||
private:
|
||||
|
||||
@@ -35,10 +35,9 @@ class ExportTask : public RenderTask
|
||||
public:
|
||||
ExportTask(ViewerOutput *viewer_node, ColorManager *color_manager, const ExportParams ¶ms);
|
||||
|
||||
public slots:
|
||||
protected:
|
||||
virtual bool Run() override;
|
||||
|
||||
protected:
|
||||
virtual QFuture<void> DownloadFrame(FramePtr frame, const QByteArray &hash) override;
|
||||
|
||||
virtual void FrameDownloaded(const QByteArray& hash, const std::list<rational>& times) override;
|
||||
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
return command_;
|
||||
}
|
||||
|
||||
public slots:
|
||||
protected:
|
||||
virtual bool Run() override;
|
||||
|
||||
private:
|
||||
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
return projects_;
|
||||
}
|
||||
|
||||
public slots:
|
||||
protected:
|
||||
virtual bool Run() override;
|
||||
|
||||
private:
|
||||
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
return project_;
|
||||
}
|
||||
|
||||
public slots:
|
||||
protected:
|
||||
virtual bool Run() override;
|
||||
|
||||
private:
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
# Olive - Non-Linear Video Editor
|
||||
# Copyright (C) 2019 Olive Team
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
task/proxy/proxy.h
|
||||
task/proxy/proxy.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
@@ -1,62 +0,0 @@
|
||||
/***
|
||||
|
||||
Olive - Non-Linear Video Editor
|
||||
Copyright (C) 2019 Olive Team
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
***/
|
||||
|
||||
#include "proxy.h"
|
||||
|
||||
#include "codec/decoder.h"
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
ProxyTask::ProxyTask(VideoStreamPtr stream, int divider) :
|
||||
stream_(stream),
|
||||
divider_(divider)
|
||||
{
|
||||
if (divider_ == 1) {
|
||||
SetTitle(tr("Generating full resolution proxy %1:%2").arg(stream_->footage()->filename(),
|
||||
QString::number(stream_->index())));
|
||||
} else {
|
||||
SetTitle(tr("Generating 1/%1 resolution proxy %2:%3").arg(QString::number(divider),
|
||||
stream_->footage()->filename(),
|
||||
QString::number(stream_->index())));
|
||||
}
|
||||
}
|
||||
|
||||
bool ProxyTask::Run()
|
||||
{
|
||||
if (stream_->footage()->decoder().isEmpty()) {
|
||||
SetError(tr("Failed to find decoder to conform audio stream"));
|
||||
return false;
|
||||
} else {
|
||||
DecoderPtr decoder = Decoder::CreateFromID(stream_->footage()->decoder());
|
||||
|
||||
decoder->set_stream(stream_);
|
||||
|
||||
connect(decoder.get(), &Decoder::IndexProgress, this, &ProxyTask::ProgressChanged);
|
||||
|
||||
if (decoder->ProxyVideo(&IsCancelled(), divider_)) {
|
||||
return true;
|
||||
} else {
|
||||
SetError(tr("Failed to generate proxy"));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
Reference in New Issue
Block a user