Page 1 of 1

Better code implementation

Posted: 16 Dec 2012 04:10
by davidsun
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?

Re: Better code implementation

Posted: 16 Dec 2012 14:46
by edwardw
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.

Re: Better code implementation

Posted: 18 Dec 2012 02:00
by Jean-Baptiste Kempf
vlc-devel is a mailing list, feel free to send patches...

Re: Better code implementation

Posted: 22 Dec 2012 05:36
by davidsun
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.