Files
oak-editor/app/render/backend/videorenderworker.h
T
itsmattkc 26b3993b9d made vast improvements to rendering engine and node structure
This was many changes that were largely fundamentally related. They included:
- More const modifiers to enforce read only node graphs
- Support for fragment and vertex shaders from the nodes
- Support for node code loaded externally (embedded into the binary)
- Fixed issue preventing two textures from being used in a shader
- Removed several unused functions and cleaned up code
- Fixed video media node misreading its matrix input
2019-12-09 23:50:52 +11:00

66 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(const TrackOutput *track, const TimeRange& range) override;
ColorProcessorCache* color_cache();
private:
void HashNodeRecursively(QCryptographicHash* hash, const Node *n, const rational &time);
VideoRenderingParams video_params_;
VideoRenderFrameCache* frame_cache_;
ColorProcessorCache color_cache_;
QByteArray download_buffer_;
private slots:
};
#endif // VIDEORENDERWORKER_H