multicam: finished UI implementation

This commit is contained in:
itsmattkc
2022-10-03 17:24:09 -07:00
parent 3275dac50f
commit 42ba84bf5f
14 changed files with 354 additions and 153 deletions
+28 -17
View File
@@ -41,6 +41,7 @@ PreviewAutoCacher::PreviewAutoCacher(QObject *parent) :
viewer_node_(nullptr),
use_custom_range_(false),
pause_renders_(false),
pause_thumbnails_(false),
single_frame_render_(nullptr),
display_color_processor_(nullptr),
multicam_(nullptr),
@@ -583,6 +584,14 @@ void PreviewAutoCacher::SetRendersPaused(bool e)
}
}
void PreviewAutoCacher::SetThumbnailsPaused(bool e)
{
pause_thumbnails_ = e;
if (!e) {
TryRender();
}
}
void PreviewAutoCacher::NodeAdded(Node *node)
{
graph_update_queue_.push_back({QueuedJob::kNodeAdded, node, NodeInput(), nullptr});
@@ -663,29 +672,31 @@ void PreviewAutoCacher::TryRender()
const int max_tasks = 4;
// Handle video tasks
while (!pending_video_jobs_.empty()) {
VideoJob &d = pending_video_jobs_.front();
if (!pause_thumbnails_) {
while (!pending_video_jobs_.empty()) {
VideoJob &d = pending_video_jobs_.front();
if (Node *copy = copy_map_.value(d.node)) {
// Queue next frames
rational t;
while (running_video_tasks_.size() < max_tasks && d.iterator.GetNext(&t)) {
RenderFrame(copy, t, d.cache, false);
if (Node *copy = copy_map_.value(d.node)) {
// Queue next frames
rational t;
while (running_video_tasks_.size() < max_tasks && d.iterator.GetNext(&t)) {
RenderFrame(copy, t, d.cache, false);
emit SignalCacheProxyTaskProgress(double(d.iterator.frame_index()) / double(d.iterator.size()));
emit SignalCacheProxyTaskProgress(double(d.iterator.frame_index()) / double(d.iterator.size()));
if (!d.iterator.HasNext()) {
emit StopCacheProxyTasks();
if (!d.iterator.HasNext()) {
emit StopCacheProxyTasks();
}
}
} else {
qCritical() << "Failed to find node copy for video job";
}
} else {
qCritical() << "Failed to find node copy for video job";
}
if (d.iterator.HasNext()) {
break;
} else {
pending_video_jobs_.pop_front();
if (d.iterator.HasNext()) {
break;
} else {
pending_video_jobs_.pop_front();
}
}
}
+2
View File
@@ -89,6 +89,7 @@ public:
bool IsRenderingCustomRange() const;
void SetRendersPaused(bool e);
void SetThumbnailsPaused(bool e);
void SetMulticamNode(MultiCamNode *n) { multicam_ = n; }
@@ -178,6 +179,7 @@ private:
TimeRange custom_autocache_range_;
bool pause_renders_;
bool pause_thumbnails_;
RenderTicketPtr single_frame_render_;
QMap<RenderTicketWatcher*, QVector<RenderTicketPtr> > video_immediate_passthroughs_;
+3 -5
View File
@@ -300,13 +300,11 @@ NodeValueDatabase RenderProcessor::GenerateDatabase(const Node *node, const Time
if (const MultiCamNode *multicam = dynamic_cast<const MultiCamNode*>(node)) {
if (Node::ValueToPtr<MultiCamNode>(ticket_->property("multicam")) == multicam) {
int sz = multicam->InputArraySize(multicam->kSourcesInput);
NodeValueTableArray arr;
int sz = multicam->GetSourceCount();
QVector<TexturePtr> multicam_tex(sz);
for (int i=0; i<sz; i++) {
ProcessInputElement(arr, multicam, multicam->kSourcesInput, i, range);
NodeValue val = GenerateRowValueElement(multicam, multicam->kSourcesInput, i, &arr.at(i), range);
NodeValueTable t = GenerateTable(multicam->GetConnectedRenderOutput(multicam->kSourcesInput, i), range, multicam);
NodeValue val = GenerateRowValueElement(multicam, multicam->kSourcesInput, i, &t, range);
ResolveJobs(val);
multicam_tex[i] = val.toTexture();