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