aboutsummaryrefslogtreecommitdiffstats
path: root/tests/osmo-pcap-test
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@gnumonks.org>2012-08-02 20:24:57 +0200
committerPablo Neira Ayuso <pablo@gnumonks.org>2012-08-02 20:36:19 +0200
commitffd20f3f1c56c6d47ec196c09069fb6b00ca081a (patch)
treeb99b04219adb02b269740a8f1e6928f80a508ecd /tests/osmo-pcap-test
parentb03de23120b2a45138fa99178b962198b5b0324e (diff)
osmux: major rework to reduce batch message size (add counter field)
This patch adds the counter field to the osmux header, so we can reduce the size of the batch even further, eg. osmuxhdr (ctr=3) speech speech speech osmuxhdr (ctr=2) speech speech ... The new header is the following: 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | FT | CTR |F|Q| SeqNR | Circuit ID |AMR-FT |AMR-CMR| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ The counter field is 3 bits long, thus, we can batch up to 8 RTP speech frames into one single batch per circuit ID. I have also removed the RTP marker, since it can be reconstructed from the AMR information. Moreover, the entire workflow has been also reworked. Whenever a packet arrives, we introduce it into the batch list. This batch list contains a list of RTP messages ordered by RTP SSRC. Then, once the batch timer expires or the it gets full, we build the batch from the list of RTP messages. Note that this allows us to put several speech frame into one single osmux header without actually worrying about the amount of messages that we'll receive. The functions that reconstruct the RTP messages has been also adjusted. Now, it returns a list of RTP messages per RTP SSRC that has been extracted from the batch.
Diffstat (limited to 'tests/osmo-pcap-test')
-rw-r--r--tests/osmo-pcap-test/osmux_test.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/osmo-pcap-test/osmux_test.c b/tests/osmo-pcap-test/osmux_test.c
index f217635..c089ddf 100644
--- a/tests/osmo-pcap-test/osmux_test.c
+++ b/tests/osmo-pcap-test/osmux_test.c
@@ -63,12 +63,22 @@ static void deliver(struct msgb *batch_msg)
/* This code below belongs to the osmux receiver */
while((osmuxh = osmux_xfrm_output_pull(batch_msg)) != NULL) {
+ struct msgb *next;
+
msg = osmux_xfrm_output(osmuxh, &h_output);
printf("scheduled transmision in %lu.%6lu seconds, "
"msg=%p (%d in batch)\n",
tv.tv_sec, tv.tv_usec, msg, ++i);
osmux_tx_sched(msg, &tv, tx_cb, NULL);
timeradd(&tv, &delta, &tv);
+
+ llist_for_each_entry(next, &msg->list, list) {
+ printf("scheduled transmision in %lu.%6lu seconds, "
+ "msg=%p (%d in batch)\n",
+ tv.tv_sec, tv.tv_usec, next, ++i);
+ osmux_tx_sched(next, &tv, tx_cb, NULL);
+ timeradd(&tv, &delta, &tv);
+ }
}
}