Beispiel #1
0
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;
}
Beispiel #2
0
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;
}	
Beispiel #3
0
void
Java_ch_nuicell_ecam_CameraPreview_stopCamera(JNIEnv* env,jobject thiz) {

    stopcapturing ();

    uninitdevice ();

    closedevice ();

    if(rgb) free(rgb);
    if(ybuf) free(ybuf);

    fd = -1;

}
Beispiel #4
0
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;

}
Beispiel #5
0
void 
Java_com_example_test1_CameraPreview_stopCamera(JNIEnv* env,jobject thiz){

	stopcapturing ();

	uninitdevice ();

	closedevice ();

	if(rgb) free(rgb);
	if(ybuf) free(ybuf);
        
	fd = -1;

}
Beispiel #6
0
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;

}
Beispiel #7
0
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]);
	}
}