Page 1 of 1

libVLC & JNI issue, Subscribing to new event in EventHandler

Posted: 02 Jun 2014 04:27
by Anonymouser
Hey there,

So I've downloaded VLC code, compiled it, took libVLC and used it in my Android app to stream RTMP. Works like a charm. Now for our purposes there is very crucial info being sent through the RTMP stream's metadata, so I need to listen to that too. Currently that event is not subscribed.

Therefore, I uncommented the line in EventHandler.java and added libvlc_MediaMetaChanged to the mp_events array in libvlcjni.c (line 366) and recompiled libVLC but it just won't work (crashes the moment I try to play anything). It keeps failing the assertion in event_attach (line 373 of event.c). Could someone please help me out? I don't know what I'm missing or why it can't attach.

Thanks!

Re: libVLC & JNI issue, Subscribing to new event in EventHan

Posted: 05 Jun 2014 14:11
by Jean-Baptiste Kempf
You should add debug around lib/event.c

Re: libVLC & JNI issue, Subscribing to new event in EventHan

Posted: 05 Jun 2014 22:56
by Anonymouser
Sorry I'm a little confused. Add what debug and where?

All I need to know is how to subscribe to an event. I uncommented MediaMetaChanged from org.videolan.libvlc.EventHandler.java and added libvlc_MediaMetaChanged to mp_events[] in Java_org_videolan_libvlc_LibVLC_playMRL() which both live in vlc-android folder (src and jni). If someone can just let me know what I'm missing or what I've done wrong I'd appreciate it. I'm working off of the following guide to compile: https://wiki.videolan.org/AndroidCompile

Re: libVLC & JNI issue, Subscribing to new event in EventHan

Posted: 05 Jun 2014 23:21
by sherington
I don't know for sure, but maybe it's because the MediaMetaChanged event pertains to a libvlc_media_t, and not a libvlc_media_player_t - there are different event managers, i.e. libvlc_media_event_manager vs libvlc_media_player_event_manager.

Re: libVLC & JNI issue, Subscribing to new event in EventHan

Posted: 06 Jun 2014 05:46
by Anonymouser
Yup, that was it. I feel so silly for having missed that.

Thanks!

Re: libVLC & JNI issue, Subscribing to new event in EventHan

Posted: 04 Sep 2014 15:27
by blackraven
Hi,

I did like you and I get the event. But how do you get meta ? I want the playing song from radio stream.


Thx.