Interface Codec

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

public interface Codec
A Codec processes a Buffer and stores the result in another Buffer.
Author:
Werner Randelshofer
  • Field Details

    • CODEC_OK

      static final int CODEC_OK
      The codec successfully converted the input to output.
      See Also:
    • CODEC_FAILED

      static final int CODEC_FAILED
      The codec could not handle the input.
      See Also:
    • 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:
    • 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:
  • Method Details

    • 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

      String getName()
      Returns a human readable name of the codec.
    • reset

      void reset()
      Resets the state of the codec.