diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-09-21 18:24:57 +0200 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-09-21 18:24:57 +0200 |
commit | 75667b81215bdb3896599ec477a256c41fc90436 (patch) | |
tree | 44eb5919b596666997b972fc75fe5fdea60a633b /layer_video.h | |
parent | 0e81cd9a89de9bdd6824bbe7265f91f3835dae97 (diff) | |
download | osc-graphics-75667b81215bdb3896599ec477a256c41fc90436.tar.gz |
split program into multiple files; switched to C++
Diffstat (limited to 'layer_video.h')
-rw-r--r-- | layer_video.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/layer_video.h b/layer_video.h new file mode 100644 index 0000000..f16d334 --- /dev/null +++ b/layer_video.h @@ -0,0 +1,57 @@ +#ifndef __HAVE_LAYER_VIDEO_H +#define __HAVE_LAYER_VIDEO_H + +#include <SDL.h> +#include <SDL_thread.h> + +#include <vlc/vlc.h> + +#include "osc_graphics.h" +#include "layer.h" + +class LayerVideo : public Layer { + libvlc_instance_t *vlcinst; + libvlc_media_player_t *mp; + + SDL_Surface *surf; + SDL_mutex *mutex; + + SDL_Rect geov; + float alphav; + + float ratev; + bool pausedv; + +public: + LayerVideo(const char *name, + SDL_Rect geo = (SDL_Rect){0, 0, 0, 0}, + float opacity = 1., + const char *url = NULL); + ~LayerVideo(); + + inline void * + lock_surf() + { + SDL_LockMutex(mutex); + SDL_MAYBE_LOCK(surf); + return surf->pixels; + } + inline void + unlock_surf() + { + SDL_MAYBE_UNLOCK(surf); + SDL_UnlockMutex(mutex); + } + + void geo(SDL_Rect geo); + void alpha(float opacity); + + void url(const char *url = NULL); + void rate(float rate); + void position(float position); + void paused(bool paused); + + void frame(SDL_Surface *target); +}; + +#endif |