Class Registry

java.lang.Object
org.monte.media.av.Registry
Direct Known Subclasses:
DefaultRegistry

public abstract class Registry extends Object
The Registry for audio and video codecs.
Author:
Werner Randelshofer
  • Constructor Details

    • Registry

      public Registry()
  • Method Details

    • getCodec

      public final Codec getCodec(Format inputFormat, Format outputFormat)
      Gets a codec which can transcode from the specified input format to the specified output format.
      Parameters:
      inputFormat - The input format.
      outputFormat - The output format.
      Returns:
      A codec or null.
    • getCodecs

      public abstract List<Codec> getCodecs(Format inputFormat, Format outputFormat)
      Gets all codecs which can transcode from the specified input format to the specified output format.
      Parameters:
      inputFormat - The input format. Or null if any is acceptable.
      outputFormat - The output format. Or null if any is acceptable.
      Returns:
      An unmodifiale list of codes. If no codecs were found, an empty list is returned.
    • getDecoder

      public final Codec getDecoder(Format inputFormat)
      Gets the first codec which can decode the specified format.
      Parameters:
      inputFormat - The output format.
      Returns:
      A codec. Returns null if no codec was found.
    • getDecoders

      public final List<Codec> getDecoders(Format inputFormat)
      Gets all codecs which can decode the specified format.
      Parameters:
      inputFormat - The input format.
      Returns:
      An unmodifiable list of codecs.
    • getEncoder

      public final Codec getEncoder(Format outputFormat)
      Gets the first codec which can encode the specified format.
      Parameters:
      outputFormat - The output format.
      Returns:
      A codec. Returns null if no codec was found.
    • getEncoders

      public final List<Codec> getEncoders(Format outputFormat)
      Gets all codecs which can encode the specified format.
      Parameters:
      outputFormat - The output format.
      Returns:
      An unmodifiable list of codecs.
    • getExtension

      public abstract String getExtension(Format ff)
    • getFileFormat

      public abstract Format getFileFormat(File file)
    • getFileFormats

      public List<Format> getFileFormats()
    • getReader

      public abstract MovieReader getReader(Format fileFormat, File file) throws IOException
      Gets a reader for the specified file format and file.
      Parameters:
      fileFormat - the desired file format.
      file - the desired file
      Returns:
      a reader or null
      Throws:
      IOException
    • getReader

      public MovieReader getReader(File file) throws IOException
      Throws:
      IOException
    • getReaderFormats

      public abstract List<Format> getReaderFormats()
    • getWriterFormats

      public abstract List<Format> getWriterFormats()
    • getWriter

      public MovieWriter getWriter(File file) throws IOException
      Throws:
      IOException
    • getWriter

      public abstract MovieWriter getWriter(Format fileFormat, File file) throws IOException
      Gets a writer for the specified file format and file.
      Parameters:
      fileFormat - the desired file format.
      file - the desired file
      Returns:
      a writer or null
      Throws:
      IOException
    • suggestOutputFormats

      public ArrayList<Format> suggestOutputFormats(Format inputMediaFormat, Format outputFileFormat)
      Suggests output formats for the given input media format and specified file format.
      Parameters:
      inputMediaFormat -
      outputFileFormat -
      Returns:
      List of output media formats.
    • getInstance

      public static Registry getInstance()