sl@0: // Copyright (c) 2004-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: // Name : logicalbuffersource.cpp sl@0: // Part of : ACL Logical Layer sl@0: // sl@0: sl@0: sl@0: sl@0: #include "logicalbuffersource.h" sl@0: #include sl@0: #include // For making it ECom plugin sl@0: sl@0: // Map the interface implementation UIDs to implementation factory functions sl@0: const TImplementationProxy ImplementationTable[] = sl@0: { sl@0: IMPLEMENTATION_PROXY_ENTRY(KMmfBufferSourceUid, CLogicalBufferSource::NewL), sl@0: }; sl@0: sl@0: // Exported proxy for instantiation method resolution. sl@0: EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) sl@0: { sl@0: aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); sl@0: return ImplementationTable; sl@0: } sl@0: // --------------------------------------------------------------------------- sl@0: // Constructor sl@0: // --------------------------------------------------------------------------- sl@0: // sl@0: CLogicalBufferSource::CLogicalBufferSource(TAny* aParam) : CAudioProcessingUnit(aParam) sl@0: { sl@0: TRACE_CREATE(); sl@0: DP_CONTEXT(CLogicalBufferSource::CLogicalBufferSource *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: DP_OUT(); sl@0: } sl@0: sl@0: // --------------------------------------------------------------------------- sl@0: // Factory method sl@0: // --------------------------------------------------------------------------- sl@0: // sl@0: CLogicalBufferSource* CLogicalBufferSource::NewL(TAny* aParameters) sl@0: { sl@0: DP_STATIC_CONTEXT(CLogicalBufferSource::NewL *CD0*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: CLogicalBufferSource* self = new(ELeave)CLogicalBufferSource(aParameters); sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(); sl@0: CleanupStack::Pop(self); sl@0: DP0_RET(self, "0x%x"); sl@0: } sl@0: sl@0: // --------------------------------------------------------------------------- sl@0: // Second phase constructor sl@0: // --------------------------------------------------------------------------- sl@0: // sl@0: void CLogicalBufferSource::ConstructL() sl@0: { sl@0: DP_CONTEXT(CLogicalBufferSource::ConstructL *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: DP_OUT(); sl@0: } sl@0: sl@0: // --------------------------------------------------------------------------- sl@0: // Destructor sl@0: // --------------------------------------------------------------------------- sl@0: // sl@0: CLogicalBufferSource::~CLogicalBufferSource() sl@0: { sl@0: DP_CONTEXT(CLogicalBufferSource::~CLogicalBufferSource *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: DP_OUT(); sl@0: } sl@0: sl@0: // from MMMFBufferSource sl@0: // --------------------------------------------------------------------------- sl@0: // CLogicalBufferSource::SetDataSupplier sl@0: // --------------------------------------------------------------------------- sl@0: // sl@0: TInt CLogicalBufferSource::SetDataSupplier(MMMFAudioDataSupplier& aSupplier) sl@0: { sl@0: DP_CONTEXT(CLogicalBufferSource::SetDataSupplier *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: TInt err = KErrNone; sl@0: iSupplier = &aSupplier; sl@0: DP0_RET(err, "%d"); sl@0: } sl@0: sl@0: // --------------------------------------------------------------------------- sl@0: // CLogicalBufferSource::BufferFilled sl@0: // --------------------------------------------------------------------------- sl@0: // sl@0: TInt CLogicalBufferSource::BufferFilled(CMMFBuffer* aBuffer) sl@0: { sl@0: DP_CONTEXT(CLogicalBufferSource::BufferFilled *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: TInt err = KErrNone; sl@0: err = iAdaptationBufferSource->BufferFilled(aBuffer); sl@0: DP0_RET(err, "%d"); sl@0: } sl@0: sl@0: // --------------------------------------------------------------------------- sl@0: // CLogicalBufferSource::BuffersDiscarded sl@0: // --------------------------------------------------------------------------- sl@0: // sl@0: TInt CLogicalBufferSource::BuffersDiscarded() sl@0: { sl@0: DP_CONTEXT(CLogicalBufferSource::BuffersDiscarded *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: TInt err = KErrNone; sl@0: err = iAdaptationBufferSource->BuffersDiscarded(); sl@0: DP0_RET(err, "%d"); sl@0: } sl@0: sl@0: // --------------------------------------------------------------------------- sl@0: // CLogicalBufferSource::IsTypeOf sl@0: // --------------------------------------------------------------------------- sl@0: // sl@0: TBool CLogicalBufferSource::IsTypeOf(TUid aTypeId) const sl@0: { sl@0: DP_CONTEXT(CLogicalBufferSource::IsTypeOf *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: TBool result = EFalse; sl@0: if (iType == aTypeId) sl@0: { sl@0: result = ETrue; sl@0: } sl@0: DP0_RET(result, "%d"); sl@0: } sl@0: sl@0: // --------------------------------------------------------------------------- sl@0: // CLogicalBufferSource::Interface sl@0: // --------------------------------------------------------------------------- sl@0: // sl@0: TAny* CLogicalBufferSource::Interface(TUid aType) sl@0: { sl@0: DP_CONTEXT(CLogicalBufferSource::Interface *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: TAny* interface = NULL; sl@0: if(aType==KUidMmfBufferSource) sl@0: { sl@0: interface = static_cast(this); sl@0: } sl@0: DP0_RET(interface, "%d"); sl@0: } sl@0: sl@0: // From MMMFAudioDataSupplier sl@0: // --------------------------------------------------------------------------- sl@0: // CLogicalBufferSource::BufferToBeFilled sl@0: // --------------------------------------------------------------------------- sl@0: // sl@0: void CLogicalBufferSource::BufferToBeFilled(MMMFBufferSource* /*aSource*/, CMMFBuffer* aBuffer) sl@0: { sl@0: iSupplier->BufferToBeFilled(this, aBuffer); sl@0: } sl@0: sl@0: // --------------------------------------------------------------------------- sl@0: // CLogicalBufferSource::DiscardBuffers sl@0: // --------------------------------------------------------------------------- sl@0: // sl@0: void CLogicalBufferSource::DiscardBuffers(MMMFBufferSource* /*aSource*/) sl@0: { sl@0: iSupplier->DiscardBuffers(this); sl@0: } sl@0: sl@0: // end of file