os/mm/mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/CIPlugins/src/g729decoderconfigtestdevice.cpp
Update contrib.
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #include <ecom/implementationproxy.h>
17 #include <ecom/ecom.h>
19 #include "g729decoderconfigtestdevice.h"
20 #include "devsoundciutestdevices.hrh"
24 CMMFG729DecoderConfig implementation
26 CMMFG729DecoderConfig* CMMFG729DecoderConfig::NewL()
28 CMMFG729DecoderConfig* self = new(ELeave) CMMFG729DecoderConfig();
32 CMMFG729DecoderConfig::~CMMFG729DecoderConfig()
36 //Actual implementation of method BadLsfNextBuffer
37 TInt CMMFG729DecoderConfig::BadLsfNextBuffer()
44 CG729DecoderConfigTestDevice implementation
46 CMMFHwDevice* CG729DecoderConfigTestDevice::NewL()
48 CG729DecoderConfigTestDevice* self=new(ELeave) CG729DecoderConfigTestDevice();
49 CleanupStack::PushL(self);
51 CleanupStack::Pop(self);
55 CG729DecoderConfigTestDevice::~CG729DecoderConfigTestDevice()
57 delete iG729DecoderConfig;
60 CG729DecoderConfigTestDevice::CG729DecoderConfigTestDevice()
64 void CG729DecoderConfigTestDevice::ConstructL()
68 TInt CG729DecoderConfigTestDevice::Start(TDeviceFunc /*aFuncCmd*/, TDeviceFlow /*aFlowCmd*/)
73 TInt CG729DecoderConfigTestDevice::Stop()
78 TInt CG729DecoderConfigTestDevice::Pause()
83 TInt CG729DecoderConfigTestDevice::Init(THwDeviceInitParams& /*aDevInfo*/)
88 TAny* CG729DecoderConfigTestDevice::CustomInterface(TUid aInterfaceId)
90 // Just return something non-NULL to keep the
91 // DevSound initialisation process happy
92 TAny* ret = static_cast<TAny*>(this);
94 // Now for the CIs we want to test...
95 if (aInterfaceId == KUidG729DecoderIntfc)
97 if (!iG729DecoderConfig)
99 TRAPD(err, iG729DecoderConfig = CMMFG729DecoderConfig::NewL());
100 if (err == KErrNone && iG729DecoderConfig)
102 MG729DecoderIntfc* ptr = this;
103 ret = static_cast<TAny*>(ptr);
115 TInt CG729DecoderConfigTestDevice::ThisHwBufferFilled(CMMFBuffer& /*aFillBufferPtr*/)
120 TInt CG729DecoderConfigTestDevice::ThisHwBufferEmptied(CMMFBuffer& /*aEmptyBufferPtr*/)
125 TInt CG729DecoderConfigTestDevice::SetConfig(TTaskConfig& /*aConfig*/)
130 TInt CG729DecoderConfigTestDevice::StopAndDeleteCodec()
135 TInt CG729DecoderConfigTestDevice::DeleteCodec()
140 CMMFSwCodec& CG729DecoderConfigTestDevice::Codec()
145 TInt CG729DecoderConfigTestDevice::BadLsfNextBuffer()
147 TInt result = KErrBadHandle;
149 if (iG729DecoderConfig)
151 result = iG729DecoderConfig->BadLsfNextBuffer();