mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
rtp: move parameter intialization to rtp_init()
This commit is contained in:
parent
b1381010fd
commit
bf40a85040
1 changed files with 16 additions and 5 deletions
|
@ -96,6 +96,21 @@ static int rtp_aimd(struct node *n, double loss_frac)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int rtp_init(struct node *n)
|
||||
{
|
||||
struct rtp *r = (struct rtp *) n->_vd;
|
||||
|
||||
/* Default values */
|
||||
r->rate = 1;
|
||||
|
||||
r->aimd.a = 10;
|
||||
r->aimd.b = 0.5;
|
||||
r->aimd.last_rate = 1;
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int rtp_reverse(struct node *n)
|
||||
{
|
||||
struct rtp *r = (struct rtp *) n->_vd;
|
||||
|
@ -124,11 +139,6 @@ int rtp_parse(struct node *n, json_t *cfg)
|
|||
json_error_t err;
|
||||
json_t *json_rtcp = NULL, *json_aimd = NULL;
|
||||
|
||||
/* Default values */
|
||||
r->aimd.a = 10;
|
||||
r->aimd.b = 0.5;
|
||||
r->aimd.last_rate = 1;
|
||||
|
||||
ret = json_unpack_ex(cfg, &err, 0, "{ s?: s, s?: f, s?: o, s?: o, s: { s: s }, s: { s: s } }",
|
||||
"format", &format,
|
||||
"rate", &r->rate,
|
||||
|
@ -568,6 +578,7 @@ static struct plugin p = {
|
|||
.size = sizeof(struct rtp),
|
||||
.type.start = rtp_type_start,
|
||||
.type.stop = rtp_type_stop,
|
||||
.init = rtp_init,
|
||||
.reverse = rtp_reverse,
|
||||
.parse = rtp_parse,
|
||||
.print = rtp_print,
|
||||
|
|
Loading…
Add table
Reference in a new issue