Package org.linphone.core

# Interface PayloadType

public interface PayloadType
Object representing an RTP payload type.

## Method Summary

Modifier and Type
Method
Description
`PayloadType`
`clone()`
Instantiates a new payload type with values from source.
`int`
`enable(boolean enabled)`
Enable/disable a payload type.
`boolean`
`enabled()`
Check whether a palyoad type is enabled.
`int`
`getChannels()`
Get the number of channels.
`int`
`getClockRate()`
Get the clock rate of a payload type.
`String`
`getDescription()`
Return a string describing a payload type.
`String`
`getEncoderDescription()`
Get a description of the encoder used to provide a payload type.
`String`
`getMimeType()`
Get the mime type.
`long`
`getNativePointer()`
Gets the native pointer used by this class to make native method calls.
`int`
`getNormalBitrate()`
Get the normal bitrate in bits/s.
`int`
`getNumber()`
Returns the payload type number assigned for this codec.
`String`
`getRecvFmtp()`
Get the format parameters for incoming streams.
`String`
`getSendFmtp()`
Get the format parameters for outgoing streams.
`int`
`getType()`
Get the type of a payload type.
`Object`
`getUserData()`
Gets the object stored in this object user's data
`boolean`
`isUsable()`
Check whether the payload is usable according the bandwidth targets set in the
core.
`boolean`
`isVbr()`
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`
`setUserData(Object data)`
Sets the object to store in this object user's data
`String`
`toString()`
`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

String getDescription()
Return a string describing a payload type.
The format of the string is <mime_type>/<clock_rate>/<channels>.

Returns:
  The description of the payload type.

### getEncoderDescription

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

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 occurred.

### 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

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

Returns:
  The format parameters as string.

### setRecvFmtp

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

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

### getSendFmtp

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

Returns:
  The format parameters as string.

### setSendFmtp

void setSendFmtp(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

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(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`