renderer: added generate job

For nodes that produce an image on the CPU before sending it to the GPU.
This commit is contained in:
itsmattkc
2020-06-13 03:01:23 +10:00
parent 0c9435c94d
commit 5c5f09a20c
12 changed files with 109 additions and 17 deletions
+23
View File
@@ -211,6 +211,29 @@ QVariant RenderWorker::ProcessSamples(const Node *node, const TimeRange &range,
return QVariant::fromValue(output_buffer);
}
QVariant RenderWorker::ProcessFrameGeneration(const Node* node, const GenerateJob &job)
{
FramePtr frame = Frame::Create();
PixelFormat::Format output_fmt;
if (job.GetAlphaChannelRequired()) {
output_fmt = PixelFormat::GetFormatWithAlphaChannel(video_params_.format());
} else {
output_fmt = PixelFormat::GetFormatWithoutAlphaChannel(video_params_.format());
}
frame->set_video_params(VideoParams(video_params_.width(),
video_params_.height(),
video_params_.time_base(),
output_fmt,
video_params_.divider()));
frame->allocate();
node->GenerateFrame(frame, job);
return CachedFrameToTexture(frame);
}
QVariant RenderWorker::GetCachedFrame(const Node* node, const rational& time)
{
if (node->id() == QStringLiteral("org.olivevideoeditor.Olive.videoinput")) {