]> git.sesse.net Git - vlc/blob - bindings/java/src/utils.h
fix dependancies
[vlc] / bindings / java / src / utils.h
1 /* These are a must*/
2 #include <jni.h>
3 #include <jawt.h>
4 #include <jawt_md.h>
5
6 #include <vlc/libvlc.h>
7 #include <stdlib.h> // for free
8
9 void handle_vlc_exception( JNIEnv*, libvlc_exception_t* );
10 jlong getInstance ( JNIEnv* , jobject );
11
12 #define CHECK_EXCEPTION \
13     if ( libvlc_exception_raised( &exception )) \
14     { \
15         handle_vlc_exception( env, &exception ); \
16     }
17
18
19 #define INIT_FUNCTION \
20     long instance; \
21     libvlc_exception_t exception; \
22     libvlc_exception_init( &exception ); \
23     instance = getInstance( env, _this );
24
25 #define GET_INPUT_THREAD \
26     libvlc_media_instance_t *input; \
27     input = libvlc_playlist_get_media_instance( ( libvlc_instance_t *) instance, &exception ); \
28     CHECK_EXCEPTION ;
29
30 #define ATTACH_JVM \
31     JNIEnv *env; \
32     jvm->AttachCurrentThread( ( void ** ) &env, NULL );
33