mmserv/tms/tmsimpl/src/tmsilbcbodyimpl.cpp
changeset 0 71ca22bcf22a
child 3 4f62049db6ac
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 <tms.h>
       
    19 #include "tmscallproxy.h"
       
    20 #include "tmsqueuehandler.h"
       
    21 #include "tmsutility.h"
       
    22 #include "tmsglobalcontext.h"
       
    23 #include "tmsilbcbodyimpl.h"
       
    24 
       
    25 using namespace TMS;
       
    26 
       
    27 TMSILBCFormatBodyImpl::TMSILBCFormatBodyImpl()
       
    28     {
       
    29     iProxy = NULL;
       
    30     }
       
    31 
       
    32 TMSILBCFormatBodyImpl::~TMSILBCFormatBodyImpl()
       
    33     {
       
    34     TRACE_PRN_FN_ENT;
       
    35     TRACE_PRN_FN_EXT;
       
    36     }
       
    37 
       
    38 gint TMSILBCFormatBodyImpl::Create(TMSILBCFormatBody*& bodyimpl)
       
    39     {
       
    40     gint ret(TMS_RESULT_INSUFFICIENT_MEMORY);
       
    41     TMSILBCFormatBodyImpl* self = new TMSILBCFormatBodyImpl;
       
    42     if (self)
       
    43         {
       
    44         ret = self->PostConstruct();
       
    45         if (ret != TMS_RESULT_SUCCESS)
       
    46             {
       
    47             delete self;
       
    48             self = NULL;
       
    49             }
       
    50         }
       
    51     bodyimpl = self;
       
    52     return ret;
       
    53     }
       
    54 
       
    55 gint TMSILBCFormatBodyImpl::PostConstruct()
       
    56     {
       
    57     gint ret(TMS_RESULT_SUCCESS);
       
    58     ret = TMSFormatBodyImpl::PostConstruct(TMS_FORMAT_ILBC);
       
    59     return ret;
       
    60     }
       
    61 
       
    62 gint TMSILBCFormatBodyImpl::SetMode(const TMSILBCCodecMode aMode)
       
    63     {
       
    64     gint ret(TMS_RESULT_UNINITIALIZED_OBJECT);
       
    65     if (iProxy)
       
    66         {
       
    67         ret = iProxy->SetFormatCodecMode(TMS_FORMAT_ILBC, iStreamType, aMode);
       
    68         }
       
    69     return ret;
       
    70     }
       
    71 
       
    72 gint TMSILBCFormatBodyImpl::GetMode(TMSILBCCodecMode& aMode)
       
    73     {
       
    74     gint ret(TMS_RESULT_UNINITIALIZED_OBJECT);
       
    75     if (iProxy)
       
    76         {
       
    77         ret = iProxy->GetFormatCodecMode(TMS_FORMAT_ILBC, iStreamType, aMode);
       
    78         }
       
    79     return ret;
       
    80     }
       
    81 
       
    82 gint TMSILBCFormatBodyImpl::SetCNG(const gboolean aCng)
       
    83     {
       
    84     gint ret(TMS_RESULT_UNINITIALIZED_OBJECT);
       
    85     if (iProxy)
       
    86         {
       
    87         ret = iProxy->SetCNG(TMS_FORMAT_ILBC, aCng);
       
    88         }
       
    89     return ret;
       
    90     }
       
    91 
       
    92 gint TMSILBCFormatBodyImpl::GetCNG(gboolean& aCng)
       
    93     {
       
    94     gint ret(TMS_RESULT_UNINITIALIZED_OBJECT);
       
    95     if (iProxy)
       
    96         {
       
    97         ret = iProxy->GetCNG(TMS_FORMAT_ILBC, aCng);
       
    98         }
       
    99     return ret;
       
   100     }
       
   101 
       
   102 gint TMSILBCFormatBodyImpl::SetVADMode(const gboolean aVad)
       
   103     {
       
   104     gint ret(TMS_RESULT_UNINITIALIZED_OBJECT);
       
   105     if (iProxy)
       
   106         {
       
   107         ret = iProxy->SetVADMode(TMS_FORMAT_ILBC, aVad);
       
   108         }
       
   109     return ret;
       
   110     }
       
   111 
       
   112 gint TMSILBCFormatBodyImpl::GetVADMode(gboolean& aVad)
       
   113     {
       
   114     gint ret(TMS_RESULT_UNINITIALIZED_OBJECT);
       
   115     if (iProxy)
       
   116         {
       
   117         ret = iProxy->GetVADMode(TMS_FORMAT_ILBC, aVad);
       
   118         }
       
   119     return ret;
       
   120     }
       
   121 
       
   122 gint TMSILBCFormatBodyImpl::GetType(TMSFormatType& fmttype)
       
   123     {
       
   124     gint ret(TMS_RESULT_SUCCESS);
       
   125     fmttype = TMS_FORMAT_ILBC;
       
   126     return ret;
       
   127     }
       
   128 
       
   129 void TMSILBCFormatBodyImpl::SetProxy(TMSGlobalContext* context,
       
   130         gpointer queuehandler)
       
   131     {
       
   132     if (context && queuehandler)
       
   133         {
       
   134         iProxy = context->CallProxy;
       
   135         iStreamType = context->StreamType;
       
   136         TMSFormatBodyImpl::SetProxy(iProxy, queuehandler);
       
   137         ((CQueueHandler*) queuehandler)->AddObserver(*this, TMS_FORMAT_ILBC);
       
   138         }
       
   139     }
       
   140 
       
   141 void TMSILBCFormatBodyImpl::QueueEvent(TInt aEventType, TInt /*aError*/,
       
   142         void* /*user_data*/)
       
   143     {
       
   144     switch (aEventType)
       
   145         {
       
   146         default:
       
   147             break;
       
   148         }
       
   149     }
       
   150 
       
   151 // End of file