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