@@ -54,6 +54,13 @@ int bcm2835_v4l2_debug;
54
54
module_param_named (debug , bcm2835_v4l2_debug , int , 0644 );
55
55
MODULE_PARM_DESC (bcm2835_v4l2_debug , "Debug level 0-2" );
56
56
57
+ int max_video_width = MAX_VIDEO_MODE_WIDTH ;
58
+ int max_video_height = MAX_VIDEO_MODE_HEIGHT ;
59
+ module_param (max_video_width , int , S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH );
60
+ MODULE_PARM_DESC (max_video_width , "Threshold for video mode" );
61
+ module_param (max_video_height , int , S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH );
62
+ MODULE_PARM_DESC (max_video_height , "Threshold for video mode" );
63
+
57
64
static struct bm2835_mmal_dev * gdev ; /* global device data */
58
65
59
66
#define FPS_MIN 1
@@ -908,8 +915,8 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev,
908
915
switch (mfmt -> mmal_component ) {
909
916
case MMAL_COMPONENT_CAMERA :
910
917
/* Make a further decision on port based on resolution */
911
- if (f -> fmt .pix .width <= MAX_VIDEO_MODE_WIDTH
912
- && f -> fmt .pix .height <= MAX_VIDEO_MODE_HEIGHT )
918
+ if (f -> fmt .pix .width <= max_video_width
919
+ && f -> fmt .pix .height <= max_video_height )
913
920
camera_port = port =
914
921
& dev -> component [MMAL_COMPONENT_CAMERA ]->
915
922
output [MMAL_CAMERA_PORT_VIDEO ];
@@ -1351,8 +1358,8 @@ static int set_camera_parameters(struct vchiq_mmal_instance *instance,
1351
1358
.max_stills_h = MAX_HEIGHT ,
1352
1359
.stills_yuv422 = 1 ,
1353
1360
.one_shot_stills = 1 ,
1354
- .max_preview_video_w = 1920 ,
1355
- .max_preview_video_h = 1088 ,
1361
+ .max_preview_video_w = max_video_width ,
1362
+ .max_preview_video_h = max_video_height ,
1356
1363
.num_preview_video_frames = 3 ,
1357
1364
.stills_capture_circular_buffer_height = 0 ,
1358
1365
.fast_preview_resume = 0 ,
@@ -1581,8 +1588,9 @@ static int __init bm2835_mmal_init_device(struct bm2835_mmal_dev *dev,
1581
1588
if (ret < 0 )
1582
1589
return ret ;
1583
1590
1584
- v4l2_info (vfd -> v4l2_dev , "V4L2 device registered as %s\n" ,
1585
- video_device_node_name (vfd ));
1591
+ v4l2_info (vfd -> v4l2_dev ,
1592
+ "V4L2 device registered as %s - stills mode > %dx%d\n" ,
1593
+ video_device_node_name (vfd ), max_video_width , max_video_height );
1586
1594
1587
1595
return 0 ;
1588
1596
}
0 commit comments