From: Andre Date: Tue, 14 Mar 2006 18:18:51 +0000 (+0100) Subject: ortp: make jitter compensation configurable. X-Git-Tag: v0.2.12~149 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=15c54cf98b77882a8f4d59a550948133341ad671;p=paraslash.git ortp: make jitter compensation configurable. Non-zero values turn on ortp's adaptive jitter compensation. --- diff --git a/ortp_recv.c b/ortp_recv.c index 58245090..4df8e3a5 100644 --- a/ortp_recv.c +++ b/ortp_recv.c @@ -256,8 +256,11 @@ static int ortp_recv_open(struct receiver_node *rn) PARA_NOTICE_LOG("receiving from %s:%d\n", conf->host_arg, conf->port_arg); rtp_session_set_local_addr(pord->session, conf->host_arg, conf->port_arg); rtp_session_set_payload_type(pord->session, PAYLOAD_AUDIO_CONTINUOUS); - rtp_session_enable_adaptive_jitter_compensation(pord->session, TRUE); - rtp_session_set_jitter_compensation(pord->session, 40); + if (conf->jitter_compensation_arg) { + rtp_session_enable_adaptive_jitter_compensation(pord->session, TRUE); + rtp_session_set_jitter_compensation(pord->session, + conf->jitter_compensation_arg); + } return 1; } diff --git a/ortp_recv.ggo b/ortp_recv.ggo index 6902fede..68ff6e7a 100644 --- a/ortp_recv.ggo +++ b/ortp_recv.ggo @@ -1,3 +1,4 @@ section "ortp options" option "host" i "ip or host to receive rtp packets from" string default="224.0.1.38" no option "port" p "udp port." int typestr="portnumber" default="1500" no +option "jitter_compensation" j "non-zero values enable ortp's adaptive jitter compensation" int typestr="milliseconds" default="400" no diff --git a/ortp_send.c b/ortp_send.c index fd9a9a11..aabbb7da 100644 --- a/ortp_send.c +++ b/ortp_send.c @@ -103,9 +103,11 @@ static void ortp_init_session(struct ortp_target *ot) if (!ot->session) return; s = ot->session; - rtp_session_enable_adaptive_jitter_compensation(ot->session, TRUE); - rtp_session_set_jitter_compensation(ot->session, 40); -// rtp_session_set_jitter_compensation(ot->session, 100); + if (conf.ortp_jitter_compensation_arg) { + rtp_session_enable_adaptive_jitter_compensation(ot->session, TRUE); + rtp_session_set_jitter_compensation(ot->session, + conf.ortp_jitter_compensation_arg); + } /* always successful */ rtp_session_set_send_payload_type(s, PAYLOAD_AUDIO_CONTINUOUS); ret = rtp_session_set_remote_addr(s, TARGET_ADDR(ot), ot->port); @@ -161,8 +163,10 @@ static void ortp_send(struct audio_format *af, long unsigned current_chunk, continue; } if (!ot->chunk_ts) - ot->chunk_ts = rtp_session_time_to_ts(ot->session, tv2ms(&af->chunk_tv)); - PARA_DEBUG_LOG("len: %d, ts: %lu, ts: %d\n", len, ot->chunk_ts * chunks_sent, ot->chunk_ts); + ot->chunk_ts = rtp_session_time_to_ts(ot->session, + tv2ms(&af->chunk_tv)); +// PARA_DEBUG_LOG("len: %d, ts: %lu, ts: %d\n", +// len, ot->chunk_ts * chunks_sent, ot->chunk_ts); ot->streaming = 1; } if (list_empty(&targets)) diff --git a/server.ggo b/server.ggo index 0cf4bb62..41f9ea4e 100644 --- a/server.ggo +++ b/server.ggo @@ -34,10 +34,11 @@ option "http_no_autostart" - "do not open tcp port on server startup" flag off option "http_max_clients" - "maximal simultaneous connections, non-positive value means unlimited" int typestr="number" default="-1" no section "dccp sender" -option "dccp_port" - "port for http streaming" int typestr="portnumber" default="5001" no +option "dccp_port" - "port for dccp streaming" int typestr="portnumber" default="5001" no section "ortp sender" option "ortp_target" - "Add given host/port to the list of targets. This option can be given multiple times. Example: '224.0.1.38:1500' instructs the ortp sender to send to udp port 1500 on host 224.0.1.38 (unassigned ip in the Local Network Control Block 224.0.0/24). This is useful for LAN-streaming." string typestr="a.b.c.d:p" no multiple option "ortp_no_autostart" - "do not start to send automatically" flag off option "ortp_default_port" - "default udp port if not specified" int typestr="portnumber" default="1500" no option "ortp_header_interval" H "time between extra header sends" int typestr="milliseconds" default="2000" no +option "ortp_jitter_compensation" j "non-zero values enable ortp's adaptive jitter compensation" int typestr="milliseconds" default="400" no