|
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 |
|
20 |
|
21 |
|
22 #ifndef CMccCONTROLLERSTUB_H |
|
23 #define CMccCONTROLLERSTUB_H |
|
24 |
|
25 #include <e32base.h> |
|
26 #include <bamdesca.h> |
|
27 #include "mceclientserver.h" |
|
28 |
|
29 class MMccCtrlObserver; |
|
30 |
|
31 const TInt KMce_MM_MaxArray = 50; |
|
32 const TUint32 KMce_MM_LinkIdBase = 500; |
|
33 const TUint32 KMce_MM_StreamIdBase = 1; |
|
34 const TUint32 KMce_MM_EndpointIdBase = 1; |
|
35 |
|
36 const TUint32 KNoEndpointId = 0; |
|
37 |
|
38 class CMccControllerStub : public CBase |
|
39 { |
|
40 |
|
41 public: |
|
42 |
|
43 enum TMMCActionType |
|
44 { |
|
45 ENone = -1, |
|
46 EMccClose, |
|
47 EMccCreateSession, |
|
48 EMccSetRemoteAddress, |
|
49 EMccCloseSession, |
|
50 EMccCreateLink, |
|
51 EMccCloseLink, |
|
52 EMccCreateStream, |
|
53 EMccPrepareStream, |
|
54 EMccInactivityTimerStart, |
|
55 EMccInactivityTimerStop, |
|
56 EMccDeleteStream, |
|
57 EMccStartStream, |
|
58 EMccStopStream, |
|
59 EMccPauseStream, |
|
60 EMccResumeStream, |
|
61 EMccGetCodec, |
|
62 EMccGetFmtpAttr, |
|
63 EMccSetCodec, |
|
64 EMccGetSupportedCodecs, |
|
65 EMccStreamSettings, |
|
66 EMccSetAudioPriority, |
|
67 EMccCancel, |
|
68 EMccSendMediaSignal, |
|
69 EMccSendRtcpRR, |
|
70 EMccSendRtcpSR, |
|
71 EMccSendRtcpData, |
|
72 EMccGetSupportedBitrates, |
|
73 EMccGetSSRC, |
|
74 EMccGetSinkId, |
|
75 EMccGetSourceId, |
|
76 EMccEnableViewFinder, |
|
77 EMccDisableViewFinder, |
|
78 EMccGetCamInfo, |
|
79 EMccGetNumOfCams, |
|
80 EMccSetCamValue1, |
|
81 EMccGetCamValue1, |
|
82 EMccSetCamValue2, |
|
83 EMccGetCamValue2, |
|
84 EMccLinkExists, |
|
85 EMccStreamsExists, |
|
86 EMccUpdateDataSource, |
|
87 EMccUpdateDataSink, |
|
88 EMccEnableDisplay, |
|
89 EMccDisableDisplay, |
|
90 EMccReuse, |
|
91 EMccSetAudioRoute, |
|
92 EMccGetAudioRoute, |
|
93 EMccTranscodeFile, |
|
94 EMccCancelTranscodeFile, |
|
95 EMccRemoveDataSource, |
|
96 EMccRemoveDataSink |
|
97 }; |
|
98 |
|
99 class TAction |
|
100 { |
|
101 public: |
|
102 inline TAction() |
|
103 { |
|
104 iAction = ENone; |
|
105 iSessionID = KMceNotAssigned; |
|
106 iLinkID = KMceNotAssigned; |
|
107 iStreamID = KMceNotAssigned; |
|
108 iEndpointID = KMceNotAssigned; |
|
109 iLinkType = KMceNotAssigned; |
|
110 iStreamType = KMceNotAssigned; |
|
111 iPaused = KMceNotAssigned; |
|
112 iEnableRTCP = KMceNotAssigned; |
|
113 iKey = KMceNotAssigned; |
|
114 iParamSet = KMceNotAssigned; |
|
115 iEventType = KMceNotAssigned; |
|
116 }; |
|
117 |
|
118 TMMCActionType iAction; |
|
119 TUint32 iSessionID; |
|
120 TUint32 iLinkID; |
|
121 TUint32 iStreamID; |
|
122 TUint32 iEndpointID; |
|
123 TUint32 iLinkType; |
|
124 TUint32 iStreamType; |
|
125 TUint32 iPaused; |
|
126 TUint32 iEnableRTCP; |
|
127 TUint32 iKey; |
|
128 TUint32 iParamSet; |
|
129 TUint32 iEventType; |
|
130 |
|
131 }; |
|
132 |
|
133 class TCodecInfo |
|
134 { |
|
135 public: |
|
136 inline TCodecInfo() |
|
137 { |
|
138 iSessionID = KMceNotAssigned; |
|
139 iLinkID = KMceNotAssigned; |
|
140 iStreamID = KMceNotAssigned; |
|
141 } |
|
142 |
|
143 public: |
|
144 TUint32 iFourCC; |
|
145 TUint32 iAlgoUsed; |
|
146 TUint32 iBitrate; |
|
147 TUint32 iCodecMode; |
|
148 TUint32 iEnableDTX; |
|
149 TUint32 iMaxPtime; |
|
150 TUint32 iPtime; |
|
151 TUint32 iPayloadType; |
|
152 TUint32 iRedundantPayload; |
|
153 TUint32 iRedundancyCount; |
|
154 TUint32 iFrameSize; |
|
155 TUint32 iHwFrameTime; |
|
156 TUint32 iBitrateMask; |
|
157 TUint32 iMaxBitrate; |
|
158 TUint32 iAverageBitrate; |
|
159 TUint32 iFramerate; |
|
160 TUint32 iVideoWidth; |
|
161 TUint32 iVideoHeight; |
|
162 TUint32 iJitterBufInactivityTimeOut; |
|
163 TUint32 iJitterBufThreshold; |
|
164 TUint32 iJitterBufBufferLength; |
|
165 TUint32 iJitterBufPlayToneTimeout; |
|
166 TUint32 iJitterBufPlayToneFrequency; |
|
167 TUint32 iJitterBufPlayToneDuration; |
|
168 TUint32 iSessionID; |
|
169 TUint32 iLinkID; |
|
170 TUint32 iStreamID; |
|
171 }; |
|
172 |
|
173 class TLink |
|
174 { |
|
175 public: |
|
176 inline TLink() |
|
177 { |
|
178 iSessionID = KMceNotAssigned; |
|
179 iLinkID = KMceNotAssigned; |
|
180 iStreams = 0; |
|
181 } |
|
182 TUint32 iSessionID; |
|
183 TUint32 iLinkID; |
|
184 TInt iStreams; |
|
185 }; |
|
186 |
|
187 public: |
|
188 |
|
189 static void OpenL(); |
|
190 static void Close(); |
|
191 static CMccControllerStub* Stub(); |
|
192 |
|
193 void Reset( TBool aAll = EFalse ); |
|
194 TInt ControllerCalled( TMMCActionType aAction, |
|
195 TUint32 aSessionID = KMceNotAssigned, |
|
196 TUint32 aLinkID = KMceNotAssigned, |
|
197 TUint32 aStreamID= KMceNotAssigned, |
|
198 TUint32 aEndpointID = KMceNotAssigned, |
|
199 TUint32 aLinkType = KMceNotAssigned, |
|
200 TUint32 aStreamType = KMceNotAssigned); |
|
201 |
|
202 TInt ControllerStreamCtrCalled( TMMCActionType aAction, |
|
203 TUint32 aSessionID, |
|
204 TUint32 aLinkID, |
|
205 TUint32 aStreamID, |
|
206 TUint32 aEndpointID, |
|
207 TUint32 aPaused = EFalse, |
|
208 TUint32 aEnableRTCP = ETrue ); |
|
209 |
|
210 TInt ControllerStreamSettings( TUint32 aSessionID, |
|
211 TUint32 aLinkID, |
|
212 TUint32 aStreamID, |
|
213 TUint32 aEndpointID, |
|
214 TUint32 aKey, |
|
215 TUint32 aSet ); |
|
216 |
|
217 TInt ControllerSignal( TUint32 aSessionID, |
|
218 TUint32 aLinkID, |
|
219 TUint32 aStreamID, |
|
220 TUint32 aEndpointID, |
|
221 TUint32 aSignal, |
|
222 TUint32 aSet ); |
|
223 |
|
224 TInt ControllerSignal( TUint32 aSessionID, |
|
225 TUint32 aLinkID, |
|
226 TUint32 aStreamID, |
|
227 TUint32 aEndpointID, |
|
228 TUint32 aEventType ); |
|
229 |
|
230 |
|
231 void SetCodec( TCodecInfo aCodecInfo ); |
|
232 void GetCodec( TCodecInfo& aCodecInfo ); |
|
233 |
|
234 void CreateStream( TLink aLink ); |
|
235 TLink& GetLink( const TLink& aLink ); |
|
236 |
|
237 |
|
238 TUint32 NextSessionId(); |
|
239 TUint32 NextLinkId(); |
|
240 TUint32 NextStreamId(); |
|
241 TUint32 NextEndpointId(); |
|
242 |
|
243 TBool StreamsExists( TUint32 aSessionId, TUint32 aLinkId ); |
|
244 ~CMccControllerStub(); |
|
245 |
|
246 private: |
|
247 |
|
248 CMccControllerStub(); |
|
249 |
|
250 |
|
251 public://data |
|
252 |
|
253 TAction iActions[KMce_MM_MaxArray]; |
|
254 TInt iActionPtr; |
|
255 |
|
256 |
|
257 TUint32 iSessionID; |
|
258 TUint32 iLinkID; |
|
259 TUint32 iStreamID; |
|
260 TUint32 iEndpointID; |
|
261 |
|
262 TInt iLeaveError; |
|
263 |
|
264 MMccCtrlObserver* iObserver; |
|
265 |
|
266 TBool iRequireSignalling; |
|
267 |
|
268 TUint32 iRefCount; |
|
269 TInt iStreamExists; |
|
270 |
|
271 public: //codec data |
|
272 |
|
273 TCodecInfo iCodecs[KMce_MM_MaxArray]; |
|
274 TLink iLinks[ KMce_MM_MaxArray ]; |
|
275 |
|
276 TBool iSetFmtpFailure; |
|
277 |
|
278 }; |
|
279 |
|
280 |
|
281 |
|
282 #endif //CMccCONTROLLERSTUB_H |
|
283 |
|
284 // End of File |