Skip to content

Commit

Permalink
* Turn on camera auto-adaptation frame rate
Browse files Browse the repository at this point in the history
  • Loading branch information
lxowalle committed Jul 18, 2024
1 parent 531b456 commit 3204e02
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/maixcam_lib/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ config SOPHGO_MIDDLEWARE_VERSION_MINOR

config SOPHGO_MIDDLEWARE_VERSION_PATCH
int "sophgo middleware package patch version"
default 4
default 5
help
sophgo middleware package patch version
endmenu
10 changes: 9 additions & 1 deletion components/vision/src/maix_camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,18 +116,26 @@ namespace maix::camera
_width = (width == -1) ? 640 : width;
_height = (height == -1) ? 480 : height;
_format = format;
_fps = (fps == -1) ? 30 : fps;
_buff_num = buff_num;
_show_colorbar = false;
_open_set_regs = set_regs_flag;
_impl = NULL;

#ifdef PLATFORM_LINUX
_fps = (fps == -1) ? 30 : fps;
_device = _get_device(device);
_impl = new CameraV4L2(_device, _width, _height, _format, _buff_num);
#endif

#ifdef PLATFORM_MAIXCAM
if (fps == -1 && _width <= 1280 && _height <= 720) {
_fps = 60;
} else if (fps == -1) {
_fps = 30;
} else {
_fps = fps;
}

if ((_width > 1280 || _height > 720) && _fps > 30) {
log::warn("Current fps is too high, will be be updated to 30fps! Currently only supported up to 720p 60fps or 1440p 30fps.\r\n");
_fps = 30;
Expand Down

0 comments on commit 3204e02

Please sign in to comment.