|
TinyUVC 0.1.0
Header-only USB Video Class (UVC) device: turn an MCU into a USB webcam
|
Connects a TinyCamera to a UVCDevice. More...
#include <TinyCamera.h>

Classes | |
| struct | Size |
| A camera frame size offered to the host. More... | |
Public Member Functions | |
| UVCCamera (UVCDevice &uvc) | |
| bool | addFrameSize (framesize_t size) |
| void | setFps (std::initializer_list< uint8_t > fps) |
| void | setFps (uint8_t fps) |
| void | setFormats (bool mjpeg, bool yuy2) |
| void | setRawPixelFormat (pixformat_t fmt) |
| void | setRgb565BigEndian (bool bigEndian) |
| void | setMaxJpegSize (uint32_t size) |
| Max JPEG size reported to the host (0 = width * height * 2) | |
| bool | begin (const camera_config_t &config, bool startDevice=true) |
| void | end () |
| Stops the camera. | |
| bool | copy () |
| tiny_camera::TinyCamera & | camera () |
| The camera (e.g. for sensor settings: camera().sensor()) | |
| uint32_t | frames () const |
| Number of frames sent. | |
Protected Member Functions | |
| bool | configure (framesize_t size, pixformat_t fmt) |
| (Re)starts the camera with the frame size and pixel format if needed | |
| bool | applySettings (const UVCStreamSettings &s) |
| bool | toPixelFormat (pixformat_t in, PixelFormat &out) const |
Protected Attributes | |
| UVCDevice & | uvc_ |
| tiny_camera::TinyCamera | camera_ |
| tiny_camera::TinyCameraFrame | frame_ |
| camera_config_t | config_ {} |
| Size | sizes_ [6] |
| int | sizeCount_ = 0 |
| uint8_t | fps_ [4] = {} |
| int | fpsCount_ = 0 |
| bool | mjpeg_ = false |
| bool | yuy2_ = true |
| bool | formatsSet_ = false |
| pixformat_t | raw_ = PIXFORMAT_RGB565 |
| bool | rgb565BE_ = false |
| uint32_t | maxJpegSize_ = 0 |
| uint32_t | generation_ = 0 |
| uint32_t | lastFrameUs_ = 0 |
| bool | sentOnce_ = false |
| uint32_t | frames_ = 0 |
| bool | configured_ = false |
| framesize_t | curSize_ {} |
| pixformat_t | curFormat_ {} |
Connects a TinyCamera to a UVCDevice.
Offers MJPEG if the camera config uses PIXFORMAT_JPEG (sensors with a JPEG encoder), otherwise YUY2, which is converted on the fly from the camera's RGB565 (or YUV422 / grayscale) frames. When the host selects a different resolution or format, the camera is reconfigured.
|
inlineexplicit |
|
inline |
Offers an additional frame size (call before begin()). Without any call, the frame size of the camera config is offered.
|
inlineprotected |
|
inline |
Starts the camera, determines the offered resolutions (one probe capture per frame size) and starts the UVC device (unless startDevice is false: then call uvc.begin() yourself)
|
inline |
The camera (e.g. for sensor settings: camera().sensor())
|
inlineprotected |
(Re)starts the camera with the frame size and pixel format if needed
|
inline |
Call in loop(): reconfigures the camera when the host (re)starts a stream, and captures and sends a frame when the device is ready and the frame interval selected by the host has passed. Returns true if a frame was sent.
|
inline |
Stops the camera.
|
inline |
Number of frames sent.
Selects the formats offered to the host. Default: MJPEG if the camera config uses PIXFORMAT_JPEG, YUY2 otherwise. With both, the camera is restarted when the host switches between them.
Frame rates offered for every size (call before begin()); the first is the default. Default: 15 fps.
Max JPEG size reported to the host (0 = width * height * 2)
|
inline |
Camera pixel format used for YUY2 streams: PIXFORMAT_RGB565 (default), PIXFORMAT_YUV422 or PIXFORMAT_GRAYSCALE (not on STM32)
Byte order of RGB565 frames. Default: big endian on ESP32 with esp32-camera, little endian everywhere else.
|
inlineprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |