If the nodes are now stateless, there's nothing stopping the renderer from rendering multiple frames at once. Earlier since the nodes held some of their input/output data (and that data could change per frame), it was not possible to render multiple frames at once without conflicts. Now that the node state is held in render threads, they can do whatever they want at any time.
68 lines
1.7 KiB
C++
68 lines
1.7 KiB
C++
#ifndef VIDEORENDERWORKER_H
|
|
#define VIDEORENDERWORKER_H
|
|
|
|
#include <QCryptographicHash>
|
|
|
|
#include "colorprocessorcache.h"
|
|
#include "node/dependency.h"
|
|
#include "render/videoparams.h"
|
|
#include "renderworker.h"
|
|
#include "videorenderframecache.h"
|
|
|
|
class VideoRenderWorker : public RenderWorker {
|
|
Q_OBJECT
|
|
public:
|
|
VideoRenderWorker(VideoRenderFrameCache* frame_cache, QObject* parent = nullptr);
|
|
|
|
void SetParameters(const VideoRenderingParams& video_params);
|
|
|
|
public slots:
|
|
void Download(NodeDependency dep, QByteArray hash, QVariant texture, QString filename);
|
|
|
|
signals:
|
|
void CompletedFrame(NodeDependency path, QByteArray hash, NodeValueTable value);
|
|
|
|
void CompletedDownload(NodeDependency path, QByteArray hash);
|
|
|
|
void HashAlreadyBeingCached(NodeDependency path, QByteArray hash);
|
|
|
|
void HashAlreadyExists(NodeDependency path, QByteArray hash);
|
|
|
|
protected:
|
|
virtual bool InitInternal() override;
|
|
|
|
virtual void CloseInternal() override;
|
|
|
|
const VideoRenderingParams& video_params();
|
|
|
|
virtual void ParametersChangedEvent(){}
|
|
|
|
virtual void TextureToBuffer(const QVariant& texture, QByteArray& buffer) = 0;
|
|
|
|
virtual NodeValueTable RenderInternal(const NodeDependency& path) override;
|
|
|
|
virtual FramePtr RetrieveFromDecoder(DecoderPtr decoder, const TimeRange& range) override;
|
|
|
|
virtual NodeValueTable RenderBlock(TrackOutput *track, const TimeRange& range) override;
|
|
|
|
ColorProcessorCache* color_cache();
|
|
|
|
private:
|
|
void ProcessNode();
|
|
|
|
void HashNodeRecursively(QCryptographicHash* hash, Node *n, const rational &time);
|
|
|
|
VideoRenderingParams video_params_;
|
|
|
|
VideoRenderFrameCache* frame_cache_;
|
|
|
|
ColorProcessorCache color_cache_;
|
|
|
|
QByteArray download_buffer_;
|
|
|
|
private slots:
|
|
|
|
};
|
|
|
|
#endif // VIDEORENDERWORKER_H
|