javax.media.cdm.CaptureDeviceManager Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fmj Show documentation
Show all versions of fmj Show documentation
Freedom for Media in Java
The newest version!
package javax.media.cdm;
import java.util.*;
import javax.media.*;
import net.sf.fmj.registry.*;
/**
* Internal implementation of javax.media.CaptureDeviceManager. Coding complete.
*
* @author Ken Larson
*/
public class CaptureDeviceManager extends javax.media.CaptureDeviceManager
{
public static synchronized boolean addDevice(CaptureDeviceInfo newDevice)
{
return Registry.getInstance().addDevice(newDevice);
}
public static synchronized void commit() throws java.io.IOException
{
Registry.getInstance().commit();
}
public static synchronized CaptureDeviceInfo getDevice(String deviceName)
{
for (CaptureDeviceInfo captureDeviceInfo : getDeviceList())
{
if (captureDeviceInfo.getName().equals(deviceName))
return captureDeviceInfo;
}
return null;
}
public static synchronized Vector getDeviceList() // not in javax.media.CaptureDeviceManager
{
return Registry.getInstance().getDeviceList();
}
public static synchronized Vector getDeviceList(Format format)
{
Vector result = new Vector();
for (CaptureDeviceInfo captureDeviceInfo : getDeviceList())
{
if (format == null)
{
result.add(captureDeviceInfo);
}
else
{
for (Format aFormat : captureDeviceInfo.getFormats())
{
if (format.matches(aFormat))
{
result.add(captureDeviceInfo);
break;
}
}
}
}
return result;
}
public static synchronized boolean removeDevice(CaptureDeviceInfo device)
{
return Registry.getInstance().removeDevice(device);
}
public CaptureDeviceManager()
{
super();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy