diff -r 4ce423f34688 -r e267340986c9 mmserv/voipaudioservices/VoIPIntfc/src/VoIPDownlinkStreamImpl.cpp --- a/mmserv/voipaudioservices/VoIPIntfc/src/VoIPDownlinkStreamImpl.cpp Fri Sep 17 08:33:15 2010 +0300 +++ b/mmserv/voipaudioservices/VoIPIntfc/src/VoIPDownlinkStreamImpl.cpp Mon Oct 04 00:51:56 2010 +0300 @@ -52,6 +52,7 @@ CVoIPAudioDownlinkStreamImpl::~CVoIPAudioDownlinkStreamImpl() { Close(); + iCodecFormats.Close(); if (iMsgQHandler) { @@ -178,7 +179,16 @@ const TMMFPrioritySettings aPriority, RArray& aFormats) { - if (!iCodecFormats || aFormats.Count() <= 0) + TInt count = iCodecFormats.Count(); + aFormats.Reset(); + if (count > 0) + { + for (TInt i = 0; i < count; i++) + { + aFormats.Append(iCodecFormats[i]); + } + } + else { RArray codecIDs; CleanupClosePushL(codecIDs); @@ -186,10 +196,14 @@ iVoIPAudioSession.GetSupportedDecoders(aPriority, codecIDs, iG711FrameSize); +#ifdef _DEBUG + RDebug::Print(_L("G711 Frame Size=%d"), iG711FrameSize); +#endif + TUint32 codec = 0; TInt count = codecIDs.Count(); TVoIPCodecFormat format; - aFormats.Reset(); + iCodecFormats.Reset(); for (TInt i = 0; i < count; i++) { @@ -205,11 +219,10 @@ format = ConvertFourCC(codec); if (format != ENULL) { + iCodecFormats.Append(format); aFormats.Append(format); } } - - iCodecFormats = &aFormats; CleanupStack::PopAndDestroy(&codecIDs); } } @@ -277,15 +290,6 @@ } // --------------------------------------------------------------------------- -// CVoIPAudioDownlinkStreamImpl::GetFormat -// --------------------------------------------------------------------------- -// -TVoIPCodecFormat CVoIPAudioDownlinkStreamImpl::GetFormat() - { - return iFormat; - } - -// --------------------------------------------------------------------------- // CVoIPAudioDownlinkStreamImpl::SetAudioDevice // --------------------------------------------------------------------------- // @@ -548,7 +552,11 @@ { TBool status = EFalse; - if (!iCodecFormats) + if (iCodecFormats.Count() > 0) + { + status = FindFormat(aFormat); + } + else { // Client hasn't called GetSupportedFormatsL RArray codecs; @@ -557,11 +565,6 @@ GetSupportedFormatsL(iPriority, codecs); //sets iCodecFormats status = FindFormat(aFormat); CleanupStack::PopAndDestroy(&codecs); - iCodecFormats = NULL; - } - else - { - status = FindFormat(aFormat); } return status; @@ -575,28 +578,33 @@ { TBool found = EFalse; - if (iCodecFormats) + if (iCodecFormats.Count() > 0) { - if (iCodecFormats->Count() > 0) + if (iCodecFormats.Find(aFormat) == KErrNotFound) { - if (iCodecFormats->Find(aFormat) == KErrNotFound) + // For backward compatibility with VAS 1.0 + if (aFormat == EG711) { - // For backward compatibility with VAS 1.0 - if (aFormat == EG711) + if (iCodecFormats.Find(EG711_10MS) != KErrNotFound) { - if (iCodecFormats->Find(EG711_10MS) != KErrNotFound) - { - iFormat = EG711_10MS; - found = ETrue; - } + iFormat = EG711_10MS; + found = ETrue; } } - else + else if (aFormat == EG711_10MS) { - iFormat = aFormat; - found = ETrue; + if (iCodecFormats.Find(EG711) != KErrNotFound) + { + iFormat = EG711; + found = ETrue; + } } } + else + { + iFormat = aFormat; + found = ETrue; + } } return found;