|
TinyUVC 0.1.0
Header-only USB Video Class (UVC) device: turn an MCU into a USB webcam
|
Produces the UVC payloads of one frame. Each payload starts with a 2 byte header (6 bytes with a presentation time stamp) that carries the frame id bit (FID, toggled per frame) and, in the last payload of the frame, the end of frame bit (EOF). More...
#include <UVCPayload.h>
Public Member Functions | |
| void | begin (const uint8_t *data, size_t len, PixelFormat fmt, bool fid, bool withPts=false, uint32_t pts=0) |
| uint8_t | headerLength () const |
| Header length in bytes. | |
| size_t | fill (uint8_t *buf, size_t maxLen) |
| bool | active () const |
| true while the frame still has data to send | |
| void | abort () |
| Aborts the current frame. | |
| size_t | outputLength () const |
| Size of the frame data as it is sent (after any conversion) | |
Produces the UVC payloads of one frame. Each payload starts with a 2 byte header (6 bytes with a presentation time stamp) that carries the frame id bit (FID, toggled per frame) and, in the last payload of the frame, the end of frame bit (EOF).
The source data is only read while fill() runs: once done() is true the caller may reuse the frame buffer. Raw pixel formats are converted to YUY2 on the fly.
|
inline |
Aborts the current frame.
|
inline |
true while the frame still has data to send
|
inline |
Starts a new frame. For JPEG/YUY2 sources the data is sent as is, other pixel formats are converted to YUY2 (len must then be pixels * bytesPerPixel(fmt), with an even number of pixels).
Writes the next payload (max maxLen bytes) and returns its length. Returns 0 if the frame is complete.
|
inline |
Header length in bytes.
|
inline |
Size of the frame data as it is sent (after any conversion)