Merge remote-tracking branch 'origin/plugin' into plugin
# Conflicts: # ext/KDDockWidgets
This commit is contained in:
@@ -22,5 +22,7 @@ set(OLIVE_SOURCES
|
||||
render/job/generatejob.h
|
||||
render/job/samplejob.h
|
||||
render/job/shaderjob.h
|
||||
PARENT_SCOPE
|
||||
render/job/pluginjob.h
|
||||
render/job/pluginjob.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -33,22 +33,22 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
NodeValue Get(const QString &input) const
|
||||
virtual NodeValue Get(const QString &input) const
|
||||
{
|
||||
return value_map_.value(input);
|
||||
}
|
||||
|
||||
void Insert(const QString &input, const NodeValueRow &row)
|
||||
virtual void Insert(const QString &input, const NodeValueRow &row)
|
||||
{
|
||||
value_map_.insert(input, row.value(input));
|
||||
}
|
||||
|
||||
void Insert(const QString &input, const NodeValue &value)
|
||||
virtual void Insert(const QString &input, const NodeValue &value)
|
||||
{
|
||||
value_map_.insert(input, value);
|
||||
}
|
||||
|
||||
void Insert(const NodeValueRow &row)
|
||||
virtual void Insert(const NodeValueRow &row)
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
|
||||
value_map_.insert(row);
|
||||
@@ -59,16 +59,16 @@ public:
|
||||
#endif
|
||||
}
|
||||
|
||||
const NodeValueRow &GetValues() const
|
||||
virtual const NodeValueRow &GetValues() const
|
||||
{
|
||||
return value_map_;
|
||||
}
|
||||
NodeValueRow &GetValues()
|
||||
virtual NodeValueRow &GetValues()
|
||||
{
|
||||
return value_map_;
|
||||
}
|
||||
|
||||
private:
|
||||
protected:
|
||||
NodeValueRow value_map_;
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Olive Community Edition - Non-Linear Video Editor
|
||||
* Copyright (C) 2025 Olive CE 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 "pluginjob.h"
|
||||
|
||||
namespace olive {
|
||||
namespace plugin {
|
||||
} // plugin
|
||||
} // olive
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Olive Community Edition - Non-Linear Video Editor
|
||||
* Copyright (C) 2025 Olive CE 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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef PLUGINJOB_H
|
||||
#define PLUGINJOB_H
|
||||
#include "acceleratedjob.h"
|
||||
#include "pluginSupport/OlivePluginInstance.h"
|
||||
|
||||
#include <any>
|
||||
#include <OpenImageIO/detail/fmt/chrono.h>
|
||||
|
||||
namespace olive {
|
||||
namespace plugin {
|
||||
|
||||
class PluginJob :public AcceleratedJob{
|
||||
public:
|
||||
explicit PluginJob(OFX::Host::ImageEffect::ImageEffectPlugin* pluginInstance, NodeValueRow row): AcceleratedJob()
|
||||
{
|
||||
this->pluginInstance = pluginInstance;
|
||||
}
|
||||
|
||||
private:
|
||||
OFX::Host::ImageEffect::ImageEffectPlugin *pluginInstance=nullptr;
|
||||
|
||||
QHash<OfxTime, QHash<QString, std::any>> paramsOnTime;
|
||||
|
||||
QHash<QString, std::any> params;
|
||||
};
|
||||
|
||||
} // plugin
|
||||
} // olive
|
||||
|
||||
#endif //PLUGINJOB_H
|
||||
@@ -0,0 +1 @@
|
||||
target_sources(libolive-editor PRIVATE pluginrenderer.cpp pluginrenderer.h)
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Olive Community Edition - Non-Linear Video Editor
|
||||
* Copyright (C) 2025 Olive CE 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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
//
|
||||
// Created by mikesolar on 25-10-19.
|
||||
//
|
||||
|
||||
#include "pluginrenderer.h"
|
||||
|
||||
#include "pluginSupport/OlivePluginInstance.h"
|
||||
void olive::plugin::PluginRenderer::Blit(QVariant shader, ShaderJob job,
|
||||
Texture *destination,
|
||||
VideoParams destination_params,
|
||||
bool clear_destination)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Olive Community Edition - Non-Linear Video Editor
|
||||
* Copyright (C) 2025 Olive CE 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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
//
|
||||
// Created by mikesolar on 25-10-19.
|
||||
//
|
||||
|
||||
#ifndef PLUGINRENDERER_H
|
||||
#define PLUGINRENDERER_H
|
||||
#include "render/renderer.h"
|
||||
namespace olive
|
||||
{
|
||||
namespace plugin{
|
||||
class PluginRenderer : public olive::Renderer{
|
||||
Q_OBJECT
|
||||
public:
|
||||
PluginRenderer(QObject *parent=nullptr):Renderer(parent){};
|
||||
protected:
|
||||
void Blit(QVariant shader,
|
||||
ShaderJob job,
|
||||
Texture *destination,
|
||||
VideoParams destination_params,
|
||||
bool clear_destination) override;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif //PLUGINRENDERER_H
|
||||
@@ -28,6 +28,8 @@
|
||||
#include "node/block/transition/transition.h"
|
||||
#include "node/project.h"
|
||||
#include "rendermanager.h"
|
||||
#include "pluginSupport/OliveClip.h"
|
||||
#include "pluginSupport/OliveHost.h"
|
||||
|
||||
namespace olive
|
||||
{
|
||||
@@ -157,6 +159,7 @@ void RenderProcessor::Run()
|
||||
|
||||
SetCancelPointer(ticket_->GetCancelAtom());
|
||||
|
||||
VideoParams params=ticket_->property("vparam").value<VideoParams>();
|
||||
SetCacheVideoParams(ticket_->property("vparam").value<VideoParams>());
|
||||
SetCacheAudioParams(ticket_->property("aparam").value<AudioParams>());
|
||||
|
||||
@@ -165,6 +168,93 @@ void RenderProcessor::Run()
|
||||
return;
|
||||
}
|
||||
|
||||
// if is a plugin
|
||||
/*Node *node=ticket_->property("node").value<Node*>();
|
||||
if (node && node->getPlugin()) {
|
||||
std::shared_ptr<OFX::Host::ImageEffect::ImageEffectPlugin> plugin
|
||||
= node->getPlugin();
|
||||
std::unique_ptr<OFX::Host::ImageEffect::Instance> instance(plugin->createInstance(kOfxImageEffectContextFilter, NULL));
|
||||
|
||||
OfxStatus stat;
|
||||
stat = instance->createInstanceAction();
|
||||
if(stat != kOfxStatOK && stat != kOfxStatReplyDefault) {
|
||||
ticket_->Finish();
|
||||
return;
|
||||
}
|
||||
// now we need to to call getClipPreferences on the instance so that it does the clip component/depth
|
||||
// logic and caches away the components and depth on each clip.
|
||||
bool ok = instance->getClipPreferences();
|
||||
if (!ok) {
|
||||
ticket_->Finish();
|
||||
return;
|
||||
}
|
||||
|
||||
// current render scale of 1
|
||||
OfxPointD renderScale;
|
||||
renderScale.x = renderScale.y = 1.0;
|
||||
|
||||
// The render window is in pixel coordinates
|
||||
// ie: render scale and a PAR of not 1
|
||||
OfxRectI renderWindow;
|
||||
renderWindow.x1 = renderWindow.y1 = 0;
|
||||
renderWindow.x2 = ticket_->property("size").value<QSize>().width();
|
||||
renderWindow.y2 = ticket_->property("size").value<QSize>().height();
|
||||
|
||||
/// RoI is in canonical coords,
|
||||
OfxRectD regionOfInterest;
|
||||
regionOfInterest.x1 = regionOfInterest.y1 = 0;
|
||||
regionOfInterest.x2 = renderWindow.x2 * instance->getProjectPixelAspectRatio();
|
||||
regionOfInterest.y2 = renderWindow.y2 * instance->getProjectPixelAspectRatio();
|
||||
|
||||
OfxRectD regionOfDefinition;
|
||||
regionOfDefinition.x1 = regionOfDefinition.y1 = 0;
|
||||
regionOfDefinition.x2 = params.width();
|
||||
regionOfDefinition.y2 = params.height();
|
||||
|
||||
|
||||
int numFramesToRender=ticket_->property("time").value<rational>().toDouble()
|
||||
* params.frame_rate().toDouble();
|
||||
stat = instance->beginRenderAction(0, numFramesToRender, 1.0, false, renderScale, /*sequential=#1#true, /*interactive=#1#false
|
||||
);
|
||||
if (stat != kOfxStatOK && stat != kOfxStatReplyDefault) {
|
||||
ticket_->Finish();
|
||||
return;
|
||||
}
|
||||
|
||||
plugin::OliveClipInstance *clip=dynamic_cast<plugin::OliveClipInstance *>(instance->getClip("Output"));
|
||||
for(int t = 0; t <= numFramesToRender; ++t)
|
||||
{
|
||||
// call get region of interest on each of the inputs
|
||||
OfxTime frame = t;
|
||||
|
||||
// get the RoI for each input clip
|
||||
// the regions of interest for each input clip are returned in a std::map
|
||||
// on a real host, these will be the regions of each input clip that the
|
||||
// effect needs to render a given frame (clipped to the RoD).
|
||||
//
|
||||
// In our example we are doing full frame fetches regardless.
|
||||
std::map<OFX::Host::ImageEffect::ClipInstance *, OfxRectD> rois;
|
||||
stat = instance->getRegionOfInterestAction(frame, renderScale,
|
||||
regionOfInterest, rois);
|
||||
assert(stat == kOfxStatOK || stat == kOfxStatReplyDefault);
|
||||
|
||||
// render a frame
|
||||
stat = instance->renderAction(t,kOfxImageFieldBoth,renderWindow, renderScale, /*sequential=#1#true, /*interactive=#1#false, /*draft=#1#false);
|
||||
assert(stat == kOfxStatOK);
|
||||
|
||||
// get the output image buffer
|
||||
OFX::Host::ImageEffect::Image *outputImage = clip->getOutputImage();
|
||||
|
||||
std::ostringstream ss;
|
||||
ss << "Output." << t << ".ppm";
|
||||
exportToPPM(ss.str(), outputImage);
|
||||
}
|
||||
|
||||
instance->endRenderAction(0, numFramesToRender, 1.0, false, renderScale, /*sequential=#1#true, /*interactive=#1#false
|
||||
);
|
||||
}
|
||||
*/
|
||||
|
||||
switch (type) {
|
||||
case RenderManager::kTypeVideo: {
|
||||
rational time = ticket_->property("time").value<rational>();
|
||||
|
||||
Reference in New Issue
Block a user