Skip to content

Commit 920a41d

Browse files
committed
rtp: add extension bit to the api
1 parent d20d56a commit 920a41d

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

include/re_rtp.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,10 @@ int rtp_listen(struct rtp_sock **rsp, int proto, const struct sa *ip,
204204
rtp_recv_h *recvh, rtcp_recv_h *rtcph, void *arg);
205205
int rtp_hdr_encode(struct mbuf *mb, const struct rtp_header *hdr);
206206
int rtp_hdr_decode(struct rtp_header *hdr, struct mbuf *mb);
207-
int rtp_encode(struct rtp_sock *rs, bool marker, uint8_t pt,
207+
int rtp_encode(struct rtp_sock *rs, bool ext, bool marker, uint8_t pt,
208208
uint32_t ts, struct mbuf *mb);
209209
int rtp_decode(struct rtp_sock *rs, struct mbuf *mb, struct rtp_header *hdr);
210-
int rtp_send(struct rtp_sock *rs, const struct sa *dst,
210+
int rtp_send(struct rtp_sock *rs, const struct sa *dst, bool ext,
211211
bool marker, uint8_t pt, uint32_t ts, struct mbuf *mb);
212212
int rtp_debug(struct re_printf *pf, const struct rtp_sock *rs);
213213
void *rtp_sock(const struct rtp_sock *rs);

src/rtp/rtp.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,8 @@ int rtp_listen(struct rtp_sock **rsp, int proto, const struct sa *ip,
358358
*
359359
* @note The buffer must have enough space for the RTP header
360360
*/
361-
int rtp_encode(struct rtp_sock *rs, bool marker, uint8_t pt, uint32_t ts,
362-
struct mbuf *mb)
361+
int rtp_encode(struct rtp_sock *rs, bool ext, bool marker, uint8_t pt,
362+
uint32_t ts, struct mbuf *mb)
363363
{
364364
struct rtp_header hdr;
365365

@@ -368,7 +368,7 @@ int rtp_encode(struct rtp_sock *rs, bool marker, uint8_t pt, uint32_t ts,
368368

369369
hdr.ver = RTP_VERSION;
370370
hdr.pad = false;
371-
hdr.ext = false;
371+
hdr.ext = ext;
372372
hdr.cc = 0;
373373
hdr.m = marker ? 1 : 0;
374374
hdr.pt = pt;
@@ -421,7 +421,7 @@ int rtp_decode(struct rtp_sock *rs, struct mbuf *mb,
421421
*
422422
* @return 0 for success, otherwise errorcode
423423
*/
424-
int rtp_send(struct rtp_sock *rs, const struct sa *dst,
424+
int rtp_send(struct rtp_sock *rs, const struct sa *dst, bool ext,
425425
bool marker, uint8_t pt, uint32_t ts, struct mbuf *mb)
426426
{
427427
size_t pos;
@@ -441,7 +441,7 @@ int rtp_send(struct rtp_sock *rs, const struct sa *dst,
441441

442442
pos = mb->pos;
443443

444-
err = rtp_encode(rs, marker, pt, ts, mb);
444+
err = rtp_encode(rs, ext, marker, pt, ts, mb);
445445
if (err)
446446
return err;
447447

0 commit comments

Comments
 (0)