wut  v1.7.0
Wii U Toolchain
Data Structures | Macros | Typedefs | Enumerations | Enumerator | Functions | Variables
Camera

Data Structures

struct  CAMEventData
 
struct  CAMMode
 
struct  CAMWorkMem
 
struct  CAMStreamInfo
 
struct  CAMSetupInfo
 
struct  CAMSurface
 
union  CAMEventData.__unnamed1__
 
struct  CAMEventData.__unnamed1__.decode
 
struct  CAMEventData.__unnamed1__.detach
 

Macros

#define CAMERA_WIDTH   640
 
#define CAMERA_PITCH   768
 
#define CAMERA_HEIGHT   480
 
#define CAMERA_Y_BUFFER_SIZE   (CAMERA_PITCH * CAMERA_HEIGHT)
 
#define CAMERA_UV_BUFFER_SIZE   (CAMERA_PITCH * CAMERA_HEIGHT / 2)
 
#define CAMERA_YUV_BUFFER_SIZE   (CAMERA_Y_BUFFER_SIZE + CAMERA_UV_BUFFER_SIZE)
 
#define CAMERA_YUV_BUFFER_ALIGNMENT   256
 

Typedefs

typedef int CAMHandle
 
typedef int CAMError
 
typedef struct CAMEventData CAMEventData
 
typedef struct CAMMode CAMMode
 
typedef struct CAMWorkMem CAMWorkMem
 
typedef struct CAMStreamInfo CAMStreamInfo
 
typedef struct CAMSetupInfo CAMSetupInfo
 
typedef struct CAMSurface CAMSurface
 
typedef enum CamError CamError
 
typedef enum CamFps CamFps
 
typedef enum CamStreamType CamStreamType
 
typedef enum CamEventType CamEventType
 
typedef void(* CAMEventHandler) (CAMEventData *camEventData)
 

Enumerations

enum  CamError {
  CAMERA_ERROR_OK = 0 ,
  CAMERA_ERROR_INVALID_ARG = -1 ,
  CAMERA_ERROR_INVALID_HANDLE = -2 ,
  CAMERA_ERROR_TOO_MANY_SURFACES = -4 ,
  CAMERA_ERROR_INSUFFICIENT_MEMORY = -5 ,
  CAMERA_ERROR_NOT_READY = -6 ,
  CAMERA_ERROR_UNINITIALIZED = -8 ,
  CAMERA_ERROR_UVC = -9 ,
  CAMERA_ERROR_UVD_CONTEXT = -10 ,
  CAMERA_ERROR_DEVICE_IN_USE = -12 ,
  CAMERA_ERROR_UVD_SESSION = -13 ,
  CAMERA_ERROR_SEGMENT_VIOLATION = -15
}
 
enum  CamFps {
  CAMERA_FPS_15 = 0 ,
  CAMERA_FPS_30 = 1
}
 
enum  CamStreamType { CAMERA_STREAM_TYPE_1 = 0 }
 
enum  CamEventType {
  CAMERA_DECODE_DONE = 0 ,
  CAMERA_DRC_DETACH = 1
}
 

Functions

CAMHandle CAMInit (int instance, CAMSetupInfo *setupInfo, CAMError *err)
 Initialize the camera. More...
 
void CAMExit (CAMHandle handle)
 Deinitialize and clean up. More...
 
CAMError CAMOpen (CAMHandle handle)
 Start recording and decoding frames. More...
 
CAMError CAMClose (CAMHandle handle)
 Stops recording and decoding. More...
 
int32_t CAMGetMemReq (CAMStreamInfo *streamInfo)
 Get the number of bytes requied by the work memory. More...
 
CAMError CAMSubmitTargetSurface (CAMHandle handle, CAMSurface *surface)
 Submit 1 surface to the working queue. More...
 
CAMError CAMCheckMemSegmentation (void *pMem, uint32_t size)
 Checks whether memory is segmented correctly to be used with the camera library. More...
 

Variables

CamEventType eventType
 Event type. More...
 
void * surfaceBuffer
 Pointer to the buffer of the decoded image. More...
 
CAMHandle handle
 Handle of instance. More...
 
BOOL failed
 TRUE if decode failed. More...
 
struct {
void * surfaceBuffer
 Pointer to the buffer of the decoded image. More...
 
CAMHandle handle
 Handle of instance. More...
 
BOOL failed
 TRUE if decode failed. More...
 
decode
 
BOOL connected
 Will be FALSE. More...
 
CAMHandle handle
 Handle of instance. More...
 
struct {
BOOL connected
 Will be FALSE. More...
 
CAMHandle handle
 Handle of instance. More...
 
detach
 
uint32_t args [3]
 Event args. More...
 
union {
   struct {
void * surfaceBuffer
 Pointer to the buffer of the decoded image. More...
 
CAMHandle handle
 Handle of instance. More...
 
BOOL failed
 TRUE if decode failed. More...
 
   } decode
 
   struct {
BOOL connected
 Will be FALSE. More...
 
CAMHandle handle
 Handle of instance. More...
 
   } detach
 
uint32_t args [3]
 Event args. More...
 
}; 
 
BOOL forceDrc
 If TRUE, the GamePad will display the camera output regardless of what is being rendered. More...
 
CamFps fps
 Framerate setting. More...
 
uint32_t size
 Size of the work memory. More...
 
void * pMem
 Pointer to the work memory. More...
 
CamStreamType type
 Stream type, only CAMERA_STREAM_TYPE_1 is valid. More...
 
uint32_t height
 Stream height. More...
 
uint32_t width
 Stream width. More...
 
CAMStreamInfo streamInfo
 Stream info. More...
 
CAMWorkMem workMem
 Memory used by library to record and decode frames. More...
 
CAMEventHandler eventHandler
 Event handler. More...
 
CAMMode mode
 Camera mode. More...
 
uint32_t threadAffinity
 See OS_THREAD_ATTRIB. More...
 
int32_t surfaceSize
 Number of bytes allocated to surface buffer. More...
 
void * surfaceBuffer
 Surface buffer data. More...
 
int32_t height
 Surface height. More...
 
int32_t width
 Surface width. More...
 
int32_t pitch
 Surface pitch. More...
 
int32_t alignment
 Surface alignment. More...
 
int32_t tileMode
 Tile mode, should be zero. More...
 
int32_t pixelFormat
 Pixel format, Should be zero. More...
 

Detailed Description


Data Structure Documentation

◆ CAMEventData

struct CAMEventData

Definition at line 68 of file camera.h.

Data Fields
CamEventType eventType Event type.
union CAMEventData __unnamed__

◆ CAMMode

struct CAMMode

Definition at line 105 of file camera.h.

Data Fields
BOOL forceDrc If TRUE, the GamePad will display the camera output regardless of what is being rendered.
CamFps fps Framerate setting.

◆ CAMWorkMem

struct CAMWorkMem

Definition at line 116 of file camera.h.

Data Fields
uint32_t size Size of the work memory.
void * pMem Pointer to the work memory.

◆ CAMStreamInfo

struct CAMStreamInfo

Definition at line 127 of file camera.h.

Data Fields
CamStreamType type Stream type, only CAMERA_STREAM_TYPE_1 is valid.
uint32_t height Stream height.
uint32_t width Stream width.

◆ CAMSetupInfo

struct CAMSetupInfo

Definition at line 141 of file camera.h.

Data Fields
CAMStreamInfo streamInfo Stream info.
CAMWorkMem workMem Memory used by library to record and decode frames.
CAMEventHandler eventHandler Event handler.
CAMMode mode Camera mode.
uint32_t threadAffinity See OS_THREAD_ATTRIB.

◆ CAMSurface

struct CAMSurface

Definition at line 162 of file camera.h.

Data Fields
int32_t surfaceSize Number of bytes allocated to surface buffer.
void * surfaceBuffer Surface buffer data.
int32_t height Surface height.
int32_t width Surface width.
int32_t pitch Surface pitch.
int32_t alignment Surface alignment.
int32_t tileMode Tile mode, should be zero.
int32_t pixelFormat Pixel format, Should be zero.

◆ CAMEventData.__unnamed1__

union CAMEventData.__unnamed1__

Definition at line 72 of file camera.h.

Data Fields
__unnamed1__ decode
__unnamed1__ detach
uint32_t args[3] Event args.

◆ CAMEventData.__unnamed1__.decode

struct CAMEventData.__unnamed1__.decode

Definition at line 74 of file camera.h.

Data Fields
void * surfaceBuffer Pointer to the buffer of the decoded image.
CAMHandle handle Handle of instance.
BOOL failed TRUE if decode failed.

◆ CAMEventData.__unnamed1__.detach

struct CAMEventData.__unnamed1__.detach

Definition at line 83 of file camera.h.

Data Fields
BOOL connected Will be FALSE.
CAMHandle handle Handle of instance.

Macro Definition Documentation

◆ CAMERA_WIDTH

#define CAMERA_WIDTH   640

Definition at line 15 of file camera.h.

◆ CAMERA_PITCH

#define CAMERA_PITCH   768

Definition at line 16 of file camera.h.

◆ CAMERA_HEIGHT

#define CAMERA_HEIGHT   480

Definition at line 17 of file camera.h.

◆ CAMERA_Y_BUFFER_SIZE

#define CAMERA_Y_BUFFER_SIZE   (CAMERA_PITCH * CAMERA_HEIGHT)

Definition at line 19 of file camera.h.

◆ CAMERA_UV_BUFFER_SIZE

#define CAMERA_UV_BUFFER_SIZE   (CAMERA_PITCH * CAMERA_HEIGHT / 2)

Definition at line 20 of file camera.h.

◆ CAMERA_YUV_BUFFER_SIZE

#define CAMERA_YUV_BUFFER_SIZE   (CAMERA_Y_BUFFER_SIZE + CAMERA_UV_BUFFER_SIZE)

Definition at line 21 of file camera.h.

◆ CAMERA_YUV_BUFFER_ALIGNMENT

#define CAMERA_YUV_BUFFER_ALIGNMENT   256

Definition at line 23 of file camera.h.

Typedef Documentation

◆ CAMHandle

typedef int CAMHandle

Definition at line 25 of file camera.h.

◆ CAMError

typedef int CAMError

Definition at line 26 of file camera.h.

◆ CAMEventData

typedef struct CAMEventData CAMEventData

Definition at line 26 of file camera.h.

◆ CAMMode

typedef struct CAMMode CAMMode

Definition at line 26 of file camera.h.

◆ CAMWorkMem

typedef struct CAMWorkMem CAMWorkMem

Definition at line 26 of file camera.h.

◆ CAMStreamInfo

typedef struct CAMStreamInfo CAMStreamInfo

Definition at line 26 of file camera.h.

◆ CAMSetupInfo

typedef struct CAMSetupInfo CAMSetupInfo

Definition at line 26 of file camera.h.

◆ CAMSurface

typedef struct CAMSurface CAMSurface

Definition at line 26 of file camera.h.

◆ CamError

typedef enum CamError CamError

◆ CamFps

typedef enum CamFps CamFps

◆ CamStreamType

◆ CamEventType

typedef enum CamEventType CamEventType

◆ CAMEventHandler

typedef void(* CAMEventHandler) (CAMEventData *camEventData)

Definition at line 103 of file camera.h.

Enumeration Type Documentation

◆ CamError

enum CamError
Enumerator
CAMERA_ERROR_OK 
CAMERA_ERROR_INVALID_ARG 
CAMERA_ERROR_INVALID_HANDLE 
CAMERA_ERROR_TOO_MANY_SURFACES 
CAMERA_ERROR_INSUFFICIENT_MEMORY 
CAMERA_ERROR_NOT_READY 
CAMERA_ERROR_UNINITIALIZED 
CAMERA_ERROR_UVC 
CAMERA_ERROR_UVD_CONTEXT 
CAMERA_ERROR_DEVICE_IN_USE 
CAMERA_ERROR_UVD_SESSION 
CAMERA_ERROR_SEGMENT_VIOLATION 

Definition at line 35 of file camera.h.

◆ CamFps

enum CamFps
Enumerator
CAMERA_FPS_15 
CAMERA_FPS_30 

Definition at line 51 of file camera.h.

◆ CamStreamType

Enumerator
CAMERA_STREAM_TYPE_1 

Definition at line 57 of file camera.h.

◆ CamEventType

Enumerator
CAMERA_DECODE_DONE 
CAMERA_DRC_DETACH 

Definition at line 62 of file camera.h.

Function Documentation

◆ CAMInit()

CAMHandle CAMInit ( int  instance,
CAMSetupInfo setupInfo,
CAMError err 
)

Initialize the camera.

Returns
camera handle on success, and -1 on failure

◆ CAMExit()

void CAMExit ( CAMHandle  handle)

Deinitialize and clean up.

◆ CAMOpen()

CAMError CAMOpen ( CAMHandle  handle)

Start recording and decoding frames.

◆ CAMClose()

CAMError CAMClose ( CAMHandle  handle)

Stops recording and decoding.

Automatically called when the process is moved to background

◆ CAMGetMemReq()

int32_t CAMGetMemReq ( CAMStreamInfo streamInfo)

Get the number of bytes requied by the work memory.

Returns
number of bytes
CAM_ERROR_INVALID_ARG if streamInfo is NULL

◆ CAMSubmitTargetSurface()

CAMError CAMSubmitTargetSurface ( CAMHandle  handle,
CAMSurface surface 
)

Submit 1 surface to the working queue.

Once the frame is captured and decoded, the event handler set in CAMInit will fire, and the frame will be dequeued. Up to 20 surfaces may be queued. Surface data is returned in the NV12 format

◆ CAMCheckMemSegmentation()

CAMError CAMCheckMemSegmentation ( void *  pMem,
uint32_t  size 
)

Checks whether memory is segmented correctly to be used with the camera library.

Variable Documentation

◆ eventType

CamEventType eventType

Event type.

Definition at line 71 of file camera.h.

◆ surfaceBuffer [1/2]

void* surfaceBuffer

Pointer to the buffer of the decoded image.

Definition at line 77 of file camera.h.

◆ handle [1/2]

CAMHandle handle

Handle of instance.

Definition at line 79 of file camera.h.

◆ failed

BOOL failed

TRUE if decode failed.

Definition at line 81 of file camera.h.

◆ 

struct { ... } decode

◆ connected

BOOL connected

Will be FALSE.

Definition at line 86 of file camera.h.

◆ handle [2/2]

CAMHandle handle

Handle of instance.

Definition at line 88 of file camera.h.

◆ 

struct { ... } detach

◆ args

uint32_t args[3]

Event args.

Definition at line 91 of file camera.h.

◆ 

union { ... }

◆ forceDrc

BOOL forceDrc

If TRUE, the GamePad will display the camera output regardless of what is being rendered.

Definition at line 108 of file camera.h.

◆ fps

CamFps fps

Framerate setting.

Definition at line 110 of file camera.h.

◆ size

uint32_t size

Size of the work memory.

Definition at line 119 of file camera.h.

◆ pMem

void* pMem

Pointer to the work memory.

Definition at line 121 of file camera.h.

◆ type

Stream type, only CAMERA_STREAM_TYPE_1 is valid.

Definition at line 130 of file camera.h.

◆ height [1/2]

uint32_t height

Stream height.

Definition at line 132 of file camera.h.

◆ width [1/2]

uint32_t width

Stream width.

Definition at line 134 of file camera.h.

◆ streamInfo

CAMStreamInfo streamInfo

Stream info.

Definition at line 144 of file camera.h.

◆ workMem

CAMWorkMem workMem

Memory used by library to record and decode frames.

Definition at line 146 of file camera.h.

◆ eventHandler

CAMEventHandler eventHandler

Event handler.

Definition at line 148 of file camera.h.

◆ mode

CAMMode mode

Camera mode.

Definition at line 150 of file camera.h.

◆ threadAffinity

uint32_t threadAffinity

See OS_THREAD_ATTRIB.

Definition at line 152 of file camera.h.

◆ surfaceSize

int32_t surfaceSize

Number of bytes allocated to surface buffer.

Definition at line 165 of file camera.h.

◆ surfaceBuffer [2/2]

void* surfaceBuffer

Surface buffer data.

Definition at line 167 of file camera.h.

◆ height [2/2]

int32_t height

Surface height.

Definition at line 169 of file camera.h.

◆ width [2/2]

int32_t width

Surface width.

Definition at line 171 of file camera.h.

◆ pitch

int32_t pitch

Surface pitch.

Definition at line 173 of file camera.h.

◆ alignment

int32_t alignment

Surface alignment.

Definition at line 175 of file camera.h.

◆ tileMode

int32_t tileMode

Tile mode, should be zero.

Definition at line 177 of file camera.h.

◆ pixelFormat

int32_t pixelFormat

Pixel format, Should be zero.

Definition at line 179 of file camera.h.