mmserv/tms/tmsimpl/src/tmsstreambodyimpl.cpp
changeset 31 8dfd592727cb
parent 22 128eb6a32b84
child 42 1fa3fb47b1e3
--- a/mmserv/tms/tmsimpl/src/tmsstreambodyimpl.cpp	Thu May 27 13:20:50 2010 +0300
+++ b/mmserv/tms/tmsimpl/src/tmsstreambodyimpl.cpp	Wed Jun 23 18:47:10 2010 +0300
@@ -334,7 +334,7 @@
     return iContext.StreamId;
     }
 
-gint TMSStreamBodyImpl::Init()
+gint TMSStreamBodyImpl::Init(gint retrytime)
     {
     gint ret(TMS_RESULT_SUCCESS);
 
@@ -355,7 +355,8 @@
     if (iContext.CallProxy)
         {
         ret = (iContext.CallProxy)->InitStream(iContext.CallType,
-                iContext.StreamType, iContext.StreamId, fmttype, &iMsgQueue);
+                iContext.StreamType, iContext.StreamId, fmttype, &iMsgQueue,
+                retrytime);
         }
     else
         {
@@ -373,7 +374,7 @@
             switch (effecttype)
                 {
                 case TMS_EFFECT_GAIN:
-                    static_cast<TMSGainEffectImpl*>(iEffectsList[i])->SetProxy(
+                    static_cast<TMSGainEffectImpl*> (iEffectsList[i])->SetProxy(
                             iContext.CallProxy, iMsgQHandler);
                     break;
                 case TMS_EFFECT_VOLUME:
@@ -395,23 +396,23 @@
         switch (fmttype)
             {
             case TMS_FORMAT_PCM:
-                static_cast<TMSPCMFormatImpl*>(iFormat)->SetProxy(&iContext,
+                static_cast<TMSPCMFormatImpl*> (iFormat)->SetProxy(&iContext,
                         iMsgQHandler);
                 break;
             case TMS_FORMAT_AMR:
-                static_cast<TMSAMRFormatImpl*>(iFormat)->SetProxy(&iContext,
+                static_cast<TMSAMRFormatImpl*> (iFormat)->SetProxy(&iContext,
                         iMsgQHandler);
                 break;
             case TMS_FORMAT_G711:
-                static_cast<TMSG711FormatImpl*>(iFormat)->SetProxy(&iContext,
+                static_cast<TMSG711FormatImpl*> (iFormat)->SetProxy(&iContext,
                         iMsgQHandler);
                 break;
             case TMS_FORMAT_G729:
-                static_cast<TMSG729FormatImpl*>(iFormat)->SetProxy(&iContext,
+                static_cast<TMSG729FormatImpl*> (iFormat)->SetProxy(&iContext,
                         iMsgQHandler);
                 break;
             case TMS_FORMAT_ILBC:
-                static_cast<TMSILBCFormatImpl*>(iFormat)->SetProxy(&iContext,
+                static_cast<TMSILBCFormatImpl*> (iFormat)->SetProxy(&iContext,
                         iMsgQHandler);
                 break;
             default:
@@ -429,8 +430,8 @@
             switch (sinkType)
                 {
                 case TMS_SINK_CLIENT:
-                    static_cast<TMSClientSinkImpl*>(iSink)->SetProxy(
-                            iContext.CallProxy, iMsgQHandler);
+                    static_cast<TMSClientSinkImpl*> (iSink)->SetProxy(&iContext,
+                            iMsgQHandler);
                     break;
                 case TMS_SINK_MODEM:
                 case TMS_SINK_SPEAKER:
@@ -454,9 +455,8 @@
             switch (sourceType)
                 {
                 case TMS_SOURCE_CLIENT:
-                    static_cast<TMSClientSourceImpl*>(iSource)->SetProxy(
-                            iContext.CallProxy, iContext.StreamId,
-                            iMsgQHandler);
+                    static_cast<TMSClientSourceImpl*> (iSource)->SetProxy(
+                            &iContext, iMsgQHandler);
                     break;
                 case TMS_SOURCE_MODEM:
                 case TMS_SOURCE_MIC:
@@ -490,13 +490,13 @@
     return ret;
     }
 
-gint TMSStreamBodyImpl::Start()
+gint TMSStreamBodyImpl::Start(gint retrytime)
     {
     gint ret(TMS_RESULT_SUCCESS);
     if (iContext.CallProxy)
         {
         ret = (iContext.CallProxy)->StartStream(iContext.CallType,
-                iContext.StreamType, iContext.StreamId);
+                iContext.StreamType, iContext.StreamId, retrytime);
         }
     else
         {
@@ -734,7 +734,14 @@
             event.prev_state = iPrevState;
             if (iObserver)
                 {
-                event.type = TMS_EVENT_STREAM_STATE_CHANGED;
+                if (aError != TMS_RESULT_SUCCESS)
+                    {
+                    event.type = TMS_EVENT_STREAM_STATE_CHANGE_ERROR;
+                    }
+                else
+                    {
+                    event.type = TMS_EVENT_STREAM_STATE_CHANGED;
+                    }
                 iObserver->TMSStreamEvent(*iParent, event);
                 }
             break;