aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2016-10-21 19:31:46 +0200
committerMax <msuraev@sysmocom.de>2016-10-21 19:45:00 +0200
commit02ceea8342bd4d722c2ac64550eb40b1060a532b (patch)
tree0efe2f5f7f1231128998ac5d08e19822fa2d5a6a
parent7a228ebc604052017f750edd45a3846085b72126 (diff)
Extend RTP RX callback parameters
While debugging low-level RTP issues it is handy to be able to match exact RTP packet with the payload available to higher-level functions. Having Sequence number and Timestamp RTP fields as parameter to receiving callback is the easiest way to do so. Change-Id: I0c9b08d247d7342d6139badca77ce64fda0cf274
-rw-r--r--TODO-RELEASE1
-rw-r--r--include/osmocom/trau/osmo_ortp.h3
-rw-r--r--src/trau/osmo_ortp.c4
3 files changed, 7 insertions, 1 deletions
diff --git a/TODO-RELEASE b/TODO-RELEASE
index 3af993e..128778a 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -1,3 +1,4 @@
#library what description / commit summary line
libosmo-abis API change major: add parameter to rx_cb() callack in osmo_ortp.h
libosmo-abis API change major: add parameter to struct input_signal_data
+libosmo-abis API change major: add parameters to rx_cb() callack in osmo_ortp.h
diff --git a/include/osmocom/trau/osmo_ortp.h b/include/osmocom/trau/osmo_ortp.h
index 1c0b223..9eb176f 100644
--- a/include/osmocom/trau/osmo_ortp.h
+++ b/include/osmocom/trau/osmo_ortp.h
@@ -55,7 +55,8 @@ struct osmo_rtp_socket {
/*! \brief callback for incoming data */
void (*rx_cb)(struct osmo_rtp_socket *rs, const uint8_t *payload,
- unsigned int payload_len, bool marker);
+ unsigned int payload_len, uint16_t seq_number,
+ uint32_t timestamp, bool marker);
/*! \brief Receive user timestamp, to be incremented by user */
uint32_t rx_user_ts;
diff --git a/src/trau/osmo_ortp.c b/src/trau/osmo_ortp.c
index e3c6234..e990487 100644
--- a/src/trau/osmo_ortp.c
+++ b/src/trau/osmo_ortp.c
@@ -161,6 +161,8 @@ int osmo_rtp_socket_poll(struct osmo_rtp_socket *rs)
if (rs->rx_cb)
rs->rx_cb(rs, mblk->b_rptr,
mblk->b_wptr - mblk->b_rptr,
+ rtp_get_seqnumber(mblk),
+ rtp_get_timestamp(mblk),
rtp_get_markbit(mblk));
//rs->rx_user_ts += 160;
freemsg(mblk);
@@ -192,6 +194,8 @@ static int osmo_rtp_fd_cb(struct osmo_fd *fd, unsigned int what)
if (rs->rx_cb)
rs->rx_cb(rs, mblk->b_rptr,
mblk->b_wptr - mblk->b_rptr,
+ rtp_get_seqnumber(mblk),
+ rtp_get_timestamp(mblk),
rtp_get_markbit(mblk));
freemsg(mblk);
} else