mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-12 02:40:00 +01:00
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:
37
Recorder.h
Normal file
37
Recorder.h
Normal 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
|
||||
Reference in New Issue
Block a user