Commit d7ba8fa1 authored by Ghislain MARY's avatar Ghislain MARY

Add RTCP XR accessor.

parent 4a41efd8
......@@ -262,6 +262,8 @@ typedef struct rtcp_xr_voip_metrics_report_block {
uint16_t jb_abs_max;
} rtcp_xr_voip_metrics_report_block_t;
#define MIN_RTCP_XR_PACKET_SIZE (sizeof(rtcp_xr_header_t) + 4)
typedef struct rtcp_sr{
......@@ -332,6 +334,9 @@ ORTP_PUBLIC void rtcp_APP_get_name(const mblk_t *m, char *name);
/* retrieve the data. when returning, data points directly into the mblk_t */
ORTP_PUBLIC void rtcp_APP_get_data(const mblk_t *m, uint8_t **data, int *len);
/* RTCP XR accessors */
ORTP_PUBLIC bool_t rtcp_is_XR(const mblk_t *m);
#ifdef __cplusplus
}
......
......@@ -283,3 +283,17 @@ void rtcp_APP_get_data(const mblk_t *m, uint8_t **data, int *len){
*data=NULL;
}
}
/* RTCP XR accessors */
bool_t rtcp_is_XR(const mblk_t *m) {
const rtcp_common_header_t *ch = rtcp_get_common_header(m);
if ((ch != NULL) && (rtcp_common_header_get_packet_type(ch) == RTCP_XR)) {
if (msgdsize(m) < MIN_RTCP_XR_PACKET_SIZE) {
ortp_warning("Too short RTCP XR packet.");
return FALSE;
}
return TRUE;
}
return FALSE;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment