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