diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-09-26 21:36:03 +0200 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-09-26 21:36:03 +0200 |
commit | e8db95ccb2ac16055e0af1177f69127da40f52de (patch) | |
tree | 9174a60b8ab5468689cf2688e313ce9783585f17 /layer_video.cpp | |
parent | ae1e2d5bf8a59095d1a978be51b7eec793d19da2 (diff) | |
download | osc-graphics-e8db95ccb2ac16055e0af1177f69127da40f52de.tar.gz |
declare liblo and libvlc callbacks with extern "C"
C might use other calling conventions than C++
Diffstat (limited to 'layer_video.cpp')
-rw-r--r-- | layer_video.cpp | 53 |
1 files changed, 33 insertions, 20 deletions
diff --git a/layer_video.cpp b/layer_video.cpp index bf6aa01..7860dfb 100644 --- a/layer_video.cpp +++ b/layer_video.cpp @@ -15,28 +15,15 @@ Layer::CtorInfo LayerVideo::ctor_info = {"video", "s" /* url */}; libvlc_instance_t *LayerVideo::vlcinst = NULL; -static void * -lock_cb(void *data, void **p_pixels) -{ - LayerVideo *video = (LayerVideo *)data; - - *p_pixels = video->lock_surf(); - - return NULL; /* picture identifier, not needed here */ -} - -static void -unlock_cb(void *data, void *id __attribute__((unused)), void *const *p_pixels) -{ - LayerVideo *video = (LayerVideo *)data; +/* + * libvlc callbacks + */ +extern "C" { - video->unlock_surf(); -} +static void *lock_cb(void *data, void **p_pixels); +static void unlock_cb(void *data, void *id, void *const *p_pixels); +static void display_cb(void *data, void *id); -static void -display_cb(void *data __attribute__((unused)), void *id __attribute__((unused))) -{ - /* VLC wants to display the video */ } LayerVideo::LayerVideo(const char *name, SDL_Rect geo, float opacity, @@ -122,6 +109,32 @@ media_get_video_size(libvlc_media_t *media, #endif +static void * +lock_cb(void *data, void **p_pixels) +{ + LayerVideo *video = (LayerVideo *)data; + + *p_pixels = video->lock_surf(); + + return NULL; /* picture identifier, not needed here */ +} + +static void +unlock_cb(void *data, void *id __attribute__((unused)), + void *const *p_pixels) +{ + LayerVideo *video = (LayerVideo *)data; + + video->unlock_surf(); +} + +static void +display_cb(void *data __attribute__((unused)), + void *id __attribute__((unused))) +{ + /* VLC wants to display the video */ +} + void LayerVideo::url(const char *url) { |