![JAR search and dependency download from the Maven repository](/logo.png)
com.github.sarxos.webcam.ds.buildin.cgt.GetDevicesTask 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.buildin.cgt;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
import com.github.sarxos.webcam.ds.buildin.WebcamGrabberProcessor;
import com.github.sarxos.webcam.ds.buildin.WebcamGrabberTask;
import com.github.sarxos.webcam.ds.buildin.natives.Device;
public class GetDevicesTask extends WebcamGrabberTask {
private AtomicReference> devices = new AtomicReference>();
private WebcamGrabberProcessor processor = null;
public GetDevicesTask(WebcamGrabberProcessor processor) {
this.processor = processor;
}
public List getDevices() {
process(processor);
return devices.get();
}
@Override
protected void handle() {
List devices = grabber.getVideoDevices().get().asArrayList();
this.devices.set(devices);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy