All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.sarxos.webcam.ds.buildin.cgt.GetDevicesTask Maven / Gradle / Ivy

Go to download

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).

There is a newer version: 0.3.12
Show newest version
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