UVCClass Class

UVCClass Class

Description
A class used for using USB webcams (USB Video Class) with Ameba.

Syntax
class UVCClass

Members

Public Constructors 
The public constructor should not be used as this class is intended to be a singleton class. Access member functions using the object instance named UVC.
Public Methods 
UVCClass::beginInitialize and start UVC.
UVCClass::endDeinitialize and stop UVC.
UVCClass::avaliableCheck if UVC is ready for streaming.
UVCClass::statusGet the status of UVC and check if UVC is currently streaming.
UVCClass::turnOnEnable streaming.
UVCClass::turnOffDisable streaming.
UVCClass::getJPEGGet a JPEG image.

UVCClass::begin

Description
Initialize and start UVC.

Syntax
void begin(int frame_type, int width, int height, int frame_rate, int compression_ratio, int app_type);
void begin(void);

Parameters
frame_type: frame type. Valid value – UVC_MJPEG or UVC_H264. Default value: UVC_MJPEG.
width: frame width. Default value: 320.
height: frame height. Default value: 240.
frame_rate: video stream frame rate. Default value: 30.
compression_ratio: video compression ratio. Default value: 0.
app_type: application type. Valid value: RTSP_STREAMING or JPEG_CAPTURE. Default value: RTSP_STREAMING.

Returns
NA

Example Code
Example: uvc_jpeg_capture
(https://github.com/ambiot/amb1_arduino/blob/dev/Arduino_package/hardware/libraries/UVC/uvc_jpeg_capture/uvc_jpeg_capture.ino)

Notes and Warnings
“UVC.h” must be included to use the class function.

UVCClass::end

Description
Deinitialize and stop UVC.

Syntax
void end(void);

Parameters
NA

Returns
NA

Example Code
NA

Notes and Warnings
“UVC.h” must be included to use the class function.

UVCClass::avaliable

Description
Check if UVC is ready for streaming.

Syntax
int avaliable(void);

Parameters
NA

Returns
This function returns true if UVC is ready else returns false.

Example Code
Example: uvc_basic
(https://github.com/ambiot/amb1_arduino/blob/dev/Arduino_package/hardware/libraries/UVC/uvc_basic/uvc_basic.ino)

Notes and Warnings
“UVC.h” must be included to use the class function.

UVCClass::status

Description
Get the status of UVC and check if UVC is currently streaming.

Syntax
int status(void);

Parameters
NA

Returns
This function returns true if UVC is streaming.

Example Code
NA

Notes and Warnings
“UVC.h” must be included to use the class function.

UVCClass::turnOn

Description
Enable UVC streaming.

Syntax
int turnOn(void);

Parameters
NA

Returns
This function returns “0” if UVC is turned on for streaming.

Example Code
NA

Notes and Warnings
“UVC.h” must be included to use the class function.

UVCClass::turnOff

Description
Disable UVC streaming.

Syntax
void turnOff(void);

Parameters
NA

Returns
NA

Example Code
NA

Notes and Warnings
“UVC.h” must be included to use the class function.

UVCClass::getJPEG

Description
Get a JPEG image if application type is JPEG capture.

Syntax
int getJPEG(unsigned char* buf);

Parameters
buf: pointer to buffer to store the image.

Returns
The function returns the JPEG size.

Example Code
Example: uvc_jpeg_capture
(https://github.com/ambiot/amb1_arduino/blob/dev/Arduino_package/hardware/libraries/UVC/uvc_jpeg_capture/uvc_jpeg_capture.ino)

Notes and Warnings
“UVC.h” must be included to use the class function.

請先確認已安裝QQ通訊軟體