sl@0: // Copyright (c) 2006-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: sl@0: sl@0: #include "logicalbuffersink.h" sl@0: #include sl@0: #include // For making it ECom plugin sl@0: sl@0: // Exported proxy for instantiation method resolution sl@0: // Define the interface UIDs sl@0: const TImplementationProxy ImplementationTable[] = sl@0: { sl@0: IMPLEMENTATION_PROXY_ENTRY(KMmfBufferSinkUid, CLogicalBufferSink::NewL) sl@0: }; sl@0: 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: CLogicalBufferSink::CLogicalBufferSink(TAny* aParam) : CAudioProcessingUnit(aParam) sl@0: { sl@0: TRACE_CREATE(); sl@0: DP_CONTEXT(CLogicalBufferSink::CLogicalBufferSink *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: CLogicalBufferSink* CLogicalBufferSink::NewL(TAny* aParameters) sl@0: { sl@0: DP_STATIC_CONTEXT(CLogicalBufferSink::NewL *CD0*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: CLogicalBufferSink* self = new(ELeave)CLogicalBufferSink(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 CLogicalBufferSink::ConstructL() sl@0: { sl@0: DP_CONTEXT(CLogicalBufferSink::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: CLogicalBufferSink::~CLogicalBufferSink() sl@0: { sl@0: DP_CONTEXT(CLogicalBufferSink::~CLogicalBufferSink *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: DP_OUT(); sl@0: } sl@0: sl@0: // from class MMMFBufferSink sl@0: // --------------------------------------------------------------------------- sl@0: // CLogicalBufferSink::SetDataConsumer sl@0: // --------------------------------------------------------------------------- sl@0: // sl@0: TInt CLogicalBufferSink::SetDataConsumer(MMMFAudioDataConsumer& aConsumer) sl@0: { sl@0: DP_CONTEXT(CLogicalBufferSink::SetDataConsumer *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: iConsumer = &aConsumer; sl@0: DP0_RET(KErrNone,"%d"); sl@0: } sl@0: sl@0: // --------------------------------------------------------------------------- sl@0: // CLogicalBufferSink::BufferEmptied sl@0: // --------------------------------------------------------------------------- sl@0: // sl@0: TInt CLogicalBufferSink::BufferEmptied(CMMFBuffer* aBuffer) sl@0: { sl@0: DP_CONTEXT(CLogicalBufferSink::BufferEmptied *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: TInt err = KErrNone; sl@0: err = iAdaptationBufferSink->BufferEmptied(aBuffer); sl@0: DP0_RET(err,"%d"); sl@0: } sl@0: sl@0: // --------------------------------------------------------------------------- sl@0: // CLogicalBufferSink::BuffersDiscarded sl@0: // --------------------------------------------------------------------------- sl@0: // sl@0: TInt CLogicalBufferSink::BuffersDiscarded() sl@0: { sl@0: DP_CONTEXT(CLogicalBufferSink::BuffersDiscarded *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: TInt err = KErrNone; sl@0: err = iAdaptationBufferSink->BuffersDiscarded(); sl@0: DP0_RET(err,"%d"); sl@0: } sl@0: sl@0: // From CAudioProcessingUnit sl@0: // --------------------------------------------------------------------------- sl@0: // CLogicalBufferSink::IsTypeOf sl@0: // --------------------------------------------------------------------------- sl@0: // sl@0: TBool CLogicalBufferSink::IsTypeOf(TUid aTypeId) const sl@0: { sl@0: DP_CONTEXT(CLogicalBufferSink::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: // CLogicalBufferSink::Interface sl@0: // --------------------------------------------------------------------------- sl@0: // sl@0: TAny* CLogicalBufferSink::Interface(TUid aType) sl@0: { sl@0: DP_CONTEXT(CLogicalBufferSink::Interface *CD1*, CtxDevSound, DPLOCAL); sl@0: DP_IN(); sl@0: MMMFBufferSink* ptr = NULL; sl@0: if(aType==KUidMmfBufferSink) sl@0: { sl@0: ptr = static_cast(this); sl@0: } sl@0: DP_OUT(); sl@0: return ptr; sl@0: } sl@0: sl@0: // From MMMFAudioDataConsumer sl@0: // --------------------------------------------------------------------------- sl@0: // CLogicalBufferSink::BufferToBeFilled sl@0: // --------------------------------------------------------------------------- sl@0: // sl@0: void CLogicalBufferSink::BufferToBeEmptied(MMMFBufferSink* /*aSink*/, CMMFBuffer* aBuffer) sl@0: { sl@0: iConsumer->BufferToBeEmptied(this, aBuffer); sl@0: } sl@0: sl@0: // --------------------------------------------------------------------------- sl@0: // CLogicalBufferSource::DiscardBuffers sl@0: // --------------------------------------------------------------------------- sl@0: // sl@0: void CLogicalBufferSink::DiscardBuffers(MMMFBufferSink* /*aSink*/) sl@0: { sl@0: iConsumer->DiscardBuffers(this); sl@0: } sl@0: sl@0: // end of file