Better code implementation

VLC for Android and Chrome OS specific usage questions
davidsun
New Cone
New Cone
Posts: 3
Joined: 16 Dec 2012 03:57

Better code implementation

Postby davidsun » 16 Dec 2012 04:10

I've found that in the source code of VLC, the JNI calls are clearly defined (by "native" keyword), while the reverse JNI calls are not clearly defined. For example, on line 232 of libvlcjni.c, this call is not well defined in Java (if someone mistakenly change the code of that Activity, something terrible would happen).

I believe a better solution is to add an interface in Java to make the reverse JNI calls clear. Since interface is created, the developers have to obey the rules created by C program developers.

PS. Another question, is there any way (for example, Github), to contact with developers directly?

edwardw
Big Cone-huna
Big Cone-huna
Posts: 2346
Joined: 24 Jun 2012 23:36
VLC version: 3.0.0-git

Re: Better code implementation

Postby edwardw » 16 Dec 2012 14:46

I don't see the point. Even if you create an interface, you could still accidentally update the Java interface without updating the JNI, so this is pointless IMO.

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: Better code implementation

Postby Jean-Baptiste Kempf » 18 Dec 2012 02:00

vlc-devel is a mailing list, feel free to send patches...
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.

davidsun
New Cone
New Cone
Posts: 3
Joined: 16 Dec 2012 03:57

Re: Better code implementation

Postby davidsun » 22 Dec 2012 05:36

I don't see the point. Even if you create an interface, you could still accidentally update the Java interface without updating the JNI, so this is pointless IMO.
The point is, if interfaces are created, all the reverse JNI calls are in one place. It's much more easier to manage, and can greatly reduce the change to cause mistake.


Return to “VLC for Android and Chrome OS”

Who is online

Users browsing this forum: No registered users and 32 guests