Group PJMED_PLC

group PJMED_PLC

Packet lost compensation algorithm.

This section describes PJMEDIA’s implementation of Packet Lost Concealment algorithm. This algorithm is used to implement PLC for codecs that do not have built-in support for one (e.g. G.711 or GSM codecs).

The PLC algorithm (either built-in or external) is embedded in PJMEDIA codec instance, and application can conceal lost frames by calling member of the codec’s member operation (pjmedia_codec_op).

See also Concealing Lost Frames for more info.

Typedefs

typedefPJ_BEGIN_DECL struct pjmedia_plc pjmedia_plc

Opaque declaration for PLC.

Functions

pj_status_t pjmedia_plc_create(pj_pool_t *pool, unsigned clock_rate, unsigned samples_per_frame, unsigned options, pjmedia_plc **p_plc)

Create PLC session. This function will select the PLC algorithm to use based on the arguments.

Parameters
  • pool – Pool to allocate memory for the PLC.

  • clock_rate – Media sampling rate.

  • samples_per_frame – Number of samples per frame.

  • options – Must be zero for now.

  • p_plc – Pointer to receive the PLC instance.

Returns

PJ_SUCCESS on success.

pj_status_t pjmedia_plc_save(pjmedia_plc *plc, pj_int16_t *frame)

Save a good frame to PLC.

Parameters
  • plc – The PLC session.

  • frame – The good frame to be stored to PLC. This frame must have the same length as the configured samples per frame.

Returns

PJ_SUCCESS on success.

pj_status_t pjmedia_plc_generate(pjmedia_plc *plc, pj_int16_t *frame)

Generate a replacement for lost frame.

Parameters
  • plc – The PLC session.

  • frame – Buffer to receive the generated frame. This buffer must be able to store the frame.

Returns

PJ_SUCCESS on success.