PSPSDK 2024-12-16
Loading...
Searching...
No Matches
pspusbcam.h File Reference

Go to the source code of this file.

Data Structures

struct  PspUsbCamSetupStillParam
 Structure for sceUsbCamSetupStill. More...
 
struct  PspUsbCamSetupStillExParam
 Structure for sceUsbCamSetupStillEx. More...
 
struct  PspUsbCamSetupVideoParam
 
struct  PspUsbCamSetupVideoExParam
 

Macros

#define PSP_USBCAM_PID   (0x282)
 
#define PSP_USBCAM_DRIVERNAME   "USBCamDriver"
 
#define PSP_USBCAMMIC_DRIVERNAME   "USBCamMicDriver"
 

Typedefs

typedef struct PspUsbCamSetupStillParam PspUsbCamSetupStillParam
 Structure for sceUsbCamSetupStill.
 
typedef struct PspUsbCamSetupStillExParam PspUsbCamSetupStillExParam
 Structure for sceUsbCamSetupStillEx.
 
typedef struct PspUsbCamSetupVideoParam PspUsbCamSetupVideoParam
 
typedef struct PspUsbCamSetupVideoExParam PspUsbCamSetupVideoExParam
 

Enumerations

enum  PspUsbCamResolution {
  PSP_USBCAM_RESOLUTION_160_120 = 0 , PSP_USBCAM_RESOLUTION_176_144 = 1 , PSP_USBCAM_RESOLUTION_320_240 = 2 , PSP_USBCAM_RESOLUTION_352_288 = 3 ,
  PSP_USBCAM_RESOLUTION_640_480 = 4 , PSP_USBCAM_RESOLUTION_1024_768 = 5 , PSP_USBCAM_RESOLUTION_1280_960 = 6 , PSP_USBCAM_RESOLUTION_480_272 = 7 ,
  PSP_USBCAM_RESOLUTION_360_272 = 8
}
 Resolutions for sceUsbCamSetupStill & sceUsbCamSetupVideo DO NOT use on sceUsbCamSetupStillEx & sceUsbCamSetupVideoEx. More...
 
enum  PspUsbCamResolutionEx {
  PSP_USBCAM_RESOLUTION_EX_160_120 = 0 , PSP_USBCAM_RESOLUTION_EX_176_144 = 1 , PSP_USBCAM_RESOLUTION_EX_320_240 = 2 , PSP_USBCAM_RESOLUTION_EX_352_288 = 3 ,
  PSP_USBCAM_RESOLUTION_EX_360_272 = 4 , PSP_USBCAM_RESOLUTION_EX_480_272 = 5 , PSP_USBCAM_RESOLUTION_EX_640_480 = 6 , PSP_USBCAM_RESOLUTION_EX_1024_768 = 7 ,
  PSP_USBCAM_RESOLUTION_EX_1280_960 = 8
}
 Resolutions for sceUsbCamSetupStillEx & sceUsbCamSetupVideoEx DO NOT use on sceUsbCamSetupStill & sceUsbCamSetupVideo. More...
 
enum  PspUsbCamReverseFlags { PSP_USBCAM_FLIP = 1 , PSP_USBCAM_MIRROR = 0x100 }
 Flags for reverse effects. More...
 
enum  PspUsbCamDelay { PSP_USBCAM_NODELAY = 0 , PSP_USBCAM_DELAY_10SEC = 1 , PSP_USBCAM_DELAY_20SEC = 2 , PSP_USBCAM_DELAY_30SEC = 3 }
 Delay to take pictures. More...
 
enum  PspUsbCamFrameRate {
  PSP_USBCAM_FRAMERATE_3_75_FPS = 0 , PSP_USBCAM_FRAMERATE_5_FPS = 1 , PSP_USBCAM_FRAMERATE_7_5_FPS = 2 , PSP_USBCAM_FRAMERATE_10_FPS = 3 ,
  PSP_USBCAM_FRAMERATE_15_FPS = 4 , PSP_USBCAM_FRAMERATE_20_FPS = 5 , PSP_USBCAM_FRAMERATE_30_FPS = 6 , PSP_USBCAM_FRAMERATE_60_FPS = 7
}
 Usbcam framerates. More...
 
