libuvcc  0.41a
simple uvc implementation for os x
 All Data Structures Functions Variables Typedefs Enumerations Groups Pages
Main

Modules

 QT-kit helpers
 
 Cam strings
 
 Non-standard helpers
 

Functions

int uvccInit ()
 
void uvccExit ()
 
CFStringRef uvccVersion ()
 
int uvccGetCamList (uvccCam ***list)
 
int uvccGetCamsWithModelID (struct uvccModelID *mID, uvccCam ***list)
 
void uvccReleaseCamList (uvccCam **list, int len)
 
void uvccReleaseCam (uvccCam *cam)
 
uint8_t uvccCamSupportsRequest (uvccCam *cam, enum uvccRequest request)
 
int uvccUni2Char (UniChar *src, char *dst, int len, int errChar)
 
int uvccOpenCam (uvccCam *cam)
 
void uvccCloseCam (uvccCam *cam)
 
int uvccSendRequest (uvccCam *cam, uint8_t bRequest, enum uvccRequest uvccReq, void *pData)
 
int uvccSendEURequest (uvccCam *cam, uint8_t euIndex, uint8_t reqIndex, uint8_t bRequest, uint16_t wLength, void *pData)
 
int uvccSendRawRequest (uvccCam *cam, IOUSBDevRequest *request)
 
int uvccSendInfoRequest (uvccCam *cam, enum uvccRequest uvccReq, int8_t *pData)
 
CFStringRef uvccErrorStr ()
 

Detailed Description

Functions to get, release, open, close and send requests to cams.

Function Documentation

uint8_t uvccCamSupportsRequest ( uvccCam cam,
enum uvccRequest  request 
)

Check if cam supports a given request, note that cam does not need to be open for this.

Parameters
cam
request
Returns
1 if camera supports request, 0 if not.
void uvccCloseCam ( uvccCam cam)

Close cam.

Parameters
cam
CFStringRef uvccErrorStr ( )

Retrieves description of last error together with the function that caused it and the corresponding OS X error code. Note that returned CFStringRef (NSString*) must be released.

Returns
CFStringRef to description or NULL on error
void uvccExit ( )

Exits uvcc.

int uvccGetCamList ( uvccCam ***  list)

Populates list with all usb connected cams that have a video control interface. List needs to be released by uvccReleaseCamList(), note that list of length 0 is not allocated and should therefor not be released.

Parameters
listcam double pointer to hold cams
Returns
Length of list or -1
int uvccGetCamsWithModelID ( struct uvccModelID mID,
uvccCam ***  list 
)

Populates list with all usb connected cams that have are identified by modelID. List needs to be released by uvccReleaseCamList(), note that list of length 0 is not allocated and should therefor not be released.

Parameters
mIdmodelID identifying cam
listcam double pointer to hold cams
Returns
Length of list or -1
int uvccInit ( )

Init uvcc.

Returns
0 on success
int uvccOpenCam ( uvccCam cam)

Open cam to be able send requests to it, this takes control over it and does not let any other process send requests while you have it opened.

Parameters
cam
Returns
0 on success != 0 otherwise
void uvccReleaseCam ( uvccCam cam)

Release single cam.

Parameters
cam
void uvccReleaseCamList ( uvccCam **  list,
int  len 
)

Release and free list of cams.

Parameters
listlist of cams
lenlength of list
int uvccSendEURequest ( uvccCam cam,
uint8_t  euIndex,
uint8_t  reqIndex,
uint8_t  bRequest,
uint16_t  wLength,
void *  pData 
)

Send extension unit (EU) request to cam. EUs are basically where the manufacturer can stuff their super secret proprietary functions. The only way to find out what they do is to send requests and see what happens. Each EU may support several different requests and a cam may have several EUs. The number of EUs on a cam is uvccCam::nEUs, the number of requests EU n supports is uvccCam::nEUReqs[n].
Note: According to the UVC standard if bRequest = UVC_GET_LEN (see UVC bRequest values) then wLength = 2.

Parameters
cam
euIndexzero-based index of the EU
reqIndexzero-based index of the request in the EU
bRequestuvc request to send, valid values are those in UVC bRequest values
wLengthlength of the data
pDatadata to send or buf to receive data in
Returns
0 on success or error code
int uvccSendInfoRequest ( uvccCam cam,
enum uvccRequest  uvccReq,
int8_t *  pData 
)

Kind of wrapper for UVC_GET_INFO. Result can be &'ed with Info flags to see what operations are supported.

Parameters
cam
uvccReqto get info about
pDatabuf to hold result
Returns
0 on success or error code
int uvccSendRawRequest ( uvccCam cam,
IOUSBDevRequest *  request 
)

For the brave.. send a raw request on the default control pipe of the video ctrl interface of the cam!

Parameters
cam
requestto send
Returns
0 on success or error code
int uvccSendRequest ( uvccCam cam,
uint8_t  bRequest,
enum uvccRequest  uvccReq,
void *  pData 
)

Send predefined uvcc request to cam.

Parameters
cam
bRequestuvc request to send, valid values are those in UVC bRequest values
uvccRequvcc request to send, valid values are those in uvccRequest
pDatadata to send or buf to receive data in
Returns
0 on success or error code
int uvccUni2Char ( UniChar *  src,
char *  dst,
int  len,
int  errChar 
)

Convert from UniChar to char.

Parameters
srcsource
dstdestination
lennumber of UniChars to convert
errCharchar to set if src[i] is non-ascii or 0 to skip them
Returns
Length of dst
CFStringRef uvccVersion ( )

uvcc version (CFStringRef can be safely casted to NSString*).

Returns
uvcc version string