FileDocCategorySizeDatePackage
H261Format.javaAPI DocJMF 2.1.1e5405Mon May 12 12:20:34 BST 2003javax.media.format

H261Format

public class H261Format extends VideoFormat
Describes H.261 compressed video data.
since
JMF 2.0

Fields Summary
protected int
stillImageTransmission
Used to indicate whether or not still image transmission is used. Can be set to NOT_SPECIFIED, TRUE, or FALSE.
private static String
ENCODING
the video encoding string
Constructors Summary
public H261Format()
Constructs an H261Format object with default parameters.


                
      
 	super(ENCODING);
    
public H261Format(Dimension size, int maxDataLength, Class dataType, float frameRate, int stillImageTransmission)
Constructs an H261Format object with the specified parameters.

param
size A Dimension that specifies the frame size.
param
maxDataLength The maximum size of the compressed data array.
param
dataType The class type of the data.
param
frameRate The frame rate of the video.
param
stillImageTransmission Specifies whether or not H.261 still image transmission is used (H.261 Annex D).

	super(ENCODING, size, maxDataLength, dataType, frameRate);
	this.stillImageTransmission = stillImageTransmission;
    
Methods Summary
public java.lang.Objectclone()
Creates a clone of this H261Format.

return
A clone of this H261Format.

	H261Format f = new H261Format();
	f.copy(this);
	return f;
    
protected voidcopy(javax.media.Format f)
Copies the attributes from the specified Format into this H261Format.

param
f The Format to copy the attributes from.

	super.copy(f);
	stillImageTransmission = ((H261Format)f).stillImageTransmission;
    
public booleanequals(java.lang.Object format)
Compares the specified Format with this H261Format. Returns true only if the specified Format is a H261Format object and all of its attributes are identical to the attributes in this H261Format.

param
format The Format to compare.
return
true if the specified Format is the same as this one.

	if (format instanceof H261Format) {
	    return super.equals(format) &&
		stillImageTransmission == ((H261Format)format).stillImageTransmission;
	}
	return false;
    
public intgetStillImageTransmission()
Gets the still image transmission setting for this Format.

return
An integer that indicates whether or not still image transmission is used: TRUE, FALSE, or NOT_SPECIFIED.

	return stillImageTransmission;
    
public javax.media.Formatintersects(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.

param
The matching Format to intersect with this H261Format.
return
A Format object with its attributes set to those attributes common to both Format objects.
see
#matches

	Format fmt;
	if ((fmt = super.intersects(format)) == null)
	    return null;
	if (!(format instanceof H261Format))
	    return fmt;
	H261Format other = (H261Format)format;
	H261Format res = (H261Format)fmt;
	res.stillImageTransmission = (stillImageTransmission != NOT_SPECIFIED ?
				      stillImageTransmission : other.stillImageTransmission);

	return res;
    
public booleanmatches(javax.media.Format format)
Checks whether or not the specified Format matches this H261Format. 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.)

param
format The Format to compare with this one.
return
true if the specified Format matches this one, false if it does not.

	if (!super.matches(format))
	    return false;
	if (!(format instanceof H261Format))
	    return true;

	H261Format f = (H261Format)format;

	return
	    (stillImageTransmission == NOT_SPECIFIED || f.stillImageTransmission == NOT_SPECIFIED ||
	     stillImageTransmission == f.stillImageTransmission);
    
public java.lang.StringtoString()
Gets a String representation of the attributes of this H261Format. For example: "H261, 352x240, ...".

return
A String that describes the format attributes.

	return "H.261 video format";