-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Discovery Service Reset #93
Comments
Hi, Thank you for the report. This is a bug, I will fix it. |
Ok, the issue you've reported is now fixed. Therefore, this code: static {
Webcam.setDriver(new IpCamDriver());
}
public static void main(String[] args) throws MalformedURLException {
IpCamDeviceRegistry.register("test 01", "http://p.de/c=1", IpCamMode.PULL);
System.out.println("-------");
for (Webcam w : Webcam.getWebcams()) {
System.out.println(w);
}
IpCamDeviceRegistry.register("test 02", "http://p.de/c=1", IpCamMode.PULL);
IpCamDeviceRegistry.register("test 03", "http://p.de/c=1", IpCamMode.PULL);
IpCamDeviceRegistry.register("test 04", "http://p.de/c=1", IpCamMode.PULL);
IpCamDevice d = IpCamDeviceRegistry.register("test 05", "http://p.de/c=1", IpCamMode.PULL);
System.out.println("-------");
for (Webcam w : Webcam.getWebcams()) {
System.out.println(w);
}
IpCamDeviceRegistry.unregister(d); // remove "test 05"
System.out.println("-------");
for (Webcam w : Webcam.getWebcams()) {
System.out.println(w);
}
} Will result in all webcams to be printed in appropriate manner:
|
Do you need new Webcam Capture release, or is it enough for you to work with source code? |
Nah, I don't need a new release. I just grabbed the updated files and it works great. Thanks! |
Great :) Thank you one more time! Take care! |
Following up on my previous issue #92, it would appear the next problem I'm having is registering an IPCamDevice with the IPCamDeviceRegistry after having already called Webcam.getWebcams(). What appears to be happening is the WebcamDiscoveryService is caching the webcam's, so subsequent calls to WebcamDiscoveryService.getWebcams() is returning the old list of Webcams.
Does this imply that we should not be able to register new webcams after having used a Webcam, or is it an oversight in that there is no way to perform a reset on WebcamDiscoveryService.getWebcams()?
I created a workaround for this by creating a reset method in WebcamDiscoveryService:
Calling it in this instance, which is called after Webcam.getWebcams() has already been called at least once and a webcam has been started and stopped:
The text was updated successfully, but these errors were encountered: