|
1 /* |
|
2 * Copyright (c) 2004-2008 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: Mcc Subthread client baseclass |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 // INCLUDE FILES |
|
22 #include "mccsubthreadclientbase.h" |
|
23 #include "mccrtpmanager.h" |
|
24 #include "mccsubcontrollerlogs.h" |
|
25 #include "mccsymstreambase.h" |
|
26 |
|
27 |
|
28 // ============================ MEMBER FUNCTIONS =============================== |
|
29 |
|
30 // ----------------------------------------------------------------------------- |
|
31 // CMccSubThreadClientBase::~CMccSubThreadClientBase |
|
32 // Destructor |
|
33 // ----------------------------------------------------------------------------- |
|
34 CMccSubThreadClientBase::~CMccSubThreadClientBase() |
|
35 { |
|
36 iDatasink = NULL; |
|
37 iDatasource = NULL; |
|
38 iObserver = NULL; |
|
39 } |
|
40 |
|
41 // ----------------------------------------------------------------------------- |
|
42 // CMccSubThreadClientBase::GetCodecL |
|
43 // Returns the used codec |
|
44 // ----------------------------------------------------------------------------- |
|
45 void CMccSubThreadClientBase::CodecInformationL( TUint32 aStreamId, |
|
46 TMccCodecInfo& aCodec ) |
|
47 { |
|
48 __SUBCONTROLLER_INT1( "CMccSubThreadClientBase::GetCodecL streamId", aStreamId ) |
|
49 |
|
50 __ASSERT_ALWAYS( iStreams.Count(), User::Leave( KErrNotFound ) ); |
|
51 |
|
52 const TInt index = FindStreamL( aStreamId ); |
|
53 iStreams[index]->GetCodecL( aCodec ); |
|
54 |
|
55 __SUBCONTROLLER( "CMccSubThreadClientBase::GetCodecL exit" ) |
|
56 } |
|
57 |
|
58 // ----------------------------------------------------------------------------- |
|
59 // CMccSubThreadClientBase::SendMediaSignalL |
|
60 // Default implementation of the signal sending |
|
61 // ----------------------------------------------------------------------------- |
|
62 void CMccSubThreadClientBase::SendMediaSignalL( const TMccEvent& /*aEvent*/ ) |
|
63 { |
|
64 User::Leave( KErrNotSupported ); |
|
65 } |
|
66 |
|
67 // ----------------------------------------------------------------------------- |
|
68 // CMccSubThreadClientBase::SetCodecInformationL |
|
69 // Sets the codec information for this stream |
|
70 // ----------------------------------------------------------------------------- |
|
71 void CMccSubThreadClientBase::SetCodecInformationL( TUint32 aStreamId, |
|
72 const TMccCodecInfo& aCodecInfo, |
|
73 const TDesC8& aFmtp ) |
|
74 { |
|
75 __SUBCONTROLLER_INT1( "CMccSubThreadClientBase::SetCodecInformationL streamId", |
|
76 aStreamId ) |
|
77 __SUBCONTROLLER_INT1( "CMccSubThreadClientBase::SetCodecInformationL streamCount", |
|
78 iStreams.Count() ) |
|
79 |
|
80 __ASSERT_ALWAYS( iStreams.Count(), User::Leave( KErrNotFound ) ); |
|
81 |
|
82 const TInt index = FindStreamL( aStreamId ); |
|
83 iStreams[ index ]->LoadCodecL( aCodecInfo, aFmtp ); |
|
84 iStreams[ index ]->SetMMFPriority( aCodecInfo.iPriority ); |
|
85 |
|
86 __SUBCONTROLLER( "CMccSubThreadClientBase::SetCodecInformationL, exit" ) |
|
87 } |
|
88 |
|
89 // ----------------------------------------------------------------------------- |
|
90 // CMccSubThreadClientBase::SetRemoteAddressL |
|
91 // Sets the remote address of uplink stream |
|
92 // ----------------------------------------------------------------------------- |
|
93 void CMccSubThreadClientBase::SetRemoteAddressL( TInetAddr /*aRemAddr*/ ) |
|
94 { |
|
95 User::Leave( KErrNotSupported ); |
|
96 } |
|
97 |
|
98 // ----------------------------------------------------------------------------- |
|
99 // CMccSubThreadClientBase::SetRemoteRtcpAddrL |
|
100 // Sets the remote address of uplink stream |
|
101 // ----------------------------------------------------------------------------- |
|
102 void CMccSubThreadClientBase::SetRemoteRtcpAddrL( TInetAddr /*aRemAddr*/ ) |
|
103 { |
|
104 User::Leave( KErrNotSupported ); |
|
105 } |
|
106 |
|
107 // ----------------------------------------------------------------------------- |
|
108 // CMccSubThreadClientBase::InitializeLinkL |
|
109 // Creates the RTP session in the subthread, STEP #1 |
|
110 // ----------------------------------------------------------------------------- |
|
111 // |
|
112 void CMccSubThreadClientBase::InitializeLinkL( TRequestStatus& /*aStatus*/, |
|
113 TInt /*aIapId*/ ) |
|
114 { |
|
115 User::Leave( KErrNotSupported ); |
|
116 } |
|
117 |
|
118 // ----------------------------------------------------------------------------- |
|
119 // CMccSubThreadClientBase::CreateSessionL |
|
120 // Creates the RTP session in the subthread, STEP #2 |
|
121 // ----------------------------------------------------------------------------- |
|
122 // |
|
123 void CMccSubThreadClientBase::CreateRtpSessionL( TUint /*aPort*/, |
|
124 TBool /*aEnableRTCP*/, |
|
125 TInt /*aIpTos*/, |
|
126 CMccRtpMediaClock& /*aClock*/ ) |
|
127 { |
|
128 User::Leave( KErrNotSupported ); |
|
129 } |
|
130 |
|
131 // ----------------------------------------------------------------------------- |
|
132 // CMccSubThreadClientBase::SetLinkId |
|
133 // Creates the RTP session in the subthread |
|
134 // ----------------------------------------------------------------------------- |
|
135 // |
|
136 void CMccSubThreadClientBase::SetLinkId( TUint32 aLinkId ) |
|
137 { |
|
138 iLinkId = aLinkId; |
|
139 if ( iRtpmanager ) |
|
140 { |
|
141 iRtpmanager->SetLinkId( aLinkId ); |
|
142 } |
|
143 } |
|
144 |
|
145 // ----------------------------------------------------------------------------- |
|
146 // CMccSubThreadClientBase::GetLinkIndex |
|
147 // Creates the RTP session in the subthread |
|
148 // ----------------------------------------------------------------------------- |
|
149 // |
|
150 TUint32 CMccSubThreadClientBase::GetLinkId() const |
|
151 { |
|
152 return iLinkId; |
|
153 } |
|
154 |
|
155 // ----------------------------------------------------------------------------- |
|
156 // CMccSubThreadClientBase::MccSessionId |
|
157 // ----------------------------------------------------------------------------- |
|
158 // |
|
159 TUint32 CMccSubThreadClientBase::MccSessionId() const |
|
160 { |
|
161 return iSessionId; |
|
162 } |
|
163 |
|
164 // ----------------------------------------------------------------------------- |
|
165 // CMccSubThreadClientBase::CloseL |
|
166 // Closes all links |
|
167 // ----------------------------------------------------------------------------- |
|
168 void CMccSubThreadClientBase::CloseL() |
|
169 { |
|
170 User::Leave( KErrNotSupported ); |
|
171 } |
|
172 |
|
173 // ----------------------------------------------------------------------------- |
|
174 // CMccSubThreadClientBase::StreamsExistsL |
|
175 // ----------------------------------------------------------------------------- |
|
176 TBool CMccSubThreadClientBase::StreamsExistsL() |
|
177 { |
|
178 return EFalse; |
|
179 } |
|
180 |
|
181 // ----------------------------------------------------------------------------- |
|
182 // CMccSubThreadClientBase::StartInactivityTimer |
|
183 // Starts inactivity timer for a stream |
|
184 // ----------------------------------------------------------------------------- |
|
185 void CMccSubThreadClientBase::StartInactivityTimerL( const TUint32 /*aStreamId*/, |
|
186 TUint32 /*aTimeoutTime*/ ) |
|
187 { |
|
188 User::Leave( KErrNotSupported ); |
|
189 } |
|
190 |
|
191 // ----------------------------------------------------------------------------- |
|
192 // CMccSubThreadClientBase::StopInactivityTimer |
|
193 // Stops inactivity timer for a stream |
|
194 // ----------------------------------------------------------------------------- |
|
195 void CMccSubThreadClientBase::StopInactivityTimerL( const TUint32 /*aStreamId*/ ) |
|
196 { |
|
197 User::Leave( KErrNotSupported ); |
|
198 } |
|
199 |
|
200 // ----------------------------------------------------------------------------- |
|
201 // CMccSubThreadClientBase::GetSupportedBitratesL |
|
202 // Gets the supported bitrates from the codec of the specified stream |
|
203 // ----------------------------------------------------------------------------- |
|
204 void CMccSubThreadClientBase::GetSupportedBitratesL( const TUint32 /*aStreamId*/, |
|
205 RArray<TUint>& /*aBitrates*/ ) |
|
206 { |
|
207 User::Leave( KErrNotSupported ); |
|
208 } |
|
209 |
|
210 // ----------------------------------------------------------------------------- |
|
211 // CMccSubThreadClientBase::SendRTCPReceiverReportL |
|
212 // Sends a RTCP receiver report |
|
213 // ----------------------------------------------------------------------------- |
|
214 // |
|
215 void CMccSubThreadClientBase::SendRTCPReceiverReportL( const TUint32 /*aStreamId*/ ) |
|
216 { |
|
217 User::Leave( KErrNotSupported ); |
|
218 } |
|
219 |
|
220 // ----------------------------------------------------------------------------- |
|
221 // CMccSubThreadClientBase::SendRTCPSenderReportL |
|
222 // Sends a RTCP sender report |
|
223 // ----------------------------------------------------------------------------- |
|
224 // |
|
225 void CMccSubThreadClientBase::SendRTCPSenderReportL( const TUint32 /*aStreamId*/ ) |
|
226 { |
|
227 User::Leave( KErrNotSupported ); |
|
228 } |
|
229 |
|
230 // ----------------------------------------------------------------------------- |
|
231 // CMccSubThreadClientBase::SendRTCPDataL |
|
232 // Sends Non-RTCP data |
|
233 // ----------------------------------------------------------------------------- |
|
234 // |
|
235 void CMccSubThreadClientBase::SendRTCPDataL( const TUint32 /*aStreamId*/, |
|
236 const TDesC8& /*aData*/ ) |
|
237 { |
|
238 User::Leave( KErrNotSupported ); |
|
239 } |
|
240 |
|
241 // ----------------------------------------------------------------------------- |
|
242 // CMccSubThreadClientBase::GetFmtpAttrL |
|
243 // Fetches the FMTP attribute of the current codec |
|
244 // ----------------------------------------------------------------------------- |
|
245 // |
|
246 void CMccSubThreadClientBase::GetFmtpAttrL( const TUint32 /*aStreamId*/, TDes8& /*aFmtp*/ ) |
|
247 { |
|
248 User::Leave( KErrNotSupported ); |
|
249 } |
|
250 |
|
251 // ----------------------------------------------------------------------------- |
|
252 // CMccSubThreadClientBase::SetPrioritySettingsL |
|
253 // Sets priority |
|
254 // ----------------------------------------------------------------------------- |
|
255 void CMccSubThreadClientBase::SetPrioritySettingsL( TUint32 aStreamId, |
|
256 const TMMFPrioritySettings& aPrioritySet ) |
|
257 { |
|
258 __SUBCONTROLLER_INT1( "CMccSubThreadClientBase::SetPrioritySettingsL, streamId", |
|
259 aStreamId ) |
|
260 |
|
261 __ASSERT_ALWAYS( iStreams.Count(), User::Leave( KErrNotFound ) ); |
|
262 |
|
263 const TInt index = FindStreamL( aStreamId ); |
|
264 iStreams[ index ]->SetMMFPriority( aPrioritySet ); |
|
265 |
|
266 __SUBCONTROLLER( "CMccSubThreadClientBase::SetPrioritySettingsL, exit" ) |
|
267 } |
|
268 |
|
269 // ----------------------------------------------------------------------------- |
|
270 // CMccSubThreadClientBase::GetSSRCL |
|
271 // ----------------------------------------------------------------------------- |
|
272 void CMccSubThreadClientBase::GetSSRCL( const TUint32 /*aStreamId*/, TUint32& /*aSSRCValue*/ ) |
|
273 { |
|
274 User::Leave( KErrNotSupported ); |
|
275 } |
|
276 |
|
277 |
|
278 // ----------------------------------------------------------------------------- |
|
279 // CMccSubThreadClientBase::FindStreamL |
|
280 // Finds a streams index from the stream array |
|
281 // ----------------------------------------------------------------------------- |
|
282 // |
|
283 TInt CMccSubThreadClientBase::FindStreamL( TUint32 aStreamId ) |
|
284 { |
|
285 const TInt index = FindStream( aStreamId ); |
|
286 User::LeaveIfError( index ); |
|
287 return index; |
|
288 } |
|
289 |
|
290 // ----------------------------------------------------------------------------- |
|
291 // CMccSubThreadClientBase::FindStream |
|
292 // Finds a streams index from the stream array |
|
293 // ----------------------------------------------------------------------------- |
|
294 // |
|
295 TInt CMccSubThreadClientBase::FindStream( TUint32 aStreamId ) |
|
296 { |
|
297 __SUBCONTROLLER_INT1( "CMccSubThreadClientBase::FindStream, streamId", aStreamId ) |
|
298 |
|
299 const TInt strmCount = iStreams.Count(); |
|
300 for( TInt k = 0; k < strmCount; k++ ) |
|
301 { |
|
302 if( aStreamId == iStreams[k]->MccStreamId() ) |
|
303 { |
|
304 return k; |
|
305 } |
|
306 } |
|
307 |
|
308 return KErrNotFound; |
|
309 } |
|
310 |
|
311 // ========================== OTHER EXPORTED FUNCTIONS ========================= |
|
312 |
|
313 // End of File |