mmserv/tms/tmscallproxy/src/tmscallproxy.cpp
changeset 0 71ca22bcf22a
child 10 3d8c721bf319
equal deleted inserted replaced
-1:000000000000 0:71ca22bcf22a
       
     1 /*
       
     2  * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description: Telephony Multimedia Service
       
    15  *
       
    16  */
       
    17 
       
    18 #include <s32mem.h>
       
    19 #include <tmsbuffer.h>
       
    20 #include "tmsutility.h"
       
    21 #include "tmsproxy.h"
       
    22 #include "tmscallclisrv.h"
       
    23 #include "tmscallproxy.h"
       
    24 
       
    25 using namespace TMS;
       
    26 
       
    27 // CONSTANTS
       
    28 
       
    29 // -----------------------------------------------------------------------------
       
    30 // TMSCallProxy::TMSCallProxy
       
    31 //
       
    32 // -----------------------------------------------------------------------------
       
    33 //
       
    34 EXPORT_C TMSCallProxy::TMSCallProxy() :
       
    35     iTMSProxy(NULL)
       
    36     {
       
    37     // No impl
       
    38     }
       
    39 
       
    40 // -----------------------------------------------------------------------------
       
    41 // TMSCallProxy::~TMSCallProxy
       
    42 //
       
    43 // -----------------------------------------------------------------------------
       
    44 //
       
    45 EXPORT_C TMSCallProxy::~TMSCallProxy()
       
    46     {
       
    47     TRACE_PRN_FN_ENT;
       
    48     this->Close();
       
    49     TRACE_PRN_FN_EXT;
       
    50     }
       
    51 
       
    52 // -----------------------------------------------------------------------------
       
    53 // TMSCallProxy::Connect
       
    54 // Create a client-side session. Start the server if not started already.
       
    55 // -----------------------------------------------------------------------------
       
    56 //
       
    57 EXPORT_C gint TMSCallProxy::Connect()
       
    58     {
       
    59     TRACE_PRN_FN_ENT;
       
    60     gint status(TMS_RESULT_SUCCESS);
       
    61     TRAP(status, iTMSProxy = new (ELeave) TMSProxy());
       
    62     if (status == TMS_RESULT_SUCCESS)
       
    63         {
       
    64         status = iTMSProxy->Connect();
       
    65         if (status == TMS_RESULT_SUCCESS)
       
    66             {
       
    67             status = SetReturnedHandle(iTMSProxy->GetTMSCallSessionHandle());
       
    68             }
       
    69         else
       
    70             {
       
    71             delete iTMSProxy;
       
    72             iTMSProxy = NULL;
       
    73             }
       
    74         }
       
    75     TRACE_PRN_FN_EXT;
       
    76     return TMSRESULT(status);
       
    77     }
       
    78 
       
    79 // -----------------------------------------------------------------------------
       
    80 // TMSCallProxy::CreateCall
       
    81 //
       
    82 // -----------------------------------------------------------------------------
       
    83 //
       
    84 EXPORT_C gint TMSCallProxy::CreateCall(gint calltype)
       
    85     {
       
    86     TRACE_PRN_FN_ENT;
       
    87     gint status(TMS_RESULT_SUCCESS);
       
    88     status = RSessionBase::SendReceive(TMS_CREATE_CALL, TIpcArgs(calltype));
       
    89     TRACE_PRN_FN_EXT;
       
    90     return TMSRESULT(status);
       
    91     }
       
    92 
       
    93 // -----------------------------------------------------------------------------
       
    94 // TMSCallProxy::CreateStream
       
    95 //
       
    96 // -----------------------------------------------------------------------------
       
    97 //
       
    98 EXPORT_C gint TMSCallProxy::CreateStream(TMSCallType callType,
       
    99         TMSStreamType strmType, gint& strmId)
       
   100     {
       
   101     TRACE_PRN_FN_ENT;
       
   102     gint status(TMS_RESULT_SUCCESS);
       
   103     TMSCliSrvStreamCreateDataStructBufPckg inPckg;
       
   104     inPckg().CallType = callType;
       
   105     inPckg().StreamType = strmType;
       
   106     TPckgBuf<gint> outPckg;
       
   107     status = RSessionBase::SendReceive(TMS_CREATE_STREAM, TIpcArgs(&inPckg,
       
   108             &outPckg));
       
   109     if (status == TMS_RESULT_SUCCESS)
       
   110         {
       
   111         strmId = outPckg();
       
   112         }
       
   113 
       
   114     TRACE_PRN_FN_EXT;
       
   115     return TMSRESULT(status);
       
   116     }
       
   117 
       
   118 // -----------------------------------------------------------------------------
       
   119 // TMSCallProxy::InitStream
       
   120 //
       
   121 // -----------------------------------------------------------------------------
       
   122 //
       
   123 EXPORT_C gint TMSCallProxy::InitStream(const TMSCallType callType,
       
   124         const TMSStreamType strmType, gint strmId,
       
   125         const TMSFormatType frmtType, RHandleBase* msgQueue)
       
   126     {
       
   127     TRACE_PRN_FN_ENT;
       
   128     gint status(TMS_RESULT_SUCCESS);
       
   129     TMSCliSrvStreamInitDataStructBufPckg inPckg;
       
   130     inPckg().CallType = callType;
       
   131     inPckg().StreamType = strmType;
       
   132     inPckg().StreamId = strmId;
       
   133     inPckg().FormatType = frmtType;
       
   134     status = RSessionBase::SendReceive(TMS_INIT_STREAM, TIpcArgs(&inPckg,
       
   135             *msgQueue));
       
   136     TRACE_PRN_FN_EXT;
       
   137     return TMSRESULT(status);
       
   138     }
       
   139 
       
   140 // -----------------------------------------------------------------------------
       
   141 // TMSCallProxy::StartStream
       
   142 //
       
   143 // -----------------------------------------------------------------------------
       
   144 //
       
   145 EXPORT_C gint TMSCallProxy::StartStream(const TMSCallType callType,
       
   146         const TMSStreamType strmType, gint strmId)
       
   147     {
       
   148     TRACE_PRN_FN_ENT;
       
   149     gint status(TMS_RESULT_SUCCESS);
       
   150     TMSCliSrvStreamOpDataStructBufPckg inPckg;
       
   151     inPckg().CallType = callType;
       
   152     inPckg().StreamType = strmType;
       
   153     inPckg().StreamId = strmId;
       
   154     status = RSessionBase::SendReceive(TMS_START_STREAM, TIpcArgs(&inPckg));
       
   155     TRACE_PRN_FN_EXT;
       
   156     return TMSRESULT(status);
       
   157     }
       
   158 
       
   159 // -----------------------------------------------------------------------------
       
   160 // TMSCallProxy::PauseStream
       
   161 //
       
   162 // -----------------------------------------------------------------------------
       
   163 //
       
   164 EXPORT_C gint TMSCallProxy::PauseStream(const TMSCallType callType,
       
   165         const TMSStreamType strmType, gint strmId)
       
   166     {
       
   167     TRACE_PRN_FN_ENT;
       
   168     gint status(TMS_RESULT_SUCCESS);
       
   169     TMSCliSrvStreamOpDataStructBufPckg inPckg;
       
   170     inPckg().CallType = callType;
       
   171     inPckg().StreamType = strmType;
       
   172     inPckg().StreamId = strmId;
       
   173     status = RSessionBase::SendReceive(TMS_PAUSE_STREAM, TIpcArgs(&inPckg));
       
   174     TRACE_PRN_FN_EXT;
       
   175     return TMSRESULT(status);
       
   176     }
       
   177 
       
   178 // -----------------------------------------------------------------------------
       
   179 // TMSCallProxy::StopStream
       
   180 //
       
   181 // -----------------------------------------------------------------------------
       
   182 //
       
   183 EXPORT_C gint TMSCallProxy::StopStream(const TMSCallType callType,
       
   184         const TMSStreamType strmType, gint strmId)
       
   185     {
       
   186     TRACE_PRN_FN_ENT;
       
   187     gint status(TMS_RESULT_SUCCESS);
       
   188     TMSCliSrvStreamOpDataStructBufPckg inPckg;
       
   189     inPckg().CallType = callType;
       
   190     inPckg().StreamType = strmType;
       
   191     inPckg().StreamId = strmId;
       
   192     status = RSessionBase::SendReceive(TMS_STOP_STREAM, TIpcArgs(&inPckg));
       
   193     TRACE_PRN_FN_EXT;
       
   194     return TMSRESULT(status);
       
   195     }
       
   196 
       
   197 // -----------------------------------------------------------------------------
       
   198 // TMSCallProxy::DeinitStream
       
   199 //
       
   200 // -----------------------------------------------------------------------------
       
   201 //
       
   202 EXPORT_C gint TMSCallProxy::DeinitStream(const TMSCallType callType,
       
   203         const TMSStreamType strmType, gint strmId)
       
   204     {
       
   205     TRACE_PRN_FN_ENT;
       
   206     gint status(TMS_RESULT_SUCCESS);
       
   207     TMSCliSrvStreamOpDataStructBufPckg inPckg;
       
   208     inPckg().CallType = callType;
       
   209     inPckg().StreamType = strmType;
       
   210     inPckg().StreamId = strmId;
       
   211     status = RSessionBase::SendReceive(TMS_DEINIT_STREAM, TIpcArgs(&inPckg));
       
   212     TRACE_PRN_FN_EXT;
       
   213     return TMSRESULT(status);
       
   214     }
       
   215 
       
   216 // -----------------------------------------------------------------------------
       
   217 // TMSCallProxy::DeleteStream
       
   218 //
       
   219 // -----------------------------------------------------------------------------
       
   220 //
       
   221 EXPORT_C gint TMSCallProxy::DeleteStream(const TMSCallType callType,
       
   222         const TMSStreamType strmType, gint& strmId)
       
   223     {
       
   224     TRACE_PRN_FN_ENT;
       
   225     gint status(TMS_RESULT_SUCCESS);
       
   226     TMSCliSrvStreamOpDataStructBufPckg inPckg;
       
   227     inPckg().CallType = callType;
       
   228     inPckg().StreamType = strmType;
       
   229     inPckg().StreamId = strmId;
       
   230     status = RSessionBase::SendReceive(TMS_DELETE_STREAM, TIpcArgs(&inPckg));
       
   231     TRACE_PRN_FN_EXT;
       
   232     return TMSRESULT(status);
       
   233     }
       
   234 
       
   235 // -----------------------------------------------------------------------------
       
   236 // TMSCallProxy::DeleteCall
       
   237 //
       
   238 // -----------------------------------------------------------------------------
       
   239 //
       
   240 EXPORT_C void TMSCallProxy::DeleteCall()
       
   241     {
       
   242     TRACE_PRN_FN_ENT;
       
   243     RSessionBase::SendReceive(TMS_DELETE_CALL);
       
   244     TRACE_PRN_FN_EXT;
       
   245     }
       
   246 
       
   247 // -----------------------------------------------------------------------------
       
   248 // TMSCallProxy::Close
       
   249 //
       
   250 // -----------------------------------------------------------------------------
       
   251 //
       
   252 EXPORT_C void TMSCallProxy::Close()
       
   253     {
       
   254     TRACE_PRN_FN_ENT;
       
   255     if (Handle() > 0)
       
   256         {
       
   257         RSessionBase::Close();
       
   258         }
       
   259 
       
   260     if (iTMSProxy)
       
   261         {
       
   262         iTMSProxy->Close();
       
   263         delete iTMSProxy;
       
   264         iTMSProxy = NULL;
       
   265         }
       
   266     TRACE_PRN_FN_EXT;
       
   267     }
       
   268 
       
   269 // -----------------------------------------------------------------------------
       
   270 // TMSCallProxy::BufferEmptied
       
   271 //
       
   272 // -----------------------------------------------------------------------------
       
   273 //
       
   274 EXPORT_C gint TMSCallProxy::BufferEmptied(TMSCallType callType,
       
   275         TMSStreamType strmType, gint strmId, TMSBuffer& /*buffer*/)
       
   276     {
       
   277     TRACE_PRN_FN_ENT;
       
   278     gint status(TMS_RESULT_SUCCESS);
       
   279     // For now we can use TMSCliSrvStreamOpDataStructBufPckg, there is
       
   280     // nothing that needs to be sent from the client side for buffer
       
   281     // emptied call
       
   282     TMSCliSrvDataXferDataStructBufPckg inPckg;
       
   283     inPckg().CallType = callType;
       
   284     inPckg().StreamType = strmType;
       
   285     inPckg().StreamId = strmId;
       
   286     status = RSessionBase::SendReceive(TMS_DATA_XFER_BUFFER_EMPTIED,
       
   287             TIpcArgs(&inPckg));
       
   288     
       
   289     TRACE_PRN_FN_EXT;
       
   290     return TMSRESULT(status);
       
   291     }
       
   292 
       
   293 // -----------------------------------------------------------------------------
       
   294 // TMSCallProxy::BufferFilled
       
   295 //
       
   296 // -----------------------------------------------------------------------------
       
   297 //
       
   298 EXPORT_C gint TMSCallProxy::BufferFilled(TMSCallType callType,
       
   299         TMSStreamType strmType, gint strmId, TMSBuffer& buffer)
       
   300     {
       
   301     TRACE_PRN_FN_ENT;
       
   302     gint status(TMS_RESULT_SUCCESS);
       
   303     // For now we can use TMSCliSrvStreamOpDataStructBufPckg, there is
       
   304     // nothing that needs to be sent from the client side for buffer
       
   305     // emptied call
       
   306     TMSCliSrvDataXferDataStructBufPckg inPckg;
       
   307     inPckg().CallType = callType;
       
   308     inPckg().StreamType = strmType;
       
   309     inPckg().StreamId = strmId;
       
   310     buffer.GetDataSize(inPckg().DataSize);
       
   311     status = RSessionBase::SendReceive(TMS_DATA_XFER_BUFFER_FILLED,
       
   312             TIpcArgs(&inPckg));
       
   313     TRACE_PRN_FN_EXT;
       
   314     return TMSRESULT(status);
       
   315     }
       
   316 
       
   317 // -----------------------------------------------------------------------------
       
   318 // TMSCallProxy::GetMaxVolume
       
   319 //
       
   320 // -----------------------------------------------------------------------------
       
   321 //
       
   322 EXPORT_C gint TMSCallProxy::GetMaxVolume(guint& aVol)
       
   323     {
       
   324     TRACE_PRN_FN_ENT;
       
   325     gint status(TMS_RESULT_SUCCESS);
       
   326     TPckgBuf<guint> pckg;
       
   327     TIpcArgs args(&pckg);
       
   328     status = SendReceive(TMS_EFFECT_VOLUME_GETMAX, args);
       
   329     if (status == TMS_RESULT_SUCCESS)
       
   330         {
       
   331         aVol = pckg();
       
   332         }
       
   333     TRACE_PRN_FN_EXT;
       
   334     return TMSRESULT(status);
       
   335     }
       
   336 
       
   337 // -----------------------------------------------------------------------------
       
   338 // TMSCallProxy::SetVolume
       
   339 //
       
   340 // -----------------------------------------------------------------------------
       
   341 //
       
   342 EXPORT_C gint TMSCallProxy::SetVolume(const guint aVol)
       
   343     {
       
   344     gint status(TMS_RESULT_SUCCESS);
       
   345     status = SendReceive(TMS_EFFECT_VOLUME_SET, TIpcArgs(aVol));
       
   346     return TMSRESULT(status);
       
   347     }
       
   348 
       
   349 // -----------------------------------------------------------------------------
       
   350 // TMSCallProxy::GetVolume
       
   351 //
       
   352 // -----------------------------------------------------------------------------
       
   353 //
       
   354 EXPORT_C gint TMSCallProxy::GetVolume(guint& aVol)
       
   355     {
       
   356     TRACE_PRN_FN_ENT;
       
   357     gint status(TMS_RESULT_SUCCESS);
       
   358     TPckgBuf<guint> pckg;
       
   359     TIpcArgs args(&pckg);
       
   360     status = SendReceive(TMS_EFFECT_VOLUME_GET, args);
       
   361     if (status == TMS_RESULT_SUCCESS)
       
   362         {
       
   363         aVol = pckg();
       
   364         }
       
   365     TRACE_PRN_FN_EXT;
       
   366     return TMSRESULT(status);
       
   367     }
       
   368 
       
   369 // -----------------------------------------------------------------------------
       
   370 // TMSCallProxy::GetMaxGain
       
   371 //
       
   372 // -----------------------------------------------------------------------------
       
   373 //
       
   374 EXPORT_C gint TMSCallProxy::GetMaxGain(guint& aGain)
       
   375     {
       
   376     TRACE_PRN_FN_ENT;
       
   377     gint status(TMS_RESULT_SUCCESS);
       
   378     TPckgBuf<guint> pckg;
       
   379     TIpcArgs args(&pckg);
       
   380     status = SendReceive(TMS_EFFECT_GAIN_GETMAX, args);
       
   381     if (status == TMS_RESULT_SUCCESS)
       
   382         {
       
   383         aGain = pckg();
       
   384         }
       
   385     TRACE_PRN_FN_EXT;
       
   386     return TMSRESULT(status);
       
   387     }
       
   388 
       
   389 // -----------------------------------------------------------------------------
       
   390 // TMSCallProxy::SetGain
       
   391 //
       
   392 // -----------------------------------------------------------------------------
       
   393 //
       
   394 EXPORT_C gint TMSCallProxy::SetGain(const guint aGain)
       
   395     {
       
   396     return SendReceive(TMS_EFFECT_GAIN_SET, TIpcArgs(aGain));
       
   397     }
       
   398 
       
   399 // -----------------------------------------------------------------------------
       
   400 // TMSCallProxy::GetGain
       
   401 //
       
   402 // -----------------------------------------------------------------------------
       
   403 //
       
   404 EXPORT_C gint TMSCallProxy::GetGain(guint& aGain)
       
   405     {
       
   406     TRACE_PRN_FN_ENT;
       
   407     gint status(TMS_RESULT_SUCCESS);
       
   408     TPckgBuf<guint> pckg;
       
   409     TIpcArgs args(&pckg);
       
   410     status = SendReceive(TMS_EFFECT_GAIN_GET, args);
       
   411     if (status == TMS_RESULT_SUCCESS)
       
   412         {
       
   413         aGain = pckg();
       
   414         }
       
   415     TRACE_PRN_FN_EXT;
       
   416     return TMSRESULT(status);
       
   417     }
       
   418 
       
   419 // -----------------------------------------------------------------------------
       
   420 // TMSCallProxy::GetSupportedBitRates
       
   421 //
       
   422 // -----------------------------------------------------------------------------
       
   423 //
       
   424 EXPORT_C gint TMSCallProxy::GetSupportedBitRates(BitRateVector& aVector)
       
   425     {
       
   426     TRAPD(status, GetSupportedBitRatesL(aVector));
       
   427     return TMSRESULT(status);
       
   428     }
       
   429 
       
   430 // -----------------------------------------------------------------------------
       
   431 // TMSCallProxy::GetSupportedBitRatesL
       
   432 //
       
   433 // -----------------------------------------------------------------------------
       
   434 //
       
   435 void TMSCallProxy::GetSupportedBitRatesL(BitRateVector& aVector)
       
   436     {
       
   437     TRACE_PRN_FN_ENT;
       
   438     gint status(TMS_RESULT_SUCCESS);
       
   439     guint brCount = 0;
       
   440     TPckgBuf<guint> pckg;
       
   441     TIpcArgs args(&pckg);
       
   442     status = SendReceive(TMS_FORMAT_GETSUPPORTEDBITRATESCOUNT, args);
       
   443 
       
   444     if (status == TMS_RESULT_SUCCESS)
       
   445         {
       
   446         brCount = pckg();
       
   447         }
       
   448     else
       
   449         {
       
   450         User::Leave(status);
       
   451         }
       
   452 
       
   453     TRACE_PRN_N1(_L("TMSCallProxy->BRCount [%d]"), brCount);
       
   454 
       
   455     if (brCount > 0 && status == TMS_RESULT_SUCCESS)
       
   456         {
       
   457         HBufC8* buf = HBufC8::NewLC(brCount * sizeof(TUint));
       
   458         TPtr8 ptr = buf->Des();
       
   459         TIpcArgs args1;
       
   460         args1.Set(0, &ptr);
       
   461         status = SendReceive(TMS_FORMAT_GETSUPPORTEDBITRATES, args1);
       
   462         if (status == TMS_RESULT_SUCCESS)
       
   463             {
       
   464             RDesReadStream stream(ptr);
       
   465             CleanupClosePushL(stream); // stream on cleanup
       
   466             //aArray.Reset();
       
   467 
       
   468             for (guint i = 0; i < brCount; i++)
       
   469                 {
       
   470                 //aArray.Append(stream.ReadUint32L());
       
   471                 aVector.push_back(stream.ReadUint32L());
       
   472                 }
       
   473 
       
   474             CleanupStack::PopAndDestroy(&stream);
       
   475             }
       
   476         else
       
   477             {
       
   478             CleanupStack::PopAndDestroy(buf);
       
   479             User::Leave(status);
       
   480             }
       
   481 
       
   482         CleanupStack::PopAndDestroy(buf);
       
   483         }
       
   484 
       
   485     TRACE_PRN_FN_EXT;
       
   486     }
       
   487 
       
   488 // -----------------------------------------------------------------------------
       
   489 // TMSCallProxy::SetBitRate
       
   490 //
       
   491 // -----------------------------------------------------------------------------
       
   492 //
       
   493 EXPORT_C gint TMSCallProxy::SetBitRate(const guint aBitrate)
       
   494     {
       
   495     gint status(TMS_RESULT_SUCCESS);
       
   496     status = SendReceive(TMS_FORMAT_SETBITRATE, TIpcArgs(aBitrate));
       
   497     return TMSRESULT(status);
       
   498     }
       
   499 
       
   500 // -----------------------------------------------------------------------------
       
   501 // TMSCallProxy::GetBitRate
       
   502 //
       
   503 // -----------------------------------------------------------------------------
       
   504 //
       
   505 EXPORT_C gint TMSCallProxy::GetBitRate(guint& aBitrate)
       
   506     {
       
   507     gint status(TMS_RESULT_SUCCESS);
       
   508     TPckgBuf<guint> pckg;
       
   509     TIpcArgs args(&pckg);
       
   510     status = SendReceive(TMS_FORMAT_GETBITRATE, args);
       
   511     if (status == TMS_RESULT_SUCCESS)
       
   512         {
       
   513         aBitrate = pckg();
       
   514         }
       
   515     return TMSRESULT(status);
       
   516     }
       
   517 
       
   518 // -----------------------------------------------------------------------------
       
   519 // TMSCallProxy::GetFormatCodecMode
       
   520 //
       
   521 // -----------------------------------------------------------------------------
       
   522 //
       
   523 EXPORT_C gint TMSCallProxy::GetFormatCodecMode(const TMSFormatType aFmtType,
       
   524         const TMSStreamType aStrmType, gint& aMode)
       
   525     {
       
   526     gint status(TMS_RESULT_SUCCESS);
       
   527     TPckgBuf<gint> pckg;
       
   528     TIpcArgs args(aFmtType, aStrmType, &pckg);
       
   529     status = SendReceive(TMS_FORMAT_GETCODECMODE, args);
       
   530     if (status == TMS_RESULT_SUCCESS)
       
   531         {
       
   532         aMode = pckg();
       
   533         }
       
   534     return TMSRESULT(status);
       
   535     }
       
   536 
       
   537 // -----------------------------------------------------------------------------
       
   538 // TMSCallProxy::
       
   539 //
       
   540 // -----------------------------------------------------------------------------
       
   541 //
       
   542 EXPORT_C gint TMSCallProxy::SetFormatCodecMode(const TMSFormatType aFmtType,
       
   543         const TMSStreamType aStrmType, gint aMode)
       
   544     {
       
   545     gint status(TMS_RESULT_SUCCESS);
       
   546     status = SendReceive(TMS_FORMAT_SETCODECMODE, TIpcArgs(aFmtType,
       
   547             aStrmType, aMode));
       
   548     return TMSRESULT(status);
       
   549     }
       
   550 
       
   551 // -----------------------------------------------------------------------------
       
   552 // TMSCallProxy::GetCNG
       
   553 //
       
   554 // -----------------------------------------------------------------------------
       
   555 //
       
   556 EXPORT_C gint TMSCallProxy::GetCNG(const TMSFormatType aFmtType,
       
   557         gboolean& aCng)
       
   558     {
       
   559     gint status(TMS_RESULT_SUCCESS);
       
   560     TPckgBuf<gboolean> pckg;
       
   561     TIpcArgs args(aFmtType, &pckg);
       
   562     status = SendReceive(TMS_FORMAT_GETCNG, args);
       
   563     if (status == TMS_RESULT_SUCCESS)
       
   564         {
       
   565         aCng = pckg();
       
   566         }
       
   567     return TMSRESULT(status);
       
   568     }
       
   569 
       
   570 // -----------------------------------------------------------------------------
       
   571 // TMSCallProxy::SetCNG
       
   572 //
       
   573 // -----------------------------------------------------------------------------
       
   574 //
       
   575 EXPORT_C gint TMSCallProxy::SetCNG(const TMSFormatType aFmtType,
       
   576         const gboolean aCng)
       
   577     {
       
   578     gint status(TMS_RESULT_SUCCESS);
       
   579     status = SendReceive(TMS_FORMAT_SETCNG, TIpcArgs(aFmtType, aCng));
       
   580     return TMSRESULT(status);
       
   581     }
       
   582 
       
   583 // -----------------------------------------------------------------------------
       
   584 // TMSCallProxy::GetPlc
       
   585 //
       
   586 // -----------------------------------------------------------------------------
       
   587 //
       
   588 EXPORT_C gint TMSCallProxy::GetPlc(const TMSFormatType aFmtType,
       
   589         gboolean& aPlc)
       
   590     {
       
   591     gint status(TMS_RESULT_SUCCESS);
       
   592     TPckgBuf<gboolean> pckg;
       
   593     TIpcArgs args(aFmtType, &pckg);
       
   594     status = SendReceive(TMS_FORMAT_GETPLC, args);
       
   595     if (status == TMS_RESULT_SUCCESS)
       
   596         {
       
   597         aPlc = pckg();
       
   598         }
       
   599     return TMSRESULT(status);
       
   600     }
       
   601 
       
   602 // -----------------------------------------------------------------------------
       
   603 // TMSCallProxy::SetPlc
       
   604 //
       
   605 // -----------------------------------------------------------------------------
       
   606 //
       
   607 EXPORT_C gint TMSCallProxy::SetPlc(const TMSFormatType aFmtType,
       
   608         const gboolean aPlc)
       
   609     {
       
   610     gint status(TMS_RESULT_SUCCESS);
       
   611     status = SendReceive(TMS_FORMAT_SETPLC, TIpcArgs(aFmtType, aPlc));
       
   612     return TMSRESULT(status);
       
   613 }
       
   614 
       
   615 // -----------------------------------------------------------------------------
       
   616 // TMSCallProxy::GetVADMode
       
   617 //
       
   618 // -----------------------------------------------------------------------------
       
   619 //
       
   620 EXPORT_C gint TMSCallProxy::GetVADMode(const TMSFormatType fmttype,
       
   621         gboolean& vad)
       
   622     {
       
   623     gint status(TMS_RESULT_SUCCESS);
       
   624     TPckgBuf<gboolean> pckg;
       
   625     TIpcArgs args(fmttype, &pckg);
       
   626     status = SendReceive(TMS_FORMAT_GETVAD, args);
       
   627     if (status == TMS_RESULT_SUCCESS)
       
   628         {
       
   629         vad = pckg();
       
   630         }
       
   631     return TMSRESULT(status);
       
   632     }
       
   633 
       
   634 // -----------------------------------------------------------------------------
       
   635 // TMSCallProxy::SetVADMode
       
   636 //
       
   637 // -----------------------------------------------------------------------------
       
   638 //
       
   639 EXPORT_C gint TMSCallProxy::SetVADMode(const TMSFormatType fmttype,
       
   640         const gboolean vad)
       
   641     {
       
   642     gint status(TMS_RESULT_SUCCESS);
       
   643     status = SendReceive(TMS_FORMAT_SETVAD, TIpcArgs(fmttype, vad));
       
   644     return TMSRESULT(status);
       
   645     }
       
   646 
       
   647 // -----------------------------------------------------------------------------
       
   648 // TMSCallProxy::GetDataXferChunkHandle
       
   649 //
       
   650 // -----------------------------------------------------------------------------
       
   651 //
       
   652 EXPORT_C gint TMSCallProxy::GetDataXferChunkHandle(TMSCallType callType,
       
   653         TMSStreamType strmType, gint strmId, guint32 key)
       
   654     {
       
   655     TRACE_PRN_FN_ENT;
       
   656     gint status(TMS_RESULT_SUCCESS);
       
   657     TMSCliSrvDataXferChunkHndlDataStructBufPckg inPckg;
       
   658     inPckg().CallType = callType;
       
   659     inPckg().StreamType = strmType;
       
   660     inPckg().StreamId = strmId;
       
   661     inPckg().Key = key;
       
   662     // We don't want to convert Symbain error to TMS error in this case.
       
   663     status = RSessionBase::SendReceive(TMS_DATA_XFER_BUFFER_GET_HNDL,
       
   664             TIpcArgs(&inPckg));
       
   665     TRACE_PRN_FN_EXT;
       
   666     return TMSRESULT(status);
       
   667     }
       
   668 
       
   669 // End of file