summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorhathach <[email protected]>2021-10-11 23:18:24 +0700
committerhathach <[email protected]>2021-10-11 23:18:24 +0700
commit4d170614dc31c083f8b96add1393156c89670dd7 (patch)
treefab0cf61dc2b296dbaa8d95888b8d1bed36104d8 /examples
parentb3bfce2cb7213df3d875133de26321542e7ecf08 (diff)
rename some video constants
Diffstat (limited to 'examples')
-rw-r--r--examples/device/video_capture/src/main.c2
-rw-r--r--examples/device/video_capture/src/tusb_config.h7
-rw-r--r--examples/device/video_capture/src/usb_descriptors.h66
3 files changed, 34 insertions, 41 deletions
diff --git a/examples/device/video_capture/src/main.c b/examples/device/video_capture/src/main.c
index f0f4df6eb..a2d95c8f9 100644
--- a/examples/device/video_capture/src/main.c
+++ b/examples/device/video_capture/src/main.c
@@ -202,7 +202,7 @@ int tud_video_commit_cb(uint_fast8_t ctl_idx, uint_fast8_t stm_idx,
(void)ctl_idx; (void)stm_idx;
/* convert unit to ms from 100 ns */
interval_ms = parameters->dwFrameInterval / 10000;
- return VIDEO_NO_ERROR;
+ return VIDEO_ERROR_NONE;
}
//--------------------------------------------------------------------+
diff --git a/examples/device/video_capture/src/tusb_config.h b/examples/device/video_capture/src/tusb_config.h
index 5d2d5470c..4feb6a48a 100644
--- a/examples/device/video_capture/src/tusb_config.h
+++ b/examples/device/video_capture/src/tusb_config.h
@@ -91,16 +91,11 @@
#endif
//------------- CLASS -------------//
-#define CFG_TUD_CDC 0
-#define CFG_TUD_MSC 0
-#define CFG_TUD_HID 0
-#define CFG_TUD_MIDI 0
-#define CFG_TUD_AUDIO 0
// The number of video control interfaces
#define CFG_TUD_VIDEO 1
+
// The number of video streaming interfaces
#define CFG_TUD_VIDEO_STREAMING 1
-#define CFG_TUD_VENDOR 0
// video streaming endpoint size
#define CFG_TUD_VIDEO_STREAMING_EP_BUFSIZE 256
diff --git a/examples/device/video_capture/src/usb_descriptors.h b/examples/device/video_capture/src/usb_descriptors.h
index 403dc56a1..340b3f799 100644
--- a/examples/device/video_capture/src/usb_descriptors.h
+++ b/examples/device/video_capture/src/usb_descriptors.h
@@ -75,40 +75,38 @@ enum {
#define TUD_VIDEO_CAPTURE_DESCRIPTOR(_stridx, _epin, _width, _height, _fps, _epsize) \
TUD_VIDEO_DESC_IAD(ITF_NUM_VIDEO_CONTROL, ITF_NUM_TOTAL, _stridx), \
- /* Video control 0 */ \
- TUD_VIDEO_DESC_STD_VC(ITF_NUM_VIDEO_CONTROL, 0, _stridx), \
- TUD_VIDEO_DESC_CS_VC( /* UVC 1.5*/ 0x0150, \
- /* wTotalLength - bLength */ \
- TUD_VIDEO_DESC_INPUT_TERM_LEN + TUD_VIDEO_DESC_OUTPUT_TERM_LEN, \
- UVC_CLOCK_FREQUENCY, 1), \
- TUD_VIDEO_DESC_INPUT_TERM(UVC_ENTITY_CAP_INPUT_TERMINAL,\
- VIDEO_TT_COMPOSITE_CONNECTOR, 0, 0), \
- TUD_VIDEO_DESC_OUTPUT_TERM(UVC_ENTITY_CAP_OUTPUT_TERMINAL,\
- VIDEO_TT_STREAMING, 0, 1, 0), \
- /* Video stream alt. 0 */ \
- TUD_VIDEO_DESC_STD_VS( 1, 0, 0, 0), \
- /* Video stream header for without still image capture */ \
- TUD_VIDEO_DESC_CS_VS_INPUT( /*bNumFormats*/1, \
- /*wTotalLength - bLength */\
- TUD_VIDEO_DESC_CS_VS_FMT_UNCOMPR_LEN\
- + TUD_VIDEO_DESC_CS_VS_FRM_UNCOMPR_CONT_LEN\
- + TUD_VIDEO_DESC_CS_VS_COLOR_MATCHING_LEN,\
- _epin, /*bmInfo*/0, /*bTerminalLink*/UVC_ENTITY_CAP_OUTPUT_TERMINAL, \
- /*bStillCaptureMethod*/0, /*bTriggerSupport*/0, /*bTriggerUsage*/0, \
- /*bmaControls(1)*/0), \
- /* Video stream format */ \
- TUD_VIDEO_DESC_CS_VS_FMT_YUY2(/*bFormatIndex*/1, /*bNumFrameDescriptors*/1, \
- /*bDefaultFrameIndex*/1, 0, 0, 0, /*bCopyProtect*/0), \
- /* Video stream frame format */ \
- TUD_VIDEO_DESC_CS_VS_FRM_UNCOMPR_CONT(/*bFrameIndex */1, 0, _width, _height, \
- _width * _height * 16, _width * _height * 16 * _fps, \
- _width * _height * 16, \
- (10000000/_fps), (10000000/_fps), 10000000, 100000), \
- TUD_VIDEO_DESC_CS_VS_COLOR_MATCHING(VIDEO_COLOR_PRIMARIES_BT709, VIDEO_COLOR_XFER_CH_BT709, VIDEO_COLOR_COEF_SMPTE170M), \
- /* VS alt 1 */\
- TUD_VIDEO_DESC_STD_VS(1, 1, 1, 0), \
- /* EP */ \
- TUD_VIDEO_DESC_EP_ISO(_epin, _epsize, 1)
+ /* Video control 0 */ \
+ TUD_VIDEO_DESC_STD_VC(ITF_NUM_VIDEO_CONTROL, 0, _stridx), \
+ TUD_VIDEO_DESC_CS_VC( /* UVC 1.5*/ 0x0150, \
+ /* wTotalLength - bLength */ \
+ TUD_VIDEO_DESC_INPUT_TERM_LEN + TUD_VIDEO_DESC_OUTPUT_TERM_LEN, \
+ UVC_CLOCK_FREQUENCY, 1), \
+ TUD_VIDEO_DESC_INPUT_TERM(UVC_ENTITY_CAP_INPUT_TERMINAL, VIDEO_ETT_COMPOSITE_CONNECTOR, 0, 0), \
+ TUD_VIDEO_DESC_OUTPUT_TERM(UVC_ENTITY_CAP_OUTPUT_TERMINAL, VIDEO_TT_STREAMING, 0, 1, 0), \
+ /* Video stream alt. 0 */ \
+ TUD_VIDEO_DESC_STD_VS( 1, 0, 0, 0), \
+ /* Video stream header for without still image capture */ \
+ TUD_VIDEO_DESC_CS_VS_INPUT( /*bNumFormats*/1, \
+ /*wTotalLength - bLength */\
+ TUD_VIDEO_DESC_CS_VS_FMT_UNCOMPR_LEN\
+ + TUD_VIDEO_DESC_CS_VS_FRM_UNCOMPR_CONT_LEN\
+ + TUD_VIDEO_DESC_CS_VS_COLOR_MATCHING_LEN,\
+ _epin, /*bmInfo*/0, /*bTerminalLink*/UVC_ENTITY_CAP_OUTPUT_TERMINAL, \
+ /*bStillCaptureMethod*/0, /*bTriggerSupport*/0, /*bTriggerUsage*/0, \
+ /*bmaControls(1)*/0), \
+ /* Video stream format */ \
+ TUD_VIDEO_DESC_CS_VS_FMT_YUY2(/*bFormatIndex*/1, /*bNumFrameDescriptors*/1, \
+ /*bDefaultFrameIndex*/1, 0, 0, 0, /*bCopyProtect*/0), \
+ /* Video stream frame format */ \
+ TUD_VIDEO_DESC_CS_VS_FRM_UNCOMPR_CONT(/*bFrameIndex */1, 0, _width, _height, \
+ _width * _height * 16, _width * _height * 16 * _fps, \
+ _width * _height * 16, \
+ (10000000/_fps), (10000000/_fps), 10000000, 100000), \
+ TUD_VIDEO_DESC_CS_VS_COLOR_MATCHING(VIDEO_COLOR_PRIMARIES_BT709, VIDEO_COLOR_XFER_CH_BT709, VIDEO_COLOR_COEF_SMPTE170M), \
+ /* VS alt 1 */\
+ TUD_VIDEO_DESC_STD_VS(1, 1, 1, 0), \
+ /* EP */ \
+ TUD_VIDEO_DESC_EP_ISO(_epin, _epsize, 1)
#endif