49 lines
925 B
C++
49 lines
925 B
C++
#ifndef WRITER_H
|
|
#define WRITER_H
|
|
|
|
#include <QObject>
|
|
#include <QThread>
|
|
#include <pylon/PylonIncludes.h>
|
|
#include <nix.hpp>
|
|
|
|
#include "pylonwrapper.h"
|
|
#include "imagebuffer.h"
|
|
#include "projectsettings.h"
|
|
#include "util.h"
|
|
|
|
class Writer : public QThread
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit Writer(ImageBuffer*buffer, QObject *parent = nullptr) :
|
|
QThread(parent), buffer(buffer) {}
|
|
|
|
void setVideoSpecs(VideoSpecs specs);
|
|
void setProjectMetadata(ProjectMetadata mdata);
|
|
void run() override;
|
|
void stop();
|
|
|
|
signals:
|
|
void terminated();
|
|
void writingDone();
|
|
|
|
private:
|
|
ImageBuffer *buffer;
|
|
VideoSpecs videoSpecs;
|
|
ProjectMetadata metadata;
|
|
bool stop_request = false, stopNow = false;
|
|
bool specs_valid = false, metadata_valid = false;
|
|
void writeMetadata(nix::Section &s);
|
|
|
|
public slots:
|
|
void requestStop() {
|
|
stop_request=true;
|
|
}
|
|
|
|
void forceStop() {
|
|
stopNow = true;
|
|
}
|
|
};
|
|
|
|
#endif // WRITER_H
|