aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-04-18 13:58:46 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2018-04-19 18:24:25 +0200
commitdbf8e531927a39cb044c5ccdde54173d0f213a2e (patch)
treedf65c0d189b6c7391b3b16e94ecd825484f70d97 /include/osmocom
parent6fb0f4de860245e7f176e65bc157ecae2afdc370 (diff)
osmux: Add new API osmux_xfrm_output_sched to fix rtp generation issues
With old implementation, in conditions with jitter we could end up scheduling RTP generated packets from two consecutive osmux frames in an interleaved way (from seq field point of view). This new implementation should make it easier for any RTP reader/playback to have better results in those conditions. Old APIs osmux_xfm_output and osmux_tx_sched are marked as deprecated in favour of the new one, which has a better control of generated RTP packets. However, they are still usable despite the implementation changes done to support the new API. Related: OS#3180 Change-Id: I4e05ff141eb4041128ae77812bbcfe84ed4c02de
Diffstat (limited to 'include/osmocom')
-rw-r--r--include/osmocom/netif/osmux.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/include/osmocom/netif/osmux.h b/include/osmocom/netif/osmux.h
index 5283059..e8e2c67 100644
--- a/include/osmocom/netif/osmux.h
+++ b/include/osmocom/netif/osmux.h
@@ -2,6 +2,7 @@
#define _OSMUX_H_
#include <osmocom/core/endian.h>
+#include <osmocom/core/timer.h>
/*! \addtogroup osmux
* @{
@@ -79,6 +80,10 @@ struct osmux_out_handle {
uint16_t rtp_seq;
uint32_t rtp_timestamp;
uint32_t rtp_ssrc;
+ struct osmo_timer_list timer;
+ struct llist_head list;
+ void (*tx_cb)(struct msgb *msg, void *data); /* Used defined rtp tx callback */
+ void *data; /* User defined opaque data structure */
};
static inline uint8_t *osmux_get_payload(struct osmux_hdr *osmuxh)
@@ -101,10 +106,13 @@ int osmux_xfrm_input(struct osmux_in_handle *h, struct msgb *msg, int ccid);
void osmux_xfrm_input_deliver(struct osmux_in_handle *h);
void osmux_xfrm_output_init(struct osmux_out_handle *h, uint32_t rtp_ssrc);
-int osmux_xfrm_output(struct osmux_hdr *osmuxh, struct osmux_out_handle *h, struct llist_head *list);
+void osmux_xfrm_output_set_tx_cb(struct osmux_out_handle *h, void (*tx_cb)(struct msgb *msg, void *data), void *data);
+int osmux_xfrm_output(struct osmux_hdr *osmuxh, struct osmux_out_handle *h, struct llist_head *list) OSMO_DEPRECATED("Use osmux_xfrm_output_sched() instead");
+int osmux_xfrm_output_sched(struct osmux_out_handle *h, struct osmux_hdr *osmuxh);
+void osmux_xfrm_output_flush(struct osmux_out_handle *h);
struct osmux_hdr *osmux_xfrm_output_pull(struct msgb *msg);
-void osmux_tx_sched(struct llist_head *list, void (*tx_cb)(struct msgb *msg, void *data), void *data);
+void osmux_tx_sched(struct llist_head *list, void (*tx_cb)(struct msgb *msg, void *data), void *data) OSMO_DEPRECATED("Use osmux_xfrm_output_set_tx_cb() instead");
/*! @} */