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