]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
dccp_send: Add command line options for FEC parameters.
authorAndre Noll <maan@systemlinux.org>
Fri, 18 Jun 2010 08:40:06 +0000 (10:40 +0200)
committerAndre Noll <maan@systemlinux.org>
Fri, 18 Jun 2010 08:40:06 +0000 (10:40 +0200)
ATM, these are hardcoded as MPS/3/4. This patch allows to impose
an upper bound on the slice size and to change the number of (data)
slices of a FEC group.

dccp_send.c
ggo/server.m4

index 9a2f6caf33a2982cc621de6d8cfe04f27fd25573..6cfdfbbeddccb42cd46a5d4b8c06aec24a0427ec 100644 (file)
@@ -97,6 +97,8 @@ static int dccp_init_fec(struct sender_client *sc)
        }
        PARA_INFO_LOG("current MPS = %d bytes\n", mps);
        assert(mps > 0);
        }
        PARA_INFO_LOG("current MPS = %d bytes\n", mps);
        assert(mps > 0);
+       if (conf.dccp_max_slice_size_arg > 0)
+               mps = PARA_MIN(mps, conf.dccp_max_slice_size_arg);
        return mps;
 }
 
        return mps;
 }
 
@@ -139,8 +141,8 @@ static void dccp_post_select(fd_set *rfds, __a_unused fd_set *wfds)
        }
        dfc = para_calloc(sizeof(*dfc));
        sc->private_data = dfc;
        }
        dfc = para_calloc(sizeof(*dfc));
        sc->private_data = dfc;
-       dfc->fcp.slices_per_group       = 4;
-       dfc->fcp.data_slices_per_group  = 3;
+       dfc->fcp.data_slices_per_group  = conf.dccp_data_slices_per_group_arg;
+       dfc->fcp.slices_per_group       = conf.dccp_slices_per_group_arg;
        dfc->fcp.init_fec               = dccp_init_fec;
        dfc->fcp.send_fec               = dccp_send_fec;
        dfc->fc = vss_add_fec_client(sc, &dfc->fcp);
        dfc->fcp.init_fec               = dccp_init_fec;
        dfc->fcp.send_fec               = dccp_send_fec;
        dfc->fc = vss_add_fec_client(sc, &dfc->fcp);
@@ -210,7 +212,7 @@ static char *dccp_info(void)
  */
 void dccp_send_init(struct sender *s)
 {
  */
 void dccp_send_init(struct sender *s)
 {
-       int ret;
+       int ret, k, n;
 
        s->info = dccp_info;
        s->send = NULL;
 
        s->info = dccp_info;
        s->send = NULL;
@@ -225,6 +227,15 @@ void dccp_send_init(struct sender *s)
        s->client_cmds[SENDER_ADD] = NULL;
        s->client_cmds[SENDER_DELETE] = NULL;
 
        s->client_cmds[SENDER_ADD] = NULL;
        s->client_cmds[SENDER_DELETE] = NULL;
 
+       k = conf.dccp_data_slices_per_group_arg;
+       n = conf.dccp_slices_per_group_arg;
+
+       if (k <= 0 || n <= 0 || k >= n) {
+               PARA_WARNING_LOG("invalid FEC parameters, using defaults\n");
+               conf.dccp_data_slices_per_group_arg = 3;
+               conf.dccp_slices_per_group_arg = 4;
+       }
+
        init_sender_status(dss, conf.dccp_access_arg, conf.dccp_access_given,
                conf.dccp_port_arg, conf.dccp_max_clients_arg,
                conf.dccp_default_deny_given);
        init_sender_status(dss, conf.dccp_access_arg, conf.dccp_access_given,
                conf.dccp_port_arg, conf.dccp_max_clients_arg,
                conf.dccp_default_deny_given);
index 4be4e2c9f029766e7376d0949153f7ed7e560a94..af5d8f633b59d55537af83ebe2ebc8d9f915dd9d 100644 (file)
@@ -238,6 +238,53 @@ details="
        See http_max_clients for details.
 "
 
        See http_max_clients for details.
 "
 
+option "dccp_max_slice_size" -
+#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+"Upper bound for the FEC slice size"
+int typestr = "size"
+default = "0"
+details = "
+       If this value is non-positive (the default) the dccp sender
+       uses the maximum packet size (MPS) of the connection as the
+       slice size. The MPS is a network parameter and depends on
+       the path maximum transmission unit (path MTU) of an incoming
+       connection, i.e. on the largest packet size that can be
+       transmitted without causing fragmentation.
+
+       This option allows to use a value less than the MPS in order
+       to fine-tune application performance. Values greater than
+       the MPS of an incoming connection can not be set.
+"
+
+option "dccp_data_slices_per_group" -
+#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+"The number of non-redundant slices per FEC group"
+int typestr = "num"
+default = "3"
+details = "
+       This determines the number of slices in each FEC group that are
+       necessary to decode the group. The given number must be smaller
+       than the value of the dccp_slices_per_group option below.
+
+       Note that the duration of a FEC group is proportional to the
+       product dccp_max_slice_size * dccp_data_slices_per_group.
+"
+
+option "dccp_slices_per_group" -
+#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+"The total number of slices per FEC group"
+int typestr = "num"
+default = "4"
+details = "
+       This value must be larger than the value given for above
+       dccp_data_slices_per_group above. The difference being the
+       number of redundant slices per group, i.e.  the number of
+       data packets that may be lost without causing interruptions
+       of the resulting audio stream.
+
+       Increase this value if for lossy networks.
+"
+
 ####################
 section "udp sender"
 ####################
 ####################
 section "udp sender"
 ####################