![JAR search and dependency download from the Maven repository](/logo.png)
com.github.sarxos.webcam.ds.cgt.WebcamCloseTask Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of webcam-capture Show documentation
Show all versions of webcam-capture Show documentation
This library allows you to use your PC webcam, IP or network cameras directly from Java. It's compatible with most operating systems (Windows, Linux, MacOS).
package com.github.sarxos.webcam.ds.cgt;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.github.sarxos.webcam.WebcamDevice;
import com.github.sarxos.webcam.WebcamDriver;
import com.github.sarxos.webcam.WebcamTask;
public class WebcamCloseTask extends WebcamTask {
private static final Logger LOG = LoggerFactory.getLogger(WebcamCloseTask.class);
public WebcamCloseTask(WebcamDriver driver, WebcamDevice device) {
super(driver, device);
}
public void close() throws InterruptedException {
process();
}
@Override
protected void handle() {
WebcamDevice device = getDevice();
if (!device.isOpen()) {
return;
}
LOG.info("Closing {}", device.getName());
device.close();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy