diff options
author | Alfred E. Heggestad <alfred.heggestad@gmail.com> | 2017-10-29 18:43:06 +0100 |
---|---|---|
committer | Alfred E. Heggestad <alfred.heggestad@gmail.com> | 2017-10-29 18:43:06 +0100 |
commit | c9b82b677e939727f9dee299ce6e876191385a5d (patch) | |
tree | 057a895a178359aeee354cd64a40d3da5bfae0e0 /src/audio.c | |
parent | b576ea027970338a418be2adb831c2dcf6484b2b (diff) |
add support for EBU-ACIP parameters
add support for EBU-ACIP parameters in the SDP. This can be
enabled with the following config item:
sdp_ebuacip yes
Reference: https://tech.ebu.ch/docs/tech/tech3368.pdf
Thanks to Ola Palm from Swedish Radio for the patch
Diffstat (limited to 'src/audio.c')
-rw-r--r-- | src/audio.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/audio.c b/src/audio.c index 116ffaa..422926b 100644 --- a/src/audio.c +++ b/src/audio.c @@ -746,6 +746,33 @@ static int add_telev_codec(struct audio *a) } +/* + * EBU ACIP (Audio Contribution over IP) Profile + */ +static int set_ebuacip_params(struct audio *au, uint32_t ptime) +{ + struct sdp_media *sdp = stream_sdpmedia(au->strm); + int jb_id; + int jbvalue; + int err = 0; + + jb_id = 0; + jbvalue = (au->strm->cfg.jbuf_del.max) * ptime; + + /* set ebuacip version */ + err |= sdp_media_set_lattr(sdp, false, "ebuacip", "version %i", 0); + + /* set jb option, only one in our case */ + err |= sdp_media_set_lattr(sdp, false, "ebuacip", "jb %i", jb_id); + + /* define jb value in option */ + err |= sdp_media_set_lattr(sdp, false, "ebuacip", + "jbdef %i fixed %d", jb_id, jbvalue); + + return err; +} + + int audio_alloc(struct audio **ap, const struct stream_param *stream_prm, const struct config *cfg, struct call *call, struct sdp_session *sdp_sess, int label, @@ -803,6 +830,13 @@ int audio_alloc(struct audio **ap, const struct stream_param *stream_prm, goto out; } + if (cfg->sdp.ebuacip) { + + err = set_ebuacip_params(a, ptime); + if (err) + goto out; + } + /* Audio codecs */ for (le = list_head(aucodecl); le; le = le->next) { err = add_audio_codec(a, stream_sdpmedia(a->strm), le->data); |