1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-22 20:12:07 +01:00

New Codec added

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@7383 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Thiago Camargo 2007-03-06 02:04:54 +00:00 committed by thiago
parent 244882cc16
commit 68901d0890
5 changed files with 24 additions and 7 deletions

View file

@ -138,7 +138,8 @@ public class PayloadType {
public boolean isNull() {
if (getId() == INVALID_PT) {
return true;
} else if (getName() == null) {
}
else if (getName() == null) {
return true;
}
return false;
@ -187,7 +188,8 @@ public class PayloadType {
if (other.getName() != null) {
return false;
}
} else if (!getName().equals(other.getName())) {
}
else if (!getName().equals(other.getName())) {
return false;
}
}
@ -199,6 +201,7 @@ public class PayloadType {
* Audio payload type.
*/
public static class Audio extends PayloadType {
private int clockRate;
/**
@ -214,6 +217,18 @@ public class PayloadType {
clockRate = rate;
}
/**
* Constructor with all the attributes of an Audio payload type
*
* @param id The identifier
* @param name The name assigned to this payload type
* @param rate The clock rate
*/
public Audio(int id, String name, int rate) {
super(id, name);
clockRate = rate;
}
/**
* Empty constructor.
*/

View file

@ -436,6 +436,5 @@ public class AudioChannel {
e.printStackTrace();
}
}
}

View file

@ -40,6 +40,8 @@ public class AudioFormatUtils {
public static AudioFormat getAudioFormat(PayloadType payloadtype) {
switch (payloadtype.getId()) {
case 0:
return new AudioFormat(AudioFormat.ULAW_RTP);
case 3:
return new AudioFormat(AudioFormat.GSM_RTP);
case 4:

View file

@ -67,6 +67,7 @@ public class JmfMediaManager extends JingleMediaManager {
private void setupPayloads() {
payloads.add(new PayloadType.Audio(3, "gsm"));
payloads.add(new PayloadType.Audio(4, "g723"));
payloads.add(new PayloadType.Audio(0, "PCMU", 16000));
}
/**
@ -77,7 +78,7 @@ public class JmfMediaManager extends JingleMediaManager {
public List<PayloadType> getPayloads() {
return payloads;
}
/**
* Runs JMFInit the first time the application is started so that capture
* devices are properly detected and initialized by JMF.

View file

@ -110,7 +110,7 @@ public class JingleMediaTest extends SmackTestCase {
XMPPConnection x0 = getConnection(0);
XMPPConnection x1 = getConnection(1);
/*
ICETransportManager icetm0 = new ICETransportManager(x0, "jivesoftware.com", 3478);
ICETransportManager icetm1 = new ICETransportManager(x1, "jivesoftware.com", 3478);
@ -121,13 +121,13 @@ public class JingleMediaTest extends SmackTestCase {
jm0.addCreationListener(icetm0);
jm1.addCreationListener(icetm1);
*/
/*
final JingleManager jm0 = new JingleManager(
x0, new BasicTransportManager());
final JingleManager jm1 = new JingleManager(
x1, new BasicTransportManager());
*/
MultiMediaManager jingleMediaManager0 = new MultiMediaManager();
jingleMediaManager0.addMediaManager(new SpeexMediaManager());
jingleMediaManager0.addMediaManager(new JmfMediaManager());