Group PJMED_RTCP_FB

group PJMED_RTCP_FB

RTCP Feedback extension to RTCP session.

PJMEDIA implements RTCP Feedback specification (RFC 4585) to enable receivers to provide more immediate feedback to the senders.

Enums

enum pjmedia_rtcp_fb_type

Enumeration of RTCP Feedback types. Each feedback type may have subtypes, which should be specified in feedback parameters.

Values:

enumerator PJMEDIA_RTCP_FB_ACK

Positive acknowledgement feedbacks. Sample subtypes are Reference Picture Selection Indication (RPSI) and application layer feedbacks.

enumerator PJMEDIA_RTCP_FB_NACK

Negative acknowledgement feedbacks. Sample subtypes are generic NACK, Picture Loss Indication (PLI), Slice Loss Indication (SLI), Reference Picture Selection Indication (RPSI), and application layer feedbacks.

enumerator PJMEDIA_RTCP_FB_TRR_INT

Minimum interval between two regular RTCP packets.

enumerator PJMEDIA_RTCP_FB_OTHER

Other feedback types.

Functions

pj_status_t pjmedia_rtcp_fb_setting_default(pjmedia_rtcp_fb_setting *opt)

Initialize RTCP Feedback setting with default values.

Parameters

opt – The RTCP Feedback setting to be initialized.

Returns

PJ_SUCCESS on success.

void pjmedia_rtcp_fb_setting_dup(pj_pool_t *pool, pjmedia_rtcp_fb_setting *dst, const pjmedia_rtcp_fb_setting *src)

Duplicate RTCP Feedback setting.

Parameters
  • pool – Pool to be used for duplicating the config.

  • dst – Destination configuration.

  • src – Source configuration.

Returns

PJ_SUCCESS on success.

void pjmedia_rtcp_fb_info_dup(pj_pool_t *pool, pjmedia_rtcp_fb_info *dst, const pjmedia_rtcp_fb_info *src)

Duplicate RTCP Feedback info.

Parameters
  • pool – Pool to be used for duplicating the info.

  • dst – Destination info.

  • src – Source info.

Returns

PJ_SUCCESS on success.

pj_status_t pjmedia_rtcp_fb_encode_sdp(pj_pool_t *pool, pjmedia_endpt *endpt, const pjmedia_rtcp_fb_setting *opt, pjmedia_sdp_session *sdp_local, unsigned med_idx, const pjmedia_sdp_session *sdp_remote)

Encode RTCP Feedback specific information into local SDP according to the provided RTCP Feedback setting. This is useful to signal remote endpoint that local endpoint is capable and willing to receive RTCP Feedback packets as described in the local SDP.

Parameters
  • pool – Pool object to allocate memory in updating local SDP.

  • endpt – The media endpoint.

  • opt – RTCP Feedback setting.

  • sdp_local – The local SDP to be filled in information from the media transport.

  • med_idx – The SDP media index.

  • sdp_remote – Remote SDP or NULL if local is offerer.

Returns

PJ_SUCCESS on success.

pj_status_t pjmedia_rtcp_fb_decode_sdp(pj_pool_t *pool, pjmedia_endpt *endpt, const void *opt, const pjmedia_sdp_session *sdp, unsigned med_idx, pjmedia_rtcp_fb_info *info)

Decode RTCP Feedback specific information from SDP media.

Parameters
  • pool – Pool object to allocate memory.

  • endpt – The media endpoint.

  • opt – Options, currently it must be NULL.

  • sdp – The SDP.

  • med_idx – The SDP media index.

  • info – The RTCP-FB info fetched from SDP.

Returns

PJ_SUCCESS on success.

pj_status_t pjmedia_rtcp_fb_decode_sdp2(pj_pool_t *pool, pjmedia_endpt *endpt, const void *opt, const pjmedia_sdp_session *sdp, unsigned med_idx, int pt, pjmedia_rtcp_fb_info *info)

Decode RTCP Feedback specific information from SDP media for the specified payload type. If the payload type is set to negative value, it will decode RTCP Feedback info for all payload types in the SDP media.

Parameters
  • pool – Pool object to allocate memory.

  • endpt – The media endpoint.

  • opt – Options, currently it must be NULL.

  • sdp – The SDP.

  • med_idx – The SDP media index.

  • pt – The payload type.

  • info – The RTCP-FB info fetched from SDP.

Returns

PJ_SUCCESS on success.

pj_status_t pjmedia_rtcp_fb_build_nack(pjmedia_rtcp_session *session, void *buf, pj_size_t *length, unsigned nack_cnt, const pjmedia_rtcp_fb_nack nack[])

Build an RTCP Feedback Generic NACK packet. This packet can be appended to other RTCP packets, e.g: RTCP RR/SR, to compose a compound RTCP packet. See also RFC 4585 Section 6.2.1 about Generic NACK message.

Parameters
  • session – The RTCP session.

  • buf – The buffer to receive RTCP Feedback packet.

  • length – On input, it will contain the buffer length. On output, it will contain the generated RTCP Feedback packet length.

  • nack_cnt – The number of RTCP Feedback Generic NACK messages.

  • nack – The array of RTCP Feedback Generic NACK messages.

Returns

PJ_SUCCESS on success.

pj_status_t pjmedia_rtcp_fb_build_pli(pjmedia_rtcp_session *session, void *buf, pj_size_t *length)

