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