os/mm/mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/CIPlugins/src/g729decoderconfigtestdevice.cpp
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/CIPlugins/src/g729decoderconfigtestdevice.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,155 @@
1.4 +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +#include <ecom/implementationproxy.h>
1.20 +#include <ecom/ecom.h>
1.21 +#include <f32file.h>
1.22 +#include "g729decoderconfigtestdevice.h"
1.23 +#include "devsoundciutestdevices.hrh"
1.24 +
1.25 +
1.26 +/*
1.27 +CMMFG729DecoderConfig implementation
1.28 +*/
1.29 +CMMFG729DecoderConfig* CMMFG729DecoderConfig::NewL()
1.30 + {
1.31 + CMMFG729DecoderConfig* self = new(ELeave) CMMFG729DecoderConfig();
1.32 + return self;
1.33 + }
1.34 +
1.35 +CMMFG729DecoderConfig::~CMMFG729DecoderConfig()
1.36 + {
1.37 + }
1.38 +
1.39 +//Actual implementation of method BadLsfNextBuffer
1.40 +TInt CMMFG729DecoderConfig::BadLsfNextBuffer()
1.41 + {
1.42 + return KErrNone;
1.43 + }
1.44 +
1.45 +
1.46 +/*
1.47 +CG729DecoderConfigTestDevice implementation
1.48 +*/
1.49 +CMMFHwDevice* CG729DecoderConfigTestDevice::NewL()
1.50 + {
1.51 + CG729DecoderConfigTestDevice* self=new(ELeave) CG729DecoderConfigTestDevice();
1.52 + CleanupStack::PushL(self);
1.53 + self->ConstructL();
1.54 + CleanupStack::Pop(self);
1.55 + return self;
1.56 + }
1.57 +
1.58 +CG729DecoderConfigTestDevice::~CG729DecoderConfigTestDevice()
1.59 + {
1.60 + delete iG729DecoderConfig;
1.61 + }
1.62 +
1.63 +CG729DecoderConfigTestDevice::CG729DecoderConfigTestDevice()
1.64 + {
1.65 + }
1.66 +
1.67 +void CG729DecoderConfigTestDevice::ConstructL()
1.68 + {
1.69 + }
1.70 +
1.71 +TInt CG729DecoderConfigTestDevice::Start(TDeviceFunc /*aFuncCmd*/, TDeviceFlow /*aFlowCmd*/)
1.72 + {
1.73 + return 0;
1.74 + }
1.75 +
1.76 +TInt CG729DecoderConfigTestDevice::Stop()
1.77 + {
1.78 + return 0;
1.79 + }
1.80 +
1.81 +TInt CG729DecoderConfigTestDevice::Pause()
1.82 + {
1.83 + return 0;
1.84 + }
1.85 +
1.86 +TInt CG729DecoderConfigTestDevice::Init(THwDeviceInitParams& /*aDevInfo*/)
1.87 + {
1.88 + return 0;
1.89 + }
1.90 +
1.91 +TAny* CG729DecoderConfigTestDevice::CustomInterface(TUid aInterfaceId)
1.92 + {
1.93 + // Just return something non-NULL to keep the
1.94 + // DevSound initialisation process happy
1.95 + TAny* ret = static_cast<TAny*>(this);
1.96 +
1.97 + // Now for the CIs we want to test...
1.98 + if (aInterfaceId == KUidG729DecoderIntfc)
1.99 + {
1.100 + if (!iG729DecoderConfig)
1.101 + {
1.102 + TRAPD(err, iG729DecoderConfig = CMMFG729DecoderConfig::NewL());
1.103 + if (err == KErrNone && iG729DecoderConfig)
1.104 + {
1.105 + MG729DecoderIntfc* ptr = this;
1.106 + ret = static_cast<TAny*>(ptr);
1.107 + }
1.108 + else
1.109 + {
1.110 + ret = NULL;
1.111 + }
1.112 + }
1.113 + }
1.114 +
1.115 + return ret;
1.116 + }
1.117 +
1.118 +TInt CG729DecoderConfigTestDevice::ThisHwBufferFilled(CMMFBuffer& /*aFillBufferPtr*/)
1.119 + {
1.120 + return 0;
1.121 + }
1.122 +
1.123 +TInt CG729DecoderConfigTestDevice::ThisHwBufferEmptied(CMMFBuffer& /*aEmptyBufferPtr*/)
1.124 + {
1.125 + return 0;
1.126 + }
1.127 +
1.128 +TInt CG729DecoderConfigTestDevice::SetConfig(TTaskConfig& /*aConfig*/)
1.129 + {
1.130 + return 0;
1.131 + }
1.132 +
1.133 +TInt CG729DecoderConfigTestDevice::StopAndDeleteCodec()
1.134 + {
1.135 + return 0;
1.136 + }
1.137 +
1.138 +TInt CG729DecoderConfigTestDevice::DeleteCodec()
1.139 + {
1.140 + return 0;
1.141 + }
1.142 +
1.143 +CMMFSwCodec& CG729DecoderConfigTestDevice::Codec()
1.144 + {
1.145 + return *iCodec;
1.146 + }
1.147 +
1.148 +TInt CG729DecoderConfigTestDevice::BadLsfNextBuffer()
1.149 + {
1.150 + TInt result = KErrBadHandle;
1.151 +
1.152 + if (iG729DecoderConfig)
1.153 + {
1.154 + result = iG729DecoderConfig->BadLsfNextBuffer();
1.155 + }
1.156 +
1.157 + return result;
1.158 + }