Package moe.kyokobot.koe.codec
Class DefaultCodecRegistry
java.lang.Object
moe.kyokobot.koe.codec.DefaultCodecRegistry
- All Implemented Interfaces:
CodecRegistry
- Direct Known Subclasses:
ExperimentalCodecRegistry
Default implementation of CodecRegistry with built-in codecs pre-registered.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ConcurrentHashMap<String,CodecInfo> protected final ConcurrentHashMap<Byte,CodecInfo> -
Constructor Summary
ConstructorsConstructorDescriptionCreates a registry with all built-in codecs pre-registered.DefaultCodecRegistry(boolean registerBuiltins) -
Method Summary
Modifier and TypeMethodDescriptionstatic DefaultCodecRegistryempty()Creates an empty registry with no codecs registered.@NotNull Collection<CodecInfo>Gets all registered codecs (audio + video).@NotNull Collection<CodecInfo>Gets all registered audio codecs.@Nullable CodecInfoGets codec info by name.@NotNull Collection<CodecInfo>Gets all registered video codecs.voidRegisters a codec capability.protected voidRegisters all built-in codecs.booleanunregister(@NotNull String codecName) Unregisters a codec by name.
-
Field Details
-
codecsByName
-
codecsByPayloadType
-
-
Constructor Details
-
DefaultCodecRegistry
public DefaultCodecRegistry(boolean registerBuiltins) -
DefaultCodecRegistry
public DefaultCodecRegistry()Creates a registry with all built-in codecs pre-registered.
-
-
Method Details
-
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
Description copied from interface:CodecRegistryRegisters a codec capability.- Specified by:
registerin interfaceCodecRegistry- Parameters:
codec- the codec info to register
-
unregister
Description copied from interface:CodecRegistryUnregisters a codec by name.- Specified by:
unregisterin interfaceCodecRegistry- Parameters:
codecName- the name of the codec to unregister- Returns:
- true if codec was registered, false if not found
-
getByName
Description copied from interface:CodecRegistryGets codec info by name.- Specified by:
getByNamein interfaceCodecRegistry- Parameters:
name- the codec name (case-insensitive)- Returns:
- CodecInfo or null if not found
-
getAudioCodecs
Description copied from interface:CodecRegistryGets all registered audio codecs.- Specified by:
getAudioCodecsin interfaceCodecRegistry- Returns:
- collection of audio codec infos
-
getVideoCodecs
Description copied from interface:CodecRegistryGets all registered video codecs.- Specified by:
getVideoCodecsin interfaceCodecRegistry- Returns:
- collection of video codec infos
-
getAllCodecs
Description copied from interface:CodecRegistryGets all registered codecs (audio + video).- Specified by:
getAllCodecsin interfaceCodecRegistry- Returns:
- collection of all codec infos
-