298 // CMceComAMRWbCodec::DoMccValidateL |
298 // CMceComAMRWbCodec::DoMccValidateL |
299 // ----------------------------------------------------------------------------- |
299 // ----------------------------------------------------------------------------- |
300 // |
300 // |
301 CMceComCodec* CMceComAMRWbCodec::DoMccValidateL( CMccCodecInformation& aMccCodec, |
301 CMceComCodec* CMceComAMRWbCodec::DoMccValidateL( CMccCodecInformation& aMccCodec, |
302 CMceSrvStream& /*aStream*/, |
302 CMceSrvStream& /*aStream*/, |
303 TMceNegotiationRole aRole ) |
303 TMceNegotiationRole /*aRole */) |
304 { |
304 { |
305 //if answerer mcc codec represents the received offer and codec the answer |
|
306 //if offerer codec represents the sent offer and mcc codec the answer |
|
307 |
|
308 // Bitrates field contains also additional information, mask it away |
|
309 TUint mccBitrates = ( aMccCodec.AllowedBitrates() & KMceAllowedAmrWbBitrateAll ); |
|
310 TUint mceBitrates = ( iAllowedBitrates & KMceAllowedAmrWbBitrateAll ); |
|
311 |
|
312 TBool notValid = aRole == EMceRoleAnswerer ? |
|
313 ( mceBitrates && mccBitrates == 0 || |
|
314 mceBitrates > mccBitrates ) : |
|
315 ( mceBitrates && mccBitrates == 0 || |
|
316 mceBitrates < mccBitrates ); |
|
317 |
|
318 User::LeaveIfError( notValid ? KErrNotSupported : KErrNone ); |
|
319 if ( aMccCodec.CodecMode() != (TCodecMode)iCodecMode ) |
305 if ( aMccCodec.CodecMode() != (TCodecMode)iCodecMode ) |
320 { |
306 { |
321 // codec-mode was different, fail. |
307 // codec-mode was different, fail. |
322 User::Leave(KErrNotSupported); |
308 User::Leave(KErrNotSupported); |
323 } |
309 } |