diff options
author | Boris Grozev <boris@jitsi.org> | 2014-06-20 13:33:17 +0200 |
---|---|---|
committer | Boris Grozev <boris@jitsi.org> | 2014-06-20 13:33:17 +0200 |
commit | abb7e42a85aa1cd000a5d51922e9b9c3cdcba7c0 (patch) | |
tree | 4441ad290fbe09e4edb33647dd1e585afbcad41c /src | |
parent | 76a83ef04263539b9c23b9f94bd80a292c444b48 (diff) | |
download | jitsi-abb7e42a85aa1cd000a5d51922e9b9c3cdcba7c0.zip jitsi-abb7e42a85aa1cd000a5d51922e9b9c3cdcba7c0.tar.gz jitsi-abb7e42a85aa1cd000a5d51922e9b9c3cdcba7c0.tar.bz2 |
Adds support for the RED (RFC2198) and ulpfec (RFC5109) RTP payload types.
Diffstat (limited to 'src')
-rw-r--r-- | src/net/java/sip/communicator/service/protocol/media/CallPeerMediaHandler.java | 50 |
1 files changed, 36 insertions, 14 deletions
diff --git a/src/net/java/sip/communicator/service/protocol/media/CallPeerMediaHandler.java b/src/net/java/sip/communicator/service/protocol/media/CallPeerMediaHandler.java index 0e4c881..f9edff4 100644 --- a/src/net/java/sip/communicator/service/protocol/media/CallPeerMediaHandler.java +++ b/src/net/java/sip/communicator/service/protocol/media/CallPeerMediaHandler.java @@ -1202,6 +1202,8 @@ public abstract class CallPeerMediaHandler<T extends MediaAwareCallPeer<?,?,?>> { List<MediaFormat> ret = new ArrayList<MediaFormat>(); MediaFormat telephoneEvents = null; + MediaFormat red = null; + MediaFormat ulpfec = null; for(MediaFormat remoteFormat : remoteFormats) { @@ -1210,30 +1212,50 @@ public abstract class CallPeerMediaHandler<T extends MediaAwareCallPeer<?,?,?>> if (localFormat != null) { - // We ignore telephone-event here as it's not a real media - // format. Therefore we don't want to decide to use it as - // our preferred format. We'll add it back later if we find - // a suitable format. + // We ignore telephone-event, red and ulpfec here as they are + // not real media formats. Therefore we don't want to decide to + // use any of them as our preferred format. We'll add them back + // later if we find a common media format. // - // Note if there are multiple telephone-event formats, we'll - // lose all but the last one. That's fine because it's - // meaningless to have multiple repeated formats. - if (Constants.TELEPHONE_EVENT.equals(localFormat.getEncoding())) + // Note if there are multiple telephone-event (or red, or + // ulpfec) formats, we'll lose all but the last one. That's + // fine because it's meaningless to have multiple repeated + // formats. + String encoding = localFormat.getEncoding(); + if (Constants.TELEPHONE_EVENT.equals(encoding)) { telephoneEvents = localFormat; continue; } + else if (Constants.RED.equals(encoding)) + { + red = localFormat; + continue; + } + else if (Constants.ULPFEC.equals(encoding)) + { + ulpfec = localFormat; + continue; + } ret.add(localFormat); } } - // If we've found some compatible formats, add telephone-event back - // in to the end of the list if we removed it above. If we didn't - // find any compatible formats, we don't want to add telephone-event - // as the only entry in the list because there'd be no media. - if ((!ret.isEmpty()) && (telephoneEvents != null)) - ret.add(telephoneEvents); + // If we've found some compatible formats, add telephone-event, red + // and ulpfec back in to the end of the list (if we removed any of them) + // above. If we didn't find any compatible formats, we don't want to + // add any of these formats as the only entries in the list because + // there'd be no media. + if (!ret.isEmpty()) + { + if (telephoneEvents != null) + ret.add(telephoneEvents); + if (red != null) + ret.add(red); + if (ulpfec != null) + ret.add(ulpfec); + } return ret; } |