1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-26 22:12:05 +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() { public boolean isNull() {
if (getId() == INVALID_PT) { if (getId() == INVALID_PT) {
return true; return true;
} else if (getName() == null) { }
else if (getName() == null) {
return true; return true;
} }
return false; return false;
@ -187,7 +188,8 @@ public class PayloadType {
if (other.getName() != null) { if (other.getName() != null) {
return false; return false;
} }
} else if (!getName().equals(other.getName())) { }
else if (!getName().equals(other.getName())) {
return false; return false;
} }
} }
@ -199,6 +201,7 @@ public class PayloadType {
* Audio payload type. * Audio payload type.
*/ */
public static class Audio extends PayloadType { public static class Audio extends PayloadType {
private int clockRate; private int clockRate;
/** /**
@ -214,6 +217,18 @@ public class PayloadType {
clockRate = rate; 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. * Empty constructor.
*/ */

View file

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

View file

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

View file

@ -67,6 +67,7 @@ public class JmfMediaManager extends JingleMediaManager {
private void setupPayloads() { private void setupPayloads() {
payloads.add(new PayloadType.Audio(3, "gsm")); payloads.add(new PayloadType.Audio(3, "gsm"));
payloads.add(new PayloadType.Audio(4, "g723")); payloads.add(new PayloadType.Audio(4, "g723"));
payloads.add(new PayloadType.Audio(0, "PCMU", 16000));
} }
/** /**

View file

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