Copyright 2012-04-26 Werner Randelshofer

org.monte.media.converter
Class CodecChain

java.lang.Object
  extended by org.monte.media.converter.CodecChain
All Implemented Interfaces:
Codec

public class CodecChain
extends java.lang.Object
implements Codec

CodecChain.

Version:
1.0 2011-09-07 Created.
Author:
Werner Randelshofer

Field Summary
 
Fields inherited from interface org.monte.media.Codec
CODEC_FAILED, CODEC_INPUT_NOT_CONSUMED, CODEC_OK, CODEC_OUTPUT_NOT_FILLED
 
Constructor Summary
CodecChain(Codec first, Codec second)
           
 
Method Summary
static Codec createCodecChain(Codec... codecs)
           
static Codec createCodecChain(java.util.List<Codec> codecs)
           
 long getElapsedTime()
           
 Format getInputFormat()
           
 Format[] getInputFormats()
          Lists all of the input formats that this codec accepts.
 java.lang.String getName()
          Returns a human readable name of the codec.
 Format getOutputFormat()
           
 Format[] getOutputFormats(Format input)
          Lists all of the output formats that this codec can generate with the provided input format.
 int process(Buffer in, Buffer out)
          Performs the media processing defined by this codec.
 java.lang.String reportElapsedTime()
           
 void reset()
          Resets the state of the codec.
 Format setInputFormat(Format input)
          Sets the input format.
 Format setOutputFormat(Format output)
          Sets the output format.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CodecChain

public CodecChain(Codec first,
                  Codec second)
Method Detail

createCodecChain

public static Codec createCodecChain(java.util.List<Codec> codecs)

createCodecChain

public static Codec createCodecChain(Codec... codecs)

getInputFormats

public Format[] getInputFormats()
Description copied from interface: Codec
Lists all of the input formats that this codec accepts.

Specified by:
getInputFormats in interface Codec

getOutputFormats

public Format[] getOutputFormats(Format input)
Description copied from interface: Codec
Lists all of the output formats that this codec can generate with the provided input format. If the input format is null, returns all supported output formats.

Specified by:
getOutputFormats in interface Codec

setInputFormat

public Format setInputFormat(Format input)
Description copied from interface: Codec
Sets the input format. Returns the format that was actually set. This is the closest format that the Codec supports. Returns null if the specified format is not supported and no reasonable match could be found.

Specified by:
setInputFormat in interface Codec

getInputFormat

public Format getInputFormat()
Specified by:
getInputFormat in interface Codec

setOutputFormat

public Format setOutputFormat(Format output)
Description copied from interface: Codec
Sets the output format. Returns the format that was actually set. This is the closest format that the Codec supports. Returns null if the specified format is not supported and no reasonable match could be found.

Specified by:
setOutputFormat in interface Codec

getOutputFormat

public Format getOutputFormat()
Specified by:
getOutputFormat in interface Codec

process

public int process(Buffer in,
                   Buffer out)
Description copied from interface: Codec
Performs the media processing defined by this codec.

Copies the data from the input buffer into the output buffer.

Specified by:
process in interface Codec
Returns:
A combination of processing flags.

getName

public java.lang.String getName()
Description copied from interface: Codec
Returns a human readable name of the codec.

Specified by:
getName in interface Codec

reset

public void reset()
Description copied from interface: Codec
Resets the state of the codec.

Specified by:
reset in interface Codec

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getElapsedTime

public long getElapsedTime()

reportElapsedTime

public java.lang.String reportElapsedTime()

Copyright 2012-04-26 Werner Randelshofer