equal
deleted
inserted
replaced
340 |
340 |
341 ret = ValidateStream(); |
341 ret = ValidateStream(); |
342 |
342 |
343 RET_REASON_IF_ERR(ret); |
343 RET_REASON_IF_ERR(ret); |
344 |
344 |
345 TMSFormatType fmttype; |
345 TMSFormatType fmttype(TMS_FORMAT_PCM); |
346 if (!iFormat && iContext.CallType == TMS_CALL_IP) |
346 if (!iFormat && iContext.CallType == TMS_CALL_IP) |
347 { |
347 { |
348 return TMS_RESULT_FORMAT_TYPE_UNSPECIFIED; |
348 return TMS_RESULT_FORMAT_TYPE_UNSPECIFIED; |
349 } |
349 } |
350 else if (iContext.CallType == TMS_CALL_IP) |
350 else if (iContext.CallType == TMS_CALL_IP) |
371 TMSEffectType effecttype; |
371 TMSEffectType effecttype; |
372 iEffectsList[i]->GetType(effecttype); |
372 iEffectsList[i]->GetType(effecttype); |
373 switch (effecttype) |
373 switch (effecttype) |
374 { |
374 { |
375 case TMS_EFFECT_GAIN: |
375 case TMS_EFFECT_GAIN: |
376 ((TMSGainEffectImpl*) iEffectsList[i])->SetProxy( |
376 static_cast<TMSGainEffectImpl*>(iEffectsList[i])->SetProxy( |
377 iContext.CallProxy, iMsgQHandler); |
377 iContext.CallProxy, iMsgQHandler); |
378 break; |
378 break; |
379 case TMS_EFFECT_VOLUME: |
379 case TMS_EFFECT_VOLUME: |
380 ((TMSVolumeEffectImpl*) iEffectsList[i])->SetProxy( |
380 static_cast<TMSVolumeEffectImpl*> |
381 iContext.CallProxy, iMsgQHandler); |
381 (iEffectsList[i])->SetProxy(iContext.CallProxy, |
|
382 iMsgQHandler); |
382 break; |
383 break; |
383 default: |
384 default: |
384 ret = TMS_RESULT_INVALID_ARGUMENT; |
385 ret = TMS_RESULT_INVALID_ARGUMENT; |
385 break; |
386 break; |
386 } |
387 } |
392 TMSFormatType fmttype; |
393 TMSFormatType fmttype; |
393 iFormat->GetType(fmttype); |
394 iFormat->GetType(fmttype); |
394 switch (fmttype) |
395 switch (fmttype) |
395 { |
396 { |
396 case TMS_FORMAT_PCM: |
397 case TMS_FORMAT_PCM: |
397 ((TMSPCMFormatImpl*) iFormat)->SetProxy(&iContext, |
398 static_cast<TMSPCMFormatImpl*>(iFormat)->SetProxy(&iContext, |
398 iMsgQHandler); |
399 iMsgQHandler); |
399 break; |
400 break; |
400 case TMS_FORMAT_AMR: |
401 case TMS_FORMAT_AMR: |
401 ((TMSAMRFormatImpl*) iFormat)->SetProxy(&iContext, |
402 static_cast<TMSAMRFormatImpl*>(iFormat)->SetProxy(&iContext, |
402 iMsgQHandler); |
403 iMsgQHandler); |
403 break; |
404 break; |
404 case TMS_FORMAT_G711: |
405 case TMS_FORMAT_G711: |
405 ((TMSG711FormatImpl*) iFormat)->SetProxy(&iContext, |
406 static_cast<TMSG711FormatImpl*>(iFormat)->SetProxy(&iContext, |
406 iMsgQHandler); |
407 iMsgQHandler); |
407 break; |
408 break; |
408 case TMS_FORMAT_G729: |
409 case TMS_FORMAT_G729: |
409 ((TMSG729FormatImpl*) iFormat)->SetProxy(&iContext, |
410 static_cast<TMSG729FormatImpl*>(iFormat)->SetProxy(&iContext, |
410 iMsgQHandler); |
411 iMsgQHandler); |
411 break; |
412 break; |
412 case TMS_FORMAT_ILBC: |
413 case TMS_FORMAT_ILBC: |
413 ((TMSILBCFormatImpl*) iFormat)->SetProxy(&iContext, |
414 static_cast<TMSILBCFormatImpl*>(iFormat)->SetProxy(&iContext, |
414 iMsgQHandler); |
415 iMsgQHandler); |
415 break; |
416 break; |
416 default: |
417 default: |
417 ret = TMS_RESULT_INVALID_ARGUMENT; |
418 ret = TMS_RESULT_INVALID_ARGUMENT; |
418 break; |
419 break; |
426 TMSSinkType sinkType; |
427 TMSSinkType sinkType; |
427 iSink->GetType(sinkType); |
428 iSink->GetType(sinkType); |
428 switch (sinkType) |
429 switch (sinkType) |
429 { |
430 { |
430 case TMS_SINK_CLIENT: |
431 case TMS_SINK_CLIENT: |
431 ((TMSClientSinkImpl*) iSink)->SetProxy( |
432 static_cast<TMSClientSinkImpl*>(iSink)->SetProxy( |
432 iContext.CallProxy, iMsgQHandler); |
433 iContext.CallProxy, iMsgQHandler); |
433 break; |
434 break; |
434 case TMS_SINK_MODEM: |
435 case TMS_SINK_MODEM: |
435 case TMS_SINK_SPEAKER: |
436 case TMS_SINK_SPEAKER: |
436 break; |
437 break; |
451 TMSSourceType sourceType; |
452 TMSSourceType sourceType; |
452 iSource->GetType(sourceType); |
453 iSource->GetType(sourceType); |
453 switch (sourceType) |
454 switch (sourceType) |
454 { |
455 { |
455 case TMS_SOURCE_CLIENT: |
456 case TMS_SOURCE_CLIENT: |
456 ((TMSClientSourceImpl*) iSource)->SetProxy( |
457 static_cast<TMSClientSourceImpl*>(iSource)->SetProxy( |
457 iContext.CallProxy, iContext.StreamId, |
458 iContext.CallProxy, iContext.StreamId, |
458 iMsgQHandler); |
459 iMsgQHandler); |
459 break; |
460 break; |
460 case TMS_SOURCE_MODEM: |
461 case TMS_SOURCE_MODEM: |
461 case TMS_SOURCE_MIC: |
462 case TMS_SOURCE_MIC: |
715 // ======== CALLBACK FUNCTIONS ======== |
716 // ======== CALLBACK FUNCTIONS ======== |
716 |
717 |
717 void TMSStreamBodyImpl::QueueEvent(TInt aEventType, TInt aError, |
718 void TMSStreamBodyImpl::QueueEvent(TInt aEventType, TInt aError, |
718 void* user_data) |
719 void* user_data) |
719 { |
720 { |
720 TMSSignalEvent event; |
721 TMSSignalEvent event = {}; //all elements initialized to zeros |
721 event.reason = aError; |
722 event.reason = aError; |
722 event.user_data = user_data; |
723 event.user_data = user_data; |
723 iStreamState = aEventType; |
724 iStreamState = aEventType; |
724 |
725 |
725 switch (aEventType) |
726 switch (aEventType) |
732 event.curr_state = aEventType; |
733 event.curr_state = aEventType; |
733 event.prev_state = iPrevState; |
734 event.prev_state = iPrevState; |
734 if (iObserver) |
735 if (iObserver) |
735 { |
736 { |
736 event.type = TMS_EVENT_STREAM_STATE_CHANGED; |
737 event.type = TMS_EVENT_STREAM_STATE_CHANGED; |
737 iObserver->TMSStreamEvent(iParent, event); |
738 iObserver->TMSStreamEvent(*iParent, event); |
738 } |
739 } |
739 break; |
740 break; |
740 } |
741 } |
741 default: |
742 default: |
742 break; |
743 break; |