]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
rtp: Allow specifying contract parameters in URL
authorMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 21 May 2010 09:14:22 +0000 (11:14 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 21 May 2010 09:14:22 +0000 (11:14 +0200)
libavformat/rtpproto.c

index a18bf558557fe6ea09512846a4db8400d070bd3d..ebfdf4a3f66828001ec0b749abefe56c664623d8 100644 (file)
@@ -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);