115 switch (strmType) |
115 switch (strmType) |
116 { |
116 { |
117 case TMS_STREAM_UPLINK: |
117 case TMS_STREAM_UPLINK: |
118 { |
118 { |
119 status = TMS_RESULT_ALREADY_EXIST; |
119 status = TMS_RESULT_ALREADY_EXIST; |
120 if (!iUplinkInitialized) |
120 if (iUplState == EIdle) |
121 { |
121 { |
122 iUplinkStreamId = iNextStreamId; |
122 iUplinkStreamId = iNextStreamId; |
123 outStrmId = iUplinkStreamId; |
123 outStrmId = iUplinkStreamId; |
124 iNextStreamId++; |
124 iNextStreamId++; |
125 //iUplinkInitialized = TRUE; //not initialized yet! |
|
126 status = TMS_RESULT_SUCCESS; |
125 status = TMS_RESULT_SUCCESS; |
127 } |
126 } |
128 break; |
127 break; |
129 } |
128 } |
130 case TMS_STREAM_DOWNLINK: |
129 case TMS_STREAM_DOWNLINK: |
131 { |
130 { |
132 status = TMS_RESULT_ALREADY_EXIST; |
131 status = TMS_RESULT_ALREADY_EXIST; |
133 if (!iDnlinkInitialized) |
132 if (iDnlState == EIdle) |
134 { |
133 { |
135 iDnlinkStreamId = iNextStreamId; |
134 iDnlinkStreamId = iNextStreamId; |
136 outStrmId = iDnlinkStreamId; |
135 outStrmId = iDnlinkStreamId; |
137 iNextStreamId++; |
136 iNextStreamId++; |
138 //iDnlinkInitialized = TRUE; //not initialized yet! |
|
139 status = TMS_RESULT_SUCCESS; |
137 status = TMS_RESULT_SUCCESS; |
140 } |
138 } |
141 break; |
139 break; |
142 } |
140 } |
143 default: |
141 default: |
155 // |
153 // |
156 // ----------------------------------------------------------------------------- |
154 // ----------------------------------------------------------------------------- |
157 // |
155 // |
158 gint TMSCallIPAdpt::InitStream(const TMSCallType /*callType*/, |
156 gint TMSCallIPAdpt::InitStream(const TMSCallType /*callType*/, |
159 const TMSStreamType strmType, const gint strmId, |
157 const TMSStreamType strmType, const gint strmId, |
160 const TMSFormatType frmtType, const RMessage2& message) |
158 const TMSFormatType frmtType, const gint retrytime, |
|
159 const RMessage2& message) |
161 { |
160 { |
162 TRACE_PRN_FN_ENT; |
161 TRACE_PRN_FN_ENT; |
163 gint status(TMS_RESULT_SUCCESS); |
162 gint status(TMS_RESULT_SUCCESS); |
164 guint32 fourCC = TOFOURCC(frmtType); |
163 guint32 fourCC = TOFOURCC(frmtType); |
165 if (fourCC == NULL) |
164 if (fourCC == NULL) |
173 { |
172 { |
174 status = TMS_RESULT_DOES_NOT_EXIST; |
173 status = TMS_RESULT_DOES_NOT_EXIST; |
175 if (strmId == iUplinkStreamId) |
174 if (strmId == iUplinkStreamId) |
176 { |
175 { |
177 SetFormat(iUplinkStreamId, fourCC); |
176 SetFormat(iUplinkStreamId, fourCC); |
178 status = OpenUplink(message); |
177 status = OpenUplink(message, retrytime); |
179 } |
178 } |
180 break; |
179 break; |
181 } |
180 } |
182 case TMS_STREAM_DOWNLINK: |
181 case TMS_STREAM_DOWNLINK: |
183 { |
182 { |
184 status = TMS_RESULT_DOES_NOT_EXIST; |
183 status = TMS_RESULT_DOES_NOT_EXIST; |
185 if (strmId == iDnlinkStreamId) |
184 if (strmId == iDnlinkStreamId) |
186 { |
185 { |
187 SetFormat(iDnlinkStreamId, fourCC); |
186 SetFormat(iDnlinkStreamId, fourCC); |
188 status = OpenDownlink(message); |
187 status = OpenDownlink(message, retrytime); |
189 } |
188 } |
190 break; |
189 break; |
191 } |
190 } |
192 default: |
191 default: |
193 { |
192 { |
205 // TMSCallIPAdpt::StartStream |
204 // TMSCallIPAdpt::StartStream |
206 // |
205 // |
207 // ----------------------------------------------------------------------------- |
206 // ----------------------------------------------------------------------------- |
208 // |
207 // |
209 gint TMSCallIPAdpt::StartStream(const TMSCallType /*callType*/, |
208 gint TMSCallIPAdpt::StartStream(const TMSCallType /*callType*/, |
210 const TMSStreamType strmType, const gint strmId) |
209 const TMSStreamType strmType, const gint strmId, const gint retrytime) |
211 { |
210 { |
212 TRACE_PRN_FN_ENT; |
211 TRACE_PRN_FN_ENT; |
213 gint status(TMS_RESULT_INVALID_STATE); |
212 gint status(TMS_RESULT_INVALID_STATE); |
214 switch (strmType) |
213 switch (strmType) |
215 { |
214 { |
216 case TMS_STREAM_UPLINK: |
215 case TMS_STREAM_UPLINK: |
217 { |
216 { |
218 if (iIPUplink && strmId == iUplinkStreamId) |
217 if (iIPUplink && strmId == iUplinkStreamId && |
219 { |
218 iUplState == EInitialized) |
220 iIPUplink->Start(); |
219 { |
|
220 iIPUplink->Start(retrytime); |
221 status = TMS_RESULT_SUCCESS; |
221 status = TMS_RESULT_SUCCESS; |
222 NotifyClient(iUplinkStreamId, ECmdUplinkStarted, status); |
|
223 } |
222 } |
224 break; |
223 break; |
225 } |
224 } |
226 case TMS_STREAM_DOWNLINK: |
225 case TMS_STREAM_DOWNLINK: |
227 { |
226 { |
228 if (iIPDownlink && strmId == iDnlinkStreamId) |
227 if (iIPDownlink && strmId == iDnlinkStreamId && |
229 { |
228 iDnlState == EInitialized) |
230 iIPDownlink->Start(); |
229 { |
|
230 iIPDownlink->Start(retrytime); |
231 status = TMS_RESULT_SUCCESS; |
231 status = TMS_RESULT_SUCCESS; |
232 NotifyClient(iDnlinkStreamId, ECmdDownlinkStarted, status); |
|
233 } |
232 } |
234 break; |
233 break; |
235 } |
234 } |
236 default: |
235 default: |
237 { |
236 { |
258 case TMS_STREAM_UPLINK: |
257 case TMS_STREAM_UPLINK: |
259 { |
258 { |
260 if (strmId == iUplinkStreamId && iIPUplink) |
259 if (strmId == iUplinkStreamId && iIPUplink) |
261 { |
260 { |
262 iIPUplink->Stop(); |
261 iIPUplink->Stop(); |
|
262 iUplState = EInitialized; |
263 status = TMS_RESULT_SUCCESS; |
263 status = TMS_RESULT_SUCCESS; |
264 NotifyClient(iUplinkStreamId, ECmdUplinkPaused, status); |
264 NotifyClient(iUplinkStreamId, ECmdUplinkPaused, status); |
265 } |
265 } |
266 break; |
266 break; |
267 } |
267 } |
268 case TMS_STREAM_DOWNLINK: |
268 case TMS_STREAM_DOWNLINK: |
269 { |
269 { |
270 if (strmId == iDnlinkStreamId && iIPDownlink) |
270 if (strmId == iDnlinkStreamId && iIPDownlink) |
271 { |
271 { |
272 iIPDownlink->Stop(); |
272 iIPDownlink->Stop(); |
|
273 iDnlState = EInitialized; |
273 status = TMS_RESULT_SUCCESS; |
274 status = TMS_RESULT_SUCCESS; |
274 NotifyClient(iDnlinkStreamId, ECmdDownlinkPaused, status); |
275 NotifyClient(iDnlinkStreamId, ECmdDownlinkPaused, status); |
275 } |
276 } |
276 break; |
277 break; |
277 } |
278 } |
298 |
299 |
299 switch (strmType) |
300 switch (strmType) |
300 { |
301 { |
301 case TMS_STREAM_UPLINK: |
302 case TMS_STREAM_UPLINK: |
302 { |
303 { |
303 if (iIPUplink && strmId == iUplinkStreamId) |
304 if (iIPUplink && strmId == iUplinkStreamId && |
|
305 iUplState == EActivated) |
304 { |
306 { |
305 iIPUplink->Stop(); |
307 iIPUplink->Stop(); |
|
308 iUplState = EInitialized; |
306 status = TMS_RESULT_SUCCESS; |
309 status = TMS_RESULT_SUCCESS; |
307 NotifyClient(iUplinkStreamId, ECmdUplinkInitComplete, status); |
310 NotifyClient(iUplinkStreamId, ECmdUplinkInitComplete, status); |
308 } |
311 } |
309 break; |
312 break; |
310 } |
313 } |
311 case TMS_STREAM_DOWNLINK: |
314 case TMS_STREAM_DOWNLINK: |
312 { |
315 { |
313 if (iIPDownlink && strmId == iDnlinkStreamId) |
316 if (iIPDownlink && strmId == iDnlinkStreamId && |
|
317 iDnlState == EActivated) |
314 { |
318 { |
315 iIPDownlink->Stop(); |
319 iIPDownlink->Stop(); |
|
320 iDnlState = EInitialized; |
316 status = TMS_RESULT_SUCCESS; |
321 status = TMS_RESULT_SUCCESS; |
317 NotifyClient(iDnlinkStreamId, ECmdDownlinkInitComplete, status); |
322 NotifyClient(iDnlinkStreamId, ECmdDownlinkInitComplete, status); |
318 } |
323 } |
319 break; |
324 break; |
320 } |
325 } |
341 |
346 |
342 switch (strmType) |
347 switch (strmType) |
343 { |
348 { |
344 case TMS_STREAM_UPLINK: |
349 case TMS_STREAM_UPLINK: |
345 { |
350 { |
346 if (iIPUplink && strmId == iUplinkStreamId) |
351 if (iIPUplink && strmId == iUplinkStreamId && iUplState != EIdle) |
347 { |
352 { |
348 iIPUplink->Stop(); |
353 iIPUplink->Stop(); |
349 //iUplinkStreamId = -1; |
354 iUplState = EIdle; |
350 iUplinkInitialized = FALSE; |
|
351 status = TMS_RESULT_SUCCESS; |
355 status = TMS_RESULT_SUCCESS; |
352 NotifyClient(iUplinkStreamId, ECmdUplinkDeInitComplete, status); |
356 NotifyClient(iUplinkStreamId, ECmdUplinkDeInitComplete, status); |
353 } |
357 } |
354 break; |
358 break; |
355 } |
359 } |
356 case TMS_STREAM_DOWNLINK: |
360 case TMS_STREAM_DOWNLINK: |
357 { |
361 { |
358 if (iIPDownlink && strmId == iDnlinkStreamId) |
362 if (iIPDownlink && strmId == iDnlinkStreamId && iDnlState != EIdle) |
359 { |
363 { |
360 iIPDownlink->Stop(); |
364 iIPDownlink->Stop(); |
361 //iDnlinkStreamId = -1; |
365 iDnlState = EIdle; |
362 iDnlinkInitialized = FALSE; |
|
363 status = TMS_RESULT_SUCCESS; |
366 status = TMS_RESULT_SUCCESS; |
364 NotifyClient(iDnlinkStreamId, ECmdDownlinkDeInitComplete, |
367 NotifyClient(iDnlinkStreamId, ECmdDownlinkDeInitComplete, |
365 status); |
368 status); |
366 } |
369 } |
367 break; |
370 break; |
392 case TMS_STREAM_UPLINK: |
394 case TMS_STREAM_UPLINK: |
393 { |
395 { |
394 if (strmId == iUplinkStreamId) |
396 if (strmId == iUplinkStreamId) |
395 { |
397 { |
396 iUplinkStreamId = -1; |
398 iUplinkStreamId = -1; |
397 iUplinkInitialized = FALSE; |
399 iUplState = EIdle; |
398 } |
400 } |
399 break; |
401 break; |
400 } |
402 } |
401 case TMS_STREAM_DOWNLINK: |
403 case TMS_STREAM_DOWNLINK: |
402 { |
404 { |
403 if (strmId == iDnlinkStreamId) |
405 if (strmId == iDnlinkStreamId) |
404 { |
406 { |
405 iDnlinkStreamId = -1; |
407 iDnlinkStreamId = -1; |
406 iDnlinkInitialized = FALSE; |
408 iDnlState = EIdle; |
407 } |
409 } |
408 break; |
410 break; |
409 } |
411 } |
410 default: |
412 default: |
411 { |
413 { |
540 // |
542 // |
541 gint TMSCallIPAdpt::SetVolume(const guint volume) |
543 gint TMSCallIPAdpt::SetVolume(const guint volume) |
542 { |
544 { |
543 TRACE_PRN_FN_ENT; |
545 TRACE_PRN_FN_ENT; |
544 gint status(TMS_RESULT_INVALID_STATE); |
546 gint status(TMS_RESULT_INVALID_STATE); |
545 if (iDnlinkInitialized && iIPDownlink) |
547 if (iIPDownlink && iDnlState != EIdle) |
546 { |
548 { |
547 status = iIPDownlink->SetVolume(volume); |
549 status = iIPDownlink->SetVolume(volume); |
548 NotifyClient(iDnlinkStreamId, ECmdSetVolume, status); |
550 NotifyClient(iDnlinkStreamId, ECmdSetVolume, status); |
549 } |
551 } |
550 TRACE_PRN_FN_EXT; |
552 TRACE_PRN_FN_EXT; |
594 // |
596 // |
595 gint TMSCallIPAdpt::SetGain(const guint gain) |
597 gint TMSCallIPAdpt::SetGain(const guint gain) |
596 { |
598 { |
597 TRACE_PRN_FN_ENT; |
599 TRACE_PRN_FN_ENT; |
598 gint status(TMS_RESULT_INVALID_STATE); |
600 gint status(TMS_RESULT_INVALID_STATE); |
599 if (iUplinkInitialized && iIPUplink) |
601 if (iIPUplink && iUplState != EIdle) |
600 { |
602 { |
601 status = iIPUplink->SetGain(gain); |
603 status = iIPUplink->SetGain(gain); |
602 NotifyClient(iUplinkStreamId, ECmdSetGain, status); |
604 NotifyClient(iUplinkStreamId, ECmdSetGain, status); |
603 } |
605 } |
604 TRACE_PRN_FN_EXT; |
606 TRACE_PRN_FN_EXT; |
977 // ----------------------------------------------------------------------------- |
979 // ----------------------------------------------------------------------------- |
978 // TMSCallIPAdpt::OpenDownlink |
980 // TMSCallIPAdpt::OpenDownlink |
979 // Method for player initialization. |
981 // Method for player initialization. |
980 // ----------------------------------------------------------------------------- |
982 // ----------------------------------------------------------------------------- |
981 // |
983 // |
982 gint TMSCallIPAdpt::OpenDownlink(const RMessage2& message) |
984 gint TMSCallIPAdpt::OpenDownlink(const RMessage2& message, const gint retrytime) |
983 { |
985 { |
984 TRACE_PRN_FN_ENT; |
986 TRACE_PRN_FN_ENT; |
985 gint status(TMS_RESULT_SUCCESS); |
987 gint status(TMS_RESULT_SUCCESS); |
986 |
988 |
987 // Clients must have MultimediaDD capability to use this priority/pref. |
989 // Clients must have MultimediaDD capability to use this priority/pref. |
997 iPriority.iPref = KAudioPrefVoipAudioDownlink; |
999 iPriority.iPref = KAudioPrefVoipAudioDownlink; |
998 iPriority.iPriority = KAudioPriorityVoipAudioDownlink; |
1000 iPriority.iPriority = KAudioPriorityVoipAudioDownlink; |
999 |
1001 |
1000 delete iIPDownlink; |
1002 delete iIPDownlink; |
1001 iIPDownlink = NULL; |
1003 iIPDownlink = NULL; |
1002 TRAP(status, iIPDownlink = TMSIPDownlink::NewL(*this, iDnFourCC, |
1004 TRAP(status, iIPDownlink = TMSIPDownlink::NewL(*this, iDnFourCC, iPriority, |
1003 iPriority)); |
1005 retrytime)); |
1004 |
1006 |
1005 if (iIPDownlink && status == TMS_RESULT_SUCCESS) |
1007 if (iIPDownlink && status == TMS_RESULT_SUCCESS) |
1006 { |
1008 { |
1007 // Open message queue for handling server notifications to the client |
1009 // Open message queue for handling server notifications to the client |
1008 if (iMsgQueueDn.Handle() <= 0) |
1010 if (iMsgQueueDn.Handle() <= 0) |
1025 // ----------------------------------------------------------------------------- |
1027 // ----------------------------------------------------------------------------- |
1026 // TMSCallIPAdpt::OpenUplink |
1028 // TMSCallIPAdpt::OpenUplink |
1027 // Method for recorder initialization. |
1029 // Method for recorder initialization. |
1028 // ----------------------------------------------------------------------------- |
1030 // ----------------------------------------------------------------------------- |
1029 // |
1031 // |
1030 gint TMSCallIPAdpt::OpenUplink(const RMessage2& message) |
1032 gint TMSCallIPAdpt::OpenUplink(const RMessage2& message, const gint retrytime) |
1031 { |
1033 { |
1032 TRACE_PRN_FN_ENT; |
1034 TRACE_PRN_FN_ENT; |
1033 gint status(TMS_RESULT_SUCCESS); |
1035 gint status(TMS_RESULT_SUCCESS); |
1034 |
1036 |
1035 // Clients must have MultimediaDD capability to use this priority/pref |
1037 // Clients must have MultimediaDD capability to use this priority/pref |
1038 * 1) KAudioPrefUnknownVoipAudioUplink -3rd party VoIP? |
1040 * 1) KAudioPrefUnknownVoipAudioUplink -3rd party VoIP? |
1039 * KAudioPriorityUnknownVoipAudioUplink -3rd party VoIP? |
1041 * KAudioPriorityUnknownVoipAudioUplink -3rd party VoIP? |
1040 * 2) KAudioPrefVoipAudioUplink -NOK native VoIP? |
1042 * 2) KAudioPrefVoipAudioUplink -NOK native VoIP? |
1041 * KAudioPriorityVoipAudioUplink -NOK native VoIP? |
1043 * KAudioPriorityVoipAudioUplink -NOK native VoIP? |
1042 */ |
1044 */ |
1043 iPriority.iPref = KAudioPrefVoipAudioUplink; |
1045 iPriority.iPref = KAudioPrefVoipAudioUplinkNonSignal; |
1044 iPriority.iPriority = KAudioPriorityVoipAudioUplink; |
1046 iPriority.iPriority = KAudioPriorityVoipAudioUplink; |
1045 |
1047 |
1046 delete iIPUplink; |
1048 delete iIPUplink; |
1047 iIPUplink = NULL; |
1049 iIPUplink = NULL; |
1048 TRAP(status, iIPUplink = TMSIPUplink::NewL(*this, iUpFourCC, iPriority)); |
1050 TRAP(status, iIPUplink = TMSIPUplink::NewL(*this, iUpFourCC, iPriority, |
|
1051 retrytime)); |
1049 |
1052 |
1050 if (iIPUplink && status == TMS_RESULT_SUCCESS) |
1053 if (iIPUplink && status == TMS_RESULT_SUCCESS) |
1051 { |
1054 { |
1052 // Open message queue for handling server notifications to the client |
1055 // Open message queue for handling server notifications to the client |
1053 if (iMsgQueueUp.Handle() <= 0) |
1056 if (iMsgQueueUp.Handle() <= 0) |
1154 // ----------------------------------------------------------------------------- |
1157 // ----------------------------------------------------------------------------- |
1155 // |
1158 // |
1156 gint TMSCallIPAdpt::SetIlbcCodecMode(const gint mode, |
1159 gint TMSCallIPAdpt::SetIlbcCodecMode(const gint mode, |
1157 const TMSStreamType strmtype) |
1160 const TMSStreamType strmtype) |
1158 { |
1161 { |
1159 gint status(TMS_RESULT_INVALID_ARGUMENT); |
1162 gint status(TMS_RESULT_SUCCESS); |
1160 |
1163 |
1161 if (strmtype == TMS_STREAM_DOWNLINK) |
1164 if (strmtype == TMS_STREAM_DOWNLINK && iIPDownlink && |
1162 { |
1165 iDnlState == EInitialized) |
1163 if (iDnlinkInitialized && iIPDownlink) |
1166 { |
1164 { |
1167 status = iIPDownlink->SetIlbcCodecMode(mode); |
1165 status = iIPDownlink->SetIlbcCodecMode(mode); |
1168 } |
1166 } |
1169 else if (strmtype == TMS_STREAM_UPLINK && iIPUplink && |
1167 } |
1170 iUplState == EInitialized) |
1168 else if (strmtype == TMS_STREAM_UPLINK) |
1171 { |
1169 { |
1172 status = iIPUplink->SetIlbcCodecMode(mode); |
1170 if (iUplinkInitialized && iIPUplink) |
1173 } |
1171 { |
1174 else |
1172 status = iIPUplink->SetIlbcCodecMode(mode); |
1175 { |
1173 } |
1176 status = TMS_RESULT_INVALID_STATE; |
1174 } |
1177 } |
1175 |
|
1176 return status; |
1178 return status; |
1177 } |
1179 } |
1178 |
1180 |
1179 // ----------------------------------------------------------------------------- |
1181 // ----------------------------------------------------------------------------- |
1180 // TMSCallIPAdpt::GetIlbcCodecMode |
1182 // TMSCallIPAdpt::GetIlbcCodecMode |
1181 // |
1183 // |
1182 // ----------------------------------------------------------------------------- |
1184 // ----------------------------------------------------------------------------- |
1183 // |
1185 // |
1184 gint TMSCallIPAdpt::GetIlbcCodecMode(gint& mode, const TMSStreamType strmtype) |
1186 gint TMSCallIPAdpt::GetIlbcCodecMode(gint& mode, const TMSStreamType strmtype) |
1185 { |
1187 { |
1186 gint status(TMS_RESULT_INVALID_ARGUMENT); |
1188 gint status(TMS_RESULT_SUCCESS); |
1187 |
1189 |
1188 if (strmtype == TMS_STREAM_DOWNLINK) |
1190 if (strmtype == TMS_STREAM_DOWNLINK && iIPDownlink && |
1189 { |
1191 iDnlState != EIdle) |
1190 if (iDnlinkInitialized && iIPDownlink) |
1192 { |
1191 { |
1193 status = iIPDownlink->GetIlbcCodecMode(mode); |
1192 status = iIPDownlink->GetIlbcCodecMode(mode); |
1194 } |
1193 } |
1195 else if (strmtype == TMS_STREAM_UPLINK && iIPUplink && |
1194 } |
1196 iUplState != EIdle) |
1195 else if (strmtype == TMS_STREAM_UPLINK) |
1197 { |
1196 { |
1198 status = iIPUplink->GetIlbcCodecMode(mode); |
1197 if (iUplinkInitialized && iIPUplink) |
1199 } |
1198 { |
1200 else |
1199 status = iIPUplink->GetIlbcCodecMode(mode); |
1201 { |
1200 } |
1202 status = TMS_RESULT_INVALID_STATE; |
1201 } |
1203 } |
1202 |
|
1203 return status; |
1204 return status; |
1204 } |
1205 } |
1205 |
1206 |
1206 // ----------------------------------------------------------------------------- |
1207 // ----------------------------------------------------------------------------- |
1207 // TMSCallIPAdpt::SetG711CodecMode |
1208 // TMSCallIPAdpt::SetG711CodecMode |
1209 // ----------------------------------------------------------------------------- |
1210 // ----------------------------------------------------------------------------- |
1210 // |
1211 // |
1211 gint TMSCallIPAdpt::SetG711CodecMode(const gint mode, |
1212 gint TMSCallIPAdpt::SetG711CodecMode(const gint mode, |
1212 const TMSStreamType strmtype) |
1213 const TMSStreamType strmtype) |
1213 { |
1214 { |
1214 gint status(TMS_RESULT_INVALID_ARGUMENT); |
1215 gint status(TMS_RESULT_SUCCESS); |
1215 |
1216 |
1216 if (strmtype == TMS_STREAM_DOWNLINK) |
1217 if (strmtype == TMS_STREAM_DOWNLINK && iIPDownlink && |
1217 { |
1218 iDnlState == EInitialized) |
1218 if (iDnlinkInitialized && iIPDownlink) |
1219 { |
1219 { |
1220 status = iIPDownlink->SetG711CodecMode(mode); |
1220 status = iIPDownlink->SetG711CodecMode(mode); |
1221 } |
1221 } |
1222 else if (strmtype == TMS_STREAM_UPLINK && iIPUplink && |
1222 } |
1223 iUplState == EInitialized) |
1223 else if (strmtype == TMS_STREAM_UPLINK) |
1224 { |
1224 { |
1225 status = iIPUplink->SetG711CodecMode(mode); |
1225 if (iUplinkInitialized && iIPUplink) |
1226 } |
1226 { |
1227 else |
1227 status = iIPUplink->SetG711CodecMode(mode); |
1228 { |
1228 } |
1229 status = TMS_RESULT_INVALID_STATE; |
1229 } |
1230 } |
1230 |
|
1231 return status; |
1231 return status; |
1232 } |
1232 } |
1233 |
1233 |
1234 // ----------------------------------------------------------------------------- |
1234 // ----------------------------------------------------------------------------- |
1235 // TMSCallIPAdpt::GetG711CodecMode |
1235 // TMSCallIPAdpt::GetG711CodecMode |
1236 // |
1236 // |
1237 // ----------------------------------------------------------------------------- |
1237 // ----------------------------------------------------------------------------- |
1238 // |
1238 // |
1239 gint TMSCallIPAdpt::GetG711CodecMode(gint& mode, const TMSStreamType strmtype) |
1239 gint TMSCallIPAdpt::GetG711CodecMode(gint& mode, const TMSStreamType strmtype) |
1240 { |
1240 { |
1241 gint status(TMS_RESULT_INVALID_ARGUMENT); |
1241 gint status(TMS_RESULT_SUCCESS); |
1242 |
1242 |
1243 if (strmtype == TMS_STREAM_DOWNLINK) |
1243 if (strmtype == TMS_STREAM_DOWNLINK && iIPDownlink && |
1244 { |
1244 iDnlState != EIdle) |
1245 if (iDnlinkInitialized && iIPDownlink) |
1245 { |
1246 { |
1246 status = iIPDownlink->GetG711CodecMode(mode); |
1247 status = iIPDownlink->GetG711CodecMode(mode); |
1247 } |
1248 } |
1248 else if (strmtype == TMS_STREAM_UPLINK && iIPUplink && |
1249 } |
1249 iUplState != EIdle) |
1250 else if (strmtype == TMS_STREAM_UPLINK) |
1250 { |
1251 { |
1251 status = iIPUplink->GetG711CodecMode(mode); |
1252 if (iUplinkInitialized && iIPUplink) |
1252 } |
1253 { |
1253 else |
1254 status = iIPUplink->GetG711CodecMode(mode); |
1254 { |
1255 } |
1255 status = TMS_RESULT_INVALID_STATE; |
1256 } |
1256 } |
1257 |
|
1258 return status; |
1257 return status; |
1259 } |
1258 } |
1260 |
1259 |
1261 // ----------------------------------------------------------------------------- |
1260 // ----------------------------------------------------------------------------- |
1262 // TMSCallIPAdpt::FrameModeRequiredForEC |
1261 // TMSCallIPAdpt::FrameModeRequiredForEC |
1263 // |
1262 // |
1264 // ----------------------------------------------------------------------------- |
1263 // ----------------------------------------------------------------------------- |
1265 // |
1264 // |
1266 gint TMSCallIPAdpt::FrameModeRqrdForEC(gboolean& frmodereq) |
1265 gint TMSCallIPAdpt::FrameModeRqrdForEC(gboolean& frmodereq) |
1267 { |
1266 { |
1268 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
1267 gint status(TMS_RESULT_INVALID_STATE); |
1269 if (iIPDownlink) |
1268 if (iIPDownlink && iDnlState == EInitialized) |
1270 { |
1269 { |
1271 status = iIPDownlink->FrameModeRqrdForEC(frmodereq); |
1270 status = iIPDownlink->FrameModeRqrdForEC(frmodereq); |
1272 } |
1271 } |
1273 return status; |
1272 return status; |
1274 } |
1273 } |
1338 // ----------------------------------------------------------------------------- |
1337 // ----------------------------------------------------------------------------- |
1339 // |
1338 // |
1340 gint TMSCallIPAdpt::SetOutput(TMSAudioOutput output) |
1339 gint TMSCallIPAdpt::SetOutput(TMSAudioOutput output) |
1341 { |
1340 { |
1342 TRACE_PRN_FN_ENT; |
1341 TRACE_PRN_FN_ENT; |
1343 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
1342 gint status(TMS_RESULT_INVALID_STATE); |
1344 if (iDnlinkInitialized && iIPDownlink) |
1343 if (iIPDownlink && iDnlState != EIdle) |
1345 { |
1344 { |
1346 TRAP(status, iIPDownlink->SetAudioDeviceL(output)); |
1345 TRAP(status, iIPDownlink->SetAudioDeviceL(output)); |
1347 } |
1346 } |
1348 TRACE_PRN_FN_EXT; |
1347 TRACE_PRN_FN_EXT; |
1349 return status; |
1348 return status; |
1350 } |
1349 } |
|
1350 |
1351 // ----------------------------------------------------------------------------- |
1351 // ----------------------------------------------------------------------------- |
1352 // TMSCallIPAdpt::GetOutput |
1352 // TMSCallIPAdpt::GetOutput |
1353 // |
1353 // |
1354 // ----------------------------------------------------------------------------- |
1354 // ----------------------------------------------------------------------------- |
1355 // |
1355 // |
1356 gint TMSCallIPAdpt::GetOutput(TMSAudioOutput& output) |
1356 gint TMSCallIPAdpt::GetOutput(TMSAudioOutput& output) |
1357 { |
1357 { |
1358 TRACE_PRN_FN_ENT; |
1358 TRACE_PRN_FN_ENT; |
1359 gint status(TMS_RESULT_UNINITIALIZED_OBJECT); |
1359 gint status(TMS_RESULT_INVALID_STATE); |
1360 if (iDnlinkInitialized && iIPDownlink) |
1360 if (iIPDownlink && iDnlState != EIdle) |
1361 { |
1361 { |
1362 TRAP(status, iIPDownlink->GetAudioDeviceL(output)); |
1362 TRAP(status, iIPDownlink->GetAudioDeviceL(output)); |
1363 } |
1363 } |
1364 TRACE_PRN_FN_EXT; |
1364 TRACE_PRN_FN_EXT; |
1365 return status; |
1365 return status; |
1381 // ----------------------------------------------------------------------------- |
1381 // ----------------------------------------------------------------------------- |
1382 // |
1382 // |
1383 gint TMSCallIPAdpt::GetAvailableOutputsL(gint& /*count*/, |
1383 gint TMSCallIPAdpt::GetAvailableOutputsL(gint& /*count*/, |
1384 CBufFlat*& /*outputsbuf*/) |
1384 CBufFlat*& /*outputsbuf*/) |
1385 { |
1385 { |
|
1386 //TODO: return public & private |
1386 return TMS_RESULT_FEATURE_NOT_SUPPORTED; |
1387 return TMS_RESULT_FEATURE_NOT_SUPPORTED; |
1387 } |
1388 } |
1388 |
1389 |
1389 // ----------------------------------------------------------------------------- |
|
1390 // ----------------------------------------------------------------------------- |
1390 // ----------------------------------------------------------------------------- |
1391 // TMSCallIPAdpt::DownlinkInitCompleted |
1391 // TMSCallIPAdpt::DownlinkInitCompleted |
1392 // From TMSIPDevSoundObserver |
1392 // From TMSIPDevSoundObserver |
1393 // ----------------------------------------------------------------------------- |
1393 // ----------------------------------------------------------------------------- |
1394 // |
1394 // |
1395 void TMSCallIPAdpt::DownlinkInitCompleted(gint status) |
1395 void TMSCallIPAdpt::DownlinkInitCompleted(gint status) |
1396 { |
1396 { |
1397 TRACE_PRN_FN_ENT; |
1397 TRACE_PRN_FN_ENT; |
1398 if (status == TMS_RESULT_SUCCESS) |
1398 if (status == TMS_RESULT_SUCCESS) |
1399 { |
1399 { |
1400 iDnlinkInitialized = TRUE; |
1400 iDnlState = EInitialized; |
1401 } |
1401 } |
1402 NotifyClient(iDnlinkStreamId, ECmdDownlinkInitComplete, status); |
1402 NotifyClient(iDnlinkStreamId, ECmdDownlinkInitComplete, status); |
1403 TRACE_PRN_FN_EXT; |
1403 TRACE_PRN_FN_EXT; |
1404 } |
1404 } |
1405 |
1405 |
1425 // ----------------------------------------------------------------------------- |
1425 // ----------------------------------------------------------------------------- |
1426 // |
1426 // |
1427 void TMSCallIPAdpt::UplinkStarted(gint status) |
1427 void TMSCallIPAdpt::UplinkStarted(gint status) |
1428 { |
1428 { |
1429 TRACE_PRN_FN_ENT; |
1429 TRACE_PRN_FN_ENT; |
|
1430 if (status == TMS_RESULT_SUCCESS) |
|
1431 { |
|
1432 iUplState = EActivated; |
|
1433 } |
1430 NotifyClient(iUplinkStreamId, ECmdUplinkStarted, status); |
1434 NotifyClient(iUplinkStreamId, ECmdUplinkStarted, status); |
1431 TRACE_PRN_FN_EXT; |
1435 TRACE_PRN_FN_EXT; |
1432 } |
1436 } |
1433 |
1437 |
1434 // ----------------------------------------------------------------------------- |
1438 // ----------------------------------------------------------------------------- |
1437 // ----------------------------------------------------------------------------- |
1441 // ----------------------------------------------------------------------------- |
1438 // |
1442 // |
1439 void TMSCallIPAdpt::DownlinkStarted(gint status) |
1443 void TMSCallIPAdpt::DownlinkStarted(gint status) |
1440 { |
1444 { |
1441 TRACE_PRN_FN_ENT; |
1445 TRACE_PRN_FN_ENT; |
|
1446 if (status == TMS_RESULT_SUCCESS) |
|
1447 { |
|
1448 iDnlState = EActivated; |
|
1449 } |
1442 NotifyClient(iDnlinkStreamId, ECmdDownlinkStarted, status); |
1450 NotifyClient(iDnlinkStreamId, ECmdDownlinkStarted, status); |
1443 TRACE_PRN_FN_EXT; |
1451 TRACE_PRN_FN_EXT; |
1444 } |
1452 } |
1445 |
1453 |
1446 // ----------------------------------------------------------------------------- |
1454 // ----------------------------------------------------------------------------- |