devsound/devsoundrefplugin/tsrc/CIPlugins/src/g729decoderconfigtestdevice.cpp
changeset 0 79dd3e2336a0
equal deleted inserted replaced
-1:000000000000 0:79dd3e2336a0
       
     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".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include <ecom/implementationproxy.h>
       
    17 #include <ecom/ecom.h>
       
    18 #include <f32file.h>
       
    19 #include "g729decoderconfigtestdevice.h"
       
    20 #include "devsoundciutestdevices.hrh"
       
    21 
       
    22 
       
    23 /*
       
    24 CMMFG729DecoderConfig implementation
       
    25 */
       
    26 CMMFG729DecoderConfig* CMMFG729DecoderConfig::NewL()
       
    27 	{
       
    28 	CMMFG729DecoderConfig* self = new(ELeave) CMMFG729DecoderConfig();
       
    29 	return self;
       
    30 	}
       
    31 
       
    32 CMMFG729DecoderConfig::~CMMFG729DecoderConfig()
       
    33 	{
       
    34 	}
       
    35 
       
    36 //Actual implementation of method BadLsfNextBuffer
       
    37 TInt CMMFG729DecoderConfig::BadLsfNextBuffer()
       
    38 	{
       
    39 	return KErrNone;
       
    40 	}
       
    41 
       
    42 
       
    43 /*
       
    44 CG729DecoderConfigTestDevice implementation
       
    45 */
       
    46 CMMFHwDevice* CG729DecoderConfigTestDevice::NewL()
       
    47 	{
       
    48 	CG729DecoderConfigTestDevice* self=new(ELeave) CG729DecoderConfigTestDevice();
       
    49 	CleanupStack::PushL(self);
       
    50 	self->ConstructL();
       
    51 	CleanupStack::Pop(self);
       
    52 	return self;
       
    53 	}
       
    54 
       
    55 CG729DecoderConfigTestDevice::~CG729DecoderConfigTestDevice()
       
    56 	{
       
    57 	delete iG729DecoderConfig;
       
    58 	}
       
    59 
       
    60 CG729DecoderConfigTestDevice::CG729DecoderConfigTestDevice()
       
    61 	{
       
    62 	}
       
    63 
       
    64 void CG729DecoderConfigTestDevice::ConstructL()
       
    65 	{
       
    66 	}
       
    67 
       
    68 TInt CG729DecoderConfigTestDevice::Start(TDeviceFunc /*aFuncCmd*/, TDeviceFlow /*aFlowCmd*/) 
       
    69 	{
       
    70 	return 0;
       
    71 	}
       
    72 
       
    73 TInt CG729DecoderConfigTestDevice::Stop()
       
    74 	{
       
    75 	return 0;
       
    76 	}
       
    77 
       
    78 TInt CG729DecoderConfigTestDevice::Pause()
       
    79 	{
       
    80 	return 0;
       
    81 	}
       
    82 
       
    83 TInt CG729DecoderConfigTestDevice::Init(THwDeviceInitParams& /*aDevInfo*/)
       
    84 	{
       
    85 	return 0;
       
    86 	}
       
    87 
       
    88 TAny* CG729DecoderConfigTestDevice::CustomInterface(TUid aInterfaceId)
       
    89 	{
       
    90 	// Just return something non-NULL to keep the
       
    91 	// DevSound initialisation process happy
       
    92 	TAny* ret = static_cast<TAny*>(this);
       
    93 
       
    94 	// Now for the CIs we want to test...
       
    95 	if (aInterfaceId == KUidG729DecoderIntfc)
       
    96 		{
       
    97 		if (!iG729DecoderConfig)
       
    98 			{
       
    99 			TRAPD(err, iG729DecoderConfig = CMMFG729DecoderConfig::NewL());
       
   100 			if (err == KErrNone && iG729DecoderConfig)
       
   101 				{
       
   102 				MG729DecoderIntfc* ptr = this;
       
   103 				ret = static_cast<TAny*>(ptr);
       
   104 				}
       
   105 			else
       
   106 				{
       
   107 				ret = NULL;
       
   108 				}
       
   109 			}
       
   110 		}
       
   111 
       
   112 	return ret;
       
   113 	}
       
   114 
       
   115 TInt CG729DecoderConfigTestDevice::ThisHwBufferFilled(CMMFBuffer& /*aFillBufferPtr*/)
       
   116 	{
       
   117 	return 0;
       
   118 	}
       
   119 
       
   120 TInt CG729DecoderConfigTestDevice::ThisHwBufferEmptied(CMMFBuffer& /*aEmptyBufferPtr*/)
       
   121 	{
       
   122 	return 0;
       
   123 	}
       
   124 
       
   125 TInt CG729DecoderConfigTestDevice::SetConfig(TTaskConfig& /*aConfig*/)
       
   126 	{
       
   127 	return 0;
       
   128 	}
       
   129 
       
   130 TInt CG729DecoderConfigTestDevice::StopAndDeleteCodec()
       
   131 	{
       
   132 	return 0;
       
   133 	}
       
   134 
       
   135 TInt CG729DecoderConfigTestDevice::DeleteCodec()
       
   136 	{
       
   137 	return 0;
       
   138 	}
       
   139 
       
   140 CMMFSwCodec& CG729DecoderConfigTestDevice::Codec()
       
   141 	{
       
   142 	return *iCodec;
       
   143 	}
       
   144 
       
   145 TInt CG729DecoderConfigTestDevice::BadLsfNextBuffer()
       
   146 	{
       
   147 	TInt result = KErrBadHandle;
       
   148 
       
   149 	if (iG729DecoderConfig)
       
   150 		{
       
   151 		result = iG729DecoderConfig->BadLsfNextBuffer();
       
   152 		}
       
   153 
       
   154 	return result;
       
   155 	}