FileDocCategorySizeDatePackage
H263Format.javaAPI DocJMF 2.1.1e9918Mon May 12 12:20:34 BST 2003javax.media.format

H263Format

public class H263Format extends VideoFormat
Describes H.263 compressed video data.
since
JMF 2.0

Fields Summary
private static String
ENCODING
the video encoding string
protected int
advancedPrediction
Indicates if advanced prediction is used. Can take values NOT_SPECIFIED, TRUE, or FALSE.
protected int
arithmeticCoding
Indicates if arithmetic coding is used. Can take values NOT_SPECIFIED, TRUE, or FALSE.
protected int
errorCompensation
Indicates if error compensation is used. Can take values NOT_SPECIFIED, TRUE, or FALSE.
protected int
hrDB
The size of Hypothetical Reference decoder buffer.
protected int
pbFrames
Indicates if PB frames mode is used in this bitstream. Can take values NOT_SPECIFIED, TRUE, or FALSE.
protected int
unrestrictedVector
Indicates if unrestricted motion estimation is used. Can take values NOT_SPECIFIED, TRUE, or FALSE.
Constructors Summary
public H263Format()
Constructs an H263Format object with default attributes.


                
      
	super(ENCODING);
    
public H263Format(Dimension size, int maxDataLength, Class dataType, float frameRate, int advancedPrediction, int arithmeticCoding, int errorCompensation, int hrDB, int pbFrames, int unrestrictedVector)
Constructs an H263Format object with the specified attributes.

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
advancedPrediction Specifies whether or not the H.263 advanced prediction capability (H.263 Annex F) is used.
param
arithmeticCoding Specifies whether or not the H.263 arithmetic coding capability (H.263 Annex E) is used.
param
errorCompensation Specifies whether or not the H.263 error compensation capability is used.
param
hrDB Specifies the H.263 Hypothetical Reference decoder buffer.
param
pbFrames Specifies whether or not the H.263 PB Frames capability (H.263 Annex G) is used.
param
unrestrictedVector Specifies whether or not the H.263 unrestricted motion vector capability (H.263 Annex D) is used.

	super(ENCODING, size, maxDataLength, dataType, frameRate);
	this.advancedPrediction = advancedPrediction;
	this.arithmeticCoding = arithmeticCoding;
	this.errorCompensation = errorCompensation;
	this.hrDB = hrDB;
	this.pbFrames = pbFrames;
	this.unrestrictedVector = unrestrictedVector;
    
Methods Summary
public java.lang.Objectclone()
Creates a clone of this H263Format.

return
A clone of this H263Format.

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

param
f The Format to copy the attributes from.

	super.copy(f);
	H263Format other = (H263Format) f;
	advancedPrediction = other.advancedPrediction;
	arithmeticCoding = other.arithmeticCoding;
	errorCompensation = other.errorCompensation;
	hrDB = other.hrDB;
	pbFrames = other.pbFrames;
	unrestrictedVector = other.unrestrictedVector;
    
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 H263Format) {
	    H263Format other = (H263Format) format;
	    return super.equals(format) &&
		advancedPrediction == other.advancedPrediction &&
		arithmeticCoding == other.arithmeticCoding &&
		errorCompensation == other.errorCompensation &&
		hrDB == other.hrDB &&
		pbFrames == other.pbFrames &&
		unrestrictedVector == other.unrestrictedVector;
	}
	return false;
    
public intgetAdvancedPrediction()
Gets the advanced prediction setting for this Format.

return
An integer that indicates the advanced prediction setting: NOT_SPECIFIED, TRUE, or FALSE.

	return advancedPrediction;
    
public intgetArithmeticCoding()
Gets the arithmetic coding setting for this Format.

return
An integer that indicates the arithmetic coding setting: NOT_SPECIFIED, TRUE, or FALSE.

	return arithmeticCoding;
    
public intgetErrorCompensation()
Gets the error compensation setting for this Format.

return
An integer that indicates the error compensation setting: NOT_SPECIFIED, TRUE, or FALSE.

	return errorCompensation;
    
public intgetHrDB()
Gets the size of Hypothetical Reference decoder buffer.

return
The size of the Hypothetical Reference decoder buffer, as an integer. Returns NOT_SPECIFIED if the decoder buffer size is not specified.

	return hrDB;
    
public intgetPBFrames()
Gets the PB frames setting for this Format.

return
An integer that indicates the PB frames setting: NOT_SPECIFIED, TRUE, or FALSE.

	return pbFrames;
    
public intgetUnrestrictedVector()
Gets the unrestricted motion vector setting for this Format.

return
An integer that indicates the unrestricted motion vector setting: NOT_SPECIFIED, TRUE, or FALSE.

	return unrestrictedVector;
    
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 H263Format))
	    return fmt;
	H263Format other = (H263Format)format;
	H263Format res = (H263Format)fmt;
	res.advancedPrediction = (advancedPrediction != NOT_SPECIFIED ?
				 advancedPrediction : other.advancedPrediction);
	res.arithmeticCoding = (arithmeticCoding != NOT_SPECIFIED ?
				arithmeticCoding : other.arithmeticCoding);
	res.errorCompensation = (errorCompensation != NOT_SPECIFIED ?
				 errorCompensation : other.errorCompensation);
	res.hrDB = (hrDB != NOT_SPECIFIED ?
		    hrDB : other.hrDB);
	res.pbFrames = (pbFrames != NOT_SPECIFIED ?
			pbFrames : other.pbFrames);
	res.unrestrictedVector = (unrestrictedVector != NOT_SPECIFIED ?
				  unrestrictedVector : other.unrestrictedVector);
	
	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 H263Format))
	    return true;

	H263Format other = (H263Format) format;

	return
	    (advancedPrediction == NOT_SPECIFIED || other.advancedPrediction == NOT_SPECIFIED ||
	     advancedPrediction == other.advancedPrediction) &&
	    (arithmeticCoding == NOT_SPECIFIED || other.arithmeticCoding == NOT_SPECIFIED ||
	     arithmeticCoding == other.arithmeticCoding) &&
	    (errorCompensation == NOT_SPECIFIED || other.errorCompensation == NOT_SPECIFIED ||
	     errorCompensation == other.errorCompensation) &&
	    (hrDB == NOT_SPECIFIED || other.hrDB == NOT_SPECIFIED ||
	     hrDB == other.hrDB) &&
	    (pbFrames == NOT_SPECIFIED || other.pbFrames == NOT_SPECIFIED ||
	     pbFrames == other.pbFrames) &&
	    (unrestrictedVector == NOT_SPECIFIED || other.unrestrictedVector == NOT_SPECIFIED ||
	     unrestrictedVector == other.unrestrictedVector);
    
public java.lang.StringtoString()
Gets a string representation of the attributes of this H263Format. For example: "H.263, 352x240, ...".

return
A String that describes the format attributes.

	return "H.263 video format";