mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-18 01:45:10 +03:00
cam: Validate camera configuration
Use CameraConfiguration::validate() to validate and possibly update the camera configuration when its prepared. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
afef18d35a
commit
7c856201c7
1 changed files with 12 additions and 0 deletions
|
@ -243,6 +243,18 @@ int CamApp::prepareConfig()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch (config_->validate()) {
|
||||||
|
case CameraConfiguration::Valid:
|
||||||
|
break;
|
||||||
|
case CameraConfiguration::Adjusted:
|
||||||
|
std::cout << "Camera configuration adjusted" << std::endl;
|
||||||
|
break;
|
||||||
|
case CameraConfiguration::Invalid:
|
||||||
|
std::cout << "Camera configuration invalid" << std::endl;
|
||||||
|
config_.reset();
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue