mmserv/voipaudioservices/VoIPIntfc/inc/VoIPUplinkStreamImpl.h
changeset 55 e267340986c9
parent 0 71ca22bcf22a
equal deleted inserted replaced
52:4ce423f34688 55:e267340986c9
     1 /*
     1 /*
     2 * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
     2  * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3  * All rights reserved.
     4 * This component and the accompanying materials are made available
     4  * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5  * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6  * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     8  *
     9 * Initial Contributors:
     9  * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10  * Nokia Corporation - initial contribution.
    11 *
    11  *
    12 * Contributors:
    12  * Contributors:
    13 *
    13  *
    14 * Description:  VOIP Audio Services
    14  * Description:  VOIP Audio Services
    15 *
    15  *
    16 */
    16  */
    17 
    17 
    18 
    18 #ifndef VOIPUPLINKSTREAMIMPL_H
    19 #ifndef __VOIPUPLINKSTREAMIMPL_H
    19 #define VOIPUPLINKSTREAMIMPL_H
    20 #define __VOIPUPLINKSTREAMIMPL_H
       
    21 
    20 
    22 // INCLUDES
    21 // INCLUDES
    23 #include <voipformatintfc.h>
    22 #include <voipformatintfc.h>
    24 #include <voipuplinkstream.h>
    23 #include <voipuplinkstream.h>
    25 #include "VoIPAudioSession.h"
    24 #include "VoIPAudioSession.h"
    26 #include "VoIPQueueHandler.h"
    25 #include "VoIPQueueHandler.h"
    27 
    26 
    28 
       
    29 /**
    27 /**
    30  *  CVoIPAudioUplinkStreamImpl class
    28  *  CVoIPAudioUplinkStreamImpl class
    31  *
    29  *
    32  *  ?more_complete_description
       
    33  *
       
    34  *  @lib VoIPAudioIntfc.dll
    30  *  @lib VoIPAudioIntfc.dll
    35  *  @since S60 v5.0
       
    36  */
    31  */
    37 NONSHARABLE_CLASS(CVoIPAudioUplinkStreamImpl) : public CBase,
    32 NONSHARABLE_CLASS(CVoIPAudioUplinkStreamImpl) : public CBase,
    38                                                 public CVoIPAudioUplinkStream,
    33         public CVoIPAudioUplinkStream,
    39                                                 public MQueueHandlerObserver,
    34         public MQueueHandlerObserver
    40                                                 public MVoIPFormatObserver
       
    41     {
    35     {
       
    36 protected:
    42     enum TQueueType
    37     enum TQueueType
    43         {
    38         {
    44         EMsgBufQueue,
    39         EMsgBufQueue,
    45         EMsgComQueue
    40         EMsgComQueue
    46         };
    41         };
    48 public:
    43 public:
    49 
    44 
    50     /**
    45     /**
    51      * 2-phased constructor
    46      * 2-phased constructor
    52      *
    47      *
    53      * @since S60 v5.0
       
    54      * @param none
    48      * @param none
    55      * @return CVoIPAudioUplinkStreamImpl*
    49      * @return CVoIPAudioUplinkStreamImpl*
    56      */
    50      */
    57     static CVoIPAudioUplinkStreamImpl* NewL(
    51     static CVoIPAudioUplinkStreamImpl* NewL(
    58                 const TMMFPrioritySettings aPriority);
    52             const TMMFPrioritySettings aPriority);
    59 
    53 
    60     /**
    54     /**
    61      * Destructor
    55      * Destructor
    62      *
    56      *
    63      * @since S60 v5.0
       
    64      * @param none
    57      * @param none
    65      * @return none
    58      * @return none
    66      */
    59      */
    67     virtual ~CVoIPAudioUplinkStreamImpl();
    60     virtual ~CVoIPAudioUplinkStreamImpl();
    68 
    61 
    69     /**
    62     /**
    70      * ?description
    63      * ?description
    71      *
    64      *
    72      * @since S60 v5.0
       
    73      * @param MVoIPUplinkObserver&
    65      * @param MVoIPUplinkObserver&
    74      * @return TInt
    66      * @return TInt
    75      */
    67      */
    76     TInt Open(MVoIPUplinkObserver& aObserver);
    68     TInt Open(MVoIPUplinkObserver& aObserver);
    77 
    69 
    78     /**
    70     /**
    79      * ?description
    71      * ?description
    80      *
    72      *
    81      * @since S60 v5.0
       
    82      * @param TVersion&
    73      * @param TVersion&
    83      * @return TInt
    74      * @return TInt
    84      */
    75      */
    85     TInt GetVersion(TVersion& aVersion);
    76     TInt GetVersion(TVersion& aVersion);
    86 
    77 
    87     /**
    78     /**
    88      * ?description
    79      * ?description
    89      *
    80      *
    90      * @since S60 v5.0
       
    91      * @param TInt&
    81      * @param TInt&
    92      * @return TInt
    82      * @return TInt
    93      */
    83      */
    94     TInt GetMaxGain(TInt& aGain);
    84     TInt GetMaxGain(TInt& aGain);
    95 
    85 
    96     /**
    86     /**
    97      * ?description
    87      * ?description
    98      *
    88      *
    99      * @since S60 v5.0
       
   100      * @param TInt
    89      * @param TInt
   101      * @return TInt
    90      * @return TInt
   102      */
    91      */
   103     TInt SetGain(TInt aGain);
    92     TInt SetGain(TInt aGain);
   104 
    93 
   105     /**
    94     /**
   106      * ?description
    95      * ?description
   107      *
    96      *
   108      * @since S60 v5.0
       
   109      * @param TInt&
    97      * @param TInt&
   110      * @return TInt
    98      * @return TInt
   111      */
    99      */
   112     TInt GetGain(TInt& aGain);
   100     TInt GetGain(TInt& aGain);
   113 
   101 
   114     /**
   102     /**
   115      * ?description
   103      * ?description
   116      *
   104      *
   117      * @since S60 v5.0
       
   118      * @param const TMMFPrioritySettings
   105      * @param const TMMFPrioritySettings
   119      * @param RArray<TVoIPCodecFormat>&
   106      * @param RArray<TVoIPCodecFormat>&
   120      * @return void
   107      * @return void
   121      */
   108      */
   122     void GetSupportedFormatsL(const TMMFPrioritySettings aPriority,
   109     void GetSupportedFormatsL(const TMMFPrioritySettings aPriority,
   123                               RArray<TVoIPCodecFormat>& aFormats);
   110             RArray<TVoIPCodecFormat>& aFormats);
   124 
   111 
   125     /**
   112     /**
   126      * ?description
   113      * ?description
   127      *
   114      *
   128      * @since S60 v5.0
       
   129      * @param TVoIPCodecFormat
   115      * @param TVoIPCodecFormat
   130      * @param CVoIPFormatIntfc&
   116      * @param CVoIPFormatIntfc&
   131      * @return void
   117      * @return void
   132      */
   118      */
   133     void SetFormatL(TVoIPCodecFormat aFormat, CVoIPFormatIntfc*& aIntfc);
   119     void SetFormatL(TVoIPCodecFormat aFormat, CVoIPFormatIntfc*& aIntfc);
   134 
   120 
   135     /**
   121     /**
   136      * ?description
   122      * ?description
   137      *
   123      *
   138      * @since S60 v5.0
       
   139      * @param none
       
   140      * @return TVoIPCodecFormat
       
   141      */
       
   142     TVoIPCodecFormat GetFormat();
       
   143 
       
   144     /**
       
   145      * ?description
       
   146      *
       
   147      * @since S60 v5.0
       
   148      * @param none
   124      * @param none
   149      * @return TInt
   125      * @return TInt
   150      */
   126      */
   151     TInt Start();
   127     TInt Start();
   152 
   128 
   153     /**
   129     /**
   154      * ?description
   130      * ?description
   155      *
   131      *
   156      * @since S60 v5.0
       
   157      * @param none
   132      * @param none
   158      * @return TInt
   133      * @return TInt
   159      */
   134      */
   160     TInt Stop();
   135     TInt Stop();
   161 
   136 
   162     /**
   137     /**
   163      * ?description
   138      * ?description
   164      *
   139      *
   165      * @since S60 v5.0
       
   166      * @param none
   140      * @param none
   167      * @return void
   141      * @return void
   168      */
   142      */
   169     void Close();
   143     void Close();
   170 
   144 
   171     /**
   145     /**
   172      * ?description
   146      * ?description
   173      *
   147      *
   174      * @since S60 v5.0
       
   175      * @param CVoIPDataBuffer*
   148      * @param CVoIPDataBuffer*
   176      * @return TInt
   149      * @return TInt
   177      */
   150      */
   178     TInt BufferEmptied(CVoIPDataBuffer* aBuffer);
   151     TInt BufferEmptied(CVoIPDataBuffer* aBuffer);
   179 
   152 
   180     /**
   153     /**
   181      * ?description
   154      * ?description
   182      *
   155      *
   183      * @since S60 v5.0
       
   184      * @param none
   156      * @param none
   185      * @return RVoIPAudioSession*
   157      * @return RVoIPAudioSession*
   186      */
   158      */
   187     RVoIPAudioSession* GetSession();
   159     RVoIPAudioSession* GetSession();
   188 
   160 
   189 
   161     // From MQueueHandlerObserver
   190 // From MQueueHandlerObserver
   162 
   191 
   163     /**
   192     /**
   164      * ?description
   193      * ?description
   165      *
   194      *
       
   195      * @since S60 v5.0
       
   196      * @param CVoIPDataBuffer*
   166      * @param CVoIPDataBuffer*
   197      * @return void
   167      * @return void
   198      */
   168      */
   199     virtual void FillBuffer(CVoIPDataBuffer* /*aBuffer*/) {};
   169     virtual void FillBuffer(CVoIPDataBuffer* /*aBuffer*/) {};
   200 
   170 
   201     /**
   171     /**
   202      * ?description
   172      * ?description
   203      *
   173      *
   204      * @since S60 v5.0
       
   205      * @param CVoIPDataBuffer*
   174      * @param CVoIPDataBuffer*
   206      * @return void
   175      * @return void
   207      */
   176      */
   208     virtual void EmptyBuffer(CVoIPDataBuffer* aBuffer);
   177     virtual void EmptyBuffer(CVoIPDataBuffer* aBuffer);
   209 
   178 
   210     /**
   179     /**
   211      * ?description
   180      * ?description
   212      *
   181      *
   213      * @since S60 v5.0
       
   214      * @param aEventType
   182      * @param aEventType
   215      * @param TInt
   183      * @param TInt
   216      * @return void
   184      * @return void
   217      */
   185      */
   218     virtual void Event(TInt aEventType, TInt aError);
   186     virtual void Event(TInt aEventType, TInt aError);
   219 
   187 
   220 // From MVoIPFormatObserver
       
   221 
       
   222     /**
       
   223      * ?description
       
   224      *
       
   225      * @since S60 v5.0
       
   226      * @param CVoIPFormatIntfc&
       
   227      * @param TInt
       
   228      * @return void
       
   229      */
       
   230     virtual void Event(const CVoIPFormatIntfc& aSrc, TInt aEventType);
       
   231 
       
   232 private:
   188 private:
   233 
   189 
   234     /**
   190     /**
   235      * Constructor
   191      * Constructor
   236      *
   192      *
   237      * @since S60 v5.0
       
   238      * @param none
   193      * @param none
   239      * @return none
   194      * @return none
   240      */
   195      */
   241     CVoIPAudioUplinkStreamImpl();
   196     CVoIPAudioUplinkStreamImpl();
   242 
   197 
   243     /**
   198     /**
   244      * Symbian constructor
   199      * Symbian constructor
   245      *
   200      *
   246      * @since S60 v5.0
       
   247      * @param none
   201      * @param none
   248      * @return void
   202      * @return void
   249      */
   203      */
   250     void ConstructL(const TMMFPrioritySettings aPriority);
   204     void ConstructL(const TMMFPrioritySettings aPriority);
   251 
   205 
   252     /**
   206     /**
   253      * ?description
   207      * ?description
   254      *
   208      *
   255      * @since S60 v5.0
       
   256      * @param TDesC&
   209      * @param TDesC&
   257      * @param TInt
   210      * @param TInt
   258      * @param TQueueType
   211      * @param TQueueType
   259      * @return TInt
   212      * @return TInt
   260      */
   213      */
   261     TInt CreateQueue(const TDesC& aQueueName,
   214     TInt CreateQueue(const TDesC& aQueueName, const TInt aNumSlots,
   262                      const TInt aNumSlots,
   215             const TQueueType aQueueType);
   263                      const TQueueType aQueueType);
   216 
   264 
   217     /**
   265     /**
   218      * ?description
   266      * ?description
   219      *
   267      *
       
   268      * @since S60 v5.0
       
   269      * @param none
   220      * @param none
   270      * @return void
   221      * @return void
   271      */
   222      */
   272     void ReceiveMsgQHandlerEventsL();
   223     void ReceiveMsgQHandlerEventsL();
   273 
   224 
   274     /**
   225     /**
   275      * ?description
   226      * ?description
   276      *
   227      *
   277      * @since S60 v5.0
       
   278      * @param none
   228      * @param none
   279      * @return void
   229      * @return void
   280      */
   230      */
   281     void ReceiveMsgQComHandlerEventsL();
   231     void ReceiveMsgQComHandlerEventsL();
   282 
   232 
   283     /**
   233     /**
   284      * ?description
   234      * ?description
   285      *
   235      *
   286      * @since S60 v5.0
       
   287      * @param TVoIPCodecFormat
   236      * @param TVoIPCodecFormat
   288      * @return TFourCC
   237      * @return TFourCC
   289      */
   238      */
   290     TUint32 CodecFourCC(TVoIPCodecFormat aFormat);
   239     TUint32 CodecFourCC(TVoIPCodecFormat aFormat);
   291 
   240 
   292     /**
   241     /**
   293      * ?description
   242      * ?description
   294      *
   243      *
   295      * @since S60 v5.0
       
   296      * @param TUint32
   244      * @param TUint32
   297      * @return TVoIPCodecFormat
   245      * @return TVoIPCodecFormat
   298      */
   246      */
   299     TVoIPCodecFormat ConvertFourCC(TUint32 aCodec);
   247     TVoIPCodecFormat ConvertFourCC(TUint32 aCodec);
   300 
   248 
   301     /**
   249     /**
   302      * ?description
   250      * ?description
   303      *
   251      *
   304      * @since S60 v5.0
       
   305      * @param TVoIPCodecFormat
   252      * @param TVoIPCodecFormat
   306      * @return TBool
   253      * @return TBool
   307      */
   254      */
   308     TBool IsCodecSupportedL(TVoIPCodecFormat aFormat);
   255     TBool IsCodecSupportedL(TVoIPCodecFormat aFormat);
   309 
   256 
   310     /**
   257     /**
   311      * ?description
   258      * ?description
   312      *
   259      *
   313      * @since S60 v5.0
       
   314      * @param TVoIPCodecFormat
   260      * @param TVoIPCodecFormat
   315      * @return TBool
   261      * @return TBool
   316      */
   262      */
   317     TBool FindFormat(TVoIPCodecFormat aFormat);
   263     TBool FindFormat(TVoIPCodecFormat aFormat);
   318 
   264 
   319 private:
   265 private:
   320 
   266 
   321 // Client side VoIP server session
   267     // Client side VoIP server session
   322     RVoIPAudioSession         iVoIPAudioSession;
   268     RVoIPAudioSession iVoIPAudioSession;
   323 
   269 
   324     MVoIPUplinkObserver*      iObserver;
   270     MVoIPUplinkObserver* iObserver;
   325 
   271 
   326 // Message queues
   272     // Message queues
   327     RMsgQueue<TVoIPMsgBuf>    iMsgQueue;
   273     RMsgQueue<TVoIPMsgBuf> iMsgQueue;
   328     RMsgQueue<TVoIPMsgBuf>    iMsgComQueue;
   274     RMsgQueue<TVoIPMsgBuf> iMsgComQueue;
   329 
   275 
   330 // Message queue handlers
   276     // Message queue handlers
   331     CQueueHandler*            iMsgQHandler;
   277     CQueueHandler* iMsgQHandler;
   332     CQueueHandler*            iMsgQComHandler;
   278     CQueueHandler* iMsgQComHandler;
   333 
   279 
   334     TMMFPrioritySettings      iPriority;
   280     TMMFPrioritySettings iPriority;
   335     TPtr8                     iBufferPtr;
   281     TPtr8 iBufferPtr;
   336     TInt                      iBufferLen;
   282     TInt iBufferLen;
   337     TInt                      iG711FrameSize;
   283     TInt iG711FrameSize;
   338     TBool                     iIsClosing;
   284     TBool iIsClosing;
   339 
   285 
   340     TVoIPCodecFormat          iFormat;
   286     TVoIPCodecFormat iFormat;
   341     RArray<TVoIPCodecFormat>* iCodecFormats;
   287     RArray<TVoIPCodecFormat> iCodecFormats;
   342 
       
   343     };
   288     };
   344 
   289 
   345 #endif //__VOIPUPLINKSTREAMIMPL_H
   290 #endif //VOIPUPLINKSTREAMIMPL_H
   346 
   291 
   347 // End of file
   292 // End of file