enum  PspUsbCamWB { PSP_USBCAM_WB_AUTO = 0 , PSP_USBCAM_WB_DAYLIGHT = 1 , PSP_USBCAM_WB_FLUORESCENT = 2 , PSP_USBCAM_WB_INCADESCENT = 3 }
 White balance values. More...
 
enum  PspUsbCamEffectMode {
  PSP_USBCAM_EFFECTMODE_NORMAL = 0 , PSP_USBCAM_EFFECTMODE_NEGATIVE = 1 , PSP_USBCAM_EFFECTMODE_BLACKWHITE = 2 , PSP_USBCAM_EFFECTMODE_SEPIA = 3 ,
  PSP_USBCAM_EFFECTMODE_BLUE = 4 , PSP_USBCAM_EFFECTMODE_RED = 5 , PSP_USBCAM_EFFECTMODE_GREEN = 6
}
 Effect modes. More...
 
enum  PspUsbCamEVLevel {
  PSP_USBCAM_EVLEVEL_2_0_POSITIVE = 0 , PSP_USBCAM_EVLEVEL_1_7_POSITIVE = 1 , PSP_USBCAM_EVLEVEL_1_5_POSITIVE = 2 , PSP_USBCAM_EVLEVEL_1_3_POSITIVE = 3 ,
  PSP_USBCAM_EVLEVEL_1_0_POSITIVE = 4 , PSP_USBCAM_EVLEVEL_0_7_POSITIVE = 5 , PSP_USBCAM_EVLEVEL_0_5_POSITIVE = 6 , PSP_USBCAM_EVLEVEL_0_3_POSITIVE = 7 ,
  PSP_USBCAM_EVLEVEL_0_0 = 8 , PSP_USBCAM_EVLEVEL_0_3_NEGATIVE = 9 , PSP_USBCAM_EVLEVEL_0_5_NEGATIVE = 10 , PSP_USBCAM_EVLEVEL_0_7_NEGATIVE = 11 ,
  PSP_USBCAM_EVLEVEL_1_0_NEGATIVE = 12 , PSP_USBCAM_EVLEVEL_1_3_NEGATIVE = 13 , PSP_USBCAM_EVLEVEL_1_5_NEGATIVE = 14 , PSP_USBCAM_EVLEVEL_1_7_NEGATIVE = 15 ,
  PSP_USBCAM_EVLEVEL_2_0_NEGATIVE = 16
}
 Exposure levels. More...
 

Functions

int sceUsbCamSetupStill (PspUsbCamSetupStillParam *param)
 Setups the parameters to take a still image.
 
int sceUsbCamSetupStillEx (PspUsbCamSetupStillExParam *param)
 Setups the parameters to take a still image (with more options)
 
int sceUsbCamStillInputBlocking (u8 *buf, SceSize size)
 Gets a still image.
 
int sceUsbCamStillInput (u8 *buf, SceSize size)
 Gets a still image.
 
int sceUsbCamStillWaitInputEnd (void)
 Waits untils still input has been finished.
 
int sceUsbCamStillPollInputEnd (void)
 Polls the status of still input completion.
 
int sceUsbCamStillCancelInput (void)
 Cancels the still input.
 
int sceUsbCamStillGetInputLength (void)
 Gets the size of the acquired still image.
 
int sceUsbCamSetupVideo (PspUsbCamSetupVideoParam *param, void *workarea, int wasize)
 Set ups the parameters for video capture.
 
int sceUsbCamSetupVideoEx (PspUsbCamSetupVideoExParam *param, void *workarea, int wasize)
 Set ups the parameters for video capture (with more options)
 
int sceUsbCamStartVideo (void)
 Starts video input from the camera.
 
int sceUsbCamStopVideo (void)
 Stops video input from the camera.
 
int sceUsbCamReadVideoFrameBlocking (u8 *buf, SceSize size)
 Reads a video frame.
 
int sceUsbCamReadVideoFrame (u8 *buf, SceSize size)
 Reads a video frame.
 
int sceUsbCamWaitReadVideoFrameEnd (void)
 Waits untils the current frame has been read.
 
int sceUsbCamPollReadVideoFrameEnd (void)
 Polls the status of video frame read completion.
 
