[MERGED] libosmo-netif[master]: tests: jibuf_tool: Add parameters to control size of buffer

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Mon Apr 16 15:15:02 UTC 2018


Harald Welte has submitted this change and it was merged.

Change subject: tests: jibuf_tool: Add parameters to control size of buffer
......................................................................


tests: jibuf_tool: Add parameters to control size of buffer

Change-Id: I8a7fa39985f8d197e24c32cab80299aba2d03087
---
M tests/jibuf/jibuf_tool.c
1 file changed, 14 insertions(+), 4 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/tests/jibuf/jibuf_tool.c b/tests/jibuf/jibuf_tool.c
index ce6632a..d24086c 100644
--- a/tests/jibuf/jibuf_tool.c
+++ b/tests/jibuf/jibuf_tool.c
@@ -60,6 +60,8 @@
 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 */
@@ -501,8 +503,8 @@
 
 	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);
@@ -517,20 +519,22 @@
 
 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();
@@ -550,6 +554,12 @@
 		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;
 		}

-- 
To view, visit https://gerrit.osmocom.org/7777
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8a7fa39985f8d197e24c32cab80299aba2d03087
Gerrit-PatchSet: 2
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list