Skip to content

Commit 98cc5e6

Browse files
committed
Merge branch 'fix/skip_eof_check_for_some_usb_camera' into 'master'
feat(usb_stream): make header EOF check can be disable See merge request ae_group/esp-iot-solution!1169
2 parents 3e75756 + 724850e commit 98cc5e6

File tree

6 files changed

+15
-5
lines changed

6 files changed

+15
-5
lines changed

components/usb/usb_stream/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# ChangeLog
22

3+
## v1.5.0 - 2024-12-10
4+
5+
### Improvements:
6+
7+
* Make header EOF(1 << 1) check can be disabled by `CONFIG_UVC_CHECK_HEADER_EOF`. Because some non-standard cameras set this bit in the header of every frame.
8+
39
## v1.4.0 - 2024-05-21
410

511
### Improvements:

components/usb/usb_stream/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,17 @@ menu "USB Stream"
8181
config UVC_CHECK_HEADER_EOH
8282
bool "Check EOH bit in payload header"
8383
default n
84+
config UVC_CHECK_HEADER_EOF
85+
bool "Check EOF bit in payload header"
86+
default y
87+
help
88+
"If EOF(1 << 1) is set in the header, it means the current image frame has been completely received."
8489
config UVC_CHECK_BULK_JPEG_HEADER
8590
bool "Check JPEG (ff d8) header in bulk payload"
8691
default y
8792
config UVC_DROP_NO_EOF_FRAME
8893
bool "Drop no EOF image frames"
94+
depends on UVC_CHECK_HEADER_EOF
8995
default n
9096
config UVC_DROP_OVERFLOW_FRAME
9197
bool "Drop overflow image frames"

components/usb/usb_stream/idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "1.4.0"
1+
version: "1.5.0"
22
targets:
33
- esp32s2
44
- esp32s3

components/usb/usb_stream/usb_stream.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2114,13 +2114,15 @@ IRAM_ATTR static void _uvc_process_payload(_uvc_stream_handle_t *strmh, size_t r
21142114
strmh->reassembling = 0;
21152115
}
21162116

2117+
#if CONFIG_UVC_CHECK_HEADER_EOF
21172118
if (header_info & (1 << 1)) {
21182119
/* The EOF bit is set, so publish the complete frame */
21192120
if (strmh->got_bytes != 0) {
21202121
_uvc_swap_buffers(strmh);
21212122
}
21222123
strmh->reassembling = 0;
21232124
}
2125+
#endif
21242126
}
21252127

21262128
/**

examples/usb/host/usb_camera_lcd_display/main/main.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,6 @@ static void _stream_state_changed_cb(usb_stream_state_t event, void *arg)
461461

462462
void app_main(void)
463463
{
464-
esp_log_level_set("*", ESP_LOG_INFO);
465464
/* Initialize NVS */
466465
esp_err_t ret = nvs_flash_init();
467466
if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) {

examples/usb/otg/usb_host_device_mode_manual_switch/main/usb_device_cdc.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ static const char *TAG = "tusb_cdc_acm";
1818
static usb_phy_handle_t phy_hdl = NULL;
1919
static TaskHandle_t uvc_task_hdl = NULL;
2020
static TaskHandle_t cdc_task_hdl = NULL;
21-
static EventGroupHandle_t usb_cdc_device;
2221

2322
//****************************************************TinyUSB callbacks*/
2423
// CDC-ACM
@@ -83,8 +82,6 @@ esp_err_t device_cdc_init(void)
8382
return ESP_FAIL;
8483
}
8584

86-
usb_cdc_device = xEventGroupCreate();
87-
8885
xTaskCreate(tusb_device_task, "tusb_device_task", 4096, NULL, 5, &uvc_task_hdl);
8986
xTaskCreate(cdc_task, "cdc_task", 4096, NULL, 5, &cdc_task_hdl);
9087
ESP_LOGI(TAG, "USB Device CDC Init");

0 commit comments

Comments
 (0)