[Bug 763065] androidmedia: assorted refactoring

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Sat Mar 5 00:04:31 UTC 2016


https://bugzilla.gnome.org/show_bug.cgi?id=763065

--- Comment #15 from Martin Kelly <martin at surround.io> ---
The macros make for slightly shorter calls because they wrap up some of the
error handling boilerplate and pass in the correct class for you (in the below
example, android.hardware.Camera):

AHC_CALL (goto done, Void, autoFocus, object);

as opposed to:

gst_amc_jni_call_void_method (env, &err, object,
    android_hardware_camera.autoFocus);
if (err)
  goto done;

That said, there's enough boilerplate involved in handling Android JNI already
that I'm not sure that the macro is worth it; it makes the code less
standardized, and you have to define a separate macro for every Java class you
might want to use. This opens up the potential for bugs if you accidentally the
macro for a different class, which will turn into a runtime error in the JNI
environment (!).

I think I'm in favor of replacing the macro with the standard function. If
there are no objections, I'll go ahead and do that.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list