From: Michal Sojka Date: Fri, 21 May 2010 09:14:22 +0000 (+0200) Subject: rtp: Allow specifying contract parameters in URL X-Git-Url: https://rtime.felk.cvut.cz/gitweb/frescor/ffmpeg.git/commitdiff_plain/b239fc6108c44012c40c4116db4865211ee41a80 rtp: Allow specifying contract parameters in URL --- diff --git a/libavformat/rtpproto.c b/libavformat/rtpproto.c index a18bf5585..ebfdf4a3f 100644 --- a/libavformat/rtpproto.c +++ b/libavformat/rtpproto.c @@ -146,6 +146,9 @@ static int rtp_open(URLContext *h, const char *uri, int flags) char buf[1024]; char path[1024]; const char *p; + int budget=frsh_rtp_budget; + int period_ms=frsh_rtp_period_ms; + int deadline_ms=frsh_rtp_deadline_ms; is_output = (flags & URL_WRONLY); @@ -172,11 +175,20 @@ static int rtp_open(URLContext *h, const char *uri, int flags) if (find_info_tag(buf, sizeof(buf), "pkt_size", p)) { max_packet_size = strtol(buf, NULL, 10); } + if (find_info_tag(buf, sizeof(buf), "budget", p)) { + budget = strtol(buf, NULL, 10); + } + if (find_info_tag(buf, sizeof(buf), "period", p)) { + period_ms = strtol(buf, NULL, 10); + } + if (find_info_tag(buf, sizeof(buf), "deadline", p)) { + deadline_ms = strtol(buf, NULL, 10); + } } build_udp_url(buf, sizeof(buf), hostname, port, local_port, ttl, max_packet_size, "RTP", - frsh_rtp_budget, frsh_rtp_period_ms, frsh_rtp_deadline_ms); + budget, period_ms, deadline_ms); if (url_open(&s->rtp_hd, buf, flags) < 0) goto fail; local_port = udp_get_local_port(s->rtp_hd);