linphone::PayloadType Class Reference

Object representing an RTP payload type. More...

`#include <payload_type.hh>`

Inheritance diagram for linphone::PayloadType:

## Public Member Functions

LINPHONECXX_PUBLIC | PayloadType (void *ptr, bool takeRef=true)
LINPHONECXX_PUBLIC _LinphonePayloadType * | cPtr ()
LINPHONECXX_PUBLIC int | getChannels () const
| Get the number of channels.
LINPHONECXX_PUBLIC int | getClockRate () const
| Get the clock rate of a payload type.
LINPHONECXX_PUBLIC std::string | getDescription () const
| Return a string describing a payload type.
LINPHONECXX_PUBLIC std::string | getEncoderDescription () const
| Get a description of the encoder used to provide a payload type.
LINPHONECXX_PUBLIC bool | isUsable () const
| Check whether the payload is usable according the bandwidth targets set in the core.
LINPHONECXX_PUBLIC bool | isVbr () const
| Tells whether the specified payload type represents a variable bitrate codec.
LINPHONECXX_PUBLIC std::string | getMimeType () const
| Get the mime type.
LINPHONECXX_PUBLIC int | getNormalBitrate () const
| Get the normal bitrate in bits/s.
LINPHONECXX_PUBLIC void | setNormalBitrate (int bitrate)
| Change the normal bitrate of a payload type.
LINPHONECXX_PUBLIC int | getNumber () const
| Returns the payload type number assigned for this codec.
LINPHONECXX_PUBLIC void | setNumber (int number)
| Force a number for a payload type.
LINPHONECXX_PUBLIC std::string | getRecvFmtp () const
| Get the format parameters for incoming streams.
LINPHONECXX_PUBLIC void | setRecvFmtp (const std::string &recvFmtp)
| Set the format parameters for incoming streams.
LINPHONECXX_PUBLIC std::string | getSendFmtp () const
| Get the format parameters for outgoing streams.
LINPHONECXX_PUBLIC void | setSendFmtp (const std::string &sendFmtp)
| Set the format parameters for outgoing streams.
LINPHONECXX_PUBLIC int | getType () const
| Get the type of a payload type.
LINPHONECXX_PUBLIC std::shared_ptr< linphone::PayloadType > | clone () const
| Instantiates a new payload type with values from source.
LINPHONECXX_PUBLIC int | enable (bool enabled)
| Enable/disable a payload type.
LINPHONECXX_PUBLIC bool | enabled () const
| Check whether a palyoad type is enabled.
LINPHONECXX_PUBLIC bool | weakEquals (const std::shared_ptr< const linphone::PayloadType > &otherPayloadType) const
| Compare two payload types, and returns true if they are equal.

## Detailed Description

Object representing an RTP payload type.

## Member Function Documentation

## clone()

LINPHONECXX_PUBLIC std::shared_ptr< linphone::PayloadType > linphone::PayloadType::clone | ( |  | ) | const

Instantiates a new payload type with values from source.

Returns
  The newly created PayloadType object.

## enable()

LINPHONECXX_PUBLIC int linphone::PayloadType::enable | ( | bool | enabled | ) |

Enable/disable a payload type.

Parameters

  enabled | Set true for enabling and false for disabling.

Returns
  0 for success, -1 for failure.

## enabled()

LINPHONECXX_PUBLIC bool linphone::PayloadType::enabled | ( |  | ) | const

Check whether a palyoad type is enabled.

Returns
  true if enabled, false if disabled.

## getChannels()

LINPHONECXX_PUBLIC int linphone::PayloadType::getChannels | ( |  | ) | const

Get the number of channels.

Returns
  The number of channels.

## getClockRate()

LINPHONECXX_PUBLIC int linphone::PayloadType::getClockRate | ( |  | ) | const

Get the clock rate of a payload type.

Returns
  The clock rate in Hz.

## getDescription()

LINPHONECXX_PUBLIC std::string linphone::PayloadType::getDescription | ( |  | ) | const

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

LINPHONECXX_PUBLIC std::string linphone::PayloadType::getEncoderDescription | ( |  | ) | const

Get a description of the encoder used to provide a payload type.

Returns
  The description of the encoder. Can be nullptr if the payload type is not supported by Mediastreamer2.

## getMimeType()

LINPHONECXX_PUBLIC std::string linphone::PayloadType::getMimeType | ( |  | ) | const

Get the mime type.

Returns
  The mime type.

## getNormalBitrate()

LINPHONECXX_PUBLIC int linphone::PayloadType::getNormalBitrate | ( |  | ) | const

Get the normal bitrate in bits/s.

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

## getNumber()

LINPHONECXX_PUBLIC int linphone::PayloadType::getNumber | ( |  | ) | const

Returns the payload type number assigned for this codec.

Returns
  The number of the payload type.

## getRecvFmtp()

LINPHONECXX_PUBLIC std::string linphone::PayloadType::getRecvFmtp | ( |  | ) | const

Get the format parameters for incoming streams.

Returns
  The format parameters as string.

## getSendFmtp()

LINPHONECXX_PUBLIC std::string linphone::PayloadType::getSendFmtp | ( |  | ) | const

Get the format parameters for outgoing streams.

Returns
  The format parameters as string.

## getType()

LINPHONECXX_PUBLIC int linphone::PayloadType::getType | ( |  | ) | const

Get the type of a payload type.

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

## isUsable()

LINPHONECXX_PUBLIC bool linphone::PayloadType::isUsable | ( |  | ) | const

Check whether the payload is usable according the bandwidth targets set in the core.

Returns
  true if the payload type is usable.

## isVbr()

LINPHONECXX_PUBLIC bool linphone::PayloadType::isVbr | ( |  | ) | const

Tells whether the specified payload type represents a variable bitrate codec.

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

## setNormalBitrate()

LINPHONECXX_PUBLIC void linphone::PayloadType::setNormalBitrate | ( | int | bitrate | ) |

Change the normal bitrate of a payload type.

Parameters

  bitrate | The new bitrate in kbits/s.

## setNumber()

LINPHONECXX_PUBLIC void linphone::PayloadType::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.

## setRecvFmtp()

LINPHONECXX_PUBLIC void linphone::PayloadType::setRecvFmtp | ( | const std::string & | recvFmtp | ) |

Set the format parameters for incoming streams.

Parameters

  recvFmtp | The new format parameters as string. The string will be copied.

## setSendFmtp()

LINPHONECXX_PUBLIC void linphone::PayloadType::setSendFmtp | ( | const std::string & | sendFmtp | ) |

Set the format parameters for outgoing streams.

Parameters

  sendFmtp | The new format parameters as string. The string will be copied.

## weakEquals()

LINPHONECXX_PUBLIC bool linphone::PayloadType::weakEquals | ( | const std::shared_ptr< const linphone::PayloadType > & | otherPayloadType | ) | const

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.

The documentation for this class was generated from the following file:

- payload_type.hh