mmserv/tms/tmsimpl/src/tmsg729bodyimpl.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 "tmsg729bodyimpl.h"
       
    24 
       
    25 using namespace TMS;
       
    26 
       
    27 TMSG729FormatBodyImpl::TMSG729FormatBodyImpl()
       
    28     {
       
    29     iProxy = NULL;
       
    30     }
       
    31 
       
    32 TMSG729FormatBodyImpl::~TMSG729FormatBodyImpl()
       
    33     {
       
    34     TRACE_PRN_FN_ENT;
       
    35     TRACE_PRN_FN_EXT;
       
    36     }
       
    37 
       
    38 gint TMSG729FormatBodyImpl::Create(TMSG729FormatBody*& bodyimpl)
       
    39     {
       
    40     gint ret(TMS_RESULT_INSUFFICIENT_MEMORY);
       
    41     TMSG729FormatBodyImpl* self = new TMSG729FormatBodyImpl;
       
    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 TMSG729FormatBodyImpl::PostConstruct()
       
    56     {
       
    57     gint ret(TMS_RESULT_SUCCESS);
       
    58     ret = TMSFormatBodyImpl::PostConstruct(TMS_FORMAT_G729);
       
    59     return ret;
       
    60     }
       
    61 
       
    62 gint TMSG729FormatBodyImpl::SetVADMode(const gboolean aVad)
       
    63     {
       
    64     gint ret(TMS_RESULT_UNINITIALIZED_OBJECT);
       
    65     if (iProxy)
       
    66         {
       
    67         ret = iProxy->SetVADMode(TMS_FORMAT_G729, aVad);
       
    68         }
       
    69     return ret;
       
    70     }
       
    71 
       
    72 gint TMSG729FormatBodyImpl::GetVADMode(gboolean& aVad)
       
    73     {
       
    74     gint ret(TMS_RESULT_UNINITIALIZED_OBJECT);
       
    75     if (iProxy)
       
    76         {
       
    77         ret = iProxy->GetVADMode(TMS_FORMAT_G729, aVad);
       
    78         }
       
    79     return ret;
       
    80     }
       
    81 
       
    82 gint TMSG729FormatBodyImpl::GetType(TMSFormatType& fmttype)
       
    83     {
       
    84     gint ret(TMS_RESULT_SUCCESS);
       
    85     fmttype = TMS_FORMAT_G729;
       
    86     return ret;
       
    87     }
       
    88 
       
    89 void TMSG729FormatBodyImpl::SetProxy(TMSGlobalContext* context,
       
    90         gpointer queuehandler)
       
    91     {
       
    92     if (context && queuehandler)
       
    93         {
       
    94         iProxy = context->CallProxy;
       
    95         iStreamType = context->StreamType;
       
    96         TMSFormatBodyImpl::SetProxy(iProxy, queuehandler);
       
    97         ((CQueueHandler*) queuehandler)->AddObserver(*this, TMS_FORMAT_G729);
       
    98         }
       
    99     }
       
   100 
       
   101 void TMSG729FormatBodyImpl::QueueEvent(TInt aEventType, TInt /*aError*/,
       
   102         void* /*user_data*/)
       
   103     {
       
   104     switch (aEventType)
       
   105         {
       
   106         default:
       
   107             break;
       
   108         }
       
   109     }
       
   110 
       
   111 // End of file