[Top][All Lists]

[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 .

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;
if (diff> 800){
sLogger.warn("Too late, skipping "+ ((diff-800)/8) +" ms...");
if (packet!=null){
if (mFirstRead) {
String lAmrHeader="#!AMR\n";
System.arraycopy(lAmrHeader.getBytes("US-ASCII"),0, b, offset, lWrittenLenth );
length = length - lWrittenLenth;
if ((length < sSilentAmr.length))  {
// special case for end of buffer
System.arraycopy(packet.getBytes(),packet.getDataOffset()+1, b, offset, length );
lWrittenLenth+= length;
mTroncatedPacket = packet;
if (sLogger.isLevelEnabled(Logger.Warn)) sLogger.warn("End of buffer, ["+lWrittenLenth+"] bytes returned");
return lWrittenLenth;
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;
mTroncatedPacket = null;
offset+= 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;
} 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

thanks all you guys for help me.
Linphone-developers mailing list

reply via email to

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