File tree Expand file tree Collapse file tree 3 files changed +20
-7
lines changed
samples/drivers/video/capture Expand file tree Collapse file tree 3 files changed +20
-7
lines changed Original file line number Diff line number Diff line change @@ -3,13 +3,13 @@ CONFIG_USB_HOST_STACK=y
3
3
CONFIG_USBH_VIDEO_CLASS=y
4
4
5
5
# Video buffer configuration
6
- CONFIG_VIDEO_BUFFER_POOL_SZ_MAX=154000
7
- CONFIG_VIDEO_BUFFER_POOL_NUM_MAX=2
6
+ CONFIG_VIDEO_BUFFER_POOL_SZ_MAX=116000
7
+ CONFIG_VIDEO_BUFFER_POOL_NUM_MAX=6
8
8
CONFIG_VIDEO_BUFFER_POOL_ALIGN=32
9
9
10
10
11
11
# Memory configuration for USB transfers
12
- CONFIG_HEAP_MEM_POOL_SIZE=70000
13
- CONFIG_MAIN_STACK_SIZE=80960
12
+ CONFIG_HEAP_MEM_POOL_SIZE=40960
13
+ CONFIG_MAIN_STACK_SIZE=10240
14
14
CONFIG_USBH_USB_DEVICE_HEAP=8912
15
- CONFIG_UHC_BUF_POOL_SIZE=4096
15
+ CONFIG_UHC_BUF_POOL_SIZE=4096
Original file line number Diff line number Diff line change @@ -11,4 +11,6 @@ CONFIG_REQUIRES_FLOAT_PRINTF=y
11
11
CONFIG_DEBUG_OPTIMIZATIONS=y
12
12
CONFIG_USBH_VIDEO_LOG_LEVEL_WRN=y
13
13
CONFIG_VIDEO_FRAME_WIDTH=320
14
- CONFIG_VIDEO_FRAME_HEIGHT=240
14
+ CONFIG_VIDEO_FRAME_HEIGHT=180
15
+ CONFIG_VIDEO_TARGET_FPS=15
16
+ CONFIG_USBH_VIDEO_MULTIPLE_PRIME_COUNT=8
Original file line number Diff line number Diff line change @@ -399,6 +399,18 @@ int main(void)
399
399
fie .index ++ ;
400
400
}
401
401
402
+ #if CONFIG_VIDEO_TARGET_FPS > 0
403
+ frmival .denominator = CONFIG_VIDEO_TARGET_FPS ;
404
+ frmival .numerator = 1 ;
405
+ if (!video_set_frmival (uvc_host , & frmival )) {
406
+ /* Get the actual frame rate that was set */
407
+ if (!video_get_frmival (uvc_host , & frmival )) {
408
+ LOG_INF ("- Target frame rate set to: %f fps" ,
409
+ 1.0 * frmival .denominator / frmival .numerator );
410
+ }
411
+ }
412
+ #endif
413
+
402
414
/* Get supported controls */
403
415
LOG_INF ("- Supported controls:" );
404
416
const struct device * last_dev = NULL ;
@@ -456,7 +468,6 @@ int main(void)
456
468
break ;
457
469
}
458
470
459
- /* TODO: CONFIG_VIDEO_BUFFER_POOL_NUM_MAX is 1 now, consider to use multiple video buffers */
460
471
for (i = 0 ; i < CONFIG_VIDEO_BUFFER_POOL_NUM_MAX ; i ++ ) {
461
472
/*
462
473
* For some hardwares, such as the PxP used on i.MX RT1170 to do image rotation,
You can’t perform that action at this time.
0 commit comments