mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-13 15:29:45 +03:00
cam: improve error checking when capturing
The return value when start() and stop() the camera should be checked and handled. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
24cb563853
commit
dd14f1ec2c
1 changed files with 9 additions and 2 deletions
|
@ -180,11 +180,18 @@ static int capture()
|
|||
}
|
||||
|
||||
std::cout << "Capture until user interrupts by SIGINT" << std::endl;
|
||||
camera->start();
|
||||
|
||||
ret = camera->start();
|
||||
if (ret) {
|
||||
std::cout << "Failed to start capture" << std::endl;
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = loop->exec();
|
||||
|
||||
camera->stop();
|
||||
ret = camera->stop();
|
||||
if (ret)
|
||||
std::cout << "Failed to stop capture" << std::endl;
|
||||
out:
|
||||
camera->freeBuffers();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue