Files
oak-editor/app/render/backend/videorenderworker.h
T
itsmattkc d25dda5275 removed all dependence on NodeOutputs
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).
2019-12-06 00:23:26 +11:00

63 lines
1.6 KiB
C++

#ifndef VIDEORENDERWORKER_H
#define VIDEORENDERWORKER_H
#include <QCryptographicHash>
#include "node/dependency.h"
#include "render/videoparams.h"
#include "renderworker.h"
#include "videorenderframecache.h"
class VideoRenderWorker : public RenderWorker {
Q_OBJECT
public:
VideoRenderWorker(DecoderCache* decoder_cache, 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();
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;
private:
void ProcessNode();
void HashNodeRecursively(QCryptographicHash* hash, Node *n, const rational &time);
VideoRenderingParams video_params_;
VideoRenderFrameCache* frame_cache_;
QByteArray download_buffer_;
private slots:
};
#endif // VIDEORENDERWORKER_H