summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2024-01-30 10:00:26 +0700
committerGitHub <[email protected]>2024-01-30 10:00:26 +0700
commit7a92038bc4ccd668dd1f8a6f322228dfe60dd115 (patch)
treeb972c878dbb7820bb47fb601c7e317d5f81b2072
parentb4c0530fda3031010e4badd8e1af54eb10aa1f46 (diff)
parent073a7a5659f06ce623e1081ac5f5566408fba670 (diff)
Merge pull request #2428 from YixingShen/master
update video_capture
-rw-r--r--examples/device/video_capture/src/main.c2
-rw-r--r--src/class/video/video.h2
2 files changed, 3 insertions, 1 deletions
diff --git a/examples/device/video_capture/src/main.c b/examples/device/video_capture/src/main.c
index 091eb8d0c..2a2b0961f 100644
--- a/examples/device/video_capture/src/main.c
+++ b/examples/device/video_capture/src/main.c
@@ -193,6 +193,7 @@ void video_send_frame(void) {
if (!already_sent) {
already_sent = 1;
+ tx_busy = 1;
start_ms = board_millis();
#ifdef CFG_EXAMPLE_VIDEO_READONLY
#if defined(CFG_EXAMPLE_VIDEO_DISABLE_MJPEG)
@@ -211,6 +212,7 @@ void video_send_frame(void) {
if (cur - start_ms < interval_ms) return; // not enough time
if (tx_busy) return;
start_ms += interval_ms;
+ tx_busy = 1;
#ifdef CFG_EXAMPLE_VIDEO_READONLY
#if defined(CFG_EXAMPLE_VIDEO_DISABLE_MJPEG)
diff --git a/src/class/video/video.h b/src/class/video/video.h
index fb0d0af1d..6319c6536 100644
--- a/src/class/video/video.h
+++ b/src/class/video/video.h
@@ -647,7 +647,7 @@ TU_VERIFY_STATIC( sizeof(video_probe_and_commit_control_t) == 48, "size is not c
/* Motion-JPEG 3.1.1 Table 3-2 and 3-4 */
#define TUD_VIDEO_DESC_CS_VS_FRM_MJPEG_DISC(_frmidx, _cap, _width, _height, _minbr, _maxbr, _maxfrmbufsz, _frminterval, ...) \
TUD_VIDEO_DESC_CS_VS_FRM_MJPEG_DISC_LEN + (TU_ARGS_NUM(__VA_ARGS__)) * 4, \
- TUSB_DESC_CS_INTERFACE, VIDEO_CS_VS_INTERFACE_FRAME_MJPEG, \
+ TUSB_DESC_CS_INTERFACE, VIDEO_CS_ITF_VS_FRAME_MJPEG, \
_frmidx, _cap, U16_TO_U8S_LE(_width), U16_TO_U8S_LE(_height), U32_TO_U8S_LE(_minbr), U32_TO_U8S_LE(_maxbr), \
U32_TO_U8S_LE(_maxfrmbufsz), U32_TO_U8S_LE(_frminterval), (TU_ARGS_NUM(__VA_ARGS__)), __VA_ARGS__