Since the webcam open function only returns the open fh on success, we need to close the FH ourselves in the event that the subsequent tests fail.
Testing:
iterate over all files in /dev/video* and attempt to open each one as a webcam
then log the details of said video device if successfully opened as a webcam.
This was used to find the initial leak of file handles, as a device which opend fine, but failed to be recognized as a valid webcam (supportsVideoCapture/ supportsVideoStreaming)the handle would be lost.
Since the webcam open function only returns the open fh on success, we need to close the FH ourselves in the event that the subsequent tests fail.
Testing: iterate over all files in /dev/video* and attempt to open each one as a webcam then log the details of said video device if successfully opened as a webcam. This was used to find the initial leak of file handles, as a device which opend fine, but failed to be recognized as a valid webcam (
supportsVideoCapture
/supportsVideoStreaming
)the handle would be lost.