osmux: batching factor can be explicitly configured by caller

Not hardcoded in osmux.c code anymore.
This commit is contained in:
Pablo Neira Ayuso 2012-08-06 18:45:18 +02:00 committed by Pablo Neira Ayuso
parent f366c924e2
commit 468d81b4ac
3 changed files with 3 additions and 4 deletions

View File

@ -42,6 +42,7 @@ struct osmux_hdr {
/* one to handle all existing RTP flows */
struct osmux_in_handle {
uint8_t osmux_seq;
uint8_t batch_factor;
void (*deliver)(struct msgb *msg);
char *data; /* internal data */
};

View File

@ -31,9 +31,6 @@
/* XXX: MTU - iphdr (20 bytes) - udphdr (8 bytes) */
#define OSMUX_BATCH_MAX 1472
/* XXX: make this configurable */
#define OSMUX_BATCH_FACTOR 4
/* delta time between two RTP messages */
#define DELTA_RTP_MSG 20000
@ -359,7 +356,7 @@ int osmux_xfrm_input(struct osmux_in_handle *h, struct msgb *msg)
"osmux start timer batch\n");
osmo_timer_schedule(&batch->timer, 0,
OSMUX_BATCH_FACTOR * DELTA_RTP_MSG);
h->batch_factor * DELTA_RTP_MSG);
}
ret = osmux_msgb_batch_queue_add(batch, msg);
break;

View File

@ -70,6 +70,7 @@ static void deliver(struct msgb *batch_msg)
*/
struct osmux_in_handle h_input = {
.osmux_seq = 0, /* sequence number to start OSmux message from */
.batch_factor = 4, /* batch up to 4 RTP messages */
.deliver = deliver,
};