Interface PayloadType


public interface PayloadType
Object representing an RTP payload type.

  • Method Summary

    Modifier and Type
    Method
    Description
    Instantiates a new payload type with values from source.
    int
    enable(boolean enabled)
    Enable/disable a payload type.
    boolean
    Check whether a palyoad type is enabled.
    int
    Get the number of channels.
    int
    Get the clock rate of a payload type.
    Return a string describing a payload type.
    Get a description of the encoder used to provide a payload type.
    Get the mime type.
    long
    Gets the native pointer used by this class to make native method calls.
    int
    Get the normal bitrate in bits/s.
    int
    Returns the payload type number assigned for this codec.
    Get the format parameters for incoming streams.
    Get the format parameters for outgoing streams.
    int
    Get the type of a payload type.
    Gets the object stored in this object user's data
    boolean
    Check whether the payload is usable according the bandwidth targets set in the
    core.
    boolean
    Tells whether the specified payload type represents a variable bitrate codec.
    void
    setNormalBitrate(int bitrate)
    Change the normal bitrate of a payload type.
    void
    setNumber(int number)
    Force a number for a payload type.
    void
    setRecvFmtp(String recvFmtp)
    Set the format parameters for incoming streams.
    void
    setSendFmtp(String sendFmtp)
    Set the format parameters for outgoing streams.
    void
    Sets the object to store in this object user's data
     
    boolean
    weakEquals(PayloadType otherPayloadType)
    Compare two payload types, and returns true if they are equal.
  • Method Details

    • getChannels

      int getChannels()
      Get the number of channels.

      Returns:
      The number of channels.
    • getClockRate

      int getClockRate()
      Get the clock rate of a payload type.

      Returns:
      The clock rate in Hz.
    • getDescription

      @NonNull String getDescription()
      Return a string describing a payload type.

      The format of the string is //.
      Returns:
      The description of the payload type.
    • getEncoderDescription

      @Nullable String getEncoderDescription()
      Get a description of the encoder used to provide a payload type.

      Returns:
      The description of the encoder. Can be null if the payload type is not
      supported by Mediastreamer2.
    • isUsable

      boolean isUsable()
      Check whether the payload is usable according the bandwidth targets set in the
      core.

      Returns:
      true if the payload type is usable.
    • isVbr

      boolean isVbr()
      Tells whether the specified payload type represents a variable bitrate codec.

      Returns:
      true if the payload type represents a VBR codec, false instead.
    • getMimeType

      @NonNull String getMimeType()
      Get the mime type.

      Returns:
      The mime type.
    • getNormalBitrate

      int getNormalBitrate()
      Get the normal bitrate in bits/s.

      Returns:
      The normal bitrate in bits/s or -1 if an error has occured.
    • setNormalBitrate

      void setNormalBitrate(int bitrate)
      Change the normal bitrate of a payload type.

      Parameters:
      bitrate - The new bitrate in kbits/s.
    • getNumber

      int getNumber()
      Returns the payload type number assigned for this codec.

      Returns:
      The number of the payload type.
    • setNumber

      void setNumber(int number)
      Force a number for a payload type.

      The Core does payload type number assignment automatically. This
      function is mainly to be used for tests, in order to override the automatic
      assignment mechanism.
      Parameters:
      number - The number to assign to the payload type.
    • getRecvFmtp

      @Nullable String getRecvFmtp()
      Get the format parameters for incoming streams.

      Returns:
      The format parameters as string.
    • setRecvFmtp

      void setRecvFmtp(@Nullable String recvFmtp)
      Set the format parameters for incoming streams.

      Parameters:
      recvFmtp - The new format parameters as string. The string will be copied.

    • getSendFmtp

      @Nullable String getSendFmtp()
      Get the format parameters for outgoing streams.

      Returns:
      The format parameters as string.
    • setSendFmtp

      void setSendFmtp(@Nullable String sendFmtp)
      Set the format parameters for outgoing streams.

      Parameters:
      sendFmtp - The new format parameters as string. The string will be copied.

    • getType

      int getType()
      Get the type of a payload type.

      Returns:
      The type of the payload e.g. PAYLOAD_AUDIO_CONTINUOUS or PAYLOAD_VIDEO.
    • clone

      @NonNull PayloadType clone()
      Instantiates a new payload type with values from source.

      Returns:
      The newly created PayloadType object.
    • enable

      int enable(boolean enabled)
      Enable/disable a payload type.

      Parameters:
      enabled - Set true for enabling and false for disabling.
      Returns:
      0 for success, -1 for failure.
    • enabled

      boolean enabled()
      Check whether a palyoad type is enabled.

      Returns:
      true if enabled, false if disabled.
    • weakEquals

      boolean weakEquals(@NonNull PayloadType otherPayloadType)
      Compare two payload types, and returns true if they are equal.

      Parameters (fmtp strings) are not compared, hence the name 'weak equals'.
      Parameters:
      otherPayloadType - another PayloadType object
      Returns:
      true if the payload types are "almost" equals.
    • setUserData

      void setUserData(Object data)
      Sets the object to store in this object user's data
      Parameters:
      data - the object to store
    • getUserData

      Object getUserData()
      Gets the object stored in this object user's data
      Returns:
      the object store if any, null otherwise
    • getNativePointer

      long getNativePointer()
      Gets the native pointer used by this class to make native method calls.
      Returns:
      the nativer pointer, as long
    • toString

      String toString()
      Overrides:
      toString in class Object