Fields Summary |
---|
protected Dimension | size |
protected int | maxDataLength |
protected float | frameRate |
public static final String | CINEPAKCinepak format. |
public static final String | JPEGJPEG format. |
public static final String | JPEG_RTPJPEG RTP format |
public static final String | MPEGMPEG format. |
public static final String | MPEG_RTPMPEG RTP format. |
public static final String | H261H.261 format. |
public static final String | H261_RTPH261 RTP format |
public static final String | H263H.263 format. |
public static final String | H263_RTPH.263 (RFC 2190) RTP format |
public static final String | H263_1998_RTPH.263+ (RFC 2429 aka H263-1998) RTP format |
public static final String | RGBRaw RGB format. |
public static final String | YUVRaw YUV or YCrCb format. |
public static final String | IRGB8-bit Indexed RGB format. |
public static final String | SMCSorensen format. |
public static final String | RLERun Length Encoded video format. |
public static final String | RPZA |
public static final String | MJPGMotion JPEG format. |
public static final String | MJPEGAMotion JPEG-A format. |
public static final String | MJPEGBMotion JPEG-B format. |
public static final String | INDEO32Indeo Video 3.2 |
public static final String | INDEO41Indeo Interactive 4.1 |
public static final String | INDEO50Indeo Interactive 5.0 |
Methods Summary |
---|
public java.lang.Object | clone()Creates a clone of this VideoFormat by copying each field to
the clone.
VideoFormat f = new VideoFormat(encoding, size, maxDataLength,
dataType, frameRate);
f.copy(this);
return f;
|
protected void | copy(javax.media.Format f)Copies the attributes from the specified
Format into this VideoFormat .
super.copy(f);
VideoFormat vf = (VideoFormat)f;
if (vf.size != null)
size = new Dimension(vf.size);
maxDataLength = vf.maxDataLength;
frameRate = vf.frameRate;
|
public boolean | equals(java.lang.Object format)Compares the specified Format with this VideoFormat .
Returns true only if the specified Format
is a VideoFormat object and all of
its attributes are identical to
the attributes in this VideoFormat .
if (format instanceof VideoFormat) {
VideoFormat vf = (VideoFormat)format;
if (size == null || vf.size == null) {
if (size != vf.size)
return false;
} else {
if (!size.equals(vf.size))
return false;
}
return super.equals(format) &&
maxDataLength == vf.maxDataLength &&
frameRate == vf.frameRate;
}
return false;
|
public float | getFrameRate()Gets the frame rate associated with this VideoFormat .
return frameRate;
|
public int | getMaxDataLength()Gets the length of the largest data chunk associated with this
VideoFormat .
return maxDataLength;
|
public java.awt.Dimension | getSize()Gets the dimensions of a video frame in this VideoFormat .
return size;
|
public javax.media.Format | intersects(javax.media.Format format)Finds the attributes shared by two matching Format objects.
If the specified Format does not match this one, the result
is undefined.
Format fmt;
if ((fmt = super.intersects(format)) == null)
return null;
if (!(format instanceof VideoFormat))
return fmt;
VideoFormat other = (VideoFormat)format;
VideoFormat res = (VideoFormat)fmt;
res.size = (size != null ?
size : other.size);
res.maxDataLength = (maxDataLength != NOT_SPECIFIED ?
maxDataLength : other.maxDataLength);
res.frameRate = (frameRate != NOT_SPECIFIED ?
frameRate : other.frameRate);
return res;
|
public boolean | matches(javax.media.Format format)Checks whether or not the specified Format matches
this VideoFormat .
Matches only compares the attributes that are defined in the specified
Format ,
unspecified attributes are ignored.
The two Format objects do not have to be of the same class
to match. For example, if "A" are "B" are being compared, a
match is possible if "A" is derived from "B"
or "B" is derived from "A". (The compared attributes must still match,
or matches fails.)
if (!super.matches(format))
return false;
if (!(format instanceof VideoFormat))
return true;
VideoFormat vf = (VideoFormat)format;
return
(size == null || vf.size == null ||
size.equals(vf.size)) &&
(frameRate == NOT_SPECIFIED || vf.frameRate == NOT_SPECIFIED ||
frameRate == vf.frameRate);
|
public javax.media.Format | relax()Generate a format that's less restrictive than this format but
contains the basic attributes that will make this resulting format
useful for format matching.
VideoFormat fmt;
if ((fmt = (VideoFormat)super.relax()) == null)
return null;
fmt.size = null;
fmt.maxDataLength = NOT_SPECIFIED;
fmt.frameRate = NOT_SPECIFIED;
return fmt;
|
public java.lang.String | toString()Gets a String representation of the attributes of this
VideoFormat . For example: "RGB, 352x240, ...".
String s = "";
if (getEncoding() != null)
s += getEncoding().toUpperCase();
else
s += "N/A";
if (size != null)
s += ", " + size.width + "x" + size.height;
if (frameRate != NOT_SPECIFIED)
s += ", FrameRate=" + ((int)(frameRate * 10) / 10f);
if (maxDataLength != NOT_SPECIFIED)
s += ", Length=" + maxDataLength;
if (dataType != null && dataType != Format.byteArray)
s += ", " + dataType;
return s;
|