aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2017-06-08 17:06:58 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2017-08-14 19:34:31 +0200
commit5746bb868ecb48924f2ff634c5ec2ad8d4baf591 (patch)
tree8aefaca975ed5e9ea3b98d9f49bfdc5d9c84cb11
parenta409ae63e3d035f7f15da07755cd392bec53e6c6 (diff)
tests: jibuf_test: Add parameters to control size of buffer
-rw-r--r--tests/jibuf/jibuf_test.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/tests/jibuf/jibuf_test.c b/tests/jibuf/jibuf_test.c
index 2d05cdf..872b98c 100644
--- a/tests/jibuf/jibuf_test.c
+++ b/tests/jibuf/jibuf_test.c
@@ -57,6 +57,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 */
@@ -520,8 +522,8 @@ void pcap_test() {
jb = osmo_jibuf_alloc();
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);
@@ -536,20 +538,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();
@@ -569,6 +573,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;
}