diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2017-06-08 17:06:58 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2018-02-28 10:52:45 +0100 |
commit | 2c730a4c02dc0d460a11a8215d6d0a27ec978824 (patch) | |
tree | a5f25f99d54b8ffcfb3dc24e29b83a9071754914 | |
parent | 55f2b3aad16a92df0fd00385d8ae44afbb5fd0c1 (diff) |
tests: jibuf_tool: Add parameters to control size of buffer
Change-Id: I8a7fa39985f8d197e24c32cab80299aba2d03087
-rw-r--r-- | tests/jibuf/jibuf_tool.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/tests/jibuf/jibuf_tool.c b/tests/jibuf/jibuf_tool.c index faa6e38..78eece0 100644 --- a/tests/jibuf/jibuf_tool.c +++ b/tests/jibuf/jibuf_tool.c @@ -56,6 +56,8 @@ static bool opt_debug_human; static bool opt_debug_table; static bool opt_osmux; static char* opt_pcap_file; +uint32_t opt_buffer_min = 60; +uint32_t opt_buffer_max = 500; /* ----------------------------- */ /* Logging related stuff */ @@ -497,8 +499,8 @@ void pcap_test() { jb = osmo_jibuf_alloc(NULL); osmo_jibuf_set_dequeue_cb(jb, dequeue_cb, NULL); - osmo_jibuf_set_min_delay(jb, 60); - osmo_jibuf_set_max_delay(jb, 500); + osmo_jibuf_set_min_delay(jb, opt_buffer_min); + osmo_jibuf_set_max_delay(jb, opt_buffer_max); /* first run */ pcap_pkt_timer_cb(NULL); @@ -513,20 +515,22 @@ void pcap_test() { static void print_help(void) { - printf("jibuf_test [-r] [-p pcap] [-o] [-d] [-g]\n"); + printf("jibuf_test [-r] [-p pcap] [-o] [-d] [-g] [-m ms] [-M ms]\n"); printf(" -h Print this help message\n"); printf(" -r Run test with randomly generated jitter\n"); printf(" -p Run test with specified pcap file\n"); printf(" -o The pcap contains OSMUX packets isntead of RTP\n"); printf(" -d Enable packet trace debug suitable for humans\n"); printf(" -t Enable packet trace debug suitable for gnuplot\n"); + printf(" -m Minimum buffer size for the jitter-buffer, in ms (only used in -p mode)\n"); + printf(" -M Maximum buffer size for the jitter-buffer, in ms (only used in -p mode)\n"); } static int parse_options(int argc, char **argv) { int opt; - while ((opt = getopt(argc, argv, "hdtrop:")) != -1) { + while ((opt = getopt(argc, argv, "hdtrop:m:M:")) != -1) { switch (opt) { case 'h': print_help(); @@ -546,6 +550,12 @@ static int parse_options(int argc, char **argv) case 'p': opt_pcap_file = strdup(optarg); break; + case 'm': + opt_buffer_min = (uint32_t) atoi(optarg); + break; + case 'M': + opt_buffer_max = (uint32_t) atoi(optarg); + break; default: return -1; } |