aboutsummaryrefslogtreecommitdiffstats
path: root/include
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 /include
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 'include')
-rw-r--r--include/osmocom/netif/osmux.h28
1 files changed, 13 insertions, 15 deletions
diff --git a/include/osmocom/netif/osmux.h b/include/osmocom/netif/osmux.h
index 3de5127..38254fa 100644
--- a/include/osmocom/netif/osmux.h
+++ b/include/osmocom/netif/osmux.h
@@ -18,26 +18,24 @@
struct osmux_hdr {
#if __BYTE_ORDER == __BIG_ENDIAN
- uint8_t ft:4,
- amr_cmr:4;
+ uint8_t ft:3,
+ ctr:3,
+ amr_f:1,
+ amr_q:1;
#elif __BYTE_ORDER == __LITTLE_ENDIAN
- uint8_t amr_cmr:4,
- ft:4;
+ uint8_t amr_q:1,
+ amr_f:1,
+ ctr:3,
+ ft:3;
#endif
- uint8_t circuit_id;
uint8_t seq;
+ uint8_t circuit_id;
#if __BYTE_ORDER == __BIG_ENDIAN
- uint8_t amr_f:1,
- amr_ft:4,
- amr_q:1,
- rtp_marker:1,
- pad:1;
+ uint8_t amr_ft:4,
+ amr_cmr:4;
#elif __BYTE_ORDER == __LITTLE_ENDIAN
- uint8_t pad:1,
- rtp_marker:1,
- amr_q:1,
- amr_ft:4,
- amr_f:1;
+ uint8_t amr_cmr:4,
+ amr_ft:4;
#endif
} __attribute__((packed));