Add packet delay attribute to Colibri Channel

sip-call-params 5510
paweldomas 10 years ago
parent 56994a6829
commit 5765b37697

@ -118,6 +118,13 @@ public class ColibriBuilder
*/
private SimulcastMode simulcastMode;
/**
* Specifies the audio packet delay that will be set on all created audio
* channels. When set to <tt>null</tt> the builder will clear the attribute
* which stands for 'undefined'.
**/
private Integer audioPacketDelay;
/**
* Creates new instance of {@link ColibriBuilder} for given
* <tt>conferenceState</tt>.
@ -221,6 +228,11 @@ public boolean addAllocateChannelsReq(
remoteRtpChannelRequest.setAdaptiveLastN(adaptiveLastN);
remoteRtpChannelRequest.setAdaptiveSimulcast(adaptiveSimulcast);
remoteRtpChannelRequest.setSimulcastMode(simulcastMode);
if (MediaType.AUDIO.equals(mediaType))
{
// When audioPacketDelay is null it will clear the attribute
remoteRtpChannelRequest.setPacketDelay(audioPacketDelay);
}
}
// Copy transport
@ -959,6 +971,28 @@ public void setAdaptiveSimulcast(Boolean adaptiveSimulcast)
this.adaptiveSimulcast = adaptiveSimulcast;
}
/**
* Returns an <tt>Integer</tt> which stands for the audio packet delay
* that will be set on all created audio channels or <tt>null</tt> if
* the builder should leave not include the XML attribute at all.
*/
public Integer getAudioPacketDelay()
{
return audioPacketDelay;
}
/**
* Configures audio channels packet delay.
* @param audioPacketDelay an <tt>Integer</tt> value which stands for
* the audio packet delay that will be set on all created audio channels or
* <tt>null</tt> if the builder should not set that channel property to any
* value.
*/
public void setAudioPacketDelay(Integer audioPacketDelay)
{
this.audioPacketDelay = audioPacketDelay;
}
/**
* Sets channel 'simulcast-mode' option that will be added to the
* request when channels are created.

@ -542,6 +542,14 @@ public static class Channel
public static final String RECEIVING_SIMULCAST_LAYER
= "receive-simulcast-layer";
/**
* The XML name of the <tt>packet-delay</tt> attribute of
* a <tt>channel</tt> of a <tt>content</tt> of a <tt>conference</tt> IQ
* which represents the value of the {@link #packetDelay} property of
* <tt>ColibriConferenceIQ.Channel</tt>.
*/
public static final String PACKET_DELAY_ATTR_NAME = "packet-delay";
/**
* The XML name of the <tt>rtcpport</tt> attribute of a <tt>channel</tt>
* of a <tt>content</tt> of a <tt>conference</tt> IQ which represents
@ -612,6 +620,11 @@ public static class Channel
*/
private SimulcastMode simulcastMode;
/**
* The amount of delay added to the RTP stream in a number of packets.
*/
private Integer packetDelay;
/**
* The <tt>payload-type</tt> elements defined by XEP-0167: Jingle RTP
* Sessions associated with this <tt>channel</tt>.
@ -892,6 +905,18 @@ public SimulcastMode getSimulcastMode()
return simulcastMode;
}
/**
* Returns an <tt>Integer</tt> which stands for the amount of delay
* added to the RTP stream in a number of packets.
*
* @return <tt>Integer</tt> with the value or <tt>null</tt> if
* unspecified.
*/
public Integer getPacketDelay()
{
return packetDelay;
}
/**
* Gets a list of <tt>payload-type</tt> elements defined by XEP-0167:
* Jingle RTP Sessions added to this <tt>channel</tt>.
@ -1081,6 +1106,14 @@ protected void printAttributes(StringBuilder xml)
.append("='").append(adaptiveSimulcast).append('\'');
}
// packet-delay
Integer packetDelay = getPacketDelay();
if (packetDelay != null)
{
xml.append(' ').append(PACKET_DELAY_ATTR_NAME).append("='")
.append(packetDelay).append('\'');
}
// simulcastMode
SimulcastMode simulcastMode = getSimulcastMode();
@ -1313,6 +1346,17 @@ public void setAdaptiveSimulcast(Boolean adaptiveSimulcast)
this.adaptiveSimulcast = adaptiveSimulcast;
}
/**
* Configures channel's packet delay which tells by how many packets
* the RTP streams will be delayed.
* @param packetDelay an <tt>Integer</tt> value which stands for
* the packet delay that will be set or <tt>null</tt> to leave undefined
*/
public void setPacketDelay(Integer packetDelay)
{
this.packetDelay = packetDelay;
}
/**
* Sets the value of the 'simulcast-mode' flag.
* @param simulcastMode the value to set.

@ -428,6 +428,15 @@ else if (ColibriConferenceIQ.GracefulShutdown.ELEMENT_NAME
if ((expire != null) && (expire.length() != 0))
channel.setExpire(Integer.parseInt(expire));
String packetDelay
= parser.getAttributeValue(
"",
ColibriConferenceIQ.Channel
.PACKET_DELAY_ATTR_NAME);
if (!StringUtils.isNullOrEmpty(packetDelay))
channel.setPacketDelay(
Integer.parseInt(packetDelay));
// host
String host
= parser.getAttributeValue(

Loading…
Cancel
Save