allwpilib icon indicating copy to clipboard operation
allwpilib copied to clipboard

CameraServer: addCamera() twice with same device name should fail

Open virtuald opened this issue 9 years ago • 3 comments

Otherwise users get cryptic errors like so:

https://www.chiefdelphi.com/forums/showpost.php?p=1646981&postcount=6

virtuald avatar Feb 19 '17 02:02 virtuald

A more general way of duplicating that error is by calling startAutomaticCapture twice with the same device number. I haven't tried C++/Java... but it appears to be present in Java, at least.

CameraServer.startAutomaticCapture(dev=0)
CameraServer.startAutomaticCapture(dev=0)

virtuald avatar Feb 19 '17 03:02 virtuald

Perhaps add a collection of video sources, and fail if it contains the added source?

Starlight220 avatar Apr 20 '20 12:04 Starlight220

I don't get any errors using the same device and it seems to work, do we still want to throw an error if adding the same device twice?

WispySparks avatar Jun 04 '24 03:06 WispySparks