FileDocCategorySizeDatePackage
AudioCodec.javaAPI DocJMF 2.1.1e2281Mon May 12 12:21:02 BST 2003com.ibm.media.codec.audio

AudioCodec

public abstract class AudioCodec extends BasicCodec

Fields Summary
protected String
PLUGIN_NAME
protected AudioFormat[]
defaultOutputFormats
protected AudioFormat[]
supportedInputFormats
protected AudioFormat[]
supportedOutputFormats
protected AudioFormat
inputFormat
protected AudioFormat
outputFormat
protected final boolean
DEBUG
Constructors Summary
Methods Summary
public booleancheckFormat(javax.media.Format format)
Checks the header of the compressed audio packet and detects any format changes. Does not modify the buffer in any way. TBD: how to select spesific output format

        return true;
    
protected javax.media.FormatgetInputFormat()

	return inputFormat;
    
protected javax.media.Format[]getMatchingOutputFormats(javax.media.Format in)

        return new Format[0];
    
public java.lang.StringgetName()


       
	return PLUGIN_NAME;
    
protected javax.media.FormatgetOutputFormat()

	return outputFormat;
    
public javax.media.Format[]getSupportedInputFormats()

	return supportedInputFormats;
    
public javax.media.Format[]getSupportedOutputFormats(javax.media.Format in)

        // null input format
        if (in==null) {
            return defaultOutputFormats;
        }

        // mismatch input format
        if ( !(in instanceof AudioFormat ) ||
             (matches(in,supportedInputFormats)==null) ) {
                return new Format[0];

        }

        // match input format
        return getMatchingOutputFormats(in);

   
public javax.media.FormatsetInputFormat(javax.media.Format format)

	if ( !(format instanceof AudioFormat) ||
           (null == matches(format, supportedInputFormats)) )
	        return null;

	inputFormat = (AudioFormat)format;
	return format;
    
public javax.media.FormatsetOutputFormat(javax.media.Format format)


	// This methods assumes setInputFormat has already been called.

	if ( !(format instanceof AudioFormat) ||
           (null == matches(format, getMatchingOutputFormats(inputFormat))) )
	        return null;

	outputFormat = (AudioFormat)format;

	return format;