If Nodes only have the one output, we don't need to do so much differentiation between them. Previous iteration used outputs as like a distinct function within a Node (e.g. length output would return one result, buffer output would produce a different result - each run different code to produce their results). Now in this iteration, it's more accurate to say a Node is just one function (which seems more appropriate for a node system anyway).
71 lines
1.5 KiB
C++
71 lines
1.5 KiB
C++
#ifndef RENDERWORKER_H
|
|
#define RENDERWORKER_H
|
|
|
|
#include <QObject>
|
|
|
|
#include "common/constructors.h"
|
|
#include "node/output/track/track.h"
|
|
#include "node/node.h"
|
|
#include "decodercache.h"
|
|
|
|
class RenderWorker : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
RenderWorker(DecoderCache* decoder_cache, QObject* parent = nullptr);
|
|
|
|
DISABLE_COPY_MOVE(RenderWorker)
|
|
|
|
bool Init();
|
|
|
|
bool IsStarted();
|
|
|
|
bool IsAvailable();
|
|
|
|
public slots:
|
|
void Close();
|
|
|
|
void Render(NodeDependency path);
|
|
|
|
NodeValueTable RenderAsSibling(NodeDependency dep);
|
|
|
|
signals:
|
|
void RequestSibling(NodeDependency path);
|
|
|
|
void CompletedCache(NodeDependency dep, NodeValueTable data);
|
|
|
|
protected:
|
|
virtual bool InitInternal() = 0;
|
|
|
|
virtual void CloseInternal() = 0;
|
|
|
|
virtual NodeValueTable RenderInternal(const NodeDependency& path);
|
|
|
|
virtual bool OutputIsAccelerated(Node *output);
|
|
|
|
virtual void RunNodeAccelerated(Node *node, const NodeValueDatabase *input_params, NodeValueTable* output_params);
|
|
|
|
StreamPtr ResolveStreamFromInput(NodeInput* input);
|
|
DecoderPtr ResolveDecoderFromInput(NodeInput* input);
|
|
|
|
virtual FramePtr RetrieveFromDecoder(DecoderPtr decoder, const TimeRange& range) = 0;
|
|
|
|
virtual QVariant FrameToValue(FramePtr frame) = 0;
|
|
|
|
NodeValueTable ProcessNodeNormally(const NodeDependency &dep);
|
|
|
|
virtual NodeValueTable RenderBlock(TrackOutput *track, const TimeRange& range) = 0;
|
|
|
|
DecoderCache* decoder_cache();
|
|
|
|
QAtomicInt working_;
|
|
|
|
private:
|
|
bool started_;
|
|
|
|
DecoderCache* decoder_cache_;
|
|
|
|
};
|
|
|
|
#endif // RENDERWORKER_H
|