net.sf.fmj.media
Class AbstractCodec

java.lang.Object
  extended by net.sf.fmj.media.AbstractControls
      extended by net.sf.fmj.media.AbstractPlugIn
          extended by net.sf.fmj.media.AbstractCodec
All Implemented Interfaces:
Codec, Controls, PlugIn
Direct Known Subclasses:
AbstractDePacketizer, AbstractPacketizer, Decoder, Decoder, DePacketizer, Encoder, Encoder, ImageIODecoder, ImageIOEncoder, ImageScaler, JavaSoundCodec, JpegEncoder, RateConverter

public abstract class AbstractCodec
extends AbstractPlugIn
implements Codec

Abstract base class to implement Codec.

Author:
Ken Larson

Field Summary
protected  Format inputFormat
           
protected  Format[] inputFormats
           
protected  boolean opened
           
protected  Format outputFormat
           
 
Fields inherited from interface javax.media.PlugIn
BUFFER_PROCESSED_FAILED, BUFFER_PROCESSED_OK, INPUT_BUFFER_NOT_CONSUMED, OUTPUT_BUFFER_NOT_FILLED, PLUGIN_TERMINATED
 
Constructor Summary
AbstractCodec()
           
 
Method Summary
protected  boolean checkInputBuffer(Buffer b)
           
protected  void dump(java.lang.String label, Buffer buffer)
           
protected  Format getInputFormat()
           
protected  Format getOutputFormat()
           
 Format[] getSupportedInputFormats()
           
abstract  Format[] getSupportedOutputFormats(Format input)
           
protected  boolean isEOM(Buffer b)
           
abstract  int process(Buffer input, Buffer output)
           
protected  void propagateEOM(Buffer b)
           
 Format setInputFormat(Format format)
           
 Format setOutputFormat(Format format)
           
 
Methods inherited from class net.sf.fmj.media.AbstractPlugIn
close, getName, open, reset
 
Methods inherited from class net.sf.fmj.media.AbstractControls
addControl, getControl, getControls, removeControl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.media.PlugIn
close, getName, open, reset
 
Methods inherited from interface javax.media.Controls
getControl, getControls
 

Field Detail

inputFormat

protected Format inputFormat

outputFormat

protected Format outputFormat

opened

protected boolean opened

inputFormats

protected Format[] inputFormats
Constructor Detail

AbstractCodec

public AbstractCodec()
Method Detail

getSupportedInputFormats

public Format[] getSupportedInputFormats()
Specified by:
getSupportedInputFormats in interface Codec

getSupportedOutputFormats

public abstract Format[] getSupportedOutputFormats(Format input)
Specified by:
getSupportedOutputFormats in interface Codec

process

public abstract int process(Buffer input,
                            Buffer output)
Specified by:
process in interface Codec

setInputFormat

public Format setInputFormat(Format format)
Specified by:
setInputFormat in interface Codec

setOutputFormat

public Format setOutputFormat(Format format)
Specified by:
setOutputFormat in interface Codec

getInputFormat

protected Format getInputFormat()

getOutputFormat

protected Format getOutputFormat()

checkInputBuffer

protected boolean checkInputBuffer(Buffer b)

isEOM

protected boolean isEOM(Buffer b)

propagateEOM

protected void propagateEOM(Buffer b)

dump

protected final void dump(java.lang.String label,
                          Buffer buffer)