mirror of
https://github.com/hathach/tinyusb.git
synced 2026-08-18 02:53:35 +00:00
Merge pull request #3802 from dxbjavid/video-payload-cap
clamp committed video payload size to streaming ep buffer
This commit is contained in:
@ -1144,6 +1144,9 @@ static int handle_video_stm_cs_req(uint8_t rhport, uint8_t stage,
|
||||
video_probe_and_commit_control_t *param = &stm->probe_commit_payload;
|
||||
TU_VERIFY(_update_streaming_parameters(stm, param), VIDEO_ERROR_INVALID_VALUE_WITHIN_RANGE);
|
||||
/* Set the negotiated value */
|
||||
if (CFG_TUD_VIDEO_STREAMING_EP_BUFSIZE < param->dwMaxPayloadTransferSize) {
|
||||
param->dwMaxPayloadTransferSize = CFG_TUD_VIDEO_STREAMING_EP_BUFSIZE;
|
||||
}
|
||||
stm->max_payload_transfer_size = param->dwMaxPayloadTransferSize;
|
||||
int ret = tud_video_commit_cb(stm->index_vc, stm->index_vs, param);
|
||||
if (VIDEO_ERROR_NONE == ret) {
|
||||
|
||||
Reference in New Issue
Block a user