Class DefaultCodecRegistry

java.lang.Object
moe.kyokobot.koe.codec.DefaultCodecRegistry
All Implemented Interfaces:
CodecRegistry
Direct Known Subclasses:
ExperimentalCodecRegistry

public class DefaultCodecRegistry extends Object implements CodecRegistry
Default implementation of CodecRegistry with built-in codecs pre-registered.
  • Field Details

  • Constructor Details

    • DefaultCodecRegistry

      public DefaultCodecRegistry(boolean registerBuiltins)
    • DefaultCodecRegistry

      public DefaultCodecRegistry()
      Creates a registry with all built-in codecs pre-registered.
  • Method Details

    • empty

      public static DefaultCodecRegistry empty()
      Creates an empty registry with no codecs registered. Use this if you want to register only specific codecs.
      Returns:
      an empty CodecRegistry
    • registerBuiltInCodecs

      protected void registerBuiltInCodecs()
      Registers all built-in codecs. Can be overridden to skip registration.
    • register

      public void register(@NotNull CodecInfo codec)
      Description copied from interface: CodecRegistry
      Registers a codec capability.
      Specified by:
      register in interface CodecRegistry
      Parameters:
      codec - the codec info to register
    • unregister

      public boolean unregister(@NotNull String codecName)
      Description copied from interface: CodecRegistry
      Unregisters a codec by name.
      Specified by:
      unregister in interface CodecRegistry
      Parameters:
      codecName - the name of the codec to unregister
      Returns:
      true if codec was registered, false if not found
    • getByName

      @Nullable public CodecInfo getByName(@NotNull String name)
      Description copied from interface: CodecRegistry
      Gets codec info by name.
      Specified by:
      getByName in interface CodecRegistry
      Parameters:
      name - the codec name (case-insensitive)
      Returns:
      CodecInfo or null if not found
    • getAudioCodecs

      @NotNull public Collection<CodecInfo> getAudioCodecs()
      Description copied from interface: CodecRegistry
      Gets all registered audio codecs.
      Specified by:
      getAudioCodecs in interface CodecRegistry
      Returns:
      collection of audio codec infos
    • getVideoCodecs

      @NotNull public Collection<CodecInfo> getVideoCodecs()
      Description copied from interface: CodecRegistry
      Gets all registered video codecs.
      Specified by:
      getVideoCodecs in interface CodecRegistry
      Returns:
      collection of video codec infos
    • getAllCodecs

      @NotNull public Collection<CodecInfo> getAllCodecs()
      Description copied from interface: CodecRegistry
      Gets all registered codecs (audio + video).
      Specified by:
      getAllCodecs in interface CodecRegistry
      Returns:
      collection of all codec infos