3dphotoshoot

diff src/android/camera.c @ 7:7f6e6eb3d20e

some progress...
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 23 May 2015 23:14:44 +0300
parents e31e23ead56f
children 9fc7d52f578d
line diff
     1.1 --- a/src/android/camera.c	Thu May 21 19:03:00 2015 +0300
     1.2 +++ b/src/android/camera.c	Sat May 23 23:14:44 2015 +0300
     1.3 @@ -102,6 +102,26 @@
     1.4  	return 0;
     1.5  }
     1.6  
     1.7 +void cam_update(void)
     1.8 +{
     1.9 +	jmethodID method;
    1.10 +
    1.11 +	if(!jvm) {
    1.12 +		fprintf(stderr, "failed to update camera\n");
    1.13 +		return -1;
    1.14 +	}
    1.15 +	if(!cam_is_capturing()) {
    1.16 +		return 0;
    1.17 +	}
    1.18 +
    1.19 +	if(!(method = (*jni)->GetStaticMethodID(jni, activity_class, "update", "()V"))) {
    1.20 +		fprintf(stderr, "failed to find static method: update\n");
    1.21 +		return -1;
    1.22 +	}
    1.23 +	(*jni)->CallStaticVoidMethod(jni, activity_class, method);
    1.24 +	return;
    1.25 +}
    1.26 +
    1.27  int cam_is_capturing(void)
    1.28  {
    1.29  	return capturing;	// XXX is it better to do this properly through JNI?