rtp: add extension bit to the api
This commit is contained in:
parent
d20d56aaa3
commit
920a41d319
2 changed files with 7 additions and 7 deletions
|
@ -204,10 +204,10 @@ int rtp_listen(struct rtp_sock **rsp, int proto, const struct sa *ip,
|
||||||
rtp_recv_h *recvh, rtcp_recv_h *rtcph, void *arg);
|
rtp_recv_h *recvh, rtcp_recv_h *rtcph, void *arg);
|
||||||
int rtp_hdr_encode(struct mbuf *mb, const struct rtp_header *hdr);
|
int rtp_hdr_encode(struct mbuf *mb, const struct rtp_header *hdr);
|
||||||
int rtp_hdr_decode(struct rtp_header *hdr, struct mbuf *mb);
|
int rtp_hdr_decode(struct rtp_header *hdr, struct mbuf *mb);
|
||||||
int rtp_encode(struct rtp_sock *rs, bool marker, uint8_t pt,
|
int rtp_encode(struct rtp_sock *rs, bool ext, bool marker, uint8_t pt,
|
||||||
uint32_t ts, struct mbuf *mb);
|
uint32_t ts, struct mbuf *mb);
|
||||||
int rtp_decode(struct rtp_sock *rs, struct mbuf *mb, struct rtp_header *hdr);
|
int rtp_decode(struct rtp_sock *rs, struct mbuf *mb, struct rtp_header *hdr);
|
||||||
int rtp_send(struct rtp_sock *rs, const struct sa *dst,
|
int rtp_send(struct rtp_sock *rs, const struct sa *dst, bool ext,
|
||||||
bool marker, uint8_t pt, uint32_t ts, struct mbuf *mb);
|
bool marker, uint8_t pt, uint32_t ts, struct mbuf *mb);
|
||||||
int rtp_debug(struct re_printf *pf, const struct rtp_sock *rs);
|
int rtp_debug(struct re_printf *pf, const struct rtp_sock *rs);
|
||||||
void *rtp_sock(const struct rtp_sock *rs);
|
void *rtp_sock(const struct rtp_sock *rs);
|
||||||
|
|
|
@ -358,8 +358,8 @@ int rtp_listen(struct rtp_sock **rsp, int proto, const struct sa *ip,
|
||||||
*
|
*
|
||||||
* @note The buffer must have enough space for the RTP header
|
* @note The buffer must have enough space for the RTP header
|
||||||
*/
|
*/
|
||||||
int rtp_encode(struct rtp_sock *rs, bool marker, uint8_t pt, uint32_t ts,
|
int rtp_encode(struct rtp_sock *rs, bool ext, bool marker, uint8_t pt,
|
||||||
struct mbuf *mb)
|
uint32_t ts, struct mbuf *mb)
|
||||||
{
|
{
|
||||||
struct rtp_header hdr;
|
struct rtp_header hdr;
|
||||||
|
|
||||||
|
@ -368,7 +368,7 @@ int rtp_encode(struct rtp_sock *rs, bool marker, uint8_t pt, uint32_t ts,
|
||||||
|
|
||||||
hdr.ver = RTP_VERSION;
|
hdr.ver = RTP_VERSION;
|
||||||
hdr.pad = false;
|
hdr.pad = false;
|
||||||
hdr.ext = false;
|
hdr.ext = ext;
|
||||||
hdr.cc = 0;
|
hdr.cc = 0;
|
||||||
hdr.m = marker ? 1 : 0;
|
hdr.m = marker ? 1 : 0;
|
||||||
hdr.pt = pt;
|
hdr.pt = pt;
|
||||||
|
@ -421,7 +421,7 @@ int rtp_decode(struct rtp_sock *rs, struct mbuf *mb,
|
||||||
*
|
*
|
||||||
* @return 0 for success, otherwise errorcode
|
* @return 0 for success, otherwise errorcode
|
||||||
*/
|
*/
|
||||||
int rtp_send(struct rtp_sock *rs, const struct sa *dst,
|
int rtp_send(struct rtp_sock *rs, const struct sa *dst, bool ext,
|
||||||
bool marker, uint8_t pt, uint32_t ts, struct mbuf *mb)
|
bool marker, uint8_t pt, uint32_t ts, struct mbuf *mb)
|
||||||
{
|
{
|
||||||
size_t pos;
|
size_t pos;
|
||||||
|
@ -441,7 +441,7 @@ int rtp_send(struct rtp_sock *rs, const struct sa *dst,
|
||||||
|
|
||||||
pos = mb->pos;
|
pos = mb->pos;
|
||||||
|
|
||||||
err = rtp_encode(rs, marker, pt, ts, mb);
|
err = rtp_encode(rs, ext, marker, pt, ts, mb);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue