multimediacommscontroller/mmccsubcontroller/inc/mccrtpkeepalivecontainer.h
changeset 0 1bce908db942
child 32 f2ed1fc4c163
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2002-2008 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:    RTP Keepalive mechanism
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef MCCRTPKEEPALIVECONTAINER_H
       
    22 #define MCCRTPKEEPALIVECONTAINER_H
       
    23 
       
    24 //  INCLUDES
       
    25 #include <e32base.h>
       
    26 #include "rtpdef.h"
       
    27 #include "rtpapi.h"
       
    28 #include "rtpheader.h"
       
    29 
       
    30 // CONSTANTS
       
    31 
       
    32 // MACROS
       
    33 
       
    34 // DATA TYPES
       
    35     
       
    36 // FUNCTION PROTOTYPES
       
    37 
       
    38 // FORWARD DECLARATIONS
       
    39 class MAsyncEventHandler;
       
    40 class MMccResources;
       
    41 class MMccRtpInterface;
       
    42 class CMccRtpKeepalive;
       
    43 class TMccCodecInfo;
       
    44 class CMccRtpMediaClock;
       
    45 
       
    46 // CLASS DECLARATION
       
    47 
       
    48 class MMccRtpKeepalive
       
    49     {
       
    50     public:
       
    51         
       
    52         /**
       
    53          * Start sending keepalive packets.
       
    54          *
       
    55          * @since Series 60 3.2
       
    56          * @param aUser rtp interface instance
       
    57          * @param aCodecInfo codec info instance
       
    58          * @param aRtpMediaClock rtp media clock instance
       
    59          * @return void
       
    60          */  
       
    61         virtual void StartKeepaliveL( MMccRtpInterface& aUser, 
       
    62                                       TMccCodecInfo& aCodecInfo, 
       
    63                                       CMccRtpMediaClock& aRtpMediaClock ) = 0;
       
    64                                       
       
    65         /**
       
    66          * Stop sending keepalive packets.
       
    67          *
       
    68          * @since Series 60 3.2
       
    69          * @param aUser rtp interface instance
       
    70          * @return One of the standard system-wide error codes.
       
    71          */ 
       
    72         virtual TInt StopKeepalive( MMccRtpInterface& aUser, 
       
    73                                     const TMccCodecInfo& aCodecInfo ) = 0;
       
    74         
       
    75         /**
       
    76          * Reset keepalive timer.
       
    77          *
       
    78          * @since Series 60 3.2
       
    79          * @param None
       
    80          * @return void
       
    81          */  
       
    82         virtual void ResetKeepaliveTimer() = 0;
       
    83         
       
    84         /**
       
    85          * Update session keepalive parameters
       
    86          *
       
    87          * @since Series 60 3.2
       
    88          * @param aUser rtp interface instance
       
    89          * @param aCodecInfo codec info instance
       
    90          * @return void
       
    91          */
       
    92         virtual void UpdateParamsL( MMccRtpInterface& aUser, 
       
    93                                     const TMccCodecInfo& aCodecInfo ) = 0;
       
    94     };
       
    95 
       
    96 NONSHARABLE_CLASS( CMccRtpKeepaliveContainer ) : public CBase, 
       
    97     public MMccRtpKeepalive
       
    98     {
       
    99     public:
       
   100     
       
   101         /**
       
   102         * Two-phased constructor.
       
   103         */
       
   104         static CMccRtpKeepaliveContainer* NewL( 
       
   105                                        MAsyncEventHandler& aEventHandler,
       
   106                                        CRtpAPI& aRtpAPI,
       
   107                                        TRtpId aRtpSessionId );
       
   108         
       
   109         /**
       
   110         * Destructor
       
   111         */
       
   112         virtual ~CMccRtpKeepaliveContainer();
       
   113 
       
   114     public: // From MMccRtpKeepalive
       
   115         
       
   116         /**
       
   117          * Start sending keepalive packets.
       
   118          *
       
   119          * @since Series 60 3.2
       
   120          * @param aUser rtp interface instance
       
   121          * @param aCodecInfo codec info instance
       
   122          * @param aRtpMediaClock rtp media clock instance
       
   123          * @return void
       
   124          */  
       
   125         virtual void StartKeepaliveL( MMccRtpInterface& aUser, 
       
   126                                       TMccCodecInfo& aCodecInfo,
       
   127                                       CMccRtpMediaClock& aRtpMediaClock );
       
   128         
       
   129         /**
       
   130          * Stop sending keepalive packets.
       
   131          *
       
   132          * @since Series 60 3.2
       
   133          * @param aUser rtp interface instance
       
   134          * @return One of the standard system-wide error codes.
       
   135          */ 
       
   136         virtual TInt StopKeepalive( MMccRtpInterface& aUser, 
       
   137                                     const TMccCodecInfo& aCodecInfo );
       
   138         /**
       
   139          * Reset keepalive timer.
       
   140          *
       
   141          * @since Series 60 3.2
       
   142          * @return void
       
   143          */  
       
   144         virtual void ResetKeepaliveTimer();
       
   145         
       
   146         /**
       
   147          * Update session keepalive parameters
       
   148          *
       
   149          * @since Series 60 3.2
       
   150          * @param aUser rtp interface instance
       
   151          * @param aConfig Configuration
       
   152          * @return void
       
   153          */
       
   154         virtual void UpdateParamsL( MMccRtpInterface& aUser, 
       
   155                                     const TMccCodecInfo& aConfig );                            
       
   156     
       
   157     public: // Functions
       
   158        
       
   159         void StopAll();
       
   160         
       
   161         TInt RemoteAddressSet();
       
   162     
       
   163     private:
       
   164     
       
   165         CMccRtpKeepalive* FindKeepaliveHandler( TUint8 aKeepAlivePT,
       
   166             MMccRtpInterface& aUser );  
       
   167        
       
   168     private: // Constructors
       
   169     
       
   170         CMccRtpKeepaliveContainer( MAsyncEventHandler& aEventHandler,
       
   171                                    CRtpAPI& aRtpAPI,
       
   172                                    TRtpId aRtpSessionId );
       
   173         
       
   174     
       
   175     private: // Data
       
   176     
       
   177         MAsyncEventHandler& iEventHandler;
       
   178 
       
   179         CRtpAPI& iRtpAPI;
       
   180         
       
   181         TRtpId iRtpSessionId;
       
   182         
       
   183         RPointerArray<CMccRtpKeepalive> iKeepaliveHandlers;
       
   184         
       
   185         TBool iStopped;
       
   186         
       
   187         /**
       
   188          * Boolen indicating if rtp sink exists.
       
   189          */
       
   190         TBool iRtpSinkExist;
       
   191 
       
   192         TBool iRemoteAddressSet;
       
   193         
       
   194         #ifdef TEST_EUNIT
       
   195         friend class UT_CMccRtpKeepalive;
       
   196         friend class UT_CMccRtpDataSink;
       
   197         friend class UT_CMccRtpDataSource;
       
   198         #endif
       
   199     };
       
   200     
       
   201 #endif      // MCCRTPKEEPALIVECONTAINER_H
       
   202 
       
   203 // End of File