mmserv/voipaudioservices/VoIPIntfc/inc/VoIPDownlinkStreamImpl.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 VOIPDOWNLINKSTREAMIMPL_H
    19 #ifndef __VOIPDOWNLINKSTREAMIMPL_H
    19 #define VOIPDOWNLINKSTREAMIMPL_H
    20 #define __VOIPDOWNLINKSTREAMIMPL_H
       
    21 
       
    22 
    20 
    23 // INCLUDES
    21 // INCLUDES
    24 #include <voipdownlinkstream.h>
    22 #include <voipdownlinkstream.h>
    25 #include "VoIPAudioSession.h"
    23 #include "VoIPAudioSession.h"
    26 #include "VoIPDtmfTonePlayerImpl.h"
    24 #include "VoIPDtmfTonePlayerImpl.h"
    27 #include "VoIPQueueHandler.h"
    25 #include "VoIPQueueHandler.h"
    28 
    26 
    29 
       
    30 /**
    27 /**
    31  *  CVoIPAudioDownlinkStreamImpl class
    28  *  CVoIPAudioDownlinkStreamImpl class
    32  *
    29  *
    33  *  ?more_complete_description
       
    34  *
       
    35  *  @lib VoIPAudioIntfc.dll
    30  *  @lib VoIPAudioIntfc.dll
    36  *  @since S60 v5.0
       
    37  */
    31  */
    38 NONSHARABLE_CLASS(CVoIPAudioDownlinkStreamImpl) :
    32 NONSHARABLE_CLASS(CVoIPAudioDownlinkStreamImpl) : public CBase,
    39                     public CBase,
    33         public CVoIPAudioDownlinkStream,
    40                     public CVoIPAudioDownlinkStream,
    34         public MQueueHandlerObserver
    41                     public MQueueHandlerObserver
       
    42     {
    35     {
    43     enum TQueueType
    36     enum TQueueType
    44         {
    37         {
    45         EMsgBufQueue,
    38         EMsgBufQueue,
    46         EMsgComQueue
    39         EMsgComQueue
    49 public:
    42 public:
    50 
    43 
    51     /**
    44     /**
    52      * 2-phased constructor
    45      * 2-phased constructor
    53      *
    46      *
    54      * @since S60 v5.0
    47      *
    55      * @param none
    48      * @param none
    56      * @return none
    49      * @return none
    57      */
    50      */
    58     static CVoIPAudioDownlinkStreamImpl* NewL(
    51     static CVoIPAudioDownlinkStreamImpl* NewL(
    59                     const TMMFPrioritySettings aPriority);
    52             const TMMFPrioritySettings aPriority);
    60 
    53 
    61     /**
    54     /**
    62      * Destructor
    55      * Destructor
    63      *
    56      *
    64      * @since S60 v5.0
       
    65      * @param none
    57      * @param none
    66      * @return none
    58      * @return none
    67      */
    59      */
    68     virtual ~CVoIPAudioDownlinkStreamImpl();
    60     virtual ~CVoIPAudioDownlinkStreamImpl();
    69 
    61 
    70     /**
    62     /**
    71      * ?description
    63      * ?description
    72      *
    64      *
    73      * @since S60 v5.0
       
    74      * @param MVoIPDownlinkObserver&
    65      * @param MVoIPDownlinkObserver&
    75      * @return TInt
    66      * @return TInt
    76      */
    67      */
    77     TInt Open(MVoIPDownlinkObserver& aObserver);
    68     TInt Open(MVoIPDownlinkObserver& aObserver);
    78 
    69 
    79     /**
    70     /**
    80      * ?description
    71      * ?description
    81      *
    72      *
    82      * @since S60 v5.0
       
    83      * @param TVersion&
    73      * @param TVersion&
    84      * @return TInt
    74      * @return TInt
    85      */
    75      */
    86     TInt GetVersion(TVersion& aVersion);
    76     TInt GetVersion(TVersion& aVersion);
    87 
    77 
    88     /**
    78     /**
    89      * ?description
    79      * ?description
    90      *
    80      *
    91      * @since S60 v5.0
       
    92      * @param TInt&
    81      * @param TInt&
    93      * @return TInt
    82      * @return TInt
    94      */
    83      */
    95     TInt GetMaxVolume(TInt& aVolume);
    84     TInt GetMaxVolume(TInt& aVolume);
    96 
    85 
    97     /**
    86     /**
    98      * ?description
    87      * ?description
    99      *
    88      *
   100      * @since S60 v5.0
       
   101      * @param TInt
    89      * @param TInt
   102      * @return TInt
    90      * @return TInt
   103      */
    91      */
   104     TInt SetVolume(TInt aVolume);
    92     TInt SetVolume(TInt aVolume);
   105 
    93 
   106     /**
    94     /**
   107      * ?description
    95      * ?description
   108      *
    96      *
   109      * @since S60 v5.0
       
   110      * @param TInt&
    97      * @param TInt&
   111      * @return TInt
    98      * @return TInt
   112      */
    99      */
   113     TInt GetVolume(TInt& aVolume);
   100     TInt GetVolume(TInt& aVolume);
   114 
   101 
   115     /**
   102     /**
   116      * ?description
   103      * ?description
   117      *
   104      *
   118      * @since S60 v5.0
       
   119      * @param const TMMFPrioritySettings
   105      * @param const TMMFPrioritySettings
   120      * @param RArray<TVoIPCodecFormat>&
   106      * @param RArray<TVoIPCodecFormat>&
   121      * @return void
   107      * @return void
   122      */
   108      */
   123     void GetSupportedFormatsL(const TMMFPrioritySettings aPriority,
   109     void GetSupportedFormatsL(const TMMFPrioritySettings aPriority,
   124                               RArray<TVoIPCodecFormat>& aFormats);
   110             RArray<TVoIPCodecFormat>& aFormats);
   125 
   111 
   126     /**
   112     /**
   127      * ?description
   113      * ?description
   128      *
   114      *
   129      * @since S60 v5.0
       
   130      * @param TVoIPCodecFormat
   115      * @param TVoIPCodecFormat
   131      * @param CVoIPFormatIntfc&
   116      * @param CVoIPFormatIntfc&
   132      * @return void
   117      * @return void
   133      */
   118      */
   134     void SetFormatL(TVoIPCodecFormat aFormat, CVoIPFormatIntfc*& aIntfc);
   119     void SetFormatL(TVoIPCodecFormat aFormat, CVoIPFormatIntfc*& aIntfc);
   135 
   120 
   136     /**
   121     /**
   137      * ?description
   122      * ?description
   138      *
   123      *
   139      * @since S60 v5.0
   124      *
   140      * @param none
       
   141      * @return TVoIPCodecFormat
       
   142      */
       
   143     TVoIPCodecFormat GetFormat();
       
   144 
       
   145     /**
       
   146      * ?description
       
   147      *
       
   148      * @since S60 v5.0
       
   149      * @param TVoIPOutputDevice
   125      * @param TVoIPOutputDevice
   150      * @return TInt
   126      * @return TInt
   151      */
   127      */
   152     TInt SetAudioDevice(const TVoIPOutputDevice aDevice);
   128     TInt SetAudioDevice(const TVoIPOutputDevice aDevice);
   153 
   129 
   154     /**
   130     /**
   155      * ?description
   131      * ?description
   156      *
   132      *
   157      * @since S60 v5.0
       
   158      * @param TVoIPOutputDevice&
   133      * @param TVoIPOutputDevice&
   159      * @return TInt
   134      * @return TInt
   160      */
   135      */
   161     TInt GetAudioDevice(TVoIPOutputDevice& aDevice);
   136     TInt GetAudioDevice(TVoIPOutputDevice& aDevice);
   162 
   137 
   163     /**
   138     /**
   164      * ?description
   139      * ?description
   165      *
   140      *
   166      * @since S60 v5.0
       
   167      * @param none
   141      * @param none
   168      * @return TInt
   142      * @return TInt
   169      */
   143      */
   170     TInt Start();
   144     TInt Start();
   171 
   145 
   172     /**
   146     /**
   173      * ?description
   147      * ?description
   174      *
   148      *
   175      * @since S60 v5.0
       
   176      * @param none
   149      * @param none
   177      * @return TInt
   150      * @return TInt
   178      */
   151      */
   179     TInt Stop();
   152     TInt Stop();
   180 
   153 
   181     /**
   154     /**
   182      * ?description
   155      * ?description
   183      *
   156      *
   184      * @since S60 v5.0
       
   185      * @param none
   157      * @param none
   186      * @return void
   158      * @return void
   187      */
   159      */
   188     void Close();
   160     void Close();
   189 
   161 
   190     /**
   162     /**
   191      * ?description
   163      * ?description
   192      *
   164      *
   193      * @since S60 v5.0
       
   194      * @param CVoIPDataBuffer*
   165      * @param CVoIPDataBuffer*
   195      * @return TInt
   166      * @return TInt
   196      */
   167      */
   197     TInt BufferFilled(CVoIPDataBuffer* aBuffer);
   168     TInt BufferFilled(CVoIPDataBuffer* aBuffer);
   198 
   169 
   199     /**
   170     /**
   200      * ?description
   171      * ?description
   201      *
   172      *
   202      * @since S60 v5.0
       
   203      * @param CVoIPJitterBufferIntfc*&
   173      * @param CVoIPJitterBufferIntfc*&
   204      * @return void
   174      * @return void
   205      */
   175      */
   206     void CreateJitterBufferIntfcL(CVoIPJitterBufferIntfc*& aJBIntfc);
   176     void CreateJitterBufferIntfcL(CVoIPJitterBufferIntfc*& aJBIntfc);
   207 
   177 
   208     /**
   178     /**
   209      * ?description
   179      * ?description
   210      *
   180      *
   211      * @since S60 v5.0
       
   212      * @param none
   181      * @param none
   213      * @return RVoIPAudioSession*
   182      * @return RVoIPAudioSession*
   214      */
   183      */
   215     RVoIPAudioSession* GetSession();
   184     RVoIPAudioSession* GetSession();
   216 
   185 
   217 
   186     // From MQueueHandlerObserver
   218 // From MQueueHandlerObserver
   187 
   219 
   188     /**
   220     /**
   189      * ?description
   221      * ?description
   190      *
   222      *
       
   223      * @since S60 v5.0
       
   224      * @param CVoIPDataBuffer*
   191      * @param CVoIPDataBuffer*
   225      * @return void
   192      * @return void
   226      */
   193      */
   227     virtual void FillBuffer(CVoIPDataBuffer* aBuffer);
   194     virtual void FillBuffer(CVoIPDataBuffer* aBuffer);
   228 
   195 
   229     /**
   196     /**
   230      * ?description
   197      * ?description
   231      *
   198      *
   232      * @since S60 v5.0
       
   233      * @param TPtr8
   199      * @param TPtr8
   234      * @return void
   200      * @return void
   235      */
   201      */
   236     virtual void EmptyBuffer(CVoIPDataBuffer* /*aBuffer*/) {}
   202     virtual void EmptyBuffer(CVoIPDataBuffer* /*aBuffer*/) {}
   237 
   203 
   238     /**
   204     /**
   239      * ?description
   205      * ?description
   240      *
   206      *
   241      * @since S60 v5.0
       
   242      * @param TInt
   207      * @param TInt
   243      * @param TInt
   208      * @param TInt
   244      * @return void
   209      * @return void
   245      */
   210      */
   246     virtual void Event(TInt aEventType, TInt aError);
   211     virtual void Event(TInt aEventType, TInt aError);
   248 private:
   213 private:
   249 
   214 
   250     /**
   215     /**
   251      * Constructor
   216      * Constructor
   252      *
   217      *
   253      * @since S60 v5.0
   218      * @param none
   254      * @param none
   219      * @return none
   255      * @return TInt
       
   256      */
   220      */
   257     CVoIPAudioDownlinkStreamImpl();
   221     CVoIPAudioDownlinkStreamImpl();
   258 
   222 
   259     /**
   223     /**
   260      * Symbian constructor
   224      * Symbian constructor
   261      *
   225      *
   262      * @since S60 v5.0
       
   263      * @param none
   226      * @param none
   264      * @return void
   227      * @return void
   265      */
   228      */
   266     void ConstructL(const TMMFPrioritySettings aPriority);
   229     void ConstructL(const TMMFPrioritySettings aPriority);
   267 
   230 
   268     /**
   231     /**
   269      * ?description
   232      * ?description
   270      *
   233      *
   271      * @since S60 v5.0
       
   272      * @param TDesC&
   234      * @param TDesC&
   273      * @param TInt
   235      * @param TInt
   274      * @param TQueueType
   236      * @param TQueueType
   275      * @return TInt
   237      * @return TInt
   276      */
   238      */
   277     TInt CreateQueue(const TDesC& aQueueName,
   239     TInt CreateQueue(const TDesC& aQueueName, const TInt aNumSlots,
   278                      const TInt aNumSlots,
   240             const TQueueType aQueueType);
   279                      const TQueueType aQueueType);
   241 
   280 
   242     /**
   281     /**
   243      * ?description
   282      * ?description
   244      *
   283      *
       
   284      * @since S60 v5.0
       
   285      * @param none
   245      * @param none
   286      * @return void
   246      * @return void
   287      */
   247      */
   288     void ReceiveMsgQHandlerEventsL();
   248     void ReceiveMsgQHandlerEventsL();
   289 
   249 
   290     /**
   250     /**
   291      * ?description
   251      * ?description
   292      *
   252      *
   293      * @since S60 v5.0
       
   294      * @param none
   253      * @param none
   295      * @return void
   254      * @return void
   296      */
   255      */
   297     void ReceiveMsgQComHandlerEventsL();
   256     void ReceiveMsgQComHandlerEventsL();
   298 
   257 
   299     /**
   258     /**
   300      * ?description
   259      * ?description
   301      *
   260      *
   302      * @since S60 v5.0
       
   303      * @param TVoIPCodecFormat
   261      * @param TVoIPCodecFormat
   304      * @return TFourCC
   262      * @return TFourCC
   305      */
   263      */
   306     TUint32 CodecFourCC(TVoIPCodecFormat aFormat);
   264     TUint32 CodecFourCC(TVoIPCodecFormat aFormat);
   307 
   265 
   308     /**
   266     /**
   309      * ?description
   267      * ?description
   310      *
   268      *
   311      * @since S60 v5.0
       
   312      * @param TUint32
   269      * @param TUint32
   313      * @return TVoIPCodecFormat
   270      * @return TVoIPCodecFormat
   314      */
   271      */
   315     TVoIPCodecFormat ConvertFourCC(TUint32 aCodec);
   272     TVoIPCodecFormat ConvertFourCC(TUint32 aCodec);
   316 
   273 
   317     /**
   274     /**
   318      * ?description
   275      * ?description
   319      *
   276      *
   320      * @since S60 v5.0
       
   321      * @param TVoIPCodecFormat
   277      * @param TVoIPCodecFormat
   322      * @return TBool
   278      * @return TBool
   323      */
   279      */
   324     TBool IsCodecSupportedL(TVoIPCodecFormat aFormat);
   280     TBool IsCodecSupportedL(TVoIPCodecFormat aFormat);
   325 
   281 
   326     /**
   282     /**
   327      * ?description
   283      * ?description
   328      *
   284      *
   329      * @since S60 v5.0
       
   330      * @param TVoIPCodecFormat
   285      * @param TVoIPCodecFormat
   331      * @return TBool
   286      * @return TBool
   332      */
   287      */
   333     TBool FindFormat(TVoIPCodecFormat aFormat);
   288     TBool FindFormat(TVoIPCodecFormat aFormat);
   334 
   289 
   335 private:
   290 private:
   336     friend class CDTMFTonePlayerImpl;
   291     friend class CDTMFTonePlayerImpl;
   337 
   292 
   338 private:
   293 private:
   339 // Client side VoIP server session
   294     // Client side VoIP server session
   340     RVoIPAudioSession         iVoIPAudioSession;
   295     RVoIPAudioSession iVoIPAudioSession;
   341 
   296 
   342     MVoIPDownlinkObserver*    iObserver;
   297     MVoIPDownlinkObserver* iObserver;
   343 
   298 
   344 // Message queues
   299     // Message queues
   345     RMsgQueue<TVoIPMsgBuf>    iMsgQueue;
   300     RMsgQueue<TVoIPMsgBuf> iMsgQueue;
   346     RMsgQueue<TVoIPMsgBuf>    iMsgComQueue;
   301     RMsgQueue<TVoIPMsgBuf> iMsgComQueue;
   347 
   302 
   348 // Message queue handlers
   303     // Message queue handlers
   349     CQueueHandler*            iMsgQHandler;
   304     CQueueHandler* iMsgQHandler;
   350     CQueueHandler*            iMsgQComHandler;
   305     CQueueHandler* iMsgQComHandler;
   351 
   306 
   352     TMMFPrioritySettings      iPriority;
   307     TMMFPrioritySettings iPriority;
   353     TPtr8                     iBufferPtr;
   308     TPtr8 iBufferPtr;
   354     TInt                      iBufferLen;
   309     TInt iBufferLen;
   355     TInt                      iG711FrameSize;
   310     TInt iG711FrameSize;
   356 
   311 
   357     TVoIPCodecFormat          iFormat;
   312     TVoIPCodecFormat iFormat;
   358     RArray<TVoIPCodecFormat>* iCodecFormats;
   313     RArray<TVoIPCodecFormat> iCodecFormats;
   359 
       
   360     };
   314     };
   361 
   315 
   362 #endif //__VOIPDOWNLINKSTREAMIMPL_H
   316 #endif //VOIPDOWNLINKSTREAMIMPL_H
   363 
   317 
   364 // End of file
   318 // End of file