aboutsummaryrefslogtreecommitdiff
path: root/src/recorder.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/recorder.h')
-rw-r--r--src/recorder.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/recorder.h b/src/recorder.h
new file mode 100644
index 0000000..b2ee5e6
--- /dev/null
+++ b/src/recorder.h
@@ -0,0 +1,38 @@
+#ifndef __RECORDER_H
+#define __RECORDER_H
+
+#include <SDL.h>
+#include <SDL_thread.h>
+#include <SDL/SDL_ffmpeg.h>
+
+#include "osc_graphics.h"
+
+class Recorder {
+ SDL_ffmpegFile *file;
+
+ SDL_mutex *mutex;
+
+ inline void
+ lock()
+ {
+ SDL_LockMutex(mutex);
+ }
+ inline void
+ unlock()
+ {
+ SDL_UnlockMutex(mutex);
+ }
+
+public:
+ Recorder() : file(NULL), mutex(SDL_CreateMutex()) {}
+ ~Recorder();
+
+ void register_methods();
+
+ void start(const char *filename);
+ void stop();
+
+ void record(SDL_Surface *surf);
+};
+
+#endif