mmsharing/mmshengine/inc/musengreceivesession.h
branchRCL_3
changeset 33 bc78a40cd63c
parent 32 73a1feb507fb
equal deleted inserted replaced
32:73a1feb507fb 33:bc78a40cd63c
    17 
    17 
    18 
    18 
    19 #ifndef MUSHENGREVEIVESESSION_H
    19 #ifndef MUSHENGREVEIVESESSION_H
    20 #define MUSHENGREVEIVESESSION_H
    20 #define MUSHENGREVEIVESESSION_H
    21 
    21 
    22 // INCLUDES
    22 
       
    23 
    23 #include "musengmcesession.h"
    24 #include "musengmcesession.h"
    24 #include "musenguriparser.h"
    25 #include "musenguriparser.h"
    25 #include "musunittesting.h"
    26 #include "musunittesting.h"
       
    27 
    26 #include <mcemediasink.h>
    28 #include <mcemediasink.h>
    27 
    29 
    28 // FORWARD DECLARATIONS
       
    29 class MMusEngReceiveSessionObserver;
    30 class MMusEngReceiveSessionObserver;
    30 class CMceInSession;
    31 class CMceInSession;
    31 class CMusEngRemoteVideoPlayer;
       
    32 
    32 
    33 
    33 class CMusEngReceiveSession : public CMusEngMceSession
    34 class CMusEngReceiveSession : 
       
    35     public CMusEngMceSession
       
    36     {
    34     {
    37     MUS_UNITTEST( UT_CMusEngMceSession )
    35     MUS_UNITTEST( UT_CMusEngMceSession )
    38     MUS_UNITTEST( UT_CMusEngReceiveSession )
    36     MUS_UNITTEST( UT_CMusEngReceiveSession )
    39     
    37     
    40     public: // Contructors and destructor
    38     public: // Contructors and destructor
    41 
    39 
    42        /**
    40        /**
    43         * Creates new MultimediaSharing Receive session.
    41         * Creates new MultimediaSharing Receive session.
       
    42         *
       
    43         * @param aRect UI drawing area. It is allowed handle from engine
       
    44         * @param aEngObserver Engine specific callbacks
       
    45         * @param aSessionObserver Session specific callbacks
    44         * @return CMusEngReceiveSession* New instanse of specified class
    46         * @return CMusEngReceiveSession* New instanse of specified class
    45         */
    47         */
    46         static CMusEngReceiveSession* NewL();
    48         IMPORT_C static CMusEngReceiveSession* NewL( 
    47         
    49                     const TRect& aRect,
       
    50                     MMusEngSessionObserver& aSessionObserver,
       
    51                     MMusEngReceiveSessionObserver& aReceiveSessionObserver );
    48        /**
    52        /**
    49         * Destructor
    53         * Destructor
    50         *
    54         *
    51         * @since S60 v3.2
    55         * @since S60 v3.2
    52         */
    56         */
    53         ~CMusEngReceiveSession();
    57         ~CMusEngReceiveSession();
       
    58       
       
    59         
       
    60     public: // API
       
    61 
       
    62        /**
       
    63         * Accept or deny processed invitation
       
    64         *
       
    65         * @param aAccept ETrue if session is to be accepted and EFalse if 
       
    66         *        to be rejected.
       
    67         */
       
    68         IMPORT_C void AcceptInvitationL(const TBool& aAccept);
    54    
    69    
    55     public: // From MLcSession
    70 
    56         
    71     private: // Overrides function in CMusEngMceSession
    57         TLcSessionState LcSessionState() const;
       
    58         
       
    59         void EstablishLcSessionL();
       
    60         
       
    61         void TerminateLcSessionL(); 
       
    62         
       
    63         MLcVideoPlayer* RemoteVideoPlayer();    
       
    64         
       
    65         const TDesC& RemoteDisplayName();         
       
    66         
       
    67     protected: // Overrides function in CMusEngMceSession
       
    68     
    72     
    69         /**
    73         /**
    70         * The state of the session has changed.
    74         * The state of the session has changed.
    71         *
    75         *
    72         * @since S60 v3.2
    76         * @since S60 v3.2
    80         * Sets Multimediasharing specific video codec settings like keepalive
    84         * Sets Multimediasharing specific video codec settings like keepalive
    81         * timer. This functions gets called for every video codec in 
    85         * timer. This functions gets called for every video codec in 
    82         * session. This function overrides function in base class. 
    86         * session. This function overrides function in base class. 
    83         * Function calls also overridden version.
    87         * Function calls also overridden version.
    84         */ 
    88         */ 
    85         virtual void AdjustVideoCodecL( CMceVideoCodec& aVideoCodec,
    89         virtual void AdjustVideoCodecL( CMceVideoCodec& aVideoCodec );
    86                                         TMceSourceType aSourceType );
       
    87         
    90         
    88         /**
    91         /**
    89         * Sets Multimediasharing specific audio codec settings like keepalive
    92         * Sets Multimediasharing specific audio codec settings like keepalive
    90         * timer. This functions gets called for every audio 
    93         * timer. This functions gets called for every audio 
    91         * codec in session.  This function overrides function in base class. 
    94         * codec in session.  This function overrides function in base class. 
    99         * Removes all the H.263 codecs if any AVC codecs found. Prefers
   102         * Removes all the H.263 codecs if any AVC codecs found. Prefers
   100         * non-interleaved AVC over single NAL AVC
   103         * non-interleaved AVC over single NAL AVC
   101         * @param aVideoStream
   104         * @param aVideoStream
   102         */
   105         */
   103         virtual void DoCodecSelectionL( CMceVideoStream& aVideoStream );
   106         virtual void DoCodecSelectionL( CMceVideoStream& aVideoStream );
   104         
   107                          
   105     protected: // from MMceInSessionObserver
   108                          
   106                // overrides the function in CMusEngMceSession
   109     private: // from MMceInSessionObserver
       
   110              // overrides the function in CMusEngMceSession
   107 
   111 
   108         /**
   112         /**
   109 	    * Incoming session invitation. The CMCEInSession is given to the
   113 	    * Incoming session invitation. The CMCEInSession is given to the
   110 		* application as a callback.
   114 		* application as a callback.
   111 	    * @param aSession, pointer to the incoming session. Ownership is
   115 	    * @param aSession, pointer to the incoming session. Ownership is
   132 					CMceSession& aOrigSession, 
   136 					CMceSession& aOrigSession, 
   133 					CMceInSession* aUpdatedSession,
   137 					CMceInSession* aUpdatedSession,
   134     				TMceTransactionDataContainer* aContainer );
   138     				TMceTransactionDataContainer* aContainer );
   135 
   139 
   136 
   140 
   137     protected: // from MMceStreamObserver, 
   141     private: // from MMceStreamObserver, 
   138              // overrides the function in CMusEngMceSession
   142              // overrides the function in CMusEngMceSession
   139 
   143 
   140         /**
   144         /**
   141         * The state of the stream has changed.
   145         * The state of the stream has changed.
   142         *
   146         *
   143         * @since S60 v3.2
   147         * @since S60 v3.2
   144         * @param aStream, the stream that uses the source.
   148         * @param aStream, the stream that uses the source.
   145         */
   149         */
   146         void StreamStateChanged( CMceMediaStream& aStream );
   150         void StreamStateChanged( CMceMediaStream& aStream );
   147     
       
   148     protected: // from MMceRtpObserver
       
   149 
       
   150         void InactivityTimeout( CMceMediaStream& aStream,
       
   151                                 CMceRtpSource& aSource );
       
   152 
   151 
   153 
   152 
   154 
   153     private: // CONSTRUCTORS
   155     protected: // CONSTRUCTORS
       
   156     
   154     
   157         CMusEngReceiveSession();
   155         CMusEngReceiveSession(  
       
   156                         MMusEngSessionObserver& aSessionObserver,
       
   157                         MMusEngReceiveSessionObserver& aReceiveSessionObserver,
       
   158                         const TRect& aRect );
   158 
   159 
   159 		void ConstructL();
   160 		void ConstructL();
   160 		
   161 		
   161     protected: // HELPERS
   162     private: // HELPERS
   162     
   163     
   163         CMceInSession* InSession();
   164         CMceInSession* InSession();
   164         
   165         
   165         void PrepareToRequire100RelL( 
   166         void PrepareToRequire100RelL( 
   166             TMceTransactionDataContainer* aContainer );
   167                         TMceTransactionDataContainer* aContainer);
   167         
   168         
   168         virtual void CompleteSessionStructureL();
   169         void CompleteSessionStructureL();
   169         
   170         
   170          /**
   171          /**
   171          * Parse P-Asserted-Identity header. 
   172          * Parse P-Asserted-Identity header. 
   172          * Tries to fetch the telephone number from tel uri, 
   173          * Tries to fetch the telephone number from tel uri, 
   173          * if tel uri not found it suppose that telephone number
   174          * if tel uri not found it suppose that telephone number
   174          * is in sip url. 
   175          * is in sip url. 
   175          */
   176          */
   176         void ParseAssertedIdentity( TMceTransactionDataContainer* aContainer );
   177         void ParseAssertedIdentity(
   177         /*
   178                         TMceTransactionDataContainer* aContainer );
   178          * Checks for buffering event happened & receiving already not started
       
   179          *      If yes, start the RTP inactivity timer and indicate to observer
       
   180          *              about videoplayer state change.
       
   181          *      else will not do anything. Bascially ignores the event.
       
   182          */
       
   183         void ReceivingStarted();
       
   184         
   179         
   185         /**
   180     private: // DATA
   186         * Checks for receiving already started and display sink is enabled
   181     
   187         *        If yes ETrue else otherwise.
   182         MMusEngReceiveSessionObserver& iReceiveSessionObserver;
   188         */
       
   189         TBool IsDisplayActive();
       
   190         
       
   191     protected: // DATA
       
   192     
   183     
   193         // Set to ETrue if CMceInSession::RingL has already been called
   184         // Set to ETrue if CMceInSession::RingL has already been called
   194         TBool iRingLCalled;
   185         TBool iRingLCalled;
   195         
   186         
   196         // identity of originator parsed form P-Asserted-Identity field
   187         // identity of originator parsed form P-Asserted-Identity field
   197         TBuf8<KMaxUriLength> iIdentity;
   188         TBuf8<KMaxUriLength> iIdentity;
   198         
       
   199         HBufC8* iOriginator;
       
   200         
       
   201         HBufC* iRemoteDisplayName;
       
   202        
       
   203         /// The remote video player implementing MLcVideoPlayer
       
   204         CMusEngRemoteVideoPlayer* iRemoteVideoPlayer;
       
   205         
       
   206         TUint32 iReceivingInactivityTimeout;
       
   207         
       
   208         TUint8 iKeepaliveTimer;
       
   209         
       
   210     private:
       
   211         /* Flag for whether receiving started. It will go EFalse
       
   212          * when RTP inactivity timeout happen.
       
   213          */
       
   214         TBool iReceiving;               
       
   215         /* Flag to indicate buffering event happened. This flag is for
       
   216          * optimization purpose since buffering event is the only place 
       
   217          * we can be sure about some packets were received.
       
   218          */
       
   219         TBool iBuffered;
       
   220     };
   189     };
   221 
   190 
   222 #endif
   191 #endif
   223 
   192