Commit 63dbabfd authored by Thomas Guillem's avatar Thomas Guillem

lib: add libvlc_media_player_set_android_context

Used to pass the Java VM and a org.videolan.libvlc.IAWindowNativeHandler
jobject.
parent 1d7c5598
...@@ -513,6 +513,21 @@ LIBVLC_API void libvlc_media_player_set_hwnd ( libvlc_media_player_t *p_mi, void ...@@ -513,6 +513,21 @@ LIBVLC_API void libvlc_media_player_set_hwnd ( libvlc_media_player_t *p_mi, void
*/ */
LIBVLC_API void *libvlc_media_player_get_hwnd ( libvlc_media_player_t *p_mi ); LIBVLC_API void *libvlc_media_player_get_hwnd ( libvlc_media_player_t *p_mi );
/**
* Set the android context.
*
* \version LibVLC 3.0.0 and later.
*
* \param p_mi the media player
* \param p_jvm the Java VM of the android process.
* \param awindow_handler org.videolan.libvlc.IAWindowNativeHandler jobject
* implemented by the org.videolan.libvlc.MediaPlayer class from the
* libvlc-android project.
*/
LIBVLC_API void libvlc_media_player_set_android_context( libvlc_media_player_t *p_mi,
void *p_jvm,
void *p_awindow_handler );
/** /**
* Callback prototype for audio playback. * Callback prototype for audio playback.
* \param data data pointer as passed to libvlc_audio_set_callbacks() [IN] * \param data data pointer as passed to libvlc_audio_set_callbacks() [IN]
......
...@@ -515,6 +515,10 @@ libvlc_media_player_new( libvlc_instance_t *instance ) ...@@ -515,6 +515,10 @@ libvlc_media_player_new( libvlc_instance_t *instance )
var_Create (mp, "drawable-agl", VLC_VAR_INTEGER); var_Create (mp, "drawable-agl", VLC_VAR_INTEGER);
var_Create (mp, "drawable-nsobject", VLC_VAR_ADDRESS); var_Create (mp, "drawable-nsobject", VLC_VAR_ADDRESS);
#endif #endif
#ifdef __ANDROID__
var_Create (mp, "android-jvm", VLC_VAR_ADDRESS);
var_Create (mp, "drawable-androidwindow", VLC_VAR_ADDRESS);
#endif
var_Create (mp, "keyboard-events", VLC_VAR_BOOL); var_Create (mp, "keyboard-events", VLC_VAR_BOOL);
var_SetBool (mp, "keyboard-events", true); var_SetBool (mp, "keyboard-events", true);
...@@ -1093,6 +1097,22 @@ void *libvlc_media_player_get_hwnd( libvlc_media_player_t *p_mi ) ...@@ -1093,6 +1097,22 @@ void *libvlc_media_player_get_hwnd( libvlc_media_player_t *p_mi )
#endif #endif
} }
/**************************************************************************
* set_android_context
**************************************************************************/
void libvlc_media_player_set_android_context( libvlc_media_player_t *p_mi,
void *p_jvm,
void *p_awindow_handler )
{
assert (p_mi != NULL);
#ifdef __ANDROID__
var_SetAddress (p_mi, "android-jvm", p_jvm);
var_SetAddress (p_mi, "drawable-androidwindow", p_awindow_handler);
#else
(void) p_mi; (void) p_jvm; (void) p_awindow_handler;
#endif
}
void libvlc_audio_set_callbacks( libvlc_media_player_t *mp, void libvlc_audio_set_callbacks( libvlc_media_player_t *mp,
libvlc_audio_play_cb play_cb, libvlc_audio_play_cb play_cb,
libvlc_audio_pause_cb pause_cb, libvlc_audio_pause_cb pause_cb,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment