sl@0
|
1 |
// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
|
sl@0
|
17 |
|
sl@0
|
18 |
#include "logicalbuffersink.h"
|
sl@0
|
19 |
#include <a3f/audioprocessingunittypeuids.h>
|
sl@0
|
20 |
#include <ecom/implementationproxy.h> // For making it ECom plugin
|
sl@0
|
21 |
|
sl@0
|
22 |
// Exported proxy for instantiation method resolution
|
sl@0
|
23 |
// Define the interface UIDs
|
sl@0
|
24 |
const TImplementationProxy ImplementationTable[] =
|
sl@0
|
25 |
{
|
sl@0
|
26 |
IMPLEMENTATION_PROXY_ENTRY(KMmfBufferSinkUid, CLogicalBufferSink::NewL)
|
sl@0
|
27 |
};
|
sl@0
|
28 |
|
sl@0
|
29 |
EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
|
sl@0
|
30 |
{
|
sl@0
|
31 |
aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
|
sl@0
|
32 |
return ImplementationTable;
|
sl@0
|
33 |
}
|
sl@0
|
34 |
// ---------------------------------------------------------------------------
|
sl@0
|
35 |
// Constructor
|
sl@0
|
36 |
// ---------------------------------------------------------------------------
|
sl@0
|
37 |
//
|
sl@0
|
38 |
CLogicalBufferSink::CLogicalBufferSink(TAny* aParam) : CAudioProcessingUnit(aParam)
|
sl@0
|
39 |
{
|
sl@0
|
40 |
TRACE_CREATE();
|
sl@0
|
41 |
DP_CONTEXT(CLogicalBufferSink::CLogicalBufferSink *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
42 |
DP_IN();
|
sl@0
|
43 |
DP_OUT();
|
sl@0
|
44 |
}
|
sl@0
|
45 |
|
sl@0
|
46 |
// ---------------------------------------------------------------------------
|
sl@0
|
47 |
// Factory method
|
sl@0
|
48 |
// ---------------------------------------------------------------------------
|
sl@0
|
49 |
//
|
sl@0
|
50 |
CLogicalBufferSink* CLogicalBufferSink::NewL(TAny* aParameters)
|
sl@0
|
51 |
{
|
sl@0
|
52 |
DP_STATIC_CONTEXT(CLogicalBufferSink::NewL *CD0*, CtxDevSound, DPLOCAL);
|
sl@0
|
53 |
DP_IN();
|
sl@0
|
54 |
CLogicalBufferSink* self = new(ELeave)CLogicalBufferSink(aParameters);
|
sl@0
|
55 |
CleanupStack::PushL(self);
|
sl@0
|
56 |
self->ConstructL();
|
sl@0
|
57 |
CleanupStack::Pop(self);
|
sl@0
|
58 |
DP0_RET(self, "0x%x");
|
sl@0
|
59 |
}
|
sl@0
|
60 |
|
sl@0
|
61 |
// ---------------------------------------------------------------------------
|
sl@0
|
62 |
// Second phase constructor
|
sl@0
|
63 |
// ---------------------------------------------------------------------------
|
sl@0
|
64 |
//
|
sl@0
|
65 |
void CLogicalBufferSink::ConstructL()
|
sl@0
|
66 |
{
|
sl@0
|
67 |
DP_CONTEXT(CLogicalBufferSink::ConstructL *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
68 |
DP_IN();
|
sl@0
|
69 |
DP_OUT();
|
sl@0
|
70 |
}
|
sl@0
|
71 |
|
sl@0
|
72 |
// ---------------------------------------------------------------------------
|
sl@0
|
73 |
// Destructor
|
sl@0
|
74 |
// ---------------------------------------------------------------------------
|
sl@0
|
75 |
//
|
sl@0
|
76 |
CLogicalBufferSink::~CLogicalBufferSink()
|
sl@0
|
77 |
{
|
sl@0
|
78 |
DP_CONTEXT(CLogicalBufferSink::~CLogicalBufferSink *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
79 |
DP_IN();
|
sl@0
|
80 |
DP_OUT();
|
sl@0
|
81 |
}
|
sl@0
|
82 |
|
sl@0
|
83 |
// from class MMMFBufferSink
|
sl@0
|
84 |
// ---------------------------------------------------------------------------
|
sl@0
|
85 |
// CLogicalBufferSink::SetDataConsumer
|
sl@0
|
86 |
// ---------------------------------------------------------------------------
|
sl@0
|
87 |
//
|
sl@0
|
88 |
TInt CLogicalBufferSink::SetDataConsumer(MMMFAudioDataConsumer& aConsumer)
|
sl@0
|
89 |
{
|
sl@0
|
90 |
DP_CONTEXT(CLogicalBufferSink::SetDataConsumer *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
91 |
DP_IN();
|
sl@0
|
92 |
iConsumer = &aConsumer;
|
sl@0
|
93 |
DP0_RET(KErrNone,"%d");
|
sl@0
|
94 |
}
|
sl@0
|
95 |
|
sl@0
|
96 |
// ---------------------------------------------------------------------------
|
sl@0
|
97 |
// CLogicalBufferSink::BufferEmptied
|
sl@0
|
98 |
// ---------------------------------------------------------------------------
|
sl@0
|
99 |
//
|
sl@0
|
100 |
TInt CLogicalBufferSink::BufferEmptied(CMMFBuffer* aBuffer)
|
sl@0
|
101 |
{
|
sl@0
|
102 |
DP_CONTEXT(CLogicalBufferSink::BufferEmptied *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
103 |
DP_IN();
|
sl@0
|
104 |
TInt err = KErrNone;
|
sl@0
|
105 |
err = iAdaptationBufferSink->BufferEmptied(aBuffer);
|
sl@0
|
106 |
DP0_RET(err,"%d");
|
sl@0
|
107 |
}
|
sl@0
|
108 |
|
sl@0
|
109 |
// ---------------------------------------------------------------------------
|
sl@0
|
110 |
// CLogicalBufferSink::BuffersDiscarded
|
sl@0
|
111 |
// ---------------------------------------------------------------------------
|
sl@0
|
112 |
//
|
sl@0
|
113 |
TInt CLogicalBufferSink::BuffersDiscarded()
|
sl@0
|
114 |
{
|
sl@0
|
115 |
DP_CONTEXT(CLogicalBufferSink::BuffersDiscarded *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
116 |
DP_IN();
|
sl@0
|
117 |
TInt err = KErrNone;
|
sl@0
|
118 |
err = iAdaptationBufferSink->BuffersDiscarded();
|
sl@0
|
119 |
DP0_RET(err,"%d");
|
sl@0
|
120 |
}
|
sl@0
|
121 |
|
sl@0
|
122 |
// From CAudioProcessingUnit
|
sl@0
|
123 |
// ---------------------------------------------------------------------------
|
sl@0
|
124 |
// CLogicalBufferSink::IsTypeOf
|
sl@0
|
125 |
// ---------------------------------------------------------------------------
|
sl@0
|
126 |
//
|
sl@0
|
127 |
TBool CLogicalBufferSink::IsTypeOf(TUid aTypeId) const
|
sl@0
|
128 |
{
|
sl@0
|
129 |
DP_CONTEXT(CLogicalBufferSink::IsTypeOf *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
130 |
DP_IN();
|
sl@0
|
131 |
TBool result = EFalse;
|
sl@0
|
132 |
if (iType == aTypeId)
|
sl@0
|
133 |
{
|
sl@0
|
134 |
result = ETrue;
|
sl@0
|
135 |
}
|
sl@0
|
136 |
DP0_RET(result, "%d");
|
sl@0
|
137 |
}
|
sl@0
|
138 |
|
sl@0
|
139 |
// ---------------------------------------------------------------------------
|
sl@0
|
140 |
// CLogicalBufferSink::Interface
|
sl@0
|
141 |
// ---------------------------------------------------------------------------
|
sl@0
|
142 |
//
|
sl@0
|
143 |
TAny* CLogicalBufferSink::Interface(TUid aType)
|
sl@0
|
144 |
{
|
sl@0
|
145 |
DP_CONTEXT(CLogicalBufferSink::Interface *CD1*, CtxDevSound, DPLOCAL);
|
sl@0
|
146 |
DP_IN();
|
sl@0
|
147 |
MMMFBufferSink* ptr = NULL;
|
sl@0
|
148 |
if(aType==KUidMmfBufferSink)
|
sl@0
|
149 |
{
|
sl@0
|
150 |
ptr = static_cast<MMMFBufferSink*>(this);
|
sl@0
|
151 |
}
|
sl@0
|
152 |
DP_OUT();
|
sl@0
|
153 |
return ptr;
|
sl@0
|
154 |
}
|
sl@0
|
155 |
|
sl@0
|
156 |
// From MMMFAudioDataConsumer
|
sl@0
|
157 |
// ---------------------------------------------------------------------------
|
sl@0
|
158 |
// CLogicalBufferSink::BufferToBeFilled
|
sl@0
|
159 |
// ---------------------------------------------------------------------------
|
sl@0
|
160 |
//
|
sl@0
|
161 |
void CLogicalBufferSink::BufferToBeEmptied(MMMFBufferSink* /*aSink*/, CMMFBuffer* aBuffer)
|
sl@0
|
162 |
{
|
sl@0
|
163 |
iConsumer->BufferToBeEmptied(this, aBuffer);
|
sl@0
|
164 |
}
|
sl@0
|
165 |
|
sl@0
|
166 |
// ---------------------------------------------------------------------------
|
sl@0
|
167 |
// CLogicalBufferSource::DiscardBuffers
|
sl@0
|
168 |
// ---------------------------------------------------------------------------
|
sl@0
|
169 |
//
|
sl@0
|
170 |
void CLogicalBufferSink::DiscardBuffers(MMMFBufferSink* /*aSink*/)
|
sl@0
|
171 |
{
|
sl@0
|
172 |
iConsumer->DiscardBuffers(this);
|
sl@0
|
173 |
}
|
sl@0
|
174 |
|
sl@0
|
175 |
// end of file
|