Code: Select all
void Java_org_videolan_libvlc_LibVLC_mediaDiscovererInit(JNIEnv *env, jobject thiz, jlong instance)
{
/* Release previous media discoverer, if any */
releaseMediaDiscoverer(env, thiz);
/* Create a media discoverer environment */
libvlc_media_discoverer_t *mp = libvlc_media_discoverer_new_from_name((libvlc_instance_t*)(intptr_t)instance, "sap");
jobject myJavaLibVLC = (*env)->NewGlobalRef(env, thiz);
/* Connect the event manager */
libvlc_event_manager_t *ev = libvlc_media_discoverer_event_manager(mp);
static const libvlc_event_type_t mp_events[] = {
libvlc_MediaDiscovererStarted,
libvlc_MediaDiscovererEnded
};
for(int i = 0; i < (sizeof(mp_events) / sizeof(*mp_events)); i++)
libvlc_event_attach(ev, mp_events[i], vlc_media_discoverer_event_callback, myVm);
/* Keep a pointer to this media discoverer */
setLong(env, thiz, "mInternalMediaDiscovererInstance", (jlong)(intptr_t)mp);
}
Code: Select all
libvlc_media_discoverer_new_from_name
Return to “VLC for Android and Chrome OS”
Users browsing this forum: No registered users and 65 guests