aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2019-05-17 17:11:02 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2019-05-17 17:12:56 +0200
commitf0f1ebf70ea2222f97bb7445805ec7466dbcd22e (patch)
tree5387a63bfd17c422796183c41d44b700b885a07a /src
parentfd339712c4bc79e60e257f563771470a5214fbd6 (diff)
osmux: Extend osmux_out_handle and add new API to set rtp payload_type
Previously payload_type was always hardcoded to 98 for generated rtp packets from incoming osmux frame. Change-Id: I5cbeb494a8932953d9fd2dc24dacf8cd97fd84e4
Diffstat (limited to 'src')
-rw-r--r--src/osmux.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/osmux.c b/src/osmux.c
index 7a6ce60..8b6a115 100644
--- a/src/osmux.c
+++ b/src/osmux.c
@@ -146,7 +146,7 @@ osmux_rebuild_rtp(struct osmux_out_handle *h, struct osmux_hdr *osmuxh,
rtph->csrc_count = 0;
rtph->extension = 0;
rtph->version = RTP_VERSION;
- rtph->payload_type = 98;
+ rtph->payload_type = h->rtp_payload_type;
/* ... emulate timestamp and ssrc */
rtph->timestamp = htonl(h->rtp_timestamp);
rtph->sequence = htons(h->rtp_seq);
@@ -999,16 +999,23 @@ osmux_tx_sched(struct llist_head *list,
}
}
-void osmux_xfrm_output_init(struct osmux_out_handle *h, uint32_t rtp_ssrc)
+void osmux_xfrm_output_init2(struct osmux_out_handle *h, uint32_t rtp_ssrc, uint8_t rtp_payload_type)
{
memset(h, 0, sizeof(*h));
h->rtp_seq = (uint16_t)random();
h->rtp_timestamp = (uint32_t)random();
h->rtp_ssrc = rtp_ssrc;
+ h->rtp_payload_type = rtp_payload_type;
INIT_LLIST_HEAD(&h->list);
osmo_timer_setup(&h->timer, osmux_xfrm_output_trigger, h);
}
+void osmux_xfrm_output_init(struct osmux_out_handle *h, uint32_t rtp_ssrc)
+{
+ /* backward compatibility with old users, where 98 was harcoded in osmux_rebuild_rtp() */
+ osmux_xfrm_output_init2(h, rtp_ssrc, 98);
+}
+
#define SNPRINTF_BUFFER_SIZE(ret, remain, offset) \
if (ret < 0) \
ret = 0; \