int sceUsbCamGetReadVideoFrameSize (void)
 Gets the size of the acquired frame.
 
int sceUsbCamSetSaturation (int saturation)
 Sets the saturation.
 
int sceUsbCamSetBrightness (int brightness)
 Sets the brightness.
 
int sceUsbCamSetContrast (int contrast)
 Sets the contrast.
 
int sceUsbCamSetSharpness (int sharpness)
 Sets the sharpness.
 
int sceUsbCamSetImageEffectMode (int effectmode)
 Sets the image effect mode.
 
int sceUsbCamSetEvLevel (int ev)
 Sets the exposure level.
 
int sceUsbCamSetReverseMode (int reverseflags)
 Sets the reverse mode.
 
int sceUsbCamSetZoom (int zoom)
 Sets the zoom.
 
int sceUsbCamGetSaturation (int *saturation)
 Gets the current saturation.
 
int sceUsbCamGetBrightness (int *brightness)
 Gets the current brightness.
 
int sceUsbCamGetContrast (int *contrast)
 Gets the current contrast.
 
int sceUsbCamGetSharpness (int *sharpness)
 Gets the current sharpness.
 
int sceUsbCamGetImageEffectMode (int *effectmode)
 Gets the current image efect mode.
 
int sceUsbCamGetEvLevel (int *ev)
 Gets the current exposure level.
 
int sceUsbCamGetReverseMode (int *reverseflags)
 Gets the current reverse mode.
 
int sceUsbCamGetZoom (int *zoom)
 Gets the current zoom.
 
int sceUsbCamAutoImageReverseSW (int on)
 Sets if the image should be automatically reversed, depending of the position of the camera.
 
int sceUsbCamGetAutoImageReverseState (void)
 Gets the state of the autoreversal of the image.
 
int sceUsbCamGetLensDirection (void)
 Gets the direction of the camera lens.
 

Macro Definition Documentation

◆ PSP_USBCAM_DRIVERNAME

#define PSP_USBCAM_DRIVERNAME   "USBCamDriver"

◆ PSP_USBCAM_PID

#define PSP_USBCAM_PID   (0x282)

◆ PSP_USBCAMMIC_DRIVERNAME

#define PSP_USBCAMMIC_DRIVERNAME   "USBCamMicDriver"

Typedef Documentation

◆ PspUsbCamSetupStillExParam

◆ PspUsbCamSetupStillParam

◆ PspUsbCamSetupVideoExParam

◆ PspUsbCamSetupVideoParam

Enumeration Type Documentation

◆ PspUsbCamDelay

Delay to take pictures.

Enumerator
PSP_USBCAM_NODELAY 
PSP_USBCAM_DELAY_10SEC 
PSP_USBCAM_DELAY_20SEC 
PSP_USBCAM_DELAY_30SEC 

◆ PspUsbCamEffectMode

Effect modes.

Enumerator
PSP_USBCAM_EFFECTMODE_NORMAL 
PSP_USBCAM_EFFECTMODE_NEGATIVE 
PSP_USBCAM_EFFECTMODE_BLACKWHITE 
PSP_USBCAM_EFFECTMODE_SEPIA 
PSP_USBCAM_EFFECTMODE_BLUE 
PSP_USBCAM_EFFECTMODE_RED 
PSP_USBCAM_EFFECTMODE_GREEN 

◆ PspUsbCamEVLevel

Exposure levels.

Enumerator
PSP_USBCAM_EVLEVEL_2_0_POSITIVE 
PSP_USBCAM_EVLEVEL_1_7_POSITIVE 
PSP_USBCAM_EVLEVEL_1_5_POSITIVE 
PSP_USBCAM_EVLEVEL_1_3_POSITIVE 
PSP_USBCAM_EVLEVEL_1_0_POSITIVE 
PSP_USBCAM_EVLEVEL_0_7_POSITIVE 
PSP_USBCAM_EVLEVEL_0_5_POSITIVE 
PSP_USBCAM_EVLEVEL_0_3_POSITIVE 
PSP_USBCAM_EVLEVEL_0_0 
PSP_USBCAM_EVLEVEL_0_3_NEGATIVE 
PSP_USBCAM_EVLEVEL_0_5_NEGATIVE 
PSP_USBCAM_EVLEVEL_0_7_NEGATIVE 
PSP_USBCAM_EVLEVEL_1_0_NEGATIVE 
PSP_USBCAM_EVLEVEL_1_3_NEGATIVE 
PSP_USBCAM_EVLEVEL_1_5_NEGATIVE 
PSP_USBCAM_EVLEVEL_1_7_NEGATIVE 
PSP_USBCAM_EVLEVEL_2_0_NEGATIVE 

◆ PspUsbCamFrameRate

Usbcam framerates.

Enumerator
PSP_USBCAM_FRAMERATE_3_75_FPS 
PSP_USBCAM_FRAMERATE_5_FPS 
PSP_USBCAM_FRAMERATE_7_5_FPS 
PSP_USBCAM_FRAMERATE_10_FPS 
PSP_USBCAM_FRAMERATE_15_FPS 
PSP_USBCAM_FRAMERATE_20_FPS 
PSP_USBCAM_FRAMERATE_30_FPS 
PSP_USBCAM_FRAMERATE_60_FPS 

◆ PspUsbCamResolution

Resolutions for sceUsbCamSetupStill & sceUsbCamSetupVideo DO NOT use on sceUsbCamSetupStillEx & sceUsbCamSetupVideoEx.

Enumerator
PSP_USBCAM_RESOLUTION_160_120 
PSP_USBCAM_RESOLUTION_176_144 
PSP_USBCAM_RESOLUTION_320_240 
PSP_USBCAM_RESOLUTION_352_288 
PSP_USBCAM_RESOLUTION_640_480 
PSP_USBCAM_RESOLUTION_1024_768 
PSP_USBCAM_RESOLUTION_1280_960 
PSP_USBCAM_RESOLUTION_480_272 
PSP_USBCAM_RESOLUTION_360_272 

◆ PspUsbCamResolutionEx

Resolutions for sceUsbCamSetupStillEx & sceUsbCamSetupVideoEx DO NOT use on sceUsbCamSetupStill & sceUsbCamSetupVideo.

Enumerator
PSP_USBCAM_RESOLUTION_EX_160_120 
PSP_USBCAM_RESOLUTION_EX_176_144 
PSP_USBCAM_RESOLUTION_EX_320_240 
PSP_USBCAM_RESOLUTION_EX_352_288 
PSP_USBCAM_RESOLUTION_EX_360_272 
PSP_USBCAM_RESOLUTION_EX_480_272 
PSP_USBCAM_RESOLUTION_EX_640_480 
PSP_USBCAM_RESOLUTION_EX_1024_768 
PSP_USBCAM_RESOLUTION_EX_1280_960 

◆ PspUsbCamReverseFlags

Flags for reverse effects.

Enumerator
PSP_USBCAM_FLIP 
PSP_USBCAM_MIRROR 

◆ PspUsbCamWB

White balance values.

Enumerator
PSP_USBCAM_WB_AUTO 
PSP_USBCAM_WB_DAYLIGHT 
PSP_USBCAM_WB_FLUORESCENT 
PSP_USBCAM_WB_INCADESCENT 

Function Documentation

◆ sceUsbCamAutoImageReverseSW()

int sceUsbCamAutoImageReverseSW ( int  on)

Sets if the image should be automatically reversed, depending of the position of the camera.

Parameters
on- 1 to set the automatical reversal of the image, 0 to set it off
Returns
0 on success, < 0 on error

◆ sceUsbCamGetAutoImageReverseState()

int sceUsbCamGetAutoImageReverseState ( void  )

Gets the state of the autoreversal of the image.

Returns
1 if it is set to automatic, 0 otherwise

◆ sceUsbCamGetBrightness()

int sceUsbCamGetBrightness ( int brightness)

Gets the current brightness.

Parameters
brightness- pointer to a variable that receives the current brightness
Returns
0 on success, < 0 on error

◆ sceUsbCamGetContrast()

int sceUsbCamGetContrast ( int contrast)

Gets the current contrast.

Parameters
contrast- pointer to a variable that receives the current contrast
Returns
0 on success, < 0 on error

◆ sceUsbCamGetEvLevel()

