public class DeviceInfo extends Object
InputInfo objects providing information about each
video input,ImageFormats, capture resolutions
(ResolutionInfo) and frame intervals supported by the video device.
VideoDevice.getDeviceInfo() on its
VideoDevice object, and retrieve parameters of interest.
Example:
VideoDevice vd = new VideoDevice("/dev/video0");
DeviceInfo d = vd.getDeviceInfo();
System.out.println("name: "+d.getName());
System.out.println("Device file: "+d.getDeviceFile());
System.out.println("Supported formats:");
for(ImageFormat f : d.getFormatList().getNativeFormats())
System.out.println("\t"+f.toNiceString());
System.out.println("\tFormats that can be RGB24-converted: "
+(vd.supportRGBConversion()?"":"None"));
if(vd.supportRGBConversion())
for(ImageFormat f: d.getFormatList().getRGBEncodableFormats())
System.out.println("\t\t"+f.toNiceString());
System.out.println("Inputs:");
for(InputInfo i: d.getInputs()){
System.out.println("\tName: "+i.getName());
System.out.println("\tType: "+i.getType()+"("+
(i.getType() == V4L4JConstants.CAMERA ? "Camera" : "Tuner")+")");
System.out.println("\tIndex: "+i.getIndex());
System.out.println("\tSupported standards:");
for(Integer s: i.getSupportedStandards()){
System.out.print("\t\t"+s);
if(s==V4L4JConstants.PAL)
System.out.println("(PAL)");
else if(s==V4L4JConstants.NTSC)
System.out.println("(NTSC)");
else if(s==V4L4JConstants.SECAM)
System.out.println("(SECAM)");
else
}
if(i.getType() == V4L4JConstants.TUNER) {
TunerInfo t = i.getTuner();
System.out.println("\tTuner");
System.out.println("\t\tname: "+t.getName());
System.out.println("\t\tIndex: "+t.getIndex());
System.out.println("\t\tRange high: "+
t.getRangeHigh());
System.out.println("\t\tRange low: "+
t.getRangeLow());
System.out.println("\t\tUnit: "+
t.getUnit()+"("+(t.getUnit() == TunerInfo.MHZ ? "MHz" : "kHz")+")");
System.out.println("\t\tType: "+
t.getType()+"("+(t.getType() == TunerInfo.RADIO ? "Radio" : "TV")+")");
}
}
vd.release();
DeviceInfo objects can not be used anymore once the matching
VideoDevice object has been released. Calling any methods will then throw
a StateException.| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
String |
getDeviceFile()
This method returns the device file associated with the video device.
|
ImageFormatList |
getFormatList()
This method returns an
ImageFormatList object containing
the various image formats, capture resolutions and frame intervals the
video device supports. |
List<InputInfo> |
getInputs()
This method returns a list of
InputInfo objects which provide
information about each video input supported by the video device. |
String |
getName()
This method returns the name of the video device.
|
int |
hashCode() |
FrameInterval |
listIntervals(ImageFormat imf,
int width,
int height)
This method returns a
FrameInterval object containing information
about the supported frame intervals for capture at the given resolution
and image format. |
public String getName()
StateException - if the associated VideoDevice has been releasedpublic String getDeviceFile()
StateException - if the associated VideoDevice has been releasedpublic List<InputInfo> getInputs()
InputInfo objects which provide
information about each video input supported by the video device.InputInfo objectsStateException - if the associated VideoDevice has been releasedInputInfopublic ImageFormatList getFormatList()
ImageFormatList object containing
the various image formats, capture resolutions and frame intervals the
video device supports.ImageFormatList objectStateException - if the associated VideoDevice has been releasedImageFormatListpublic FrameInterval listIntervals(ImageFormat imf, int width, int height)
FrameInterval object containing information
about the supported frame intervals for capture at the given resolution
and image format. Note that the returned FrameInterval object
could have its type set to FrameInterval.Type.UNSUPPORTED if the
driver does not support frame interval enumeration OR if the device is
currently being used by another application and frame intervals cannot
be enumerated at this time.ResolutionInfo objects, attached to each
ImageFormat. See getFormatList().imf - the capture image format for which the frame intervals should
be enumeratedwidth - the capture width for which the frame intervals should be
enumeratedheight - the capture height for which the frame intervals should be
enumeratedFrameInterval object containing information about
the supported frame intervalsStateException - if the associated VideoDevice has been releasedCopyright © 2013-2015 Bartosz Firyn (sarxos). All Rights Reserved.