linphone-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Linphone-developers] g711 implementation codec


From: Jehan Monnier
Subject: Re: [Linphone-developers] g711 implementation codec
Date: Mon, 31 Jan 2011 10:19:02 +0100

Hi Aleksei,
Well, first I just want to tell you that in France coders's wife does not consider Saturdays with family as an option ;-)
Regarding G711, the point is that we didn't managed to get realtime simultaneous play/record in PCM 16 bits. But in case you manage that, don't hesitate to contribute your patch.
Today I think the best way to use Linphone for BB is with a server transcoder. But there is the AMR patent cost issue. If we found any people ready to pay for the patent (Minimal $ 10.000  per year), we might provides this service .
Cheers



Le 29 janv. 2011 à 20:09, aleksei drassen a écrit :

Hi, again (i know, i know today is sarturday bla bla bla but we are coders!, saturday does'nt exist!), so i unable to find a server to test the linphone blackberry client offline (lan) so i need know how can i implement g711 ulaw or allaw codec.

or if any of you have any documentation of the source code to start porting android g711 implementation to blackberry device, the problem is clear: this client with amr is useless with almost all sip servers i found.

I see this class and maybe i think here is embebed amr on the client:

try {
long diff;
while((diff=(ts-mPlayerTs))>=0){
if (diff> 800){
mPlayerTs=ts-800;
sLogger.warn("Too late, skipping "+ ((diff-800)/8) +" ms...");
}
packet=mSession.recvPacket((int)mPlayerTs);
if (packet!=null){
mReturnedMs+=20;
if (mFirstRead) {
String lAmrHeader="#!AMR\n";
lWrittenLenth=lAmrHeader.length();
System.arraycopy(lAmrHeader.getBytes("US-ASCII"),0, b, offset, lWrittenLenth );
length = length - lWrittenLenth;
offset+=lWrittenLenth;
mFirstRead=false;
}
if ((length < sSilentAmr.length))  {
// special case for end of buffer
System.arraycopy(packet.getBytes(),packet.getDataOffset()+1, b, offset, length );
lWrittenLenth+= length;
mTroncatedPacketSize=length;
mTroncatedPacket = packet;
if (sLogger.isLevelEnabled(Logger.Warn)) sLogger.warn("End of buffer, ["+lWrittenLenth+"] bytes returned");
return lWrittenLenth;
}else{
if (mTroncatedPacket != null) {
// special case for troncated packet
int remain=mTroncatedPacket.getRealLength()-mTroncatedPacket.getDataOffset()-1- mTroncatedPacketSize;
System.arraycopy(mTroncatedPacket.getBytes(),mTroncatedPacket.getDataOffset()+1+mTroncatedPacketSize, b, offset, remain);
lWrittenLenth+= remain;
mTroncatedPacketSize=0;
mTroncatedPacket = null;
offset+= remain;
length-=remain;
}
//+1 because we need to skip the CMR bytes
int datalen=packet.getRealLength()-packet.getDataOffset()-1;
System.arraycopy(packet.getBytes(),packet.getDataOffset()+1, b, offset, datalen );
lWrittenLenth+= datalen;
length-=datalen;
offset+=datalen;
}
}
mPlayerTs+=160;
}
} catch (RtpException e) {
sLogger.error("Bad RTP packet", e);
}
if (packet==null) Thread.sleep(20);
}
if (!mRunning){
//to notify end of stream.
return -1;
}
if (sLogger.isLevelEnabled(Logger.Debug)) sLogger.debug("["+lWrittenLenth+"] bytes returned");
return lWrittenLenth;
} catch (Throwable e) {
sLogger.error("Exiting player input stream",e);
return -1;
}
finally {
if (bytesToReturn > sSilentAmr.length) {
// we were buffering, so now it's ok resetting value
mBuffering=false;
}
}



thanks all you guys for help me.
_______________________________________________
Linphone-developers mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/linphone-developers


reply via email to

[Prev in Thread] Current Thread [Next in Thread]