|
1 |
| -[](https://github.com/esp-arduino-libs/[xxx]/actions/workflows/arduino_lint.yml) [](https://github.com/esp-arduino-libs/[xxx]/actions/workflows/pre-commit.yml) [](https://github.com/esp-arduino-libs/[xxx]/actions/workflows/build_test.yml) |
| 1 | +[](https://github.com/esp-arduino-libs/ESP32_USB_Stream/actions/workflows/arduino_lint.yml) [](https://github.com/esp-arduino-libs/ESP32_USB_Stream/actions/workflows/pre-commit.yml) |
2 | 2 |
|
3 |
| -# [xxx] |
| 3 | +# ESP32_USB_STREAM |
4 | 4 |
|
5 |
| -[xxx] is an Arduino library designed for driving [xxx] using ESP SoCs. |
| 5 | +ESP32_USB_STREAM is an Arduino library designed to support USB UVC + UAC host driver for ESP32-S2/ESP32-S3. It supports read/write/control multimedia streaming from usb device. For example, at most one UVC + one Microphone + one Speaker streaming can be supported at the same time. |
6 | 6 |
|
7 |
| -[xxx] encapsulates the component from the [Espressif Components Registry](https://components.espressif.com/). It is developed based on [arduino-esp32](https://github.com/espressif/arduino-esp32) and can be easily downloaded and integrated into the Arduino IDE. |
| 7 | +ESP32_USB_STREAM encapsulates the component from the [Espressif Components Registry](https://components.espressif.com/). It is developed based on [arduino-esp32](https://github.com/espressif/arduino-esp32) and can be easily downloaded and integrated into the Arduino IDE. |
8 | 8 |
|
9 | 9 | ## Features
|
10 | 10 |
|
11 |
| -* [xxx] |
| 11 | +* Only support for ESP32-S2 and ESP32-S3 SoCs. |
| 12 | +* Support video stream through UVC Stream interface. |
| 13 | +* Support microphone stream and speaker stream through the UAC Stream interface |
| 14 | +* Support volume, mute and other features control through the UAC Control interface |
| 15 | +* Support stream separately suspend and resume |
12 | 16 |
|
13 | 17 | ## Supported Drivers
|
14 | 18 |
|
15 | 19 | | **Driver** | **Version** |
|
16 | 20 | | ------------------------------------------------------------------ | ----------- |
|
17 |
| -| [xxx](https://components.espressif.com/components/espressif/xxx) | | |
18 |
| - |
19 |
| -## Dependencies Version |
20 |
| - |
21 |
| -| **Name** | **Version** | |
22 |
| -| ----------------------------------------------------------- | ----------- | |
23 |
| -| [xxx] | v0.x.x | |
24 |
| -| [arduino-esp32](https://github.com/espressif/arduino-esp32) | >= [xxx] | |
| 21 | +| [usb_stream](https://components.espressif.com/components/espressif/usb_stream) |1.2.0| |
25 | 22 |
|
26 | 23 | ## How to Use
|
27 | 24 |
|
28 | 25 | For information on how to use the library in the Arduino IDE, please refer to the documentation for [Arduino IDE v1.x.x](https://docs.arduino.cc/software/ide-v1/tutorials/installing-libraries) or [Arduino IDE v2.x.x](https://docs.arduino.cc/software/ide-v2/tutorials/ide-v2-installing-a-library).
|
29 | 26 |
|
| 27 | +## Dependencies Version |
| 28 | + |
| 29 | +| **Name** | **Version** | |
| 30 | +| -------------------------------------------------------------------------- | ----------- | |
| 31 | +| [arduino-esp32](https://github.com/espressif/arduino-esp32) | >= v2.0.14 | |
| 32 | + |
30 | 33 | ### Examples
|
31 | 34 |
|
32 |
| -* [xxx](examples/xxx): Demonstrates how to use [xxx] and test all functions. |
| 35 | +* [Getting started with a UVC](examples/GettingStartUVC/): Demonstrates how to use usb video streaming. |
| 36 | +* [Getting started with a UAC](examples/GettingStartUAC/): Demonstrates how to use usb audio streaming. |
33 | 37 |
|
34 | 38 | ### Detailed Usage
|
35 | 39 |
|
36 | 40 | ```cpp
|
37 |
| - [xxx] |
| 41 | +#include "USB_STREAM.h" |
| 42 | + |
| 43 | +// Instantiate a Ustream object |
| 44 | +USB_STREAM *usb = new USB_STREAM(); |
| 45 | + |
| 46 | +// allocate memory |
| 47 | +uint8_t *_xferBufferA = (uint8_t *)malloc(55 * 1024); |
| 48 | +assert(_xferBufferA != NULL); |
| 49 | +uint8_t *_xferBufferB = (uint8_t *)malloc(55 * 1024); |
| 50 | +assert(_xferBufferB != NULL); |
| 51 | +uint8_t *_frameBuffer = (uint8_t *)malloc(55 * 1024); |
| 52 | +assert(_frameBuffer != NULL); |
| 53 | + |
| 54 | +// Config the parameter |
| 55 | +usb->uvcConfiguration(FRAME_RESOLUTION_ANY, FRAME_RESOLUTION_ANY, FRAME_INTERVAL_FPS_15, 55 * 1024, _xferBufferA, _xferBufferB, 55 * 1024, _frameBuffer); |
| 56 | + |
| 57 | + |
| 58 | +//Register the camera frame callback function |
| 59 | +usb->uvcCamRegisterFrameCb(&cameraFramecb, NULL); |
| 60 | + |
| 61 | +usb->start(); |
| 62 | + |
| 63 | +/*Dont forget to free the allocated memory*/ |
| 64 | +// free(_xferBufferA); |
| 65 | +// free(_xferBufferB); |
| 66 | +// free(_frameBuffer); |
| 67 | + |
38 | 68 | ```
|
| 69 | +Note: For additional details and information about the **usb_stream** functionality, please refer to the documentation provided by [ESP-IOT Solutions](https://github.com/espressif/esp-iot-solution/tree/master/components/usb/usb_stream). |
0 commit comments