|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.java.sip.communicator.impl.protocol.jabber.jinglesdp.JingleUtils
public class JingleUtils
The class contains a number of utility methods that are meant to facilitate creating and parsing jingle media rtp description descriptions and transports.
| Constructor Summary | |
|---|---|
JingleUtils()
|
|
| Method Summary | |
|---|---|
static ContentPacketExtension |
createDescription(ContentPacketExtension.CreatorEnum creator,
String contentName,
ContentPacketExtension.SendersEnum senders,
List<MediaFormat> formats,
List<RTPExtension> rtpExtensions,
DynamicPayloadTypeRegistry dynamicPayloadTypes,
DynamicRTPExtensionsRegistry rtpExtensionsRegistry)
Creates a new ContentPacketExtension instance according to the
specified formats, connector and direction,
and using the dynamicPayloadTypes registry to handle dynamic
payload type registrations. |
static MediaStreamTarget |
extractDefaultTarget(ContentPacketExtension content)
Returns the default candidate for the specified content content. |
static List<MediaFormat> |
extractFormats(RtpDescriptionPacketExtension description,
DynamicPayloadTypeRegistry ptRegistry)
Extracts and returns the list of MediaFormats advertised in description preserving their oder and registering dynamic payload type numbers in the specified ptRegistry. |
static List<RTPExtension> |
extractRTPExtensions(RtpDescriptionPacketExtension desc,
DynamicRTPExtensionsRegistry extMap)
Extracts and returns the list of RTPExtensions advertised in desc and registers newly encountered ones into the specified extMap. |
static PayloadTypePacketExtension |
formatToPayloadType(MediaFormat format,
DynamicPayloadTypeRegistry ptRegistry)
Converts a specific MediaFormat into a new
PayloadTypePacketExtension instance. |
static MediaDirection |
getDirection(ContentPacketExtension.SendersEnum senders,
boolean initiatorPerspective)
Determines the direction of the media stream that content describes and returns the corresponding MediaDirection enum entry. |
static MediaDirection |
getDirection(ContentPacketExtension content,
boolean initiatorPerspective)
Determines the direction of the media stream that content describes and returns the corresponding MediaDirection enum entry. |
static CandidatePacketExtension |
getFirstCandidate(ContentPacketExtension content,
int componentID)
Returns the first candidate for the specified componentID or null if no such component exists. |
static RtpDescriptionPacketExtension |
getRtpDescription(ContentPacketExtension content)
Extracts and returns an RtpDescriptionPacketExtension provided
with content or null if there is none. |
static ContentPacketExtension.SendersEnum |
getSenders(MediaDirection direction,
boolean initiatorPerspective)
Converts the specified media direction into the corresponding ContentPacketExtension.SendersEnum value so that we could add it to a content element. |
static MediaFormat |
payloadTypeToMediaFormat(PayloadTypePacketExtension payloadType,
DynamicPayloadTypeRegistry ptRegistry)
Returns the MediaFormat described in the payloadType
extension or null if we don't recognize the format. |
static MediaFormat |
payloadTypeToMediaFormat(PayloadTypePacketExtension payloadType,
MediaService mediaService,
DynamicPayloadTypeRegistry ptRegistry)
Returns the MediaFormat described in the payloadType
extension or null if we don't recognize the format. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JingleUtils()
| Method Detail |
|---|
public static RtpDescriptionPacketExtension getRtpDescription(ContentPacketExtension content)
RtpDescriptionPacketExtension provided
with content or null if there is none.
content - the media content that we'd like to extract the
RtpDescriptionPacketExtension from.
RtpDescriptionPacketExtension provided with
content or null if there is none.
public static List<MediaFormat> extractFormats(RtpDescriptionPacketExtension description,
DynamicPayloadTypeRegistry ptRegistry)
description - the MediaDescription that we'd like to probe
for a list of MediaFormatsptRegistry - a reference to the DynamycPayloadTypeRegistry
where we should be registering newly added payload type number to format
mappings.
public static MediaFormat payloadTypeToMediaFormat(PayloadTypePacketExtension payloadType,
DynamicPayloadTypeRegistry ptRegistry)
MediaFormat described in the payloadType
extension or null if we don't recognize the format.
payloadType - the PayloadTypePacketExtension which is to be
parsed into a MediaFormat.ptRegistry - the DynamicPayloadTypeRegistry that we would
use for the registration of possible dynamic payload types or
null the returned MediaFormat is to not be registered
into a DynamicPayloadTypeRegistry.
MediaFormat described in the payloadType
extension or null if we don't recognize the format.
public static MediaFormat payloadTypeToMediaFormat(PayloadTypePacketExtension payloadType,
MediaService mediaService,
DynamicPayloadTypeRegistry ptRegistry)
MediaFormat described in the payloadType
extension or null if we don't recognize the format.
payloadType - the PayloadTypePacketExtension which is to be
parsed into a MediaFormat.mediaService - the MediaService implementation which is to
be used for MediaFormat-related factory methodsptRegistry - the DynamicPayloadTypeRegistry that we would
use for the registration of possible dynamic payload types or
null the returned MediaFormat is to not be registered
into a DynamicPayloadTypeRegistry.
MediaFormat described in the payloadType
extension or null if we don't recognize the format.
public static List<RTPExtension> extractRTPExtensions(RtpDescriptionPacketExtension desc,
DynamicRTPExtensionsRegistry extMap)
desc - the RtpDescriptionPacketExtension that we'd like to
probe for a list of RTPExtensionsextMap - a reference to the DynamycRTPExtensionsRegistry
where we should be registering newly added extension mappings.
RTPExtensions advertised in the
mediaDesc description.
public static ContentPacketExtension.SendersEnum getSenders(MediaDirection direction,
boolean initiatorPerspective)
ContentPacketExtension.SendersEnum value so that we could add it to a content element.
The initiatorPerspectice allows callers to specify whether the
direction is to be considered from the session initator's perspective
or that of the responder.
Example: A MediaDirection.SENDONLY value would be translated to
ContentPacketExtension.SendersEnum.initiator from the initiator's perspective and to
ContentPacketExtension.SendersEnum.responder otherwise.
direction - the MediaDirection that we'd like to translate.initiatorPerspective - true if the direction param
is to be considered from the initiator's perspective and false
otherwise.
public static MediaDirection getDirection(ContentPacketExtension content,
boolean initiatorPerspective)
Example: An initiator value would be translated to
MediaDirection.SENDONLY from the initiator's perspective and to
MediaDirection.RECVONLY from the responder's.
content - the description of the media stream whose direction
we are trying to determine.initiatorPerspective - true if the senders argument is to
be translated into a direction from the initiator's perspective and
false for the sender's.
public static MediaDirection getDirection(ContentPacketExtension.SendersEnum senders,
boolean initiatorPerspective)
senders - senders directioninitiatorPerspective - true if the senders argument is to
be translated into a direction from the initiator's perspective and
false for the sender's.
public static MediaStreamTarget extractDefaultTarget(ContentPacketExtension content)
content - the stream whose default candidate we are looking for.
MediaStreamTarget containing the default
candidates for the stream described in content or
null, if for some reason, the packet does not contain any
candidates.
public static CandidatePacketExtension getFirstCandidate(ContentPacketExtension content,
int componentID)
content - the ContentPacketExtension that we'll be searching
for a component.componentID - the id of the component that we are looking for
(e.g. 1 for RTP, 2 for RTCP);
public static ContentPacketExtension createDescription(ContentPacketExtension.CreatorEnum creator,
String contentName,
ContentPacketExtension.SendersEnum senders,
List<MediaFormat> formats,
List<RTPExtension> rtpExtensions,
DynamicPayloadTypeRegistry dynamicPayloadTypes,
DynamicRTPExtensionsRegistry rtpExtensionsRegistry)
ContentPacketExtension instance according to the
specified formats, connector and direction,
and using the dynamicPayloadTypes registry to handle dynamic
payload type registrations. The type (e.g. audio/video) of the media
description is determined via from the type of the first
MediaFormat in the formats list.
creator - indicates whether the person who originally created this
content was the initiator or the responder of the jingle sessioncontentName - the name of the content element as indicator by the
creator or, in case we are the creators: as we'd like it to be.formats - the list of formats that should be advertised in the newly
created content extension.senders - indicates the direction of the media in this stream.rtpExtensions - a list of RTPExtensions supported by the
MediaDevice that we will be advertising.dynamicPayloadTypes - a reference to the
DynamicPayloadTypeRegistry that we should be using to lookup
and register dynamic RTP mappings.rtpExtensionsRegistry - a reference to the
DynamicRTPExtensionRegistry that we should be using to lookup
and register URN to ID mappings.
public static PayloadTypePacketExtension formatToPayloadType(MediaFormat format,
DynamicPayloadTypeRegistry ptRegistry)
MediaFormat into a new
PayloadTypePacketExtension instance.
format - the MediaFormat we'd like to convert.ptRegistry - the DynamicPayloadTypeRegistry to use for
formats that don't have a static pt number.
|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||