]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/blobdiff - libavformat/rtpproto.c
Reworked assignment of FRSH contract parameters
[frescor/ffmpeg.git] / libavformat / rtpproto.c
index 727c799619801d4104b29f6151a153353d21e8b0..a18bf558557fe6ea09512846a4db8400d070bd3d 100644 (file)
@@ -19,6 +19,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+int frsh_rtp_budget=0, frsh_rtp_period_ms=0, frsh_rtp_deadline_ms=0;
+
 /**
  * @file libavformat/rtpproto.c
  * RTP protocol
@@ -109,7 +111,7 @@ static void build_udp_url(char *buf, int buf_size,
                           const char *hostname, int port,
                           int local_port, int ttl,
                           int max_packet_size,
-                         const char *label)
+                         const char *label, int budget, int period_ms, int deadline_ms)
 {
     snprintf(buf, buf_size, URL_PROTO"://%s:%d", hostname, port);
     if (local_port >= 0)
@@ -120,6 +122,12 @@ static void build_udp_url(char *buf, int buf_size,
         url_add_option(buf, buf_size, "pkt_size=%d", max_packet_size);
     if (label)
         url_add_option(buf, buf_size, "contract_label=%s", label);
+    if (budget >=0)
+        url_add_option(buf, buf_size, "budget=%d", budget);
+    if (period_ms >=0)
+        url_add_option(buf, buf_size, "period=%d", period_ms);
+    if (deadline_ms >=0)
+        url_add_option(buf, buf_size, "deadline=%d", deadline_ms);
 }
 
 /**
@@ -167,7 +175,8 @@ static int rtp_open(URLContext *h, const char *uri, int flags)
     }
 
     build_udp_url(buf, sizeof(buf),
-                  hostname, port, local_port, ttl, max_packet_size, "RTP");
+                  hostname, port, local_port, ttl, max_packet_size, "RTP",
+                 frsh_rtp_budget, frsh_rtp_period_ms, frsh_rtp_deadline_ms);
     if (url_open(&s->rtp_hd, buf, flags) < 0)
         goto fail;
     local_port = udp_get_local_port(s->rtp_hd);
@@ -176,7 +185,8 @@ static int rtp_open(URLContext *h, const char *uri, int flags)
     /* well, should suppress localport in path */
 
     build_udp_url(buf, sizeof(buf),
-                  hostname, port + 1, local_port + 1, ttl, max_packet_size, "RTCP");
+                  hostname, port + 1, local_port + 1, ttl, max_packet_size, "RTCP",
+                 1000, 100*1000, 0);
     if (url_open(&s->rtcp_hd, buf, flags) < 0)
         goto fail;