sl@0: // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include "g711decoderconfigtestdevice.h" sl@0: #include "devsoundciutestdevices.hrh" sl@0: sl@0: sl@0: /* sl@0: CMMFG711DecoderConfig implementation sl@0: */ sl@0: CMMFG711DecoderConfig* CMMFG711DecoderConfig::NewL() sl@0: { sl@0: CMMFG711DecoderConfig* self = new(ELeave) CMMFG711DecoderConfig(); sl@0: return self; sl@0: } sl@0: sl@0: CMMFG711DecoderConfig::~CMMFG711DecoderConfig() sl@0: { sl@0: } sl@0: sl@0: //Actual implementation of method SetDecoderMode sl@0: TInt CMMFG711DecoderConfig::SetDecoderMode(TDecodeMode aDecodeMode) sl@0: { sl@0: iDecodeMode = aDecodeMode; sl@0: return KErrNone; sl@0: } sl@0: sl@0: //Actual implementation of method SetDecoderMode sl@0: TInt CMMFG711DecoderConfig::GetDecoderMode(TDecodeMode& aDecodeMode) sl@0: { sl@0: aDecodeMode = iDecodeMode; sl@0: return KErrNone; sl@0: } sl@0: sl@0: //Actual implementation of method SetCng sl@0: TInt CMMFG711DecoderConfig::SetComfortNoiseGeneration(TBool aCng) sl@0: { sl@0: iCng = aCng; sl@0: return KErrNone; sl@0: } sl@0: sl@0: //Actual implementation of method GetCng sl@0: TInt CMMFG711DecoderConfig::GetComfortNoiseGeneration(TBool& aCng) sl@0: { sl@0: aCng = iCng; sl@0: return KErrNone; sl@0: } sl@0: sl@0: //Actual implementation of method SetPlc sl@0: TInt CMMFG711DecoderConfig::SetPacketLossConcealment(TBool aPlc) sl@0: { sl@0: iPlc = aPlc; sl@0: return KErrNone; sl@0: } sl@0: //Actual implementation of method SetPlc sl@0: TInt CMMFG711DecoderConfig::GetPacketLossConcealment(TBool& aPlc) sl@0: { sl@0: aPlc = iPlc; sl@0: return KErrNone; sl@0: } sl@0: sl@0: /* sl@0: CG711DecoderConfigTestDevice implementation sl@0: */ sl@0: CMMFHwDevice* CG711DecoderConfigTestDevice::NewL() sl@0: { sl@0: CG711DecoderConfigTestDevice* self = new(ELeave) CG711DecoderConfigTestDevice(); sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(); sl@0: CleanupStack::Pop(self); sl@0: return self; sl@0: } sl@0: sl@0: CG711DecoderConfigTestDevice::~CG711DecoderConfigTestDevice() sl@0: { sl@0: delete iG711DecoderConfig; sl@0: } sl@0: sl@0: CG711DecoderConfigTestDevice::CG711DecoderConfigTestDevice() sl@0: { sl@0: } sl@0: sl@0: void CG711DecoderConfigTestDevice::ConstructL() sl@0: { sl@0: } sl@0: sl@0: TInt CG711DecoderConfigTestDevice::Start(TDeviceFunc /*aFuncCmd*/, TDeviceFlow /*aFlowCmd*/) sl@0: { sl@0: return 0; sl@0: } sl@0: sl@0: TInt CG711DecoderConfigTestDevice::Stop() sl@0: { sl@0: return 0; sl@0: } sl@0: sl@0: TInt CG711DecoderConfigTestDevice::Pause() sl@0: { sl@0: return 0; sl@0: } sl@0: sl@0: TInt CG711DecoderConfigTestDevice::Init(THwDeviceInitParams& /*aDevInfo*/) sl@0: { sl@0: return 0; sl@0: } sl@0: sl@0: TAny* CG711DecoderConfigTestDevice::CustomInterface(TUid aInterfaceId) sl@0: { sl@0: // Just return something non-NULL to keep the sl@0: // DevSound initialisation process happy sl@0: TAny* ret = static_cast(this); sl@0: sl@0: // Now for the CIs we want to test... sl@0: if (aInterfaceId == KUidG711DecoderIntfc) sl@0: { sl@0: if (!iG711DecoderConfig) sl@0: { sl@0: TRAPD(err, iG711DecoderConfig = CMMFG711DecoderConfig::NewL()); sl@0: if (err == KErrNone && iG711DecoderConfig) sl@0: { sl@0: MG711DecoderIntfc* ptr = this; sl@0: ret = static_cast(ptr); sl@0: } sl@0: else sl@0: { sl@0: ret = NULL; sl@0: } sl@0: } sl@0: } sl@0: sl@0: return ret; sl@0: } sl@0: sl@0: TInt CG711DecoderConfigTestDevice::ThisHwBufferFilled(CMMFBuffer& /*aFillBufferPtr*/) sl@0: { sl@0: return 0; sl@0: } sl@0: sl@0: TInt CG711DecoderConfigTestDevice::ThisHwBufferEmptied(CMMFBuffer& /*aEmptyBufferPtr*/) sl@0: { sl@0: return 0; sl@0: } sl@0: sl@0: TInt CG711DecoderConfigTestDevice::SetConfig(TTaskConfig& /*aConfig*/) sl@0: { sl@0: return 0; sl@0: } sl@0: sl@0: TInt CG711DecoderConfigTestDevice::StopAndDeleteCodec() sl@0: { sl@0: return 0; sl@0: } sl@0: sl@0: TInt CG711DecoderConfigTestDevice::DeleteCodec() sl@0: { sl@0: return 0; sl@0: } sl@0: sl@0: CMMFSwCodec& CG711DecoderConfigTestDevice::Codec() sl@0: { sl@0: return *iCodec; sl@0: } sl@0: sl@0: TInt CG711DecoderConfigTestDevice::SetDecoderMode(TDecodeMode aDecodeMode) sl@0: { sl@0: TInt result = KErrBadHandle; sl@0: sl@0: if (iG711DecoderConfig) sl@0: { sl@0: result = iG711DecoderConfig->SetDecoderMode(aDecodeMode); sl@0: } sl@0: sl@0: return result; sl@0: } sl@0: sl@0: TInt CG711DecoderConfigTestDevice::GetDecoderMode(TDecodeMode& aDecodeMode) sl@0: { sl@0: TInt result = KErrBadHandle; sl@0: sl@0: if (iG711DecoderConfig) sl@0: { sl@0: result = iG711DecoderConfig->GetDecoderMode(aDecodeMode); sl@0: } sl@0: sl@0: return result; sl@0: } sl@0: sl@0: TInt CG711DecoderConfigTestDevice::SetComfortNoiseGeneration(TBool aCng) sl@0: { sl@0: TInt result = KErrBadHandle; sl@0: sl@0: if (iG711DecoderConfig) sl@0: { sl@0: result = iG711DecoderConfig->SetComfortNoiseGeneration(aCng); sl@0: } sl@0: sl@0: return result; sl@0: } sl@0: sl@0: TInt CG711DecoderConfigTestDevice::GetComfortNoiseGeneration(TBool& aCng) sl@0: { sl@0: TInt result = KErrBadHandle; sl@0: sl@0: if (iG711DecoderConfig) sl@0: { sl@0: result = iG711DecoderConfig->GetComfortNoiseGeneration(aCng); sl@0: } sl@0: sl@0: return result; sl@0: } sl@0: sl@0: TInt CG711DecoderConfigTestDevice::SetPacketLossConcealment(TBool aPlc) sl@0: { sl@0: TInt result = KErrBadHandle; sl@0: sl@0: if (iG711DecoderConfig) sl@0: { sl@0: result = iG711DecoderConfig->SetPacketLossConcealment(aPlc); sl@0: } sl@0: sl@0: return result; sl@0: } sl@0: sl@0: TInt CG711DecoderConfigTestDevice::GetPacketLossConcealment(TBool& aPlc) sl@0: { sl@0: TInt result = KErrBadHandle; sl@0: sl@0: if (iG711DecoderConfig) sl@0: { sl@0: result = iG711DecoderConfig->GetPacketLossConcealment(aPlc); sl@0: } sl@0: sl@0: return result; sl@0: }