Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash if camera is already open #55

Open
navzam opened this issue Feb 4, 2016 · 3 comments
Open

Crash if camera is already open #55

navzam opened this issue Feb 4, 2016 · 3 comments
Labels
Clean Up Needs Improvement This tag is for things that are currently functional, but should be improved when we have time.

Comments

@navzam
Copy link
Member

navzam commented Feb 4, 2016

If the camera is being used by another source, camera_open() usually crashes the user program.

@Zacharyprime Zacharyprime added Bug This tag is for things that are broken in the software. Needs Improvement This tag is for things that are currently functional, but should be improved when we have time. and removed Needs Improvement This tag is for things that are currently functional, but should be improved when we have time. Bug This tag is for things that are broken in the software. labels Jan 30, 2020
@Zacharyprime
Copy link
Member

This is confirmed to be an issue on the Wombat.
The program will return with NULL instead of 0 and crash if the camera is open in Botui.

@EugeneDMyers
Copy link
Contributor

Actually, the 0 return is normal (and expected behavior) when the camera cannot be opened. The user program should check to see if there is a 0 return when the camera cannot be opened because BOTUI has control of the camera.

A crash can be prevented by camera::Device::update (camera.cpp) check to see if the camera is opened by calling camera::Device::isOpen(). That is a best a bandaid solution as the code in camera.cpp is a hodgpodge of support for non-opencv and opencv cameras.

@EugeneDMyers
Copy link
Contributor

Also, in this case the user program will loop waiting for a frame to appear. They still need to check for this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Up Needs Improvement This tag is for things that are currently functional, but should be improved when we have time.
Projects
None yet
Development

No branches or pull requests

3 participants