jint Java_ch_nuicell_ecam_CameraPreview_prepareCamera( JNIEnv* env,jobject thiz, jint videoid) { int ret; if(camerabase<0) { camerabase = checkCamerabase(); } ret = opendevice(camerabase + videoid); if(ret != ERROR_LOCAL) { ret = initdevice(); } if(ret != ERROR_LOCAL) { ret = startcapturing(); if(ret != SUCCESS_LOCAL) { stopcapturing(); uninitdevice (); closedevice (); LOGE("device resetted"); } } if(ret != ERROR_LOCAL) { rgb = (int *)malloc(sizeof(int) * (IMG_WIDTH*IMG_HEIGHT)); ybuf = (int *)malloc(sizeof(int) * (IMG_WIDTH*IMG_HEIGHT)); } return ret; }
jint Java_dk_itu_eyedroid_io_protocols_InputStreamUSBCamera_prepareCamera( JNIEnv* env,jobject thiz, jint videoid){ int ret; if(camerabase<0){ camerabase = checkCamerabase(); } ret = opendevice(camerabase + videoid); if(ret != ERROR_LOCAL){ ret = initdevice(); } if(ret != ERROR_LOCAL){ ret = startcapturing(); if(ret != SUCCESS_LOCAL){ stopcapturing(); uninitdevice (); closedevice (); LOGE("device resetted"); } } if(ret != ERROR_LOCAL){ rgb = (int *)malloc(sizeof(int) * (IMG_WIDTH*IMG_HEIGHT)); ybuf = (int *)malloc(sizeof(int) * (IMG_WIDTH*IMG_HEIGHT)); } return ret; }
void Java_ch_nuicell_ecam_CameraPreview_stopCamera(JNIEnv* env,jobject thiz) { stopcapturing (); uninitdevice (); closedevice (); if(rgb) free(rgb); if(ybuf) free(ybuf); fd = -1; }
void Java_dk_itu_eyedroid_io_protocols_InputStreamUSBCamera_stopCamera(JNIEnv* env,jobject thiz){ stopcapturing (); uninitdevice (); closedevice (); if(rgb) free(rgb); if(ybuf) free(ybuf); fd = -1; }
void Java_com_example_test1_CameraPreview_stopCamera(JNIEnv* env,jobject thiz){ stopcapturing (); uninitdevice (); closedevice (); if(rgb) free(rgb); if(ybuf) free(ybuf); fd = -1; }
void Java_com_usb_camera_android_SingleCameraPreview_stopCamera(JNIEnv* env,jobject thiz){ stopcapturing (); uninitdevice (); closedevice (); if(rgb) free(rgb); if(ybuf) free(ybuf); fd = -1; }
void Java_com_camera_simpledoublewebcams2_CameraPreview_stopCamera(JNIEnv* env,jobject thiz){ int i; for(i=0 ; i<CAMERANUM ; i++){ if(fd[i]!=-1) stopcapturing (i); if(fd[i]!=-1) uninitdevice (i); if(fd[i]!=-1) closedevice (i); fd[i] =-1; if(rgb[i]) free(rgb[i]); } }