Adds a 'direction' field to ColibriConferenceIQ.Channel

cusax-fix
Boris Grozev 13 years ago
parent c6bb666945
commit a4e091b2c2

@ -10,6 +10,7 @@
import net.java.sip.communicator.impl.protocol.jabber.extensions.jingle.*;
import org.jitsi.service.neomedia.*;
import org.jivesoftware.smack.packet.*;
/**
@ -283,6 +284,12 @@ public static class Channel
*/
public static final String SSRC_ELEMENT_NAME = "ssrc";
/**
* The name of the XML attribute of a <tt>channel</tt> which represents
* its direction.
*/
public static final String DIRECTION_ATTR_NAME = "direction";
/**
* The number of seconds of inactivity after which the <tt>channel</tt>
* represented by this instance expires.
@ -323,6 +330,11 @@ public static class Channel
*/
private long[] ssrcs = NO_SSRCS;
/**
* The direction of the <tt>channel</tt> represented by this instance.
*/
private MediaDirection direction;
/**
* Adds a <tt>payload-type</tt> element defined by XEP-0167: Jingle RTP
* Sessions to this <tt>channel</tt>.
@ -462,6 +474,16 @@ public synchronized long[] getSSRCs()
return (ssrcs.length == 0) ? NO_SSRCS : ssrcs.clone();
}
/**
* Gets the <tt>direction</tt> of this <tt>Channel</tt>.
*
* @return the <tt>direction</tt> of this <tt>Channel</tt>.
*/
public MediaDirection getDirection()
{
return direction;
}
/**
* Removes a <tt>payload-type</tt> element defined by XEP-0167: Jingle
* RTP Sessions from this <tt>channel</tt>.
@ -608,6 +630,17 @@ public void setSSRCs(long[] ssrcs)
: ssrcs.clone();
}
/**
* Sets the <tt>direction</tt> of this <tt>Channel</tt>
*
* @param direction the <tt>MediaDirection</tt> to set the
* <tt>direction</tt> of this <tt>Channel</tt> to.
*/
public void setDirection(MediaDirection direction)
{
this.direction = direction;
}
/**
* Appends the XML <tt>String</tt> representation of this
* <tt>Channel</tt> to a specific <tt>StringBuilder</tt>.
@ -660,6 +693,13 @@ public void toXML(StringBuilder xml)
.append(expire).append('\'');
}
MediaDirection direction = getDirection();
if (direction != null && direction != MediaDirection.SENDRECV)
{
xml.append(' ').append(DIRECTION_ATTR_NAME).append("='")
.append(direction.toString()).append('\'');
}
List<PayloadTypePacketExtension> payloadTypes = getPayloadTypes();
boolean hasPayloadTypes = (payloadTypes.size() != 0);
long[] ssrcs = getSSRCs();

Loading…
Cancel
Save