Skip to content

Draft: Refactor UVC opening procedure#312

Draft
tore-espressif wants to merge 1 commit intomasterfrom
fix/uvc_bandwidth
Draft

Draft: Refactor UVC opening procedure#312
tore-espressif wants to merge 1 commit intomasterfrom
fix/uvc_bandwidth

Conversation

@tore-espressif
Copy link
Collaborator

@tore-espressif tore-espressif commented Nov 7, 2025

Refactor UVC opening procedure

@tore-espressif tore-espressif self-assigned this Nov 7, 2025
ESP_GOTO_ON_ERROR(
uvc_transfers_allocate(uvc_stream, stream_config->advanced.number_of_urbs, stream_config->advanced.urb_size, ep_desc),
err, TAG,);
ESP_RETURN_ON_ERROR(

Check warning

Code scanning / clang-tidy

Potential leak of memory pointed to by 'uvc_stream' [clang-analyzer-unix.Malloc] Warning

Potential leak of memory pointed to by 'uvc_stream' [clang-analyzer-unix.Malloc]
Refactor UVC stream opening operations to following order:
1. Find and open underlaying USB device (and cache CFG descriptor)
2. Find interface number for requested format: bInterfaceNumber is needed for Control transfers during format negotiation
3. Negotiate the format: negotiated result is needed for correct size of frame buffers and for selecting of bandwidth in ISOC cameras
4. Allocate the frame buffers
5. Find the interface endpoint that fits our requirements and claim it: the endpoint descriptor is needed for proper USB transfer allocation
6. Allocate the USB transfer
@tore-espressif tore-espressif changed the title Draft: UVC bandwidth Draft: Refactor UVC opening procedure Feb 23, 2026
@tore-espressif tore-espressif removed this from the usb_host_uvc 2.5.0 milestone Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant