mmserv/tms/tmscallserver/src/tmscallipadpt.cpp
branchRCL_3
changeset 45 095bea5f582e
parent 40 60e492b28869
child 46 0ac9a5310753
equal deleted inserted replaced
41:a36789189b53 45:095bea5f582e
    94 gint TMSCallIPAdpt::PostConstruct()
    94 gint TMSCallIPAdpt::PostConstruct()
    95     {
    95     {
    96     TRACE_PRN_FN_ENT;
    96     TRACE_PRN_FN_ENT;
    97     gint status(TMS_RESULT_SUCCESS);
    97     gint status(TMS_RESULT_SUCCESS);
    98     iNextStreamId = 1;
    98     iNextStreamId = 1;
    99     iUplinkInitialized = FALSE;
    99     iUplState = EIdle;
   100     iDnlinkInitialized = FALSE;
   100     iDnlState = EIdle;
   101     TRACE_PRN_FN_EXT;
   101     TRACE_PRN_FN_EXT;
   102     return status;
   102     return status;
   103     }
   103     }
   104 
   104 
   105 // -----------------------------------------------------------------------------
   105 // -----------------------------------------------------------------------------
   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;
   370             {
   373             {
   371             status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED;
   374             status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED;
   372             break;
   375             break;
   373             }
   376             }
   374         }
   377         }
   375 
       
   376     TRACE_PRN_FN_EXT;
   378     TRACE_PRN_FN_EXT;
   377     return status;
   379     return status;
   378     }
   380     }
   379 
   381 
   380 // -----------------------------------------------------------------------------
   382 // -----------------------------------------------------------------------------
   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             {
   521 //
   523 //
   522 gint TMSCallIPAdpt::GetMaxVolume(guint& volume)
   524 gint TMSCallIPAdpt::GetMaxVolume(guint& volume)
   523     {
   525     {
   524     TRACE_PRN_FN_ENT;
   526     TRACE_PRN_FN_ENT;
   525     gint status(TMS_RESULT_INVALID_STATE);
   527     gint status(TMS_RESULT_INVALID_STATE);
   526     if (iDnlinkInitialized && iIPDownlink)
   528     if (iIPDownlink && iDnlState != EIdle)
   527         {
   529         {
   528         status = iIPDownlink->GetMaxVolume(volume);
   530         status = iIPDownlink->GetMaxVolume(volume);
   529         iMaxVolume = volume;
   531         iMaxVolume = volume;
   530         TRACE_PRN_N1(_L("TMS->TMSCallIPAdpt: GetMaxVolume [%d]"), iMaxVolume);
   532         TRACE_PRN_N1(_L("TMS->TMSCallIPAdpt: GetMaxVolume [%d]"), iMaxVolume);
   531         }
   533         }
   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;
   558 //
   560 //
   559 gint TMSCallIPAdpt::GetVolume(guint& volume)
   561 gint TMSCallIPAdpt::GetVolume(guint& volume)
   560     {
   562     {
   561     TRACE_PRN_FN_ENT;
   563     TRACE_PRN_FN_ENT;
   562     gint status(TMS_RESULT_INVALID_STATE);
   564     gint status(TMS_RESULT_INVALID_STATE);
   563     if (iDnlinkInitialized && iIPDownlink)
   565     if (iIPDownlink && iDnlState != EIdle)
   564         {
   566         {
   565         status = iIPDownlink->GetVolume(volume);
   567         status = iIPDownlink->GetVolume(volume);
   566         }
   568         }
   567     TRACE_PRN_FN_EXT;
   569     TRACE_PRN_FN_EXT;
   568     return status;
   570     return status;
   575 //
   577 //
   576 gint TMSCallIPAdpt::GetMaxGain(guint& gain)
   578 gint TMSCallIPAdpt::GetMaxGain(guint& gain)
   577     {
   579     {
   578     TRACE_PRN_FN_ENT;
   580     TRACE_PRN_FN_ENT;
   579     gint status(TMS_RESULT_INVALID_STATE);
   581     gint status(TMS_RESULT_INVALID_STATE);
   580     if (iUplinkInitialized && iIPUplink)
   582     if (iIPUplink && iUplState != EIdle)
   581         {
   583         {
   582         status = iIPUplink->GetMaxGain(gain);
   584         status = iIPUplink->GetMaxGain(gain);
   583         iMaxGain = gain;
   585         iMaxGain = gain;
   584         TRACE_PRN_N1(_L("TMS->TMSCallIPAdpt::GetMaxGain [%d]"), iMaxGain);
   586         TRACE_PRN_N1(_L("TMS->TMSCallIPAdpt::GetMaxGain [%d]"), iMaxGain);
   585         }
   587         }
   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;
   612 //
   614 //
   613 gint TMSCallIPAdpt::GetGain(guint& gain)
   615 gint TMSCallIPAdpt::GetGain(guint& gain)
   614     {
   616     {
   615     TRACE_PRN_FN_ENT;
   617     TRACE_PRN_FN_ENT;
   616     gint status(TMS_RESULT_INVALID_STATE);
   618     gint status(TMS_RESULT_INVALID_STATE);
   617     if (iUplinkInitialized && iIPUplink)
   619     if (iIPUplink && iUplState != EIdle)
   618         {
   620         {
   619         status = iIPUplink->GetGain(gain);
   621         status = iIPUplink->GetGain(gain);
   620         }
   622         }
   621     TRACE_PRN_FN_EXT;
   623     TRACE_PRN_FN_EXT;
   622     return status;
   624     return status;
   629 //
   631 //
   630 gint TMSCallIPAdpt::GetGlobalMaxVolume(guint& volume)
   632 gint TMSCallIPAdpt::GetGlobalMaxVolume(guint& volume)
   631     {
   633     {
   632     TRACE_PRN_FN_ENT;
   634     TRACE_PRN_FN_ENT;
   633     gint status(TMS_RESULT_INVALID_STATE);
   635     gint status(TMS_RESULT_INVALID_STATE);
   634     if (iDnlinkInitialized && iIPDownlink)
   636     if (iIPDownlink && iDnlState != EIdle)
   635         {
   637         {
   636         status = iIPDownlink->GetMaxVolume(volume);
   638         status = iIPDownlink->GetMaxVolume(volume);
   637         iMaxVolume = volume;
   639         iMaxVolume = volume;
   638         TRACE_PRN_N1(_L("TMS->TMSCallIPAdpt::GetGlobalMaxVolume [%d]"), volume);
   640         TRACE_PRN_N1(_L("TMS->TMSCallIPAdpt::GetGlobalMaxVolume [%d]"), volume);
   639         }
   641         }
   649 gint TMSCallIPAdpt::SetGlobalVolume(const guint volume)
   651 gint TMSCallIPAdpt::SetGlobalVolume(const guint volume)
   650     {
   652     {
   651     TRACE_PRN_FN_ENT;
   653     TRACE_PRN_FN_ENT;
   652     gint status(TMS_RESULT_INVALID_STATE);
   654     gint status(TMS_RESULT_INVALID_STATE);
   653     //iGlobalVol = volume;
   655     //iGlobalVol = volume;
   654     if (iDnlinkInitialized && iIPDownlink)
   656     if (iIPDownlink && iDnlState != EIdle)
   655         {
   657         {
   656         status = iIPDownlink->SetVolume(volume);
   658         status = iIPDownlink->SetVolume(volume);
   657         }
   659         }
   658     TRACE_PRN_FN_EXT;
   660     TRACE_PRN_FN_EXT;
   659     return status;
   661     return status;
   666 //
   668 //
   667 gint TMSCallIPAdpt::GetGlobalVolume(guint& volume)
   669 gint TMSCallIPAdpt::GetGlobalVolume(guint& volume)
   668     {
   670     {
   669     TRACE_PRN_FN_ENT;
   671     TRACE_PRN_FN_ENT;
   670     gint status(TMS_RESULT_INVALID_STATE);
   672     gint status(TMS_RESULT_INVALID_STATE);
   671     if (iDnlinkInitialized && iIPDownlink)
   673     if (iIPDownlink && iDnlState != EIdle)
   672         {
   674         {
   673         status = iIPDownlink->GetVolume(volume);
   675         status = iIPDownlink->GetVolume(volume);
   674         }
   676         }
   675     TRACE_PRN_FN_EXT;
   677     TRACE_PRN_FN_EXT;
   676     return status;
   678     return status;
   683 //
   685 //
   684 gint TMSCallIPAdpt::GetGlobalMaxGain(guint& gain)
   686 gint TMSCallIPAdpt::GetGlobalMaxGain(guint& gain)
   685     {
   687     {
   686     TRACE_PRN_FN_ENT;
   688     TRACE_PRN_FN_ENT;
   687     gint status(TMS_RESULT_INVALID_STATE);
   689     gint status(TMS_RESULT_INVALID_STATE);
   688     if (iUplinkInitialized && iIPUplink)
   690     if (iIPUplink && iUplState != EIdle)
   689         {
   691         {
   690         status = iIPUplink->GetMaxGain(gain);
   692         status = iIPUplink->GetMaxGain(gain);
   691         iMaxGain = gain;
   693         iMaxGain = gain;
   692         TRACE_PRN_N1(_L("TMS->TMSCallIPAdpt::GetGlobalMaxGain [%d]"), gain);
   694         TRACE_PRN_N1(_L("TMS->TMSCallIPAdpt::GetGlobalMaxGain [%d]"), gain);
   693         }
   695         }
   703 gint TMSCallIPAdpt::SetGlobalGain(const guint gain)
   705 gint TMSCallIPAdpt::SetGlobalGain(const guint gain)
   704     {
   706     {
   705     TRACE_PRN_FN_ENT;
   707     TRACE_PRN_FN_ENT;
   706     gint status(TMS_RESULT_INVALID_STATE);
   708     gint status(TMS_RESULT_INVALID_STATE);
   707     //iGlobalGain = gain;
   709     //iGlobalGain = gain;
   708     if (iUplinkInitialized && iIPUplink)
   710     if (iIPUplink && iUplState != EIdle)
   709         {
   711         {
   710         status = iIPUplink->SetGain(gain);
   712         status = iIPUplink->SetGain(gain);
   711         }
   713         }
   712     TRACE_PRN_FN_EXT;
   714     TRACE_PRN_FN_EXT;
   713     return status;
   715     return status;
   720 //
   722 //
   721 gint TMSCallIPAdpt::GetGlobalGain(guint& gain)
   723 gint TMSCallIPAdpt::GetGlobalGain(guint& gain)
   722     {
   724     {
   723     TRACE_PRN_FN_ENT;
   725     TRACE_PRN_FN_ENT;
   724     gint status(TMS_RESULT_INVALID_STATE);
   726     gint status(TMS_RESULT_INVALID_STATE);
   725     if (iUplinkInitialized && iIPUplink)
   727     if (iIPUplink && iUplState != EIdle)
   726         {
   728         {
   727         status = iIPUplink->GetGain(gain);
   729         status = iIPUplink->GetGain(gain);
   728         }
   730         }
   729     TRACE_PRN_FN_EXT;
   731     TRACE_PRN_FN_EXT;
   730     return status;
   732     return status;
   789 //
   791 //
   790 gint TMSCallIPAdpt::GetSupportedBitRatesCount(guint& count)
   792 gint TMSCallIPAdpt::GetSupportedBitRatesCount(guint& count)
   791     {
   793     {
   792     TRACE_PRN_FN_ENT;
   794     TRACE_PRN_FN_ENT;
   793     gint status(TMS_RESULT_INVALID_STATE);
   795     gint status(TMS_RESULT_INVALID_STATE);
   794     if (iIPUplink)
   796     if (iIPUplink && iUplState != EIdle)
   795         {
   797         {
   796         status = iIPUplink->GetSupportedBitrates(iArrBitrates);
   798         status = iIPUplink->GetSupportedBitrates(iArrBitrates);
   797         count = iArrBitrates.Count();
   799         count = iArrBitrates.Count();
   798         }
   800         }
   799     TRACE_PRN_FN_EXT;
   801     TRACE_PRN_FN_EXT;
   845 //
   847 //
   846 gint TMSCallIPAdpt::GetBitRate(guint& bitrate)
   848 gint TMSCallIPAdpt::GetBitRate(guint& bitrate)
   847     {
   849     {
   848     TRACE_PRN_FN_ENT;
   850     TRACE_PRN_FN_ENT;
   849     gint status(TMS_RESULT_INVALID_STATE);
   851     gint status(TMS_RESULT_INVALID_STATE);
   850     if (iIPUplink)
   852     if (iIPUplink && iUplState != EIdle)
   851         {
   853         {
   852         status = iIPUplink->GetBitrate(bitrate);
   854         status = iIPUplink->GetBitrate(bitrate);
   853         }
   855         }
   854     TRACE_PRN_FN_EXT;
   856     TRACE_PRN_FN_EXT;
   855     return status;
   857     return status;
   862 //
   864 //
   863 gint TMSCallIPAdpt::SetBitRate(const guint bitrate)
   865 gint TMSCallIPAdpt::SetBitRate(const guint bitrate)
   864     {
   866     {
   865     TRACE_PRN_FN_ENT;
   867     TRACE_PRN_FN_ENT;
   866     gint status(TMS_RESULT_INVALID_STATE);
   868     gint status(TMS_RESULT_INVALID_STATE);
   867     if (iIPUplink)
   869     if (iIPUplink && iUplState != EIdle)
   868         {
   870         {
   869         status = iIPUplink->SetBitrate(bitrate);
   871         status = iIPUplink->SetBitrate(bitrate);
   870         }
   872         }
   871     TRACE_PRN_FN_EXT;
   873     TRACE_PRN_FN_EXT;
   872     return status;
   874     return status;
   879 //
   881 //
   880 gint TMSCallIPAdpt::GetVAD(const TMSFormatType fmttype, gboolean& vad)
   882 gint TMSCallIPAdpt::GetVAD(const TMSFormatType fmttype, gboolean& vad)
   881     {
   883     {
   882     TRACE_PRN_FN_ENT;
   884     TRACE_PRN_FN_ENT;
   883     gint status(TMS_RESULT_INVALID_STATE);
   885     gint status(TMS_RESULT_INVALID_STATE);
   884     if (iIPUplink)
   886     if (iIPUplink && iUplState != EIdle)
   885         {
   887         {
   886         status = iIPUplink->GetVad(fmttype, vad);
   888         status = iIPUplink->GetVad(fmttype, vad);
   887         }
   889         }
   888     TRACE_PRN_FN_EXT;
   890     TRACE_PRN_FN_EXT;
   889     return status;
   891     return status;
   896 //
   898 //
   897 gint TMSCallIPAdpt::SetVAD(const TMSFormatType fmttype, const gboolean vad)
   899 gint TMSCallIPAdpt::SetVAD(const TMSFormatType fmttype, const gboolean vad)
   898     {
   900     {
   899     TRACE_PRN_FN_ENT;
   901     TRACE_PRN_FN_ENT;
   900     gint status(TMS_RESULT_INVALID_STATE);
   902     gint status(TMS_RESULT_INVALID_STATE);
   901     if (iIPUplink)
   903     if (iIPUplink && iUplState != EIdle)
   902         {
   904         {
   903         status = iIPUplink->SetVad(fmttype, vad);
   905         status = iIPUplink->SetVad(fmttype, vad);
   904         }
   906         }
   905     TRACE_PRN_FN_EXT;
   907     TRACE_PRN_FN_EXT;
   906     return status;
   908     return status;
   913 //
   915 //
   914 gint TMSCallIPAdpt::GetCNG(const TMSFormatType fmttype, gboolean& cng)
   916 gint TMSCallIPAdpt::GetCNG(const TMSFormatType fmttype, gboolean& cng)
   915     {
   917     {
   916     TRACE_PRN_FN_ENT;
   918     TRACE_PRN_FN_ENT;
   917     gint status(TMS_RESULT_INVALID_STATE);
   919     gint status(TMS_RESULT_INVALID_STATE);
   918     if (iIPDownlink)
   920     if (iIPDownlink && iDnlState == EInitialized)
   919         {
   921         {
   920         status = iIPDownlink->GetCng(fmttype, cng);
   922         status = iIPDownlink->GetCng(fmttype, cng);
   921         }
   923         }
   922     TRACE_PRN_FN_EXT;
   924     TRACE_PRN_FN_EXT;
   923     return status;
   925     return status;
   930 //
   932 //
   931 gint TMSCallIPAdpt::SetCNG(const TMSFormatType fmttype, const gboolean cng)
   933 gint TMSCallIPAdpt::SetCNG(const TMSFormatType fmttype, const gboolean cng)
   932     {
   934     {
   933     TRACE_PRN_FN_ENT;
   935     TRACE_PRN_FN_ENT;
   934     gint status(TMS_RESULT_INVALID_STATE);
   936     gint status(TMS_RESULT_INVALID_STATE);
   935     if (iIPDownlink)
   937     if (iIPDownlink && iDnlState == EInitialized)
   936         {
   938         {
   937         status = iIPDownlink->SetCng(fmttype, cng);
   939         status = iIPDownlink->SetCng(fmttype, cng);
   938         }
   940         }
   939     TRACE_PRN_FN_EXT;
   941     TRACE_PRN_FN_EXT;
   940     return status;
   942     return status;
   947 //
   949 //
   948 gint TMSCallIPAdpt::GetPlc(const TMSFormatType fmttype, gboolean& plc)
   950 gint TMSCallIPAdpt::GetPlc(const TMSFormatType fmttype, gboolean& plc)
   949     {
   951     {
   950     TRACE_PRN_FN_ENT;
   952     TRACE_PRN_FN_ENT;
   951     gint status(TMS_RESULT_INVALID_STATE);
   953     gint status(TMS_RESULT_INVALID_STATE);
   952     if (iIPDownlink)
   954     if (iIPDownlink && iDnlState != EIdle)
   953         {
   955         {
   954         status = iIPDownlink->GetPlc(fmttype, plc);
   956         status = iIPDownlink->GetPlc(fmttype, plc);
   955         }
   957         }
   956     TRACE_PRN_FN_EXT;
   958     TRACE_PRN_FN_EXT;
   957     return status;
   959     return status;
   964 //
   966 //
   965 gint TMSCallIPAdpt::SetPlc(const TMSFormatType fmttype, const gboolean plc)
   967 gint TMSCallIPAdpt::SetPlc(const TMSFormatType fmttype, const gboolean plc)
   966     {
   968     {
   967     TRACE_PRN_FN_ENT;
   969     TRACE_PRN_FN_ENT;
   968     gint status(TMS_RESULT_INVALID_STATE);
   970     gint status(TMS_RESULT_INVALID_STATE);
   969     if (iIPDownlink)
   971     if (iIPDownlink && iDnlState == EInitialized)
   970         {
   972         {
   971         status = iIPDownlink->SetPlc(fmttype, plc);
   973         status = iIPDownlink->SetPlc(fmttype, plc);
   972         }
   974         }
   973     TRACE_PRN_FN_EXT;
   975     TRACE_PRN_FN_EXT;
   974     return status;
   976     return status;
   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     }
  1278 //
  1277 //
  1279 // -----------------------------------------------------------------------------
  1278 // -----------------------------------------------------------------------------
  1280 //
  1279 //
  1281 gint TMSCallIPAdpt::SetFrameMode(const gboolean frmode)
  1280 gint TMSCallIPAdpt::SetFrameMode(const gboolean frmode)
  1282     {
  1281     {
  1283     gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
  1282     gint status(TMS_RESULT_INVALID_STATE);
  1284     if (iIPDownlink)
  1283     if (iIPDownlink && iDnlState == EInitialized)
  1285         {
  1284         {
  1286         status = iIPDownlink->SetFrameMode(frmode);
  1285         status = iIPDownlink->SetFrameMode(frmode);
  1287         }
  1286         }
  1288     return status;
  1287     return status;
  1289     }
  1288     }
  1293 //
  1292 //
  1294 // -----------------------------------------------------------------------------
  1293 // -----------------------------------------------------------------------------
  1295 //
  1294 //
  1296 gint TMSCallIPAdpt::GetFrameMode(gboolean& frmode)
  1295 gint TMSCallIPAdpt::GetFrameMode(gboolean& frmode)
  1297     {
  1296     {
  1298     gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
  1297     gint status(TMS_RESULT_INVALID_STATE);
  1299     if (iIPDownlink)
  1298     if (iIPDownlink && iDnlState != EIdle)
  1300         {
  1299         {
  1301         status = iIPDownlink->GetFrameMode(frmode);
  1300         status = iIPDownlink->GetFrameMode(frmode);
  1302         }
  1301         }
  1303     return status;
  1302     return status;
  1304     }
  1303     }
  1307 // TMSCallIPAdpt::ConcealErrorForNextBuffer
  1306 // TMSCallIPAdpt::ConcealErrorForNextBuffer
  1308 // -----------------------------------------------------------------------------
  1307 // -----------------------------------------------------------------------------
  1309 //
  1308 //
  1310 gint TMSCallIPAdpt::ConcealErrorForNextBuffer()
  1309 gint TMSCallIPAdpt::ConcealErrorForNextBuffer()
  1311     {
  1310     {
  1312     gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
  1311     gint status(TMS_RESULT_INVALID_STATE);
  1313     if (iIPDownlink)
  1312     if (iIPDownlink && iDnlState == EActivated)
  1314         {
  1313         {
  1315         status = iIPDownlink->ConcealErrorForNextBuffer();
  1314         status = iIPDownlink->ConcealErrorForNextBuffer();
  1316         }
  1315         }
  1317     return status;
  1316     return status;
  1318     }
  1317     }
  1322 //
  1321 //
  1323 // -----------------------------------------------------------------------------
  1322 // -----------------------------------------------------------------------------
  1324 //
  1323 //
  1325 gint TMSCallIPAdpt::BadLsfNextBuffer()
  1324 gint TMSCallIPAdpt::BadLsfNextBuffer()
  1326     {
  1325     {
  1327     gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
  1326     gint status(TMS_RESULT_INVALID_STATE);
  1328     if (iIPDownlink)
  1327     if (iIPDownlink && iDnlState == EActivated)
  1329         {
  1328         {
  1330         status = iIPDownlink->BadLsfNextBuffer();
  1329         status = iIPDownlink->BadLsfNextBuffer();
  1331         }
  1330         }
  1332     return status;
  1331     return status;
  1333     }
  1332     }
  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 
  1411 void TMSCallIPAdpt::UplinkInitCompleted(gint status)
  1411 void TMSCallIPAdpt::UplinkInitCompleted(gint status)
  1412     {
  1412     {
  1413     TRACE_PRN_FN_ENT;
  1413     TRACE_PRN_FN_ENT;
  1414     if (status == TMS_RESULT_SUCCESS)
  1414     if (status == TMS_RESULT_SUCCESS)
  1415         {
  1415         {
  1416         iUplinkInitialized = TRUE;
  1416         iUplState = EInitialized;
  1417         }
  1417         }
  1418     NotifyClient(iUplinkStreamId, ECmdUplinkInitComplete, status);
  1418     NotifyClient(iUplinkStreamId, ECmdUplinkInitComplete, status);
  1419     TRACE_PRN_FN_EXT;
  1419     TRACE_PRN_FN_EXT;
  1420     }
  1420     }
  1421 
  1421 
  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 // -----------------------------------------------------------------------------
  1461         {
  1469         {
  1462         iMsgQueueDn.Send(iMsgBuffer);
  1470         iMsgQueueDn.Send(iMsgBuffer);
  1463         }
  1471         }
  1464     }
  1472     }
  1465 
  1473 
  1466 // End of file