Build an RTCP Feedback Picture Loss Indication (PLI) packet. This packet can be appended to other RTCP packets, e.g: RTCP RR/SR, to compose a compound RTCP packet. See also RFC 4585 Section 6.3.1 about PLI FB message.

Parameters
  • session – The RTCP session.

  • buf – The buffer to receive RTCP Feedback packet.

  • length – On input, it will contain the buffer length. On output, it will contain the generated RTCP Feedback packet length.

Returns

PJ_SUCCESS on success.

pj_status_t pjmedia_rtcp_fb_build_sli(pjmedia_rtcp_session *session, void *buf, pj_size_t *length, unsigned sli_cnt, const pjmedia_rtcp_fb_sli sli[])

Build an RTCP Feedback Slice Loss Indication (SLI) packet. This packet can be appended to other RTCP packets, e.g: RTCP RR/SR, to compose a compound RTCP packet. See also RFC 4585 Section 6.3.2 about SLI FB message.

Parameters
  • session – The RTCP session.

  • buf – The buffer to receive RTCP Feedback packet.

  • length – On input, it will contain the buffer length. On output, it will contain the generated RTCP Feedback packet length.

  • sli_cnt – The number of RTCP Feedback SLI messages.

  • sli – The array of RTCP Feedback SLI messages.

Returns

PJ_SUCCESS on success.

pj_status_t pjmedia_rtcp_fb_build_rpsi(pjmedia_rtcp_session *session, void *buf, pj_size_t *length, const pjmedia_rtcp_fb_rpsi *rpsi)

Build an RTCP Feedback Reference Picture Selection Indication (RPSI) packet. This packet can be appended to other RTCP packets, e.g: RTCP RR/SR, to compose a compound RTCP packet. See also RFC 4585 Section 6.3.3 about RPSI FB message.

Parameters
  • session – The RTCP session.

  • buf – The buffer to receive RTCP Feedback packet.

  • length – On input, it will contain the buffer length. On output, it will contain the generated RTCP Feedback packet length.

  • rpsi – The RTCP Feedback RPSI message.

Returns

PJ_SUCCESS on success.

pj_status_t pjmedia_rtcp_fb_parse_nack(const void *buf, pj_size_t length, unsigned *nack_cnt, pjmedia_rtcp_fb_nack nack[])

Check whether the specified payload contains RTCP feedback generic NACK message, and parse the payload if it does.

Parameters
  • buf – The payload buffer.

  • length – The payload length.

  • nack_cnt – On input, it specifies the maximum number of generic NACK messages. On output, it specifies the number of parsed generic NACK messages.

  • nack – The array of RTCP Feedback Generic NACK messages.

Returns

PJ_SUCCESS if the payload contains generic NACK message and has been parsed successfully.

pj_status_t pjmedia_rtcp_fb_parse_pli(const void *buf, pj_size_t length)

Check whether the specified payload contains RTCP feedback Picture Loss Indication (PLI) message.

Parameters
  • buf – The payload buffer.

  • length – The payload length.

Returns

PJ_SUCCESS if the payload contains PLI message.

pj_status_t pjmedia_rtcp_fb_parse_sli(const void *buf, pj_size_t length, unsigned *sli_cnt, pjmedia_rtcp_fb_sli sli[])

Check whether the specified payload contains RTCP feedback Slice Loss Indication (SLI) message, and parse the payload if it does.

Parameters
  • buf – The payload buffer.

  • length – The payload length.

  • sli_cnt – On input, it specifies the maximum number of SLI messages. On output, it specifies the number of parsed SLI messages.

  • sli – The array of RTCP Feedback SLI messages.

Returns

PJ_SUCCESS if the payload contains SLI messages and has been parsed successfully.

pj_status_t pjmedia_rtcp_fb_parse_rpsi(const void *buf, pj_size_t length, pjmedia_rtcp_fb_rpsi *rpsi)

Check whether the specified payload contains RTCP feedback Reference Picture Selection Indication (RPSI) message, and parse the payload if it does.

Parameters
  • buf – The payload buffer.

  • length – The payload length.

  • rpsi – The parsed RTCP Feedback RPSI messages.

Returns

PJ_SUCCESS if the payload contains SLI messages and has been parsed successfully.

struct pjmedia_rtcp_fb_cap
#include <rtcp_fb.h>

This structure declare RTCP Feedback capability.

struct pjmedia_rtcp_fb_info
#include <rtcp_fb.h>

This structure declares RTCP Feedback information.

struct pjmedia_rtcp_fb_setting
#include <rtcp_fb.h>

This structure declares RTCP Feedback configuration settings.

struct pjmedia_rtcp_fb_nack
#include <rtcp_fb.h>

This structure declares RTCP Feedback Generic NACK message.

struct pjmedia_rtcp_fb_sli
#include <rtcp_fb.h>

This structure declares RTCP Feedback Slice Loss Indication (SLI) message.

struct pjmedia_rtcp_fb_rpsi
#include <rtcp_fb.h>

This structure declares RTCP Feedback Reference Picture Selection Indication (RPSI) message.

struct pjmedia_event_rx_rtcp_fb_data
#include <rtcp_fb.h>

Event data for incoming RTCP Feedback message event (PJMEDIA_EVENT_RX_RTCP_FB).