Copyright 2012-04-26 Werner Randelshofer

org.monte.media
Interface Codec

All Known Implementing Classes:
AbstractAudioCodec, AbstractCodec, AbstractVideoCodec, AnimationCodec, AVIPCMAudioCodec, BitmapCodec, BitmapCodec, CodecChain, ColorAdjustCodec, DIBCodec, FFRtoVFRConverter, FrameRateConverter, JPEGCodec, PassThroughCodec, PCMAudioCodec, PNGCodec, QuickTimePCMAudioCodec, RawCodec, RunLengthCodec, ScaleImageCodec, TechSmithCodec, ZMBVCodec

public interface Codec

A Codec processes a Buffer and stores the result in another Buffer.

Version:
1.0 2011-03-12 Created.
Author:
Werner Randelshofer

Field Summary
static int CODEC_FAILED
          The codec could not handle the input.
static int CODEC_INPUT_NOT_CONSUMED
          The codec did not fully consume the input buffer.
static int CODEC_OK
          The codec successfully converted the input to output.
static int CODEC_OUTPUT_NOT_FILLED
          The codec did not fully fill the output buffer.
 
Method Summary
 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.
 void reset()
          Resets the state of the codec.
 Format setInputFormat(Format input)
          Sets the input format.
 Format setOutputFormat(Format output)
          Sets the output format.
 

Field Detail

CODEC_OK

static final int CODEC_OK
The codec successfully converted the input to output.

See Also:
Constant Field Values

CODEC_FAILED

static final int CODEC_FAILED
The codec could not handle the input.

See Also:
Constant Field Values

CODEC_INPUT_NOT_CONSUMED

static final int CODEC_INPUT_NOT_CONSUMED
The codec did not fully consume the input buffer. The codec has updated the input buffer to reflect the amount of data that it has processed. The codec must be called again with the same input buffer.

See Also:
Constant Field Values

CODEC_OUTPUT_NOT_FILLED

static final int CODEC_OUTPUT_NOT_FILLED
The codec did not fully fill the output buffer. The codec has updated the output buffer to reflect the amount of data that it has processed. The codec must be called again with the same output buffer.

See Also:
Constant Field Values
Method Detail

getInputFormats

Format[] getInputFormats()
Lists all of the input formats that this codec accepts.


getOutputFormats

Format[] getOutputFormats(Format input)
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.


setInputFormat

Format setInputFormat(Format input)
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.


getInputFormat

Format getInputFormat()

setOutputFormat

Format setOutputFormat(Format output)
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.


getOutputFormat

Format getOutputFormat()

process

int process(Buffer in,
            Buffer out)
Performs the media processing defined by this codec.

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

Returns:
A combination of processing flags.

getName

java.lang.String getName()
Returns a human readable name of the codec.


reset

void reset()
Resets the state of the codec.


Copyright 2012-04-26 Werner Randelshofer