|
1 /* |
|
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include "mccresourcepool_STUB.h" |
|
22 #include "mccmultiplexer.h" |
|
23 #include "mcctimermanager.h" |
|
24 #include <mmf/server/mmfbuffer.h> |
|
25 |
|
26 // EXTERNAL DATA STRUCTURES |
|
27 |
|
28 // EXTERNAL FUNCTION PROTOTYPES |
|
29 |
|
30 // CONSTANTS |
|
31 |
|
32 // MACROS |
|
33 |
|
34 // LOCAL CONSTANTS AND MACROS |
|
35 |
|
36 // MODULE DATA STRUCTURES |
|
37 |
|
38 // LOCAL FUNCTION PROTOTYPES |
|
39 |
|
40 // FORWARD DECLARATIONS |
|
41 |
|
42 // ============================= LOCAL FUNCTIONS =============================== |
|
43 |
|
44 // ============================ MEMBER FUNCTIONS =============================== |
|
45 |
|
46 // ----------------------------------------------------------------------------- |
|
47 // CMccResourcePoolStub::NewL |
|
48 // ----------------------------------------------------------------------------- |
|
49 // |
|
50 CMccResourcePoolStub* CMccResourcePoolStub::NewL() |
|
51 { |
|
52 CMccResourcePoolStub* self = new ( ELeave ) CMccResourcePoolStub; |
|
53 CleanupStack::PushL( self ); |
|
54 self->ConstructL(); |
|
55 CleanupStack::Pop( self ); |
|
56 return self; |
|
57 } |
|
58 |
|
59 // ----------------------------------------------------------------------------- |
|
60 // CMccResourcePoolStub::~CMccResourcePoolStub |
|
61 // ----------------------------------------------------------------------------- |
|
62 // |
|
63 CMccResourcePoolStub::~CMccResourcePoolStub() |
|
64 { |
|
65 delete iMultiplexer; |
|
66 delete iTimerManager; |
|
67 } |
|
68 |
|
69 // ----------------------------------------------------------------------------- |
|
70 // CMccResourcePoolStub::ReserveSinkL |
|
71 // ----------------------------------------------------------------------------- |
|
72 // |
|
73 void CMccResourcePoolStub::ReserveSinkL( MDataSink* /*aSink*/, TUint32 /*aEndpointId*/ ) |
|
74 { |
|
75 } |
|
76 |
|
77 // ----------------------------------------------------------------------------- |
|
78 // CMccResourcePoolStub::ReserveSourceL |
|
79 // ----------------------------------------------------------------------------- |
|
80 // |
|
81 void CMccResourcePoolStub::ReserveSourceL( MDataSource* /*aSource*/, TUint32 /*aEndpointId*/ ) |
|
82 { |
|
83 } |
|
84 |
|
85 // ----------------------------------------------------------------------------- |
|
86 // CMccResourcePoolStub::PrepareEndpointRemovalL |
|
87 // ----------------------------------------------------------------------------- |
|
88 // |
|
89 void CMccResourcePoolStub::PrepareEndpointRemovalL( |
|
90 TUint32 /*aEndpointId*/, |
|
91 RArray<TMccResourceParams>& /*aAffectedStreams*/ ) |
|
92 { |
|
93 } |
|
94 |
|
95 // ----------------------------------------------------------------------------- |
|
96 // CMccResourcePoolStub::RemoveEndpointL |
|
97 // ----------------------------------------------------------------------------- |
|
98 // |
|
99 void CMccResourcePoolStub::RemoveEndpointL( TUint32 /*aEndpointId*/ ) |
|
100 { |
|
101 } |
|
102 |
|
103 // ----------------------------------------------------------------------------- |
|
104 // CMccResourcePoolStub::ReserveResourcesL |
|
105 // ----------------------------------------------------------------------------- |
|
106 // |
|
107 void CMccResourcePoolStub::ReserveResourcesL( |
|
108 const TMccResourceParams& /*aParams*/ ) |
|
109 { |
|
110 } |
|
111 |
|
112 // ----------------------------------------------------------------------------- |
|
113 // CMccResourcePoolStub::FreeResources |
|
114 // ----------------------------------------------------------------------------- |
|
115 // |
|
116 void CMccResourcePoolStub::FreeResources( TUint32 /*aStreamId*/ ) |
|
117 { |
|
118 } |
|
119 |
|
120 // ----------------------------------------------------------------------------- |
|
121 // CMccResourcePoolStub::IsResourceUsageAllowed |
|
122 // ----------------------------------------------------------------------------- |
|
123 // |
|
124 TBool CMccResourcePoolStub::IsResourceUsageAllowed( TUint32 /*aStreamId*/ ) |
|
125 { |
|
126 return ETrue; |
|
127 } |
|
128 |
|
129 // ----------------------------------------------------------------------------- |
|
130 // CMccResourcePoolStub::SetResourceStateL |
|
131 // ----------------------------------------------------------------------------- |
|
132 // |
|
133 void CMccResourcePoolStub::SetResourceStateL( |
|
134 TUint32 /*aStreamId*/, |
|
135 TUint32 aEndpointId, |
|
136 MMccResources::TResourceState /*aState*/, |
|
137 TBool& aControlNetworkResources, |
|
138 RArray<TUint32>& aControlledEndpoints, |
|
139 RArray<TUint32>& aUncontrolledEndpoints ) |
|
140 { |
|
141 if ( iControlled ) |
|
142 { |
|
143 aControlNetworkResources = ETrue; |
|
144 aControlledEndpoints.AppendL( aEndpointId ); |
|
145 } |
|
146 else |
|
147 { |
|
148 aControlNetworkResources = EFalse; |
|
149 aUncontrolledEndpoints.AppendL( aEndpointId ); |
|
150 } |
|
151 } |
|
152 |
|
153 // ----------------------------------------------------------------------------- |
|
154 // CMccResourcePoolStub::ResourceStateSetL |
|
155 // ----------------------------------------------------------------------------- |
|
156 // |
|
157 void CMccResourcePoolStub::ResourceStateSetL() |
|
158 { |
|
159 } |
|
160 |
|
161 // ----------------------------------------------------------------------------- |
|
162 // CMccResourcePoolStub::EventReceived |
|
163 // ----------------------------------------------------------------------------- |
|
164 // |
|
165 |
|
166 TInt CMccResourcePoolStub::EventReceived( |
|
167 TMccEvent& /*aEvent*/, |
|
168 TBool& aDiscardEvent, |
|
169 TBool& aEffectiveStandby, |
|
170 TMccEvent** /*aAdditionalEvent*/ ) |
|
171 { |
|
172 aDiscardEvent = EFalse; |
|
173 aEffectiveStandby = EFalse; |
|
174 return KErrNone; |
|
175 } |
|
176 |
|
177 // ----------------------------------------------------------------------------- |
|
178 // CMccResourcePoolStub::Sinks |
|
179 // ----------------------------------------------------------------------------- |
|
180 // |
|
181 const RPointerArray<MDataSink>& CMccResourcePoolStub::Sinks( TBool /*aOnlyInternals*/ ) |
|
182 { |
|
183 return iTempSinks; |
|
184 } |
|
185 |
|
186 // ----------------------------------------------------------------------------- |
|
187 // CMccResourcePoolStub::Sources |
|
188 // ----------------------------------------------------------------------------- |
|
189 // |
|
190 const RPointerArray<MDataSource>& CMccResourcePoolStub::Sources( TBool /*aOnlyInternals*/ ) |
|
191 { |
|
192 return iTempSources; |
|
193 } |
|
194 |
|
195 // ----------------------------------------------------------------------------- |
|
196 // CMccResourcePoolStub::MultiplexerL |
|
197 // ----------------------------------------------------------------------------- |
|
198 // |
|
199 CMccMultiplexer* CMccResourcePoolStub::MultiplexerL( MDataSource* aSource ) |
|
200 { |
|
201 if ( !iMultiplexer ) |
|
202 { |
|
203 iMultiplexer = CMccMultiplexer::NewL( aSource ); |
|
204 } |
|
205 return iMultiplexer; |
|
206 } |
|
207 |
|
208 // ----------------------------------------------------------------------------- |
|
209 // CMccResourcePoolStub::FindResource |
|
210 // ----------------------------------------------------------------------------- |
|
211 // |
|
212 TInt CMccResourcePoolStub::FindResource( TUint32 /*aLinkId*/, |
|
213 TUint32 /*aEndpointId*/, |
|
214 TUid /*aResourceUid*/, |
|
215 MDataSource** /*aSource*/, |
|
216 MDataSink** /*aSink*/ ) |
|
217 { |
|
218 return KErrNotFound; |
|
219 } |
|
220 |
|
221 // ----------------------------------------------------------------------------- |
|
222 // CMccResourcePoolStub::FindNetworkResourceByRtpStreamId |
|
223 // ----------------------------------------------------------------------------- |
|
224 // |
|
225 TInt CMccResourcePoolStub::FindNetworkResourceByRtpStreamId( |
|
226 const TUint32 aMccSessionId, |
|
227 const TRtpId& /*aRtpStreamId*/, |
|
228 MDataSource** /*aSource*/, |
|
229 MDataSink** /*aSink*/ ) |
|
230 { |
|
231 return KErrNotFound; |
|
232 } |
|
233 |
|
234 // ----------------------------------------------------------------------------- |
|
235 // CMccResourcePoolStub::FindNetworkResourceByRtpSsrc |
|
236 // ----------------------------------------------------------------------------- |
|
237 // |
|
238 TInt CMccResourcePoolStub::FindNetworkResourceByRtpSsrc( |
|
239 const TRtpSSRC& /*aRtpSsrc*/, |
|
240 MDataSource** /*aSource*/, |
|
241 MDataSink** /*aSink*/ ) |
|
242 { |
|
243 return KErrNotFound; |
|
244 } |
|
245 |
|
246 // ----------------------------------------------------------------------------- |
|
247 // CMccResourcePoolStub::StoreKeyFrameInfoL |
|
248 // ----------------------------------------------------------------------------- |
|
249 // |
|
250 void CMccResourcePoolStub::StoreKeyFrameInfoL( TUint32 /*aEndpointId*/, CMMFBuffer& aKeyFrame ) |
|
251 { |
|
252 iKeyFrameTimeStamp = aKeyFrame.TimeToPlay().Int64(); |
|
253 } |
|
254 |
|
255 // ----------------------------------------------------------------------------- |
|
256 // CMccResourcePoolStub::IsKeyFrame |
|
257 // ----------------------------------------------------------------------------- |
|
258 // |
|
259 TBool CMccResourcePoolStub::IsKeyFrame( TUint32 aEndpointId, CMMFBuffer& aBuffer ) |
|
260 { |
|
261 return ( iKeyFrameTimeStamp == aBuffer.TimeToPlay().Int64() ); |
|
262 } |
|
263 |
|
264 // ----------------------------------------------------------------------------- |
|
265 // CMccResourcePoolStub::EnableViewFinderL |
|
266 // ----------------------------------------------------------------------------- |
|
267 // |
|
268 void CMccResourcePoolStub::EnableViewFinderL( TMccVideoSinkSetting& /*aSetting*/ ) |
|
269 { |
|
270 |
|
271 } |
|
272 |
|
273 // ----------------------------------------------------------------------------- |
|
274 // CMccResourcePoolStub::DisableViewFinderL |
|
275 // ----------------------------------------------------------------------------- |
|
276 // |
|
277 void CMccResourcePoolStub::DisableViewFinderL() |
|
278 { |
|
279 |
|
280 } |
|
281 |
|
282 // ----------------------------------------------------------------------------- |
|
283 // CMccResourcePoolStub::CMccResourcePoolStub |
|
284 // ----------------------------------------------------------------------------- |
|
285 // |
|
286 CMccResourcePoolStub::CMccResourcePoolStub() : |
|
287 iControlled( ETrue ) |
|
288 { |
|
289 } |
|
290 |
|
291 // ----------------------------------------------------------------------------- |
|
292 // CMccResourcePoolStub::ConstructL |
|
293 // ----------------------------------------------------------------------------- |
|
294 // |
|
295 void CMccResourcePoolStub::ConstructL() |
|
296 { |
|
297 iTimerManager = CMccTimerManager::NewL(); |
|
298 } |
|
299 |
|
300 // ----------------------------------------------------------------------------- |
|
301 // CMccResourcePoolStub::ConstructL |
|
302 // ----------------------------------------------------------------------------- |
|
303 // |
|
304 MMccTimerManager& CMccResourcePoolStub::TimerManager() |
|
305 { |
|
306 return *iTimerManager; |
|
307 } |
|
308 |