int sceUsbCamGetEvLevel ( int ev)

Gets the current exposure level.

Parameters
ev- pointer to a variable that receives the current exposure level
Returns
0 on success, < 0 on error

◆ sceUsbCamGetImageEffectMode()

int sceUsbCamGetImageEffectMode ( int effectmode)

Gets the current image efect mode.

Parameters
effectmode- pointer to a variable that receives the current effect mode
Returns
0 on success, < 0 on error

◆ sceUsbCamGetLensDirection()

int sceUsbCamGetLensDirection ( void  )

Gets the direction of the camera lens.

Returns
1 if the camera is "looking to you", 0 if the camera is "looking to the other side".

◆ sceUsbCamGetReadVideoFrameSize()

int sceUsbCamGetReadVideoFrameSize ( void  )

Gets the size of the acquired frame.

Returns
the size of the acquired frame on success, < 0 on error

◆ sceUsbCamGetReverseMode()

int sceUsbCamGetReverseMode ( int reverseflags)

Gets the current reverse mode.

Parameters
reverseflags- pointer to a variable that receives the current reverse mode flags
Returns
0 on success, < 0 on error

◆ sceUsbCamGetSaturation()

int sceUsbCamGetSaturation ( int saturation)

Gets the current saturation.

Parameters
saturation- pointer to a variable that receives the current saturation
Returns
0 on success, < 0 on error

◆ sceUsbCamGetSharpness()

int sceUsbCamGetSharpness ( int sharpness)

Gets the current sharpness.

Parameters
sharpness- pointer to a variable that receives the current sharpness
Returns
0 on success, < 0 on error

◆ sceUsbCamGetZoom()

int sceUsbCamGetZoom ( int zoom)

Gets the current zoom.

Parameters
zoom- pointer to a variable that receives the current zoom
Returns
0 on success, < 0 on error

◆ sceUsbCamPollReadVideoFrameEnd()

int sceUsbCamPollReadVideoFrameEnd ( void  )

Polls the status of video frame read completion.

Returns
the size of the acquired frame if it has been read, 0 if the frame has not yet been read, < 0 on error.

◆ sceUsbCamReadVideoFrame()

int sceUsbCamReadVideoFrame ( u8 buf,
SceSize  size 
)

Reads a video frame.

The function returns inmediately, and the completion has to be handled by calling sceUsbCamWaitReadVideoFrameEnd or sceUsbCamPollReadVideoFrameEnd.

Parameters
buf- The buffer that receives the frame jpeg data
size- The size of the buffer.
Returns
0 on success, < 0 on error

◆ sceUsbCamReadVideoFrameBlocking()

int sceUsbCamReadVideoFrameBlocking ( u8 buf,
SceSize  size 
)

Reads a video frame.

The function doesn't return until the frame has been acquired.

Parameters
buf- The buffer that receives the frame jpeg data
size- The size of the buffer.
Returns
size of acquired frame on success, < 0 on error

◆ sceUsbCamSetBrightness()

int sceUsbCamSetBrightness ( int  brightness)

Sets the brightness.

Parameters
brightness- The brightness (0-255)
Returns
0 on success, < 0 on error

◆ sceUsbCamSetContrast()

int sceUsbCamSetContrast ( int  contrast)

Sets the contrast.

Parameters
contrast- The contrast (0-255)
Returns
0 on success, < 0 on error

◆ sceUsbCamSetEvLevel()

int sceUsbCamSetEvLevel ( int  ev)

Sets the exposure level.

Parameters
ev- The exposure level, one of PspUsbCamEVLevel
Returns
0 on success, < 0 on error

◆ sceUsbCamSetImageEffectMode()

int sceUsbCamSetImageEffectMode ( int  effectmode)

Sets the image effect mode.

Parameters
effectmode- The effect mode, one of PspUsbCamEffectMode
Returns
0 on success, < 0 on error

◆ sceUsbCamSetReverseMode()

int sceUsbCamSetReverseMode ( int  reverseflags)

Sets the reverse mode.

Parameters
reverseflags- The reverse flags, zero or more of PspUsbCamReverseFlags
Returns
0 on success, < 0 on error

◆ sceUsbCamSetSaturation()

