mmserv/tms/tmsimpl/src/tmsg711bodyimpl.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 "tmsg711bodyimpl.h"
       
    24 
       
    25 using namespace TMS;
       
    26 
       
    27 TMSG711FormatBodyImpl::TMSG711FormatBodyImpl()
       
    28     {
       
    29     iProxy = NULL;
       
    30     }
       
    31 
       
    32 TMSG711FormatBodyImpl::~TMSG711FormatBodyImpl()
       
    33     {
       
    34     TRACE_PRN_FN_ENT;
       
    35     TRACE_PRN_FN_EXT;
       
    36     }
       
    37 
       
    38 gint TMSG711FormatBodyImpl::Create(TMSG711FormatBody*& bodyimpl)
       
    39     {
       
    40     gint ret(TMS_RESULT_INSUFFICIENT_MEMORY);
       
    41     TMSG711FormatBodyImpl* self = new TMSG711FormatBodyImpl;
       
    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 TMSG711FormatBodyImpl::PostConstruct()
       
    56     {
       
    57     gint ret(TMS_RESULT_SUCCESS);
       
    58     ret = TMSFormatBodyImpl::PostConstruct(TMS_FORMAT_G711);
       
    59     return ret;
       
    60     }
       
    61 
       
    62 gint TMSG711FormatBodyImpl::SetMode(const TMSG711CodecMode mode)
       
    63     {
       
    64     gint ret(TMS_RESULT_UNINITIALIZED_OBJECT);
       
    65     if (iProxy)
       
    66         {
       
    67         ret = iProxy->SetFormatCodecMode(TMS_FORMAT_G711, iStreamType, mode);
       
    68         }
       
    69     return ret;
       
    70     }
       
    71 
       
    72 gint TMSG711FormatBodyImpl::GetMode(TMSG711CodecMode& mode)
       
    73     {
       
    74     gint ret(TMS_RESULT_UNINITIALIZED_OBJECT);
       
    75     if (iProxy)
       
    76         {
       
    77         ret = iProxy->GetFormatCodecMode(TMS_FORMAT_G711, iStreamType, mode);
       
    78         }
       
    79     return ret;
       
    80     }
       
    81 
       
    82 gint TMSG711FormatBodyImpl::SetCNG(const gboolean aCng)
       
    83     {
       
    84     gint ret(TMS_RESULT_UNINITIALIZED_OBJECT);
       
    85     if (iProxy)
       
    86         {
       
    87         ret = iProxy->SetCNG(TMS_FORMAT_G711, aCng);
       
    88         }
       
    89     return ret;
       
    90     }
       
    91 
       
    92 gint TMSG711FormatBodyImpl::GetCNG(gboolean& aCng)
       
    93     {
       
    94     gint ret(TMS_RESULT_UNINITIALIZED_OBJECT);
       
    95     if (iProxy)
       
    96         {
       
    97         ret = iProxy->GetCNG(TMS_FORMAT_G711, aCng);
       
    98         }
       
    99     return ret;
       
   100     }
       
   101 
       
   102 gint TMSG711FormatBodyImpl::SetPlc(const gboolean aPlc)
       
   103     {
       
   104     gint ret(TMS_RESULT_UNINITIALIZED_OBJECT);
       
   105     if (iProxy)
       
   106         {
       
   107         ret = iProxy->SetPlc(TMS_FORMAT_G711, aPlc);
       
   108         }
       
   109     return ret;
       
   110     }
       
   111 
       
   112 gint TMSG711FormatBodyImpl::GetPlc(gboolean& aPlc)
       
   113     {
       
   114     gint ret(TMS_RESULT_UNINITIALIZED_OBJECT);
       
   115     if (iProxy)
       
   116         {
       
   117         ret = iProxy->GetPlc(TMS_FORMAT_G711, aPlc);
       
   118         }
       
   119     return ret;
       
   120     }
       
   121 
       
   122 gint TMSG711FormatBodyImpl::SetVADMode(const gboolean aVad)
       
   123     {
       
   124     gint ret(TMS_RESULT_UNINITIALIZED_OBJECT);
       
   125     if (iProxy)
       
   126         {
       
   127         ret = iProxy->SetVADMode(TMS_FORMAT_G711, aVad);
       
   128         }
       
   129     return ret;
       
   130     }
       
   131 
       
   132 gint TMSG711FormatBodyImpl::GetVADMode(gboolean& aVad)
       
   133     {
       
   134     gint ret(TMS_RESULT_UNINITIALIZED_OBJECT);
       
   135     if (iProxy)
       
   136         {
       
   137         ret = iProxy->GetVADMode(TMS_FORMAT_G711, aVad);
       
   138         }
       
   139     return ret;
       
   140     }
       
   141 
       
   142 gint TMSG711FormatBodyImpl::GetType(TMSFormatType& fmttype)
       
   143     {
       
   144     gint ret(TMS_RESULT_SUCCESS);
       
   145     fmttype = TMS_FORMAT_G711;
       
   146     return ret;
       
   147     }
       
   148 
       
   149 void TMSG711FormatBodyImpl::SetProxy(TMSGlobalContext* context,
       
   150         gpointer queuehandler)
       
   151     {
       
   152     if (context && queuehandler)
       
   153         {
       
   154         iProxy = context->CallProxy;
       
   155         iStreamType = context->StreamType;
       
   156         TMSFormatBodyImpl::SetProxy(iProxy, queuehandler);
       
   157         ((CQueueHandler*) queuehandler)->AddObserver(*this, TMS_FORMAT_G711);
       
   158         }
       
   159     }
       
   160 
       
   161 void TMSG711FormatBodyImpl::QueueEvent(TInt aEventType, TInt /* aError*/,
       
   162         void* /*user_data*/)
       
   163     {
       
   164     switch (aEventType)
       
   165         {
       
   166         default:
       
   167             break;
       
   168         }
       
   169     }
       
   170 
       
   171 // End of file