Fixes a few bugs in the addition of the SSRC list to RawPackets. And prepares for a first commit of the whole functionality to SVN

cusax-fix
Emil Ivov 16 years ago
parent 3f1692e490
commit 468621f780

@ -1377,11 +1377,9 @@ public long[] getLocalContributingSourceIDs()
{
if( this.deviceSession == null)
return null;
MediaDeviceSession deviceSession = getDeviceSession();
long[] ssrcArray = deviceSession.getRemoteSSRCList();
List<Long> csrcList = new ArrayList<Long>(ssrcArray.length);
//in case of a conf call the mixer would return all SSRC IDs that are
@ -1390,9 +1388,17 @@ public long[] getLocalContributingSourceIDs()
for(long csrc : ssrcArray)
{
if (csrc != this.getRemoteSourceID())
{
csrcList.add(csrc);
}
else
{
}
}
//now add our own ID since we are also participating in the call.
csrcList.add(getLocalSourceID());
int cc = csrcList.size();
if ( cc == 0)
return null;
@ -1420,7 +1426,7 @@ public long[] getRemoteContributingSourceIDs()
{
long[] remoteSsrcList = getDeviceSession().getRemoteSSRCList();
//todo -implement
/** @todo -implement */
return remoteSsrcList;
}

@ -254,7 +254,7 @@ public void shrink(int len)
*/
public int getCsrcCount()
{
return (buffer[offset] & 0x0fb);
return (buffer[offset] & 0x0f);
}
/**
@ -267,6 +267,7 @@ public int getCsrcCount()
*/
public void setCsrcList(long[] newCsrcList)
{
int newCsrcCount = newCsrcList.length;
byte[] csrcBuff = new byte[newCsrcCount * 4];
int csrcOffset = 0;
@ -309,11 +310,15 @@ public void setCsrcList(long[] newCsrcList)
System.arraycopy( oldBuffer, payloadOffsetForOldBuff,
newBuffer, payloadOffsetForNewBuff,
csrcBuff.length - payloadOffsetForOldBuff);
oldBuffer.length - payloadOffsetForOldBuff);
//set the new CSRC count
newBuffer[offset] = (byte)((newBuffer[offset] & 0xF0b)
& newCsrcCount);
newBuffer[offset] = (byte)((newBuffer[offset] & 0xF0)
| newCsrcCount);
this.buffer = newBuffer;
this.length = newBuffer.length;
}
/**

Loading…
Cancel
Save