Implementation of Recorder class. For now, only a capture to PNG is

available, but the mechanism is in place for video capture.
This commit is contained in:
brunoherbelin
2020-07-23 23:50:32 +02:00
parent cec49a9a62
commit 978bbff9a7
7 changed files with 144 additions and 0 deletions

37
Recorder.h Normal file
View File

@@ -0,0 +1,37 @@
#ifndef RECORDER_H
#define RECORDER_H
#include <atomic>
#include <string>
#include <gst/gst.h>
class FrameBuffer;
class Recorder
{
public:
Recorder();
virtual ~Recorder() {}
virtual void addFrame(const FrameBuffer *frame_buffer, float dt) = 0;
inline bool finished() const { return finished_; }
inline bool enabled() const { return enabled_; }
protected:
std::atomic<bool> enabled_;
std::atomic<bool> finished_;
};
class FrameRecorder : public Recorder
{
std::string filename_;
public:
FrameRecorder();
void addFrame(const FrameBuffer *frame_buffer, float dt);
};
#endif // RECORDER_H