Refactors code in order to make it easier to discover and advertise in SDP functionalities such as mixer-to-client sound levels or DTMF

cusax-fix
Emil Ivov 17 years ago
parent e0c8b06adf
commit 3466b4cbdc

@ -915,10 +915,8 @@ private Vector<MediaDescription> createMediaDescriptionsForAnswer(
answerDescriptions.add(SdpUtils
.createDisablingAnswer(mediaDescription));
/*
* TODO As we closeStream bellow when targetDataPort is equal to
* 0, does it mean that we have to do it here?
*/
//close the stream in case it already exists
closeStream(mediaType);
continue;
}
@ -931,24 +929,12 @@ private Vector<MediaDescription> createMediaDescriptionsForAnswer(
.getDirectionForAnswer(remoteDirection);
// create the corresponding stream...
if(targetDataPort != 0)
{
initStream(connector, dev, supportedFormats.get(0), target,
direction);
}
else
// or destroy it in case the target port was 0.
{
/*
* XXX We shouldn't even be here because targetDataPort has
* already been checked.
*/
closeStream(mediaType);
}
initStream(connector, dev, supportedFormats.get(0), target,
direction);
// create the answer description
answerDescriptions.add(createMediaDescription(supportedFormats,
connector, direction));
answerDescriptions.add(createMediaDescription(
supportedFormats, connector, direction));
atLeastOneValidDescription = true;
}

@ -970,13 +970,12 @@ public static URL getCallInfoURL(SessionDescription sessDesc)
* some other reason.
*/
public static MediaDescription createMediaDescription(
MediaDevice dev,
List<MediaFormat> formats,
StreamConnector connector,
MediaDirection direction,
DynamicPayloadTypeRegistry dynamicPayloadTypes)
throws OperationFailedException
{
List<MediaFormat> formats = dev.getSupportedFormats();
int[] payloadTypesArray = new int[formats.size()];
Vector<Attribute> mediaAttributes = new Vector<Attribute>(
2 * payloadTypesArray.length + 1);

Loading…
Cancel
Save