File tree Expand file tree Collapse file tree 11 files changed +48
-12
lines changed
host/class/uvc/usb_host_uvc Expand file tree Collapse file tree 11 files changed +48
-12
lines changed Original file line number Diff line number Diff line change 1+ ## 2.3.2
2+
3+ - Added SOI check to prevent output of corrupted MJPEG frames
4+ - Moved ` usb_types_uvc.h ` to ` private_include ` directory
5+
16## 2.3.1
27
38- Added support for ESP32-H4
Original file line number Diff line number Diff line change 1212#include < cstdint>
1313
1414#include " usb/usb_types_stack.h"
15- #include " usb/ usb_types_uvc.h"
15+ #include " usb_types_uvc.h"
1616
1717extern " C" {
1818#include " Mockusb_host.h"
Original file line number Diff line number Diff line change 11# # IDF Component Manager Manifest File
2- version : " 2.3.1 "
2+ version : " 2.3.2 "
33description : USB Host UVC driver
44url : https://github.com/espressif/esp-usb/tree/master/host/class/uvc/usb_host_uvc
55dependencies :
Original file line number Diff line number Diff line change 77#pragma once
88
99#include "usb/uvc_host.h"
10+ #include "usb_types_uvc.h"
1011
1112#ifdef __cplusplus
1213extern "C" {
Original file line number Diff line number Diff line change 88
99#include <stdbool.h>
1010#include "usb/usb_host.h"
11- #include "usb/usb_types_uvc.h"
1211#include "esp_err.h"
1312
1413// Use this macros for opening a UVC stream with any VID or PID
File renamed without changes.
Original file line number Diff line number Diff line change 1010// So we include only files with USB specification definitions
1111// This interface is also used in host_tests
1212#include "usb/usb_types_ch9.h"
13- #include "usb/ usb_types_uvc.h"
13+ #include "usb_types_uvc.h"
1414
1515#define UVC_DESC_FPS_TO_DWFRAMEINTERVAL (fps ) (((fps) != 0) ? 10000000.0f / (fps) : 0)
1616#define UVC_DESC_DWFRAMEINTERVAL_TO_FPS (dwFrameInterval ) (((dwFrameInterval) != 0) ? 10000000.0f / ((float)(dwFrameInterval)) : 0)
Original file line number Diff line number Diff line change 1212
1313#include "usb/usb_host.h"
1414#include "usb/uvc_host.h"
15+ #include "usb_types_uvc.h"
1516
1617#include "freertos/FreeRTOS.h"
1718#include "freertos/queue.h"
Original file line number Diff line number Diff line change @@ -125,6 +125,14 @@ void bulk_transfer_callback(usb_transfer_t *transfer)
125125 uvc_stream -> single_thread .current_frame_id = payload_header -> bmHeaderInfo .frame_id ;
126126 uvc_stream -> single_thread .skip_current_frame = payload_header -> bmHeaderInfo .error ; // Check for error flag
127127
128+ // Check mjpeg frame start
129+ if (uvc_stream -> dynamic .vs_format .format == UVC_VS_FORMAT_MJPEG &&
130+ payload_data [payload_header -> bHeaderLength ] != 0xff && payload_data [1 + payload_header -> bHeaderLength ] != 0xd8 ) {
131+ // We received frame with invalid frame, skip this frame
132+ uvc_stream -> single_thread .skip_current_frame = true;
133+ ESP_LOGW (TAG , "invalid MJPEG SOI" );
134+ }
135+
128136 // Get free frame buffer for this new frame
129137 UVC_ENTER_CRITICAL ();
130138 const bool need_new_frame = (uvc_stream -> dynamic .streaming && !uvc_stream -> dynamic .current_frame );
Original file line number Diff line number Diff line change 1212
1313#include "uvc_control.h"
1414#include "usb/usb_types_ch9.h"
15- #include "usb/ usb_types_uvc.h"
15+ #include "usb_types_uvc.h"
1616#include "uvc_types_priv.h"
1717#include "uvc_descriptors_priv.h"
1818#include "uvc_check_priv.h"
You can’t perform that action at this time.
0 commit comments