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

com.github.sarxos.webcam.ds.dummy.WebcamDummyDriver 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.dummy;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import com.github.sarxos.webcam.WebcamDevice;
import com.github.sarxos.webcam.WebcamDiscoverySupport;
import com.github.sarxos.webcam.WebcamDriver;


public class WebcamDummyDriver implements WebcamDriver, WebcamDiscoverySupport {

	private int count;

	public WebcamDummyDriver(int count) {
		this.count = count;
	}

	@Override
	public long getScanInterval() {
		return 10000;
	}

	@Override
	public boolean isScanPossible() {
		return true;
	}

	@Override
	public List getDevices() {
		List devices = new ArrayList();
		for (int i = 0; i < count; i++) {
			devices.add(new WebcamDummyDevice(i));
		}
		return Collections.unmodifiableList(devices);
	}

	@Override
	public boolean isThreadSafe() {
		return false;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy