diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-10-03 15:37:20 +0200 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-10-03 15:37:20 +0200 |
commit | c61253adbd5bed1d7393a3153f9c865517280431 (patch) | |
tree | f13e3d561129b2e9824895fbee82d9f65322b257 /src/recorder.h | |
parent | bca127f7f24f6a4b70e8797639619913e945b62b (diff) | |
download | osc-graphics-c61253adbd5bed1d7393a3153f9c865517280431.tar.gz |
added video recorder based on SDL_ffmpeg
Diffstat (limited to 'src/recorder.h')
-rw-r--r-- | src/recorder.h | 38 |
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 |