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
33CONFIG_USBH_VIDEO_CLASS=y
44
55# 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
88CONFIG_VIDEO_BUFFER_POOL_ALIGN=32
99
1010
1111# 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
1414CONFIG_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
1111CONFIG_DEBUG_OPTIMIZATIONS=y
1212CONFIG_USBH_VIDEO_LOG_LEVEL_WRN=y
1313CONFIG_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)
399399 fie .index ++ ;
400400 }
401401
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+
402414 /* Get supported controls */
403415 LOG_INF ("- Supported controls:" );
404416 const struct device * last_dev = NULL ;
@@ -456,7 +468,6 @@ int main(void)
456468 break ;
457469 }
458470
459- /* TODO: CONFIG_VIDEO_BUFFER_POOL_NUM_MAX is 1 now, consider to use multiple video buffers */
460471 for (i = 0 ; i < CONFIG_VIDEO_BUFFER_POOL_NUM_MAX ; i ++ ) {
461472 /*
462473 * 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