libVLC & JNI issue, Subscribing to new event in EventHandler

This forum is about all development around libVLC.
Anonymouser
New Cone
New Cone
Posts: 4
Joined: 02 Jun 2014 04:06

libVLC & JNI issue, Subscribing to new event in EventHandler

Postby Anonymouser » 02 Jun 2014 04:27

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!

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

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

Postby Jean-Baptiste Kempf » 05 Jun 2014 14:11

You should add debug around lib/event.c
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

Anonymouser
New Cone
New Cone
Posts: 4
Joined: 02 Jun 2014 04:06

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

Postby Anonymouser » 05 Jun 2014 22:56

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

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

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

Postby sherington » 05 Jun 2014 23:21

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.

Anonymouser
New Cone
New Cone
Posts: 4
Joined: 02 Jun 2014 04:06

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

Postby Anonymouser » 06 Jun 2014 05:46

Yup, that was it. I feel so silly for having missed that.

Thanks!

blackraven
New Cone
New Cone
Posts: 1
Joined: 04 Sep 2014 15:25

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

Postby blackraven » 04 Sep 2014 15:27

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.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 61 guests