1 /* |
|
2 * Copyright (c) 2005 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 #include "mcemanager.h" |
|
20 #include "mceinsessionobserver.h" |
|
21 #include "mcesessionobserver.h" |
|
22 #include "mcesession.h" |
|
23 #include "mcetransactiondatacontainer.h" |
|
24 #include "mceamrcodec.h" |
|
25 #include "mceh263codec.h" |
|
26 #include "mceavccodec.h" |
|
27 // Test simulator |
|
28 #include "mussessionsimulator.h" |
|
29 |
|
30 // ============================ MEMBER FUNCTIONS =============================== |
|
31 |
|
32 |
|
33 // ----------------------------------------------------------------------------- |
|
34 // CMceManager::NewL |
|
35 // ----------------------------------------------------------------------------- |
|
36 // |
|
37 EXPORT_C CMceManager* CMceManager::NewL( |
|
38 const TUid& aAppUid, |
|
39 TMceTransactionDataContainer* aContainer ) |
|
40 { |
|
41 |
|
42 CMceManager* self = |
|
43 new (ELeave) CMceManager( aAppUid, aContainer ); |
|
44 CleanupStack::PushL( self ); |
|
45 self->ConstructL(); |
|
46 CleanupStack::Pop( self ); |
|
47 return self; |
|
48 |
|
49 } |
|
50 |
|
51 |
|
52 // ----------------------------------------------------------------------------- |
|
53 // CMceManager::~CMceManager |
|
54 // ----------------------------------------------------------------------------- |
|
55 // |
|
56 EXPORT_C CMceManager::~CMceManager() |
|
57 { |
|
58 if (iContainer) |
|
59 { |
|
60 iContainer->Clear(); |
|
61 iContainer = 0; |
|
62 } |
|
63 |
|
64 iSessions.Reset(); |
|
65 iSessions.Close(); |
|
66 |
|
67 iSupportedAudioCodecs.ResetAndDestroy(); |
|
68 iSupportedVideoCodecs.ResetAndDestroy(); |
|
69 |
|
70 delete iSessionSimulator; |
|
71 |
|
72 } |
|
73 |
|
74 // ----------------------------------------------------------------------------- |
|
75 // CMceManager::SetInSessionObserver |
|
76 // ----------------------------------------------------------------------------- |
|
77 // |
|
78 EXPORT_C void CMceManager::SetInSessionObserver( |
|
79 MMceInSessionObserver* aInSessionObserver ) |
|
80 { |
|
81 iInSessionObserver = aInSessionObserver; |
|
82 } |
|
83 |
|
84 // ----------------------------------------------------------------------------- |
|
85 // CMceManager::SetInEventObserver |
|
86 // ----------------------------------------------------------------------------- |
|
87 // |
|
88 EXPORT_C void CMceManager::SetInEventObserver( |
|
89 MMceInEventObserver* /*aInEventObserver*/ ) |
|
90 { |
|
91 // NOP |
|
92 } |
|
93 |
|
94 // ----------------------------------------------------------------------------- |
|
95 // CMceManager::SetInReferObserver |
|
96 // ----------------------------------------------------------------------------- |
|
97 // |
|
98 EXPORT_C void CMceManager::SetInReferObserver( |
|
99 MMceInReferObserver* /*aInReferObserver*/ ) |
|
100 { |
|
101 // NOP |
|
102 } |
|
103 |
|
104 // ----------------------------------------------------------------------------- |
|
105 // CMceManager::SetSessionObserver |
|
106 // ----------------------------------------------------------------------------- |
|
107 // |
|
108 EXPORT_C void CMceManager::SetSessionObserver( |
|
109 MMceSessionObserver* aSessionObserver ) |
|
110 { |
|
111 iSessionObserver = aSessionObserver; |
|
112 } |
|
113 |
|
114 // ----------------------------------------------------------------------------- |
|
115 // CMceManager::SetEventObserver |
|
116 // ----------------------------------------------------------------------------- |
|
117 // |
|
118 EXPORT_C void CMceManager::SetEventObserver( |
|
119 MMceEventObserver* /*aEventObserver*/ ) |
|
120 { |
|
121 // NOP |
|
122 } |
|
123 |
|
124 // ----------------------------------------------------------------------------- |
|
125 // CMceManager::SetReferObserver |
|
126 // ----------------------------------------------------------------------------- |
|
127 // |
|
128 EXPORT_C void CMceManager::SetReferObserver( |
|
129 MMceReferObserver* /*aReferObserver*/ ) |
|
130 { |
|
131 // NOP |
|
132 } |
|
133 |
|
134 // ----------------------------------------------------------------------------- |
|
135 // CMceManager::SetMediaObserver |
|
136 // ----------------------------------------------------------------------------- |
|
137 // |
|
138 EXPORT_C void CMceManager::SetMediaObserver( |
|
139 MMceStreamObserver* aMediaObserver ) |
|
140 { |
|
141 iMediaObserver = aMediaObserver; |
|
142 } |
|
143 |
|
144 |
|
145 // ----------------------------------------------------------------------------- |
|
146 // CMceManager::SetRtpObserver |
|
147 // ----------------------------------------------------------------------------- |
|
148 // |
|
149 EXPORT_C void CMceManager::SetRtpObserver( |
|
150 MMceRtpObserver* aRtpObserver ) |
|
151 { |
|
152 iRtpObserver = aRtpObserver; |
|
153 } |
|
154 |
|
155 |
|
156 // ----------------------------------------------------------------------------- |
|
157 // CMceManager::SupportedAudioCodecs |
|
158 // ----------------------------------------------------------------------------- |
|
159 // |
|
160 EXPORT_C const RPointerArray<const CMceAudioCodec>& |
|
161 CMceManager::SupportedAudioCodecs() const |
|
162 { |
|
163 return iSupportedAudioCodecs; |
|
164 } |
|
165 |
|
166 |
|
167 // ----------------------------------------------------------------------------- |
|
168 // |
|
169 // ----------------------------------------------------------------------------- |
|
170 // |
|
171 EXPORT_C const RPointerArray<const CMceVideoCodec>& |
|
172 CMceManager::SupportedVideoCodecs() const |
|
173 { |
|
174 return iSupportedVideoCodecs; |
|
175 } |
|
176 |
|
177 |
|
178 // ----------------------------------------------------------------------------- |
|
179 // CMceManager::Sessions |
|
180 // ----------------------------------------------------------------------------- |
|
181 // |
|
182 EXPORT_C const RPointerArray<CMceSession>& CMceManager::Sessions() const |
|
183 { |
|
184 return iSessions; |
|
185 } |
|
186 |
|
187 |
|
188 // ----------------------------------------------------------------------------- |
|
189 // CMceManager::SetDefaultHeadersL |
|
190 // ----------------------------------------------------------------------------- |
|
191 // |
|
192 EXPORT_C void CMceManager::SetDefaultHeadersL( CDesC8Array* aMethods, |
|
193 CDesC8Array* aHeaders ) |
|
194 { |
|
195 delete aMethods; |
|
196 delete aHeaders; |
|
197 } |
|
198 |
|
199 |
|
200 // ----------------------------------------------------------------------------- |
|
201 // CMceManager::DefaultHeadersL |
|
202 // ----------------------------------------------------------------------------- |
|
203 // |
|
204 EXPORT_C CDesC8Array* CMceManager::DefaultHeadersL( const TDesC8& /*aMethod*/ ) const |
|
205 { |
|
206 return NULL; |
|
207 } |
|
208 |
|
209 |
|
210 // ----------------------------------------------------------------------------- |
|
211 // CMceManager::InSessionObserver |
|
212 // ----------------------------------------------------------------------------- |
|
213 // |
|
214 MMceInSessionObserver* CMceManager::InSessionObserver() const |
|
215 { |
|
216 return iInSessionObserver; |
|
217 } |
|
218 |
|
219 |
|
220 // ----------------------------------------------------------------------------- |
|
221 // CMceManager::SessionObserver |
|
222 // ----------------------------------------------------------------------------- |
|
223 // |
|
224 MMceSessionObserver* CMceManager::SessionObserver() const |
|
225 { |
|
226 return iSessionObserver; |
|
227 } |
|
228 |
|
229 // ----------------------------------------------------------------------------- |
|
230 // CMceManager::MediaObserver |
|
231 // ----------------------------------------------------------------------------- |
|
232 // |
|
233 MMceStreamObserver* CMceManager::MediaObserver() const |
|
234 { |
|
235 return iMediaObserver; |
|
236 } |
|
237 |
|
238 // ----------------------------------------------------------------------------- |
|
239 // CMceManager::RtpObserver |
|
240 // ----------------------------------------------------------------------------- |
|
241 // |
|
242 MMceRtpObserver* CMceManager::RtpObserver() const |
|
243 { |
|
244 return iRtpObserver; |
|
245 } |
|
246 |
|
247 |
|
248 // ----------------------------------------------------------------------------- |
|
249 // CMceManager::TransactionContainer |
|
250 // ----------------------------------------------------------------------------- |
|
251 // |
|
252 TMceTransactionDataContainer* CMceManager::TransactionContainer() const |
|
253 { |
|
254 return iContainer; |
|
255 } |
|
256 |
|
257 |
|
258 // ----------------------------------------------------------------------------- |
|
259 // CMceManager::CMceManager |
|
260 // ----------------------------------------------------------------------------- |
|
261 // |
|
262 CMceManager::CMceManager( const TUid& /*aAppUid*/, |
|
263 TMceTransactionDataContainer* aContainer ) |
|
264 :iContainer( aContainer ) |
|
265 { |
|
266 |
|
267 } |
|
268 |
|
269 |
|
270 // ----------------------------------------------------------------------------- |
|
271 // CMceManager::ConstructL |
|
272 // ----------------------------------------------------------------------------- |
|
273 // |
|
274 void CMceManager::ConstructL() |
|
275 { |
|
276 // Fake having PCMU codec |
|
277 iSupportedAudioCodecs.AppendL( CMceAmrCodec::NewLC( KMceSDPNamePCMU() ) ); |
|
278 CleanupStack::Pop(); |
|
279 |
|
280 iSupportedAudioCodecs.AppendL( CMceAmrCodec::NewLC( KMceSDPNameAMR() ) ); |
|
281 CleanupStack::Pop(); |
|
282 |
|
283 // Avc codec, level default 1 |
|
284 iSupportedVideoCodecs.AppendL( CMceAvcCodec::NewLC( KMceSDPNameH264() ) ); |
|
285 CleanupStack::Pop(); |
|
286 |
|
287 // Avc codec, level default 1, no profile id or constraint set defined |
|
288 CMceVideoCodec* avc_2nd_Level_1 = CMceAvcCodec::NewLC( KMceSDPNameH264() ); |
|
289 avc_2nd_Level_1->SetAllowedBitrates( KMceAvcBitrateLevel1 ); |
|
290 iSupportedVideoCodecs.AppendL( avc_2nd_Level_1 ); |
|
291 CleanupStack::Pop( avc_2nd_Level_1 ); |
|
292 |
|
293 // Avc codec, level 1_3 |
|
294 CMceVideoCodec* avcLevel_1_3 = CMceAvcCodec::NewLC( KMceSDPNameH264() ); |
|
295 avcLevel_1_3->SetAllowedBitrates( KMceAvcCodecProfileIdBaseline | |
|
296 KMceAvcCodecProfileIopConstraintSet | |
|
297 KMceAvcBitrateLevel1_3 ); |
|
298 iSupportedVideoCodecs.AppendL( avcLevel_1_3 ); |
|
299 CleanupStack::Pop( avcLevel_1_3 ); |
|
300 |
|
301 // H263 codec |
|
302 iSupportedVideoCodecs.AppendL( CMceH263Codec::NewLC( KMceSDPNameH2632000() ) ); |
|
303 CleanupStack::Pop(); |
|
304 |
|
305 // Test simulator |
|
306 iSessionSimulator = CMusTestSessionSimulator::NewL( *this ); |
|
307 } |
|
308 |
|
309 |
|