mirror of https://github.com/sipwise/jitsi.git
cusax-fix
4921
parent
22e5ff0a90
commit
527cee16b9
Binary file not shown.
Binary file not shown.
@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Jitsi, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.impl.protocol.jabber.extensions.colibri;
|
||||
|
||||
/**
|
||||
* Defines the RTP-level relay types as specified by RFC 3550 "RTP: A Transport
|
||||
* Protocol for Real-Time Applications" in section 2.3 "Mixers and Translators".
|
||||
*
|
||||
* @author Lyubomir Marinov
|
||||
*/
|
||||
public enum RTPLevelRelayType
|
||||
{
|
||||
/**
|
||||
* The type of RTP-level relay which performs content mixing on the received
|
||||
* media. In order to mix the received content, the relay will usually
|
||||
* decode the received RTP and RTCP packets into raw media and will
|
||||
* subsequently generate new RTP and RTCP packets to send the new media
|
||||
* which represents the mix of the received content.
|
||||
*/
|
||||
MIXER,
|
||||
|
||||
/**
|
||||
* The type of RTP-level relay which does not perform content mixing on the
|
||||
* received media and rather forwards the received RTP and RTCP packets. The
|
||||
* relay will usually not decode the received RTP and RTCP into raw media.
|
||||
*/
|
||||
TRANSLATOR;
|
||||
|
||||
public static RTPLevelRelayType parseRTPLevelRelayType(String s)
|
||||
{
|
||||
for (RTPLevelRelayType value : RTPLevelRelayType.values())
|
||||
{
|
||||
if (s.equals(value.toString()))
|
||||
return value;
|
||||
}
|
||||
throw new IllegalArgumentException(s);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
switch (this)
|
||||
{
|
||||
case MIXER:
|
||||
return "mixer";
|
||||
case TRANSLATOR:
|
||||
return "translator";
|
||||
default:
|
||||
return super.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,95 @@
|
||||
/*
|
||||
* Jitsi, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.impl.protocol.jabber.extensions.colibri;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import net.java.sip.communicator.impl.protocol.jabber.extensions.*;
|
||||
import net.java.sip.communicator.impl.protocol.jabber.extensions.jingle.*;
|
||||
|
||||
/**
|
||||
* Implements <tt>AbstractPacketExtension</tt> for the <tt>source</tt> element
|
||||
* defined by <a href="http://hancke.name/jabber/jingle-sources">
|
||||
* Source-Specific Media Attributes in Jingle</a>.
|
||||
*
|
||||
* @author Lyubomir Marinov
|
||||
*/
|
||||
public class SourcePacketExtension
|
||||
extends AbstractPacketExtension
|
||||
{
|
||||
/**
|
||||
* The XML name of the <tt>setup</tt> element defined by Source-Specific
|
||||
* Media Attributes in Jingle.
|
||||
*/
|
||||
public static final String ELEMENT_NAME = "source";
|
||||
|
||||
/**
|
||||
* The XML namespace of the <tt>setup</tt> element defined by
|
||||
* Source-Specific Media Attributes in Jingle.
|
||||
*/
|
||||
public static final String NAMESPACE = "urn:xmpp:jingle:apps:rtp:ssma:0";
|
||||
|
||||
/**
|
||||
* The XML name of the <tt>setup</tt> element's attribute which corresponds
|
||||
* to the <tt>ssrc</tt> media attribute in SDP.
|
||||
*/
|
||||
private static final String SSRC_ATTR_NAME = "ssrc";
|
||||
|
||||
/** Initializes a new <tt>SourcePacketExtension</tt> instance. */
|
||||
public SourcePacketExtension()
|
||||
{
|
||||
super(NAMESPACE, ELEMENT_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a specific parameter (as defined by Source-Specific Media Attributes
|
||||
* in Jingle) to this source.
|
||||
*
|
||||
* @param parameter the <tt>ParameterPacketExtension</tt> to add to this
|
||||
* source
|
||||
*/
|
||||
public void addParameter(ParameterPacketExtension parameter)
|
||||
{
|
||||
addChildExtension(parameter);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the parameters (as defined by Source-Specific Media Attributes in
|
||||
* Jingle) of this source.
|
||||
*
|
||||
* @return the <tt>ParameterPacketExtension</tt>s of this source
|
||||
*/
|
||||
public List<ParameterPacketExtension> getParameters()
|
||||
{
|
||||
return getChildExtensionsOfType(ParameterPacketExtension.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the synchronization source (SSRC) ID of this source.
|
||||
*
|
||||
* @return the synchronization source (SSRC) ID of this source
|
||||
*/
|
||||
public long getSSRC()
|
||||
{
|
||||
String s = getAttributeAsString(SSRC_ATTR_NAME);
|
||||
|
||||
return (s == null) ? -1 : Long.parseLong(s);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the synchronization source (SSRC) ID of this source.
|
||||
*
|
||||
* @param ssrc the synchronization source (SSRC) ID to be set on this source
|
||||
*/
|
||||
public void setSSRC(long ssrc)
|
||||
{
|
||||
if (ssrc == -1)
|
||||
removeAttribute(SSRC_ATTR_NAME);
|
||||
else
|
||||
setAttribute(SSRC_ATTR_NAME, Long.toString(ssrc));
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue