Class CodecInfo

java.lang.Object
moe.kyokobot.koe.codec.CodecInfo
Direct Known Subclasses:
H264CodecInfo, OpusCodecInfo, VP8CodecInfo, VP9CodecInfo

public abstract class CodecInfo extends Object
Immutable codec capabilities and metadata. Represents what a codec CAN do, not what it IS doing in a session.
  • Field Details

    • name

      protected final String name
    • type

      protected final CodecType type
    • defaultPriority

      protected final int defaultPriority
    • defaultPayloadType

      protected final byte defaultPayloadType
    • defaultRtxPayloadType

      protected final byte defaultRtxPayloadType
  • Constructor Details

    • CodecInfo

      protected CodecInfo(@NotNull String name, @NotNull CodecType type, byte defaultPayloadType, byte defaultRtxPayloadType, int defaultPriority)
  • Method Details

    • getName

      @NotNull public String getName()
    • getType

      @NotNull public CodecType getType()
    • getDefaultPayloadType

      public byte getDefaultPayloadType()
    • getDefaultRtxPayloadType

      public byte getDefaultRtxPayloadType()
    • getDefaultPriority

      public int getDefaultPriority()
    • instantiate

      @NotNull public CodecInstance instantiate(byte negotiatedPayloadType, byte negotiatedRtxPayloadType)
      Creates a codec instance with negotiated payload types.
      Parameters:
      negotiatedPayloadType - the negotiated payload type for this session
      negotiatedRtxPayloadType - the negotiated RTX payload type for this session
      Returns:
      a new CodecInstance with the negotiated payload types
    • instantiate

      @NotNull public CodecInstance instantiate()
      Creates a codec instance using default payload types (for Discord's simple protocol).
      Returns:
      a new CodecInstance with default payload types
    • toJson

      @NotNull public JsonObject toJson()
      Converts this codec info to JSON format for gateway protocol.
      Returns:
      JSON representation of this codec
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object