psl1ght
A free SDK for Sony's PS3 console
camera.h
1 #ifndef __LV2_CAMERA_H__
2 #define __LV2_CAMERA_H__
3 
4 #include <ppu-types.h>
5 #include <sys/memory.h>
6 
7 #define CAMERA_ERRO_DOUBLE_INIT 0x80140801
8 #define CAMERA_ERRO_NEED_INIT 0x80140803
9 #define CAMERA_ERRO_BAD_PARAM 0x80140804
10 #define CAMERA_ERRO_DOUBLE_OPEN 0x80140805
11 #define CAMERA_ERRO_NEED_OPEN 0x80140806
12 #define CAMERA_ERRO_NO_DEVICE_FOUND 0x80140807
13 #define CAMERA_ERRO_DEVICE_DEACTIVATED 0x80140808
14 #define CAMERA_ERRO_NEED_START 0x80140809
15 #define CAMERA_ERRO_UNKNOWN_FORMAT 0x8014080a
16 #define CAMERA_ERRO_UNKNOWN_RESOLUTION 0x8014080b
17 #define CAMERA_ERRO_BAD_FRAMERATE 0x8014080c
18 #define CAMERA_ERRO_TIMEOUT 0x8014080d
19 #define CAMERA_ERRO_BUSY 0x8014080e
20 #define CAMERA_ERRO_FATAL 0x8014080f
21 #define CAMERA_ERRO_MUTEX 0x80140810
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 typedef enum _camera_attrib
28 {
29  CAM_ATTR_GAIN,
30  CAM_ATTR_RED_BLUE_GAIN,
31  CAM_ATTR_SATURATION,
32  CAM_ATTR_EXPOSURE,
33  CAM_ATTR_BRIGHTNESS,
34  CAM_ATTR_AUTO_EXPOSURE,
35  CAM_ATTR_AUTO_GAIN_CONTROL,
36  CAM_ATTR_AUTO_WHITE_BALANCE,
37  CAM_ATTR_AUTO_BRIGHTNESS,
38  CAM_ATTR_LED,
39  CAM_ATTR_AUDIO_GAIN,
40  CAM_ATTR_QS,
41  CAM_ATTR_NONZERO_COEFFS,
42  CAM_ATTR_YUV_FLAG,
43  CAM_ATTR_JPEG_FLAG,
44  CAM_ATTR_BACKLIGHT_COMPENSATION,
45  CAM_ATTR_MIRROR_FLAG,
46  CAM_ATTR_MEASURED_QS,
47  CAM_ATTR_422_FLAG,
48  CAM_ATTR_USBLOAD,
49  CAM_ATTR_GAMMA,
50  CAM_ATTR_GREEN_GAIN,
51  CAM_ATTR_AUTO_GAIN_CONTROL_LIMIT,
52  CAM_ATTR_DENOISE,
53  CAM_ATTR_FRAMERATE_ADJUST,
54  CAM_ATTR_PIXEL_OUTLIER_FILTER,
55  CAM_ATTR_AUTO_GAIN_CONTROL_LOW,
56  CAM_ATTR_AUTO_GAIN_CONTROL_HIGH,
57 
58  CAM_ATTR_FORMAT_CAP=100,
59  CAM_ATTR_FORMAT_INDEX,
60  CAM_ATTR_FRAME_NUM,
61  CAM_ATTR_FRAME_INDEX,
62  CAM_ATTR_FRAME_SIZE,
63  CAM_ATTR_INTERVAL_TYPE,
64  CAM_ATTR_INTERVAL_INDEX,
65  CAM_ATTR_INTERVAL_VALUE,
66  CAM_ATTR_COLOR_MATCHING,
67  CAM_ATTR_PL_FREQ,
68  CAM_ATTR_DEV_ID,
69  CAM_ATTR_DEV_CAP,
70  CAM_ATTR_DEV_SPEED,
71  CAM_ATTR_USBVIDCLASS_REQUEST_CODE,
72  CAM_ATTR_USBVIDCLASS_REQUEST_DATA,
73  CAM_ATTR_DEVICE_ID,
74 
75  CAM_ATTR_READ_MODE=300,
76  CAM_ATTR_GAME_PID,
77  CAM_ATTR_PBUFFER,
78  CAM_ATTR_READ_FINISH,
79 
80  CAM_ATTR_UNKNOWN=500,
81 } cameraAttrib;
82 
83 typedef enum _camera_type
84 {
85  CAM_TYPE_UNKNOWN,
86  CAM_TYPE_EYETOY,
87  CAM_TYPE_PLAYSTATION_EYE,
88  CAM_TYPE_USBVIDEO_CLASS,
89 } cameraType;
90 
91 typedef enum _camera_format
92 {
93  CAM_FORM_UNKNOWN,
94  CAM_FORM_JPG,
95  CAM_FORM_RAW8,
96  CAM_FORM_YUV422,
97  CAM_FORM_RAW10,
98  CAM_FORM_RGBA,
99  CAM_FORM_YUV420
100 } cameraFormat;
101 
102 typedef enum _camera_resolution
103 {
104  CAM_RESO_UNKNOWN,
105  CAM_RESO_VGA,
106  CAM_RESO_QVGA,
107  CAM_RESO_WGA,
108  CAM_RESO_SPECIFIED
109 } cameraResolution;
110 
111 typedef struct _camera_info
112 {
113  cameraFormat format;
114  cameraResolution resolution;
115  s32 framerate;
116  u32 buffer;
117  s32 bytesize;
118  s32 width;
119  s32 height;
120  s32 dev_num;
121  s32 guid;
122  s32 info_ver;
123  sys_mem_container_t container;
124 } cameraInfo;
125 
126 typedef struct _camera_info_ex
127 {
128  cameraFormat format;
129  cameraResolution resolution;
130  s32 framerate;
131  u32 buffer;
132  s32 bytesize;
133  s32 width;
134  s32 height;
135  s32 dev_num;
136  s32 guid;
137 
138  s32 info_ver;
139  sys_mem_container_t container;
140 
141  s32 readmode;
142  u32 pbuf[2];
143 } cameraInfoEx;
144 
145 typedef struct _camera_read_info
146 {
147  s32 version;
148  u32 frame;
149  u32 readcount;
150  s64 timestamp;
151  u32 buffer;
153 
154 s32 cameraInit();
155 s32 cameraEnd();
156 s32 cameraStart(s32 num);
157 s32 cameraStop(s32 num);
158 s32 cameraOpenEx(s32 num,cameraInfoEx *info);
159 s32 cameraClose(s32 num);
160 
161 s32 cameraRead(s32 num,u32 *frame,u32 *readcount);
162 s32 cameraReadEx(s32 num,cameraReadInfo *info);
163 s32 cameraGetBufferInfoEx(s32 num,cameraInfoEx *info);
164 s32 cameraReset(s32 num);
165 s32 cameraGetAttribute(s32 num,cameraAttrib attribute,u32* arg0,u32* arg1);
166 s32 cameraSetAttribute(s32 num,cameraAttrib attribute,u32 arg0,u32 arg1);
167 s32 cameraGetType(s32 num,cameraType* type);
168 s32 cameraGetDeviceGUID(s32 num,u32* guid);
169 s32 cameraGetBufferSize(s32 num,cameraInfoEx* info);
170 
171 s32 cameraIsStarted(s32 num);
172 s32 cameraIsOpen(s32 num);
173 s32 cameraIsAvailable(s32 num);
174 s32 cameraIsAttached(s32 num);
175 
176 s32 cameraSetNotifyEventQueue(u64 key);
177 s32 cameraSetNotifyEventQueue2(u64 key,u64 source,u64 flag);
178 s32 cameraRemoveNotifyEventQueue(u64 key);
179 s32 cameraRemoveNotifyEventQueue2(u64 key);
180 s32 cameraReadComplete(s32 num,u32 buf,u32 arg);
181 s32 cameraPrepExtensionUnit(s32 num,u8* guidExtCode);
182 s32 cameraCtrlExtensionUnit(s32 num,u8 req,u16 wval,u16 wlen,u8* data);
183 s32 cameraGetExtensionUnit(s32 num,u16 wval,u16 wlen,u8* data);
184 s32 cameraSetExtensionUnit(s32 num,u16 wval,u16 wlen,u8* data);
185 
186 #ifdef __cplusplus
187  }
188 #endif
189 
190 #endif
Definition: camera.h:126
Definition: camera.h:145
Memory management functions.
Definition: camera.h:111