int sceUsbCamSetSaturation ( int  saturation)

Sets the saturation.

Parameters
saturation- The saturation (0-255)
Returns
0 on success, < 0 on error

◆ sceUsbCamSetSharpness()

int sceUsbCamSetSharpness ( int  sharpness)

Sets the sharpness.

Parameters
sharpness- The sharpness (0-255)
Returns
0 on success, < 0 on error

◆ sceUsbCamSetupStill()

int sceUsbCamSetupStill ( PspUsbCamSetupStillParam param)

Setups the parameters to take a still image.

Parameters
param- pointer to a PspUsbCamSetupStillParam
Returns
0 on success, < 0 on error

◆ sceUsbCamSetupStillEx()

int sceUsbCamSetupStillEx ( PspUsbCamSetupStillExParam param)

Setups the parameters to take a still image (with more options)

Parameters
param- pointer to a PspUsbCamSetupStillExParam
Returns
0 on success, < 0 on error

◆ sceUsbCamSetupVideo()

int sceUsbCamSetupVideo ( PspUsbCamSetupVideoParam param,
void workarea,
int  wasize 
)

Set ups the parameters for video capture.

Parameters
param- Pointer to a PspUsbCamSetupVideoParam structure.
workarea- Pointer to a buffer used as work area by the driver.
wasize- Size of the work area.
Returns
0 on success, < 0 on error

◆ sceUsbCamSetupVideoEx()

int sceUsbCamSetupVideoEx ( PspUsbCamSetupVideoExParam param,
void workarea,
int  wasize 
)

Set ups the parameters for video capture (with more options)

Parameters
param- Pointer to a PspUsbCamSetupVideoExParam structure.
workarea- Pointer to a buffer used as work area by the driver.
wasize- Size of the work area.
Returns
0 on success, < 0 on error

◆ sceUsbCamSetZoom()

int sceUsbCamSetZoom ( int  zoom)

Sets the zoom.

Parameters
zoom- The zoom level starting by 10. (10 = 1X, 11 = 1.1X, etc)
Returns
0 on success, < 0 on error

◆ sceUsbCamStartVideo()

int sceUsbCamStartVideo ( void  )

Starts video input from the camera.

Returns
0 on success, < 0 on error

◆ sceUsbCamStillCancelInput()

int sceUsbCamStillCancelInput ( void  )

Cancels the still input.

Returns
0 on success, < 0 on error

◆ sceUsbCamStillGetInputLength()

int sceUsbCamStillGetInputLength ( void  )

Gets the size of the acquired still image.

Returns
the size of the acquired image on success, < 0 on error

◆ sceUsbCamStillInput()

int sceUsbCamStillInput ( u8 buf,
SceSize  size 
)

Gets a still image.

The function returns inmediately, and the completion has to be handled by calling sceUsbCamStillWaitInputEnd or sceUsbCamStillPollInputEnd.

Parameters
buf- The buffer that receives the image jpeg data
size- The size of the buffer.
Returns
0 on success, < 0 on error

◆ sceUsbCamStillInputBlocking()

int sceUsbCamStillInputBlocking ( u8 buf,
SceSize  size 
)

Gets a still image.

The function doesn't return until the image has been acquired.

Parameters
buf- The buffer that receives the image jpeg data
size- The size of the buffer.
Returns
size of acquired image on success, < 0 on error

◆ sceUsbCamStillPollInputEnd()

int sceUsbCamStillPollInputEnd ( void  )

Polls the status of still input completion.

Returns
the size of the acquired image if still input has ended, 0 if the input has not ended, < 0 on error.

◆ sceUsbCamStillWaitInputEnd()

int sceUsbCamStillWaitInputEnd ( void  )

Waits untils still input has been finished.

Returns
the size of the acquired image on sucess, < 0 on error

◆ sceUsbCamStopVideo()

int sceUsbCamStopVideo ( void  )

Stops video input from the camera.

Returns
0 on success, < 0 on error

◆ sceUsbCamWaitReadVideoFrameEnd()

int sceUsbCamWaitReadVideoFrameEnd ( void  )

Waits untils the current frame has been read.

Returns
the size of the acquired frame on sucess, < 0 on error