rtp: add new parameter to osmo_rtp_get_payload to obtain payload length

This commit is contained in:
Pablo Neira Ayuso 2012-07-09 19:41:01 +02:00
parent c6dceb8cf7
commit efaae10304
2 changed files with 4 additions and 2 deletions

View File

@ -58,7 +58,7 @@ int osmo_rtp_handle_tx_set_ssrc(struct osmo_rtp_handle *h, uint32_t ssrc);
int osmo_rtp_handle_tx_set_timestamp(struct osmo_rtp_handle *h, uint32_t timestamp);
struct rtp_hdr *osmo_rtp_get_hdr(struct msgb *msg);
void *osmo_rtp_get_payload(struct rtp_hdr *rtph, struct msgb *msg);
void *osmo_rtp_get_payload(struct rtp_hdr *rtph, struct msgb *msg, uint32_t *plen);
struct msgb *osmo_rtp_build(struct osmo_rtp_handle *h, uint8_t payload_type, uint32_t payload_len, const void *data, uint32_t duration);

View File

@ -86,7 +86,8 @@ struct rtp_hdr *osmo_rtp_get_hdr(struct msgb *msg)
return rtph;
}
void *osmo_rtp_get_payload(struct rtp_hdr *rtph, struct msgb *msg)
void *osmo_rtp_get_payload(struct rtp_hdr *rtph, struct msgb *msg,
uint32_t *plen)
{
struct rtp_x_hdr *rtpxh;
uint8_t *payload;
@ -132,6 +133,7 @@ void *osmo_rtp_get_payload(struct rtp_hdr *rtph, struct msgb *msg)
}
}
*plen = payload_len;
return (uint8_t *)msg->data + msg->len - payload_len;
}