Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
91287e97
Commit
91287e97
authored
Jul 18, 2007
by
Philippe Morin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid allocating/freeing livlc_exception_t.
parent
78f3edc5
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
117 additions
and
124 deletions
+117
-124
bindings/java/src/audio-jni.cc
bindings/java/src/audio-jni.cc
+18
-18
bindings/java/src/callback-jni.cc
bindings/java/src/callback-jni.cc
+2
-2
bindings/java/src/input-jni.cc
bindings/java/src/input-jni.cc
+16
-16
bindings/java/src/playlist-jni.cc
bindings/java/src/playlist-jni.cc
+26
-26
bindings/java/src/utils.h
bindings/java/src/utils.h
+5
-12
bindings/java/src/video-jni.cc
bindings/java/src/video-jni.cc
+24
-24
bindings/java/src/vlm-jni.cc
bindings/java/src/vlm-jni.cc
+26
-26
No files found.
bindings/java/src/audio-jni.cc
View file @
91287e97
...
...
@@ -40,10 +40,10 @@ JNIEXPORT jint JNICALL Java_org_videolan_jvlc_Audio__1getTrack (JNIEnv *env, job
jint
res
=
0
;
res
=
libvlc_audio_get_track
(
input
,
exception
);
res
=
libvlc_audio_get_track
(
input
,
&
exception
);
libvlc_media_instance_release
(
input
);
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
return
res
;
}
...
...
@@ -53,19 +53,19 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Audio__1setTrack (JNIEnv *env, job
INIT_FUNCTION
;
GET_INPUT_THREAD
;
libvlc_audio_set_track
(
input
,
value
,
exception
);
libvlc_audio_set_track
(
input
,
value
,
&
exception
);
libvlc_media_instance_release
(
input
);
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
}
JNIEXPORT
jint
JNICALL
Java_org_videolan_jvlc_Audio__1getChannel
(
JNIEnv
*
env
,
jobject
_this
)
{
INIT_FUNCTION
;
int
res
=
libvlc_audio_get_channel
(
(
libvlc_instance_t
*
)
instance
,
exception
);
int
res
=
libvlc_audio_get_channel
(
(
libvlc_instance_t
*
)
instance
,
&
exception
);
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
return
res
;
}
...
...
@@ -74,9 +74,9 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Audio__1setChannel (JNIEnv *env, j
{
INIT_FUNCTION
;
libvlc_audio_set_channel
(
(
libvlc_instance_t
*
)
instance
,
channel
,
exception
);
libvlc_audio_set_channel
(
(
libvlc_instance_t
*
)
instance
,
channel
,
&
exception
);
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
}
...
...
@@ -85,9 +85,9 @@ JNIEXPORT jboolean JNICALL Java_org_videolan_jvlc_Audio__1getMute (JNIEnv *env,
INIT_FUNCTION
;
jboolean
res
;
res
=
(
jboolean
)
libvlc_audio_get_mute
(
(
libvlc_instance_t
*
)
instance
,
exception
);
res
=
(
jboolean
)
libvlc_audio_get_mute
(
(
libvlc_instance_t
*
)
instance
,
&
exception
);
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
return
res
;
...
...
@@ -97,18 +97,18 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Audio__1setMute (JNIEnv *env, jobj
{
INIT_FUNCTION
;
libvlc_audio_set_mute
(
(
libvlc_instance_t
*
)
instance
,
value
,
exception
);
libvlc_audio_set_mute
(
(
libvlc_instance_t
*
)
instance
,
value
,
&
exception
);
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
}
JNIEXPORT
void
JNICALL
Java_org_videolan_jvlc_Audio__1toggleMute
(
JNIEnv
*
env
,
jobject
_this
)
{
INIT_FUNCTION
;
libvlc_audio_get_mute
(
(
libvlc_instance_t
*
)
instance
,
exception
);
libvlc_audio_get_mute
(
(
libvlc_instance_t
*
)
instance
,
&
exception
);
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
}
JNIEXPORT
jint
JNICALL
Java_org_videolan_jvlc_Audio__1getVolume
(
JNIEnv
*
env
,
jobject
_this
)
...
...
@@ -116,9 +116,9 @@ JNIEXPORT jint JNICALL Java_org_videolan_jvlc_Audio__1getVolume (JNIEnv *env, jo
INIT_FUNCTION
;
jint
res
=
0
;
res
=
libvlc_audio_get_volume
(
(
libvlc_instance_t
*
)
instance
,
exception
);
res
=
libvlc_audio_get_volume
(
(
libvlc_instance_t
*
)
instance
,
&
exception
);
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
return
res
;
}
...
...
@@ -127,7 +127,7 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Audio__1setVolume (JNIEnv *env, jo
{
INIT_FUNCTION
;
libvlc_audio_set_volume
(
(
libvlc_instance_t
*
)
instance
,
volume
,
exception
);
libvlc_audio_set_volume
(
(
libvlc_instance_t
*
)
instance
,
volume
,
&
exception
);
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
}
bindings/java/src/callback-jni.cc
View file @
91287e97
...
...
@@ -60,8 +60,8 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Audio__1install_1callback( JNIEnv
libvlc_VolumeChanged
,
volumeChangedCallback
,
NULL
,
exception
);
CHECK_EXCEPTION
_FREE
;
&
exception
);
CHECK_EXCEPTION
;
}
void
volumeChangedCallback
(
struct
libvlc_instance_t
*
p_instance
,
libvlc_event_t
*
event
,
void
*
user_data
)
...
...
bindings/java/src/input-jni.cc
View file @
91287e97
...
...
@@ -38,10 +38,10 @@ JNIEXPORT jlong JNICALL Java_org_videolan_jvlc_Input__1getLength (JNIEnv *env, j
GET_INPUT_THREAD
;
res
=
libvlc_media_instance_get_length
(
input
,
exception
);
res
=
libvlc_media_instance_get_length
(
input
,
&
exception
);
libvlc_media_instance_release
(
input
);
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
return
res
;
}
...
...
@@ -53,9 +53,9 @@ JNIEXPORT jfloat JNICALL Java_org_videolan_jvlc_Input__1getPosition (JNIEnv *env
GET_INPUT_THREAD
;
res
=
libvlc_media_instance_get_position
(
input
,
exception
);
res
=
libvlc_media_instance_get_position
(
input
,
&
exception
);
libvlc_media_instance_release
(
input
);
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
return
res
;
}
...
...
@@ -67,9 +67,9 @@ JNIEXPORT jlong JNICALL Java_org_videolan_jvlc_Input__1getTime (JNIEnv *env, job
GET_INPUT_THREAD
;
res
=
libvlc_media_instance_get_time
(
input
,
exception
);
res
=
libvlc_media_instance_get_time
(
input
,
&
exception
);
libvlc_media_instance_release
(
input
);
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
return
res
;
}
...
...
@@ -81,9 +81,9 @@ JNIEXPORT jfloat JNICALL Java_org_videolan_jvlc_Input__1getFPS (JNIEnv *env, job
GET_INPUT_THREAD
;
res
=
libvlc_media_instance_get_fps
(
input
,
exception
);
res
=
libvlc_media_instance_get_fps
(
input
,
&
exception
);
libvlc_media_instance_release
(
input
);
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
return
res
;
}
...
...
@@ -94,9 +94,9 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Input__1setTime (JNIEnv *env, jobj
GET_INPUT_THREAD
;
libvlc_media_instance_set_time
(
input
,
time
,
exception
);
libvlc_media_instance_set_time
(
input
,
time
,
&
exception
);
libvlc_media_instance_release
(
input
);
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
}
...
...
@@ -106,9 +106,9 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Input__1setPosition (JNIEnv *env,
GET_INPUT_THREAD
;
libvlc_media_instance_set_position
(
input
,
position
,
exception
);
libvlc_media_instance_set_position
(
input
,
position
,
&
exception
);
libvlc_media_instance_release
(
input
);
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
}
JNIEXPORT
jboolean
JNICALL
Java_org_videolan_jvlc_Input__1isPlaying
(
JNIEnv
*
env
,
jobject
_this
)
...
...
@@ -118,9 +118,9 @@ JNIEXPORT jboolean JNICALL Java_org_videolan_jvlc_Input__1isPlaying (JNIEnv *env
GET_INPUT_THREAD
;
res
=
libvlc_media_instance_will_play
(
input
,
exception
);
res
=
libvlc_media_instance_will_play
(
input
,
&
exception
);
libvlc_media_instance_release
(
input
);
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
return
res
;
}
...
...
@@ -132,9 +132,9 @@ JNIEXPORT jboolean JNICALL Java_org_videolan_jvlc_Input__1hasVout (JNIEnv *env,
GET_INPUT_THREAD
;
res
=
libvlc_media_instance_has_vout
(
input
,
exception
);
res
=
libvlc_media_instance_has_vout
(
input
,
&
exception
);
libvlc_media_instance_release
(
input
);
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
return
res
;
}
...
...
bindings/java/src/playlist-jni.cc
View file @
91287e97
...
...
@@ -60,14 +60,14 @@ JNIEXPORT jint JNICALL Java_org_videolan_jvlc_Playlist__1playlist_1add (JNIEnv *
ppsz_options
[
i
+
1
]
=
env
->
GetStringUTFChars
(
(
jstring
)
env
->
GetObjectArrayElement
(
options
,
i
),
0
);
}
res
=
libvlc_playlist_add_extended
(
(
libvlc_instance_t
*
)
instance
,
psz_uri
,
psz_name
,
i_options
,
ppsz_options
,
exception
);
res
=
libvlc_playlist_add_extended
(
(
libvlc_instance_t
*
)
instance
,
psz_uri
,
psz_name
,
i_options
,
ppsz_options
,
&
exception
);
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
}
else
{
res
=
libvlc_playlist_add
(
(
libvlc_instance_t
*
)
instance
,
psz_uri
,
psz_name
,
exception
);
res
=
libvlc_playlist_add
(
(
libvlc_instance_t
*
)
instance
,
psz_uri
,
psz_name
,
&
exception
);
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
}
if
(
psz_uri
!=
NULL
)
{
...
...
@@ -99,16 +99,16 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Playlist__1play (JNIEnv *env, jobj
}
}
libvlc_playlist_play
(
(
libvlc_instance_t
*
)
instance
,
id
,
i_options
,
(
char
**
)
ppsz_options
,
exception
);
libvlc_playlist_play
(
(
libvlc_instance_t
*
)
instance
,
id
,
i_options
,
(
char
**
)
ppsz_options
,
&
exception
);
CHECK_EXCEPTION
;
while
(
!
libvlc_playlist_isplaying
(
(
libvlc_instance_t
*
)
instance
,
exception
)
)
while
(
!
libvlc_playlist_isplaying
(
(
libvlc_instance_t
*
)
instance
,
&
exception
)
)
{
usleep
(
100
);
}
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
}
...
...
@@ -116,60 +116,60 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Playlist__1pause (JNIEnv *env, job
{
INIT_FUNCTION
;
libvlc_playlist_pause
(
(
libvlc_instance_t
*
)
instance
,
exception
);
libvlc_playlist_pause
(
(
libvlc_instance_t
*
)
instance
,
&
exception
);
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
}
JNIEXPORT
void
JNICALL
Java_org_videolan_jvlc_Playlist__1stop
(
JNIEnv
*
env
,
jobject
_this
)
{
INIT_FUNCTION
;
libvlc_playlist_stop
(
(
libvlc_instance_t
*
)
instance
,
exception
);
libvlc_playlist_stop
(
(
libvlc_instance_t
*
)
instance
,
&
exception
);
while
(
libvlc_playlist_isplaying
(
(
libvlc_instance_t
*
)
instance
,
exception
)
)
while
(
libvlc_playlist_isplaying
(
(
libvlc_instance_t
*
)
instance
,
&
exception
)
)
{
usleep
(
100
);
}
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
}
JNIEXPORT
void
JNICALL
Java_org_videolan_jvlc_Playlist__1next
(
JNIEnv
*
env
,
jobject
_this
)
{
INIT_FUNCTION
;
libvlc_playlist_next
(
(
libvlc_instance_t
*
)
instance
,
exception
);
libvlc_playlist_next
(
(
libvlc_instance_t
*
)
instance
,
&
exception
);
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
}
JNIEXPORT
void
JNICALL
Java_org_videolan_jvlc_Playlist__1prev
(
JNIEnv
*
env
,
jobject
_this
)
{
INIT_FUNCTION
;
libvlc_playlist_prev
(
(
libvlc_instance_t
*
)
instance
,
exception
);
libvlc_playlist_prev
(
(
libvlc_instance_t
*
)
instance
,
&
exception
);
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
}
JNIEXPORT
void
JNICALL
Java_org_videolan_jvlc_Playlist__1clear
(
JNIEnv
*
env
,
jobject
_this
)
{
INIT_FUNCTION
;
libvlc_playlist_clear
(
(
libvlc_instance_t
*
)
instance
,
exception
);
libvlc_playlist_clear
(
(
libvlc_instance_t
*
)
instance
,
&
exception
);
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
}
JNIEXPORT
void
JNICALL
Java_org_videolan_jvlc_Playlist__1deleteItem
(
JNIEnv
*
env
,
jobject
_this
,
jint
itemID
)
{
INIT_FUNCTION
;
libvlc_playlist_delete_item
(
(
libvlc_instance_t
*
)
instance
,
itemID
,
exception
);
libvlc_playlist_delete_item
(
(
libvlc_instance_t
*
)
instance
,
itemID
,
&
exception
);
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
}
...
...
@@ -178,9 +178,9 @@ JNIEXPORT jint JNICALL Java_org_videolan_jvlc_Playlist__1itemsCount (JNIEnv *env
INIT_FUNCTION
;
int
res
=
0
;
res
=
libvlc_playlist_items_count
(
(
libvlc_instance_t
*
)
instance
,
exception
);
res
=
libvlc_playlist_items_count
(
(
libvlc_instance_t
*
)
instance
,
&
exception
);
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
return
res
;
...
...
@@ -191,9 +191,9 @@ JNIEXPORT jint JNICALL Java_org_videolan_jvlc_Playlist__1isRunning (JNIEnv *env,
INIT_FUNCTION
;
int
res
=
0
;
res
=
libvlc_playlist_isplaying
(
(
libvlc_instance_t
*
)
instance
,
exception
);
res
=
libvlc_playlist_isplaying
(
(
libvlc_instance_t
*
)
instance
,
&
exception
);
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
return
res
;
}
...
...
@@ -203,8 +203,8 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Playlist__1setLoop
{
INIT_FUNCTION
;
libvlc_playlist_loop
(
(
libvlc_instance_t
*
)
instance
,
loop
,
exception
);
libvlc_playlist_loop
(
(
libvlc_instance_t
*
)
instance
,
loop
,
&
exception
);
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
}
bindings/java/src/utils.h
View file @
91287e97
...
...
@@ -9,29 +9,22 @@
void
handle_vlc_exception
(
JNIEnv
*
,
libvlc_exception_t
*
);
jlong
getInstance
(
JNIEnv
*
,
jobject
);
#define CHECK_EXCEPTION_FREE \
if ( libvlc_exception_raised( exception )) \
{ \
handle_vlc_exception( env, exception ); \
} \
free( exception );
#define CHECK_EXCEPTION \
if ( libvlc_exception_raised( exception )) \
if ( libvlc_exception_raised(
&
exception )) \
{ \
handle_vlc_exception( env, exception ); \
handle_vlc_exception( env,
&
exception ); \
}
#define INIT_FUNCTION \
long instance; \
libvlc_exception_t
*exception = ( libvlc_exception_t * ) malloc( sizeof( libvlc_exception_t ))
; \
libvlc_exception_init( exception ); \
libvlc_exception_t
exception
; \
libvlc_exception_init(
&
exception ); \
instance = getInstance( env, _this );
#define GET_INPUT_THREAD \
libvlc_media_instance_t *input; \
input = libvlc_playlist_get_media_instance( ( libvlc_instance_t *) instance, exception ); \
input = libvlc_playlist_get_media_instance( ( libvlc_instance_t *) instance,
&
exception ); \
CHECK_EXCEPTION ;
#define ATTACH_JVM \
...
...
bindings/java/src/video-jni.cc
View file @
91287e97
...
...
@@ -40,11 +40,11 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Video__1toggleFullscreen (JNIEnv *
GET_INPUT_THREAD
;
libvlc_toggle_fullscreen
(
input
,
exception
);
libvlc_toggle_fullscreen
(
input
,
&
exception
);
libvlc_media_instance_release
(
input
);
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
}
JNIEXPORT
void
JNICALL
Java_org_videolan_jvlc_Video__1setFullscreen
(
JNIEnv
*
env
,
jobject
_this
,
jboolean
value
)
...
...
@@ -53,10 +53,10 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Video__1setFullscreen (JNIEnv *env
GET_INPUT_THREAD
;
libvlc_set_fullscreen
(
input
,
value
,
exception
);
libvlc_set_fullscreen
(
input
,
value
,
&
exception
);
libvlc_media_instance_release
(
input
);
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
}
JNIEXPORT
jboolean
JNICALL
Java_org_videolan_jvlc_Video__1getFullscreen
(
JNIEnv
*
env
,
jobject
_this
)
...
...
@@ -66,10 +66,10 @@ JNIEXPORT jboolean JNICALL Java_org_videolan_jvlc_Video__1getFullscreen (JNIEnv
GET_INPUT_THREAD
;
res
=
libvlc_get_fullscreen
(
input
,
exception
);
res
=
libvlc_get_fullscreen
(
input
,
&
exception
);
libvlc_media_instance_release
(
input
);
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
return
res
;
}
...
...
@@ -81,10 +81,10 @@ JNIEXPORT jint JNICALL Java_org_videolan_jvlc_Video__1getHeight (JNIEnv *env, jo
GET_INPUT_THREAD
;
res
=
libvlc_video_get_height
(
input
,
exception
);
res
=
libvlc_video_get_height
(
input
,
&
exception
);
libvlc_media_instance_release
(
input
);
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
return
res
;
}
...
...
@@ -96,10 +96,10 @@ JNIEXPORT jint JNICALL Java_org_videolan_jvlc_Video__1getWidth (JNIEnv *env, job
GET_INPUT_THREAD
;
res
=
libvlc_video_get_width
(
input
,
exception
);
res
=
libvlc_video_get_width
(
input
,
&
exception
);
libvlc_media_instance_release
(
input
);
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
return
res
;
}
...
...
@@ -112,10 +112,10 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Video__1getSnapshot (JNIEnv *env,
GET_INPUT_THREAD
;
libvlc_video_take_snapshot
(
input
,
(
char
*
)
psz_filepath
,
exception
);
libvlc_video_take_snapshot
(
input
,
(
char
*
)
psz_filepath
,
&
exception
);
libvlc_media_instance_release
(
input
);
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
if
(
psz_filepath
!=
NULL
)
{
env
->
ReleaseStringUTFChars
(
filepath
,
psz_filepath
);
...
...
@@ -129,10 +129,10 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Video__1destroyVideo (JNIEnv *env,
GET_INPUT_THREAD
;
libvlc_video_destroy
(
input
,
exception
);
libvlc_video_destroy
(
input
,
&
exception
);
libvlc_media_instance_release
(
input
);
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
}
JNIEXPORT
void
JNICALL
Java_org_videolan_jvlc_Video__1reparent
(
JNIEnv
*
env
,
jobject
_this
,
jobject
canvas
)
...
...
@@ -195,10 +195,10 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Video__1reparent (JNIEnv *env, job
dsi_win
=
(
JAWT_Win32DrawingSurfaceInfo
*
)
dsi
->
platformInfo
;
drawable
=
reinterpret_cast
<
int
>
(
dsi_win
->
hwnd
);
libvlc_video_set_parent
((
libvlc_instance_t
*
)
instance
,
drawable
,
exception
);
libvlc_video_set_parent
((
libvlc_instance_t
*
)
instance
,
drawable
,
&
exception
);
libvlc_media_instance_release
(
input
);
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
#else // UNIX
/* Get the platform-specific drawing info */
...
...
@@ -211,9 +211,9 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Video__1reparent (JNIEnv *env, job
/* and reparent */
drawable
=
dsi_x11
->
drawable
;
libvlc_video_set_parent
(
(
libvlc_instance_t
*
)
instance
,
drawable
,
exception
);
libvlc_video_set_parent
(
(
libvlc_instance_t
*
)
instance
,
drawable
,
&
exception
);
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
XFreeGC
(
dsi_x11
->
display
,
gc
);
...
...
@@ -282,9 +282,9 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Video__1paint (JNIEnv *env, jobjec
dsi_win
=
(
JAWT_Win32DrawingSurfaceInfo
*
)
dsi
->
platformInfo
;
drawable
=
reinterpret_cast
<
int
>
(
dsi_win
->
hwnd
);
libvlc_video_set_parent
(
(
libvlc_instance_t
*
)
instance
,
drawable
,
exception
);
libvlc_video_set_parent
(
(
libvlc_instance_t
*
)
instance
,
drawable
,
&
exception
);
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
#else // UNIX
/* Get the platform-specific drawing info */
...
...
@@ -297,9 +297,9 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Video__1paint (JNIEnv *env, jobjec
/* and reparent */
drawable
=
dsi_x11
->
drawable
;
libvlc_video_set_parent
(
(
libvlc_instance_t
*
)
instance
,
drawable
,
exception
);
libvlc_video_set_parent
(
(
libvlc_instance_t
*
)
instance
,
drawable
,
&
exception
);
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
XFreeGC
(
dsi_x11
->
display
,
gc
);
...
...
@@ -322,8 +322,8 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Video__1setSize (JNIEnv *env, jobj
GET_INPUT_THREAD
;
libvlc_video_resize
(
input
,
width
,
height
,
exception
);
libvlc_video_resize
(
input
,
width
,
height
,
&
exception
);
libvlc_media_instance_release
(
input
);
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
}
bindings/java/src/vlm-jni.cc
View file @
91287e97
...
...
@@ -51,9 +51,9 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_VLM__1addBroadcast (JNIEnv *env, j
}
libvlc_vlm_add_broadcast
(
(
libvlc_instance_t
*
)
instance
,
(
char
*
)
psz_name
,
(
char
*
)
psz_inputmrl
,
(
char
*
)
psz_outputmrl
,
i_options
,
(
char
**
)
ppsz_options
,
enable
,
loop
,
exception
);
i_options
,
(
char
**
)
ppsz_options
,
enable
,
loop
,
&
exception
);
CHECK_EXCEPTION
_FREE
;
CHECK_EXCEPTION
;
if
(
psz_name
!=
NULL
)
{
...
...
@@ -72,8 +72,8 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_VLM__1deleteMedia (JNIEnv *env, jo
INIT_FUNCTION
;
const
char
*
psz_name
=
env
->
GetStringUTFChars
(
name
,
0
);
libvlc_vlm_del_media
(
(
libvlc_instance_t
*
)
instance
,
(
char
*
)
psz_name
,
exception
);
CHECK_EXCEPTION
_FREE
;
libvlc_vlm_del_media
(
(
libvlc_instance_t
*
)
instance
,
(
char
*
)
psz_name
,
&
exception
);
CHECK_EXCEPTION
;
if
(
psz_name
!=
NULL
)
{
env
->
ReleaseStringUTFChars
(
name
,
psz_name
);
...
...
@@ -85,8 +85,8 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_VLM__1setEnabled (JNIEnv *env, job
INIT_FUNCTION
;
const
char
*
psz_name
=
env
->
GetStringUTFChars
(
name
,
0
);
libvlc_vlm_set_enabled
(
(
libvlc_instance_t
*
)
instance
,
(
char
*
)
psz_name
,
newStatus
,
exception
);
CHECK_EXCEPTION
_FREE
;
libvlc_vlm_set_enabled
(
(
libvlc_instance_t
*
)
instance
,
(
char
*
)
psz_name
,
newStatus
,
&
exception
);
CHECK_EXCEPTION
;
if
(
psz_name
!=
NULL
)
{
env
->
ReleaseStringUTFChars
(
name
,
psz_name
);
...
...
@@ -99,8 +99,8 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_VLM__1setOutput (JNIEnv *env, jobj
const
char
*
psz_name
=
env
->
GetStringUTFChars
(
name
,
0
);
const
char
*
psz_mrl
=
env
->
GetStringUTFChars
(
mrl
,
0
);
libvlc_vlm_set_output
((
libvlc_instance_t
*
)
instance
,
(
char
*
)
psz_name
,
(
char
*
)
psz_mrl
,
exception
);
CHECK_EXCEPTION
_FREE
;
libvlc_vlm_set_output
((
libvlc_instance_t
*
)
instance
,
(
char
*
)
psz_name
,
(
char
*
)
psz_mrl
,
&
exception
);
CHECK_EXCEPTION
;
if
(
psz_name
!=
NULL
)
{
env
->
ReleaseStringUTFChars
(
name
,
psz_name
);
...
...
@@ -117,8 +117,8 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_VLM__1setInput (JNIEnv *env, jobje
const
char
*
psz_name
=
env
->
GetStringUTFChars
(
name
,
0
);
const
char
*
psz_mrl
=
env
->
GetStringUTFChars
(
mrl
,
0
);
libvlc_vlm_set_input
((
libvlc_instance_t
*
)
instance
,
(
char
*
)
psz_name
,
(
char
*
)
psz_mrl
,
exception
);
CHECK_EXCEPTION
_FREE
;
libvlc_vlm_set_input
((
libvlc_instance_t
*
)
instance
,
(
char
*
)
psz_name
,
(
char
*
)
psz_mrl
,
&
exception
);
CHECK_EXCEPTION
;
if
(
psz_name
!=
NULL
)
{
env
->
ReleaseStringUTFChars
(
name
,
psz_name
);
...
...
@@ -133,8 +133,8 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_VLM__1setLoop (JNIEnv *env, jobjec
INIT_FUNCTION
;
const
char
*
psz_name
=
env
->
GetStringUTFChars
(
name
,
0
);
libvlc_vlm_set_loop
((
libvlc_instance_t
*
)
instance
,
(
char
*
)
psz_name
,
newStatus
,
exception
);
CHECK_EXCEPTION
_FREE
;
libvlc_vlm_set_loop
((
libvlc_instance_t
*
)
instance
,
(
char
*
)
psz_name
,
newStatus
,
&
exception
);
CHECK_EXCEPTION
;
if
(
psz_name
!=
NULL
)
{
env
->
ReleaseStringUTFChars
(
name
,
psz_name
);
...
...
@@ -161,8 +161,8 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_VLM__1changeMedia (JNIEnv *env, jo
}
libvlc_vlm_change_media
(
(
libvlc_instance_t
*
)
instance
,
(
char
*
)
psz_name
,
(
char
*
)
psz_inputmrl
,
(
char
*
)
psz_outputmrl
,
i_options
,
(
char
**
)
ppsz_options
,
enablenewbroadcast
,
broadcast
,
exception
);
CHECK_EXCEPTION
_FREE
;
i_options
,
(
char
**
)
ppsz_options
,
enablenewbroadcast
,
broadcast
,
&
exception
);
CHECK_EXCEPTION
;
if
(
psz_name
!=
NULL
)
{
env
->
ReleaseStringUTFChars
(
name
,
psz_name
);
...
...
@@ -182,8 +182,8 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_VLM__1playMedia (JNIEnv *env, jobj
INIT_FUNCTION
;
const
char
*
psz_name
=
env
->
GetStringUTFChars
(
name
,
0
);
libvlc_vlm_play_media
(
(
libvlc_instance_t
*
)
instance
,
(
char
*
)
psz_name
,
exception
);
CHECK_EXCEPTION
_FREE
;
libvlc_vlm_play_media
(
(
libvlc_instance_t
*
)
instance
,
(
char
*
)
psz_name
,
&
exception
);
CHECK_EXCEPTION
;
if
(
psz_name
!=
NULL
)
{
env
->
ReleaseStringUTFChars
(
name
,
psz_name
);
...
...
@@ -196,8 +196,8 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_VLM__1stopMedia (JNIEnv *env, jobj
const
char
*
psz_name
=
env
->
GetStringUTFChars
(
name
,
0
);
libvlc_vlm_stop_media
(
(
libvlc_instance_t
*
)
instance
,
(
char
*
)
psz_name
,
exception
);
CHECK_EXCEPTION
_FREE
;
libvlc_vlm_stop_media
(
(
libvlc_instance_t
*
)
instance
,
(
char
*
)
psz_name
,
&
exception
);
CHECK_EXCEPTION
;
if
(
psz_name
!=
NULL
)
{
env
->
ReleaseStringUTFChars
(
name
,
psz_name
);
...
...
@@ -209,8 +209,8 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_VLM__1pauseMedia (JNIEnv *env, job
INIT_FUNCTION
;
const
char
*
psz_name
=
env
->
GetStringUTFChars
(
name
,
0
);
libvlc_vlm_pause_media
(
(
libvlc_instance_t
*
)
instance
,
(
char
*
)
psz_name
,
exception
);
CHECK_EXCEPTION
_FREE
;
libvlc_vlm_pause_media
(
(
libvlc_instance_t
*
)
instance
,
(
char
*
)
psz_name
,
&
exception
);
CHECK_EXCEPTION
;
if
(
psz_name
!=
NULL
)
{
env
->
ReleaseStringUTFChars
(
name
,
psz_name
);
...
...
@@ -222,8 +222,8 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_VLM__1seekMedia (JNIEnv *env, jobj
INIT_FUNCTION
;
const
char
*
psz_name
=
env
->
GetStringUTFChars
(
name
,
0
);
libvlc_vlm_seek_media
(
(
libvlc_instance_t
*
)
instance
,
(
char
*
)
psz_name
,
(
float
)
percentage
,
exception
);
CHECK_EXCEPTION
_FREE
;
libvlc_vlm_seek_media
(
(
libvlc_instance_t
*
)
instance
,
(
char
*
)
psz_name
,
(
float
)
percentage
,
&
exception
);
CHECK_EXCEPTION
;
if
(
psz_name
!=
NULL
)
{
env
->
ReleaseStringUTFChars
(
name
,
psz_name
);
...
...
@@ -237,8 +237,8 @@ JNIEXPORT jstring JNICALL Java_org_videolan_jvlc_VLM__1showMedia (JNIEnv *env, j
char
*
psz_response
;
jstring
js_response
;
psz_response
=
libvlc_vlm_show_media
(
(
libvlc_instance_t
*
)
instance
,
(
char
*
)
psz_name
,
exception
);
CHECK_EXCEPTION
_FREE
;
psz_response
=
libvlc_vlm_show_media
(
(
libvlc_instance_t
*
)
instance
,
(
char
*
)
psz_name
,
&
exception
);
CHECK_EXCEPTION
;
if
(
psz_name
!=
NULL
)
{
env
->
ReleaseStringUTFChars
(
name
,
psz_name
);
...
...
@@ -257,8 +257,8 @@ JNIEXPORT j ## returnType JNICALL Java_org_videolan_jvlc_VLM__1getMedia ## attr(
const char* psz_name = env->GetStringUTFChars( name, 0 ); \
returnType response; \
\
response = libvlc_vlm_get_media_ ## attr( (libvlc_instance_t *) instance, (char*)psz_name, (int)index, exception ); \
CHECK_EXCEPTION
_FREE
; \
response = libvlc_vlm_get_media_ ## attr( (libvlc_instance_t *) instance, (char*)psz_name, (int)index,
&
exception ); \
CHECK_EXCEPTION ; \
\
if (psz_name != NULL) { \
env->ReleaseStringUTFChars( name, psz_name ); \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment