Skip to content

Commit

Permalink
Merge pull request #2428 from YixingShen/master
Browse files Browse the repository at this point in the history
update video_capture
  • Loading branch information
hathach authored Jan 30, 2024
2 parents b4c0530 + 073a7a5 commit 7a92038
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions examples/device/video_capture/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/class/video/video.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__

Expand Down

0 comments on commit 7a92038

Please sign in to comment.