diff --git a/src/dcall.c b/src/dcall.c index 6e5157e..666d879 100644 --- a/src/dcall.c +++ b/src/dcall.c @@ -16,6 +16,8 @@ struct dcall_elements { int remote_port, local_port, latency; guint64 grtppktlost; GMainLoop *loop; + char* buffering_mode; + gboolean droplat; }; int create_rx_chain(struct dcall_elements* de) { @@ -40,8 +42,8 @@ int create_rx_chain(struct dcall_elements* de) { g_object_set(G_OBJECT (de->rx_jitterbuffer), "do-lost", TRUE, NULL); g_object_set(G_OBJECT (de->rx_jitterbuffer), "do-retransmission", FALSE, NULL); g_object_set(G_OBJECT (de->rx_jitterbuffer), "latency", de->latency, NULL); - g_object_set(G_OBJECT (de->rx_jitterbuffer), "drop-on-latency", FALSE, NULL); - gst_util_set_object_arg(G_OBJECT(de->rx_jitterbuffer), "mode", "slave"); + g_object_set(G_OBJECT (de->rx_jitterbuffer), "drop-on-latency", de->droplat, NULL); + gst_util_set_object_arg(G_OBJECT(de->rx_jitterbuffer), "mode", de->buffering_mode); g_object_set(G_OBJECT (de->rx_opusdec), "plc", TRUE, NULL); g_object_set(G_OBJECT (de->rx_opusdec), "use-inband-fec", FALSE, NULL); @@ -227,11 +229,13 @@ int main(int argc, char *argv[]) { .local_port = 5000, .audio_sink = "pulsesink", .audio_tap = "pulsesrc", - .grtppktlost = 0 + .grtppktlost = 0, + .droplat = FALSE, + .buffering_mode = "slave" }; int opt = 0; - while ((opt = getopt(argc, argv, "t:s:r:p:l:d:a:hb:c:")) != -1) { + while ((opt = getopt(argc, argv, "t:s:r:p:l:d:a:hb:c:m:o")) != -1) { switch(opt) { case 'a': de.audio_file = optarg; @@ -251,6 +255,11 @@ int main(int argc, char *argv[]) { case 'p': de.remote_port = atoi(optarg); break; + case 'o': + de.droplat = TRUE; + break; + case 'm': + de.buffering_mode = optarg; case 'r': de.remote_host = optarg; break;