Dana
2025-11-30 5a5240e9db90474d8da4e20d241246d3f1fa2950
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include <jni.h>
#include <android/log.h>
#include <android/bitmap.h>
 
#include <string.h>
 
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
 
#include <fcntl.h>              /* low-level i/o */
#include <unistd.h>
#include <errno.h>
#include <malloc.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
 
#include <asm/types.h>          /* for videodev2.h */
 
#include <linux/videodev2.h>
#include <linux/usbdevice_fs.h>
 
#define  LOG_TAG    "WebCam"
#define  LOGI(...)  __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
#define  LOGE(...)  __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__)
 
#define CLEAR(x) memset (&(x), 0, sizeof (x))
 
#define ERROR_AY_CAMERA -2
#define ERROR_USB_NAME -3
#define ERROR_LOCAL -1
#define SUCCESS_LOCAL 0
 
 
 
 
//
//jint Java_com_anyun_libusbcamera_UsbCamera_prepareCamera( JNIEnv* env,jobject thiz, jint videoid, jintArray resolution, jboolean ay_camera);
//jint Java_com_anyun_libusbcamera_UsbCamera_prepareCameraWithBase( JNIEnv* env,jobject thiz, jint videoid, jint videobase, jintArray resolution, jboolean define_camera);
//jint Java_com_anyun_libusbcamera_UsbCamera_processCamera( JNIEnv* env,jobject thiz);
//void Java_com_anyun_libusbcamera_UsbCamera_stopCamera(JNIEnv* env,jobject thiz);
//void Java_com_anyun_libusbcamera_UsbCamera_pixeltobmp( JNIEnv* env,jobject thiz,jobject bitmap);
//void Java_com_anyun_libusbcamera_UsbCamera_rgba(JNIEnv* env,
//                                                jobject thiz, jint type,jbyteArray output);