mmserv/tms/tmscallserver/inc/callipadpt.h
changeset 14 80975da52420
parent 12 5a06f39ad45b
child 16 43d09473c595
child 19 4a629bc82c5e
equal deleted inserted replaced
12:5a06f39ad45b 14:80975da52420
     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 #ifndef __CALLIPADAPT_H
       
    19 #define __CALLIPADAPT_H
       
    20 
       
    21 // INCLUDES
       
    22 #include <e32msgqueue.h>
       
    23 #include <mmcccodecinformation.h>
       
    24 #include "tmsclientserver.h"
       
    25 #include "tmsshared.h"
       
    26 #include "calladpt.h"
       
    27 #include "cpeaudiodtmftoneplayer.h"
       
    28 #include "dtmfnotifier.h"
       
    29 
       
    30 namespace TMS {
       
    31 
       
    32 // FORWARD DECLARATIONS
       
    33 class TMSIPDownlink;
       
    34 class TMSIPUplink;
       
    35 
       
    36 // TMSCallIPAdpt class
       
    37 class TMSCallIPAdpt : public TMSCallAdpt,
       
    38                       public TMSDTMFTonePlayerObserver
       
    39     {
       
    40 public:
       
    41     // Constractor
       
    42     static TMSCallIPAdpt* NewL();
       
    43 
       
    44     virtual ~TMSCallIPAdpt();
       
    45     virtual gint PostConstruct();
       
    46 
       
    47     virtual gint CreateStream(TMSCallType callType, TMSStreamType strmType,
       
    48             gint& outStrmId);
       
    49     virtual gint InitStreamL(TMSCallType callType, TMSStreamType strmType,
       
    50             gint strmId, TMSFormatType frmtType, const RMessage2& aMessage);
       
    51     virtual gint StartStream(TMSCallType callType, TMSStreamType strmType,
       
    52             gint strmId);
       
    53     virtual gint PauseStream(TMSCallType callType, TMSStreamType strmType,
       
    54             gint strmId);
       
    55     virtual gint StopStream(TMSCallType callType, TMSStreamType strmType,
       
    56             gint strmId);
       
    57     virtual gint DeinitStream(TMSCallType callType, TMSStreamType strmType,
       
    58             gint strmId);
       
    59     virtual gint DeleteStream(TMSCallType callType, TMSStreamType strmType,
       
    60             gint strmId);
       
    61     virtual gint DataXferBufferEmptied(TMSCallType callType,
       
    62             TMSStreamType strmType, gint strmId);
       
    63     virtual gint DataXferBufferFilled(TMSCallType callType,
       
    64             TMSStreamType strmType, gint strmId, guint datasize);
       
    65     virtual gint GetDataXferBufferHndl(const TMSCallType callType,
       
    66             const TMSStreamType strmType, const gint strmId,
       
    67             const guint32 key, RChunk& chunk);
       
    68 
       
    69     virtual gint GetMaxVolume(guint& volume);
       
    70     virtual gint SetVolume(const guint volume);
       
    71     virtual gint GetVolume(guint& volume);
       
    72     virtual gint GetMaxGain(guint& gain);
       
    73     virtual gint SetGain(const guint gain);
       
    74     virtual gint GetGain(guint& gain);
       
    75     virtual gint GetGlobalMaxVolume(guint& volume);
       
    76     virtual gint SetGlobalVolume(const guint volume);
       
    77     virtual gint GetGlobalVolume(guint& volume);
       
    78     virtual gint GetGlobalMaxGain(guint& gain);
       
    79     virtual gint SetGlobalGain(const guint gain);
       
    80     virtual gint GetGlobalGain(guint& gain);
       
    81 
       
    82     virtual gint GetCodecMode(const TMSFormatType fmttype,
       
    83             const TMSStreamType strmtype, gint& mode);
       
    84     virtual gint SetCodecMode(const TMSFormatType fmttype,
       
    85             const TMSStreamType strmtype, const gint mode);
       
    86     virtual gint GetSupportedBitRatesCount(guint& count);
       
    87     virtual gint GetSupportedBitRates(CBufFlat*& brbuffer);
       
    88     virtual gint GetBitRate(guint& bitrate);
       
    89     virtual gint SetBitRate(const guint bitrate);
       
    90     virtual gint GetVAD(const TMSFormatType fmttype, gboolean& vad);
       
    91     virtual gint SetVAD(const TMSFormatType fmttype, const gboolean vad);
       
    92     virtual gint GetCNG(const TMSFormatType fmttype, gboolean& cng);
       
    93     virtual gint SetCNG(const TMSFormatType fmttype, const gboolean cng);
       
    94     virtual gint GetPlc(const TMSFormatType fmttype, gboolean& plc);
       
    95     virtual gint SetPlc(const TMSFormatType fmttype, const gboolean plc);
       
    96 
       
    97     virtual gint SetOutput(TMSAudioOutput output);
       
    98     virtual gint GetOutput(TMSAudioOutput& output);
       
    99     virtual gint GetPreviousOutput(TMSAudioOutput& output);
       
   100     virtual gint GetAvailableOutputsL(TInt& count, CBufFlat*& outputsbuffer);
       
   101 
       
   102     virtual gint StartDTMF(TMSStreamType streamtype, TDes& dtmfstring);
       
   103     virtual gint StopDTMF(TMSStreamType streamtype);
       
   104     virtual gint ContinueDTMF(TBool continuesending);
       
   105 
       
   106     gint SetIlbcCodecMode(const gint mode, const TMSStreamType strmtype);
       
   107     gint GetIlbcCodecMode(gint& mode, const TMSStreamType strmtype);
       
   108     gint SetG711CodecMode(const gint mode, const TMSStreamType strmtype);
       
   109     gint GetG711CodecMode(gint& mode, const TMSStreamType strmtype);
       
   110     gint FrameModeRqrdForEC(gboolean& frmodereq);
       
   111     gint SetFrameMode(const gboolean frmode);
       
   112     gint GetFrameMode(gboolean& frmode);
       
   113     gint ConcealErrorForNextBuffer();
       
   114     gint BadLsfNextBuffer();
       
   115 
       
   116     gint OpenDownlinkL(const RMessage2& aMessage);
       
   117     gint OpenUplinkL(const RMessage2& aMessage);
       
   118     void SetFormat(const gint strmId, const TUint32 aFormat);
       
   119 
       
   120     void BufferFilledL(TUint dataSize);
       
   121     void BufferEmptiedL();
       
   122     gint GetDataXferChunkHndl(const TMSStreamType strmType,
       
   123             const TUint32 key, RChunk& chunk);
       
   124 
       
   125     //From DTMFTonePlayerObserver
       
   126      void DTMFInitCompleted(TInt error);
       
   127      void DTMFToneFinished(TInt error);
       
   128 
       
   129 private:
       
   130     void ConstructL();
       
   131     TMSCallIPAdpt();
       
   132 
       
   133     void NotifyClient(const gint strmId, const TInt aCommand,
       
   134             const TInt aStatus = KErrNone, const TInt64 aInt64 = TInt64(0));
       
   135     //void DetermineG711FrameRateL(); //G711 10/20ms
       
   136     void GetSupportedBitRatesL(CBufFlat*& brbuffer);
       
   137 
       
   138 private:
       
   139     gint iNextStreamId;
       
   140     gboolean iUplinkInitialized;
       
   141     gint iUplinkStreamId;
       
   142     gboolean iDnlinkInitialized;
       
   143     gint iDnlinkStreamId;
       
   144 
       
   145     TMSIPDownlink* iIPDownlink;
       
   146     TMSIPUplink* iIPUplink;
       
   147 
       
   148     // Message queues for communication and data transfer back to the client
       
   149     RMsgQueue<TmsMsgBuf> iMsgQueueUp;
       
   150     RMsgQueue<TmsMsgBuf> iMsgQueueDn;
       
   151 
       
   152     TmsMsgBuf iMsgBuffer;
       
   153     TMMFPrioritySettings iPriority;
       
   154     TUint32 iUpFourCC;
       
   155     TUint32 iDnFourCC;
       
   156     TInt iMaxVolume;
       
   157     TInt iMaxGain;
       
   158     RArray<TUint> iArrBitrates;
       
   159     RArray<TFourCC> iCodecs;
       
   160     TInt iCodecsCount;
       
   161 
       
   162     TMSAudioDtmfTonePlayer* iDTMFDnlinkPlayer;
       
   163     TMSAudioDtmfTonePlayer* iDTMFUplinkPlayer;
       
   164     TMSDtmfNotifier* iDTMFNotifier;
       
   165     };
       
   166 
       
   167 } //namespace TMS
       
   168 
       
   169 #endif //__CALLIPADAPT_H
       
   170 
       
   171 // End of file