mmsharing/mmshengine/inc/musengmcesession.h
changeset 22 496ad160a278
equal deleted inserted replaced
15:ccd8e69b5392 22:496ad160a278
       
     1 /*
       
     2 * Copyright (c) 2005 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: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MUSENGMCESESSION_H
       
    20 #define MUSENGMCESESSION_H
       
    21 
       
    22 // USER
       
    23 #include "musengsessiondurationtimerobserver.h"
       
    24 #include "musunittesting.h"
       
    25 #include "mussipprofileuser.h"
       
    26 #include "musengdisplayhandler.h"
       
    27 #include "musengaudioroutingobserver.h"
       
    28 
       
    29 // SYSTEM
       
    30 #include <lcsession.h>
       
    31 #include <lcaudiocontrol.h>
       
    32 #include <mcesessionobserver.h>
       
    33 #include <mceinsessionobserver.h>
       
    34 #include <mcestreamobserver.h>
       
    35 #include <mcertpobserver.h>
       
    36 #include <mcetransactiondatacontainer.h>
       
    37 #include <mcemediasource.h>
       
    38 
       
    39 // FORWARD DECLARATIONS
       
    40 class CMceManager;
       
    41 class CMceSession;
       
    42 class CMceVideoStream;
       
    43 class CMceAudioStream;
       
    44 class CMceVideoCodec;
       
    45 class CMceAudioCodec;
       
    46 class CMusEngSessionDurationTimer;
       
    47 class CMusSipProfileHandler;
       
    48 class CMusEngTelephoneUtils;
       
    49 class MMusEngAudioRoutingObserver;
       
    50 class MLcSessionObserver;
       
    51 
       
    52 // CONSTANTS
       
    53 
       
    54 _LIT8( KMusEngAcceptContactHeader, 
       
    55        "Accept-Contact: *;+g.3gpp.cs-voice; explicit" );
       
    56 _LIT8( KMusAcceptHeader, 
       
    57        "Accept: application/sdp" );
       
    58 _LIT8( KMusEngSessionSdpLineXApplication, "a=X-application:com.nokia.rtvs\r\n" );
       
    59 _LIT8( KMusEngSessionSdpLineApplication , "a=application:com.gsma.rts\r\n" );
       
    60 _LIT8( KMusEngSessionSdpLineType, "a=type:videolive\r\n" );
       
    61 _LIT8( KMusEngSessionSdpLineBandwidthLine  , "b=AS:" );
       
    62 _LIT8( KMusEngSessionSdpLineBandwidthField  , "b=AS:85\r\n" );
       
    63 _LIT8( KMusEngSessionSdpLineTiasLine  , "b=TIAS:" );
       
    64 _LIT8( KMusPPreferredIdentity, "P-Preferred-Identity" );
       
    65 _LIT8( KMusEngNewLine  , "\r\n" );
       
    66 
       
    67 const TInt KMusTiasMultiplier = 1000;
       
    68 const TUint8 KMusEngRtpKeepAliveTimer = 5;
       
    69 const TUint8 KMusEngKeepAlivePayloadTypeVideoH263 = 96;
       
    70 const TUint8 KMusEngKeepAlivePayloadTypeAudio = 97;
       
    71 const TUint8 KMusEngKeepAlivePayloadTypeVideoAvc = 98;
       
    72 
       
    73 // Value for uninitialized rect
       
    74 const TInt KMusEngRectNotInit = 1000;
       
    75 
       
    76 // CLASS DECLARATION
       
    77 
       
    78 /**
       
    79 * Base class for Multimedia Sharing Engine MCE sessions, inherited by
       
    80 * CMusEngLiveSession CMusEngClipSession and CMusEngReceiveSession.
       
    81 *
       
    82 * CMusEngMceSession encapsulates CMCESession and simplifies use of
       
    83 * MCE Sessions to user interface. Also splits observers messy events
       
    84 * to simplified function calls.
       
    85 *
       
    86 * @lib musengine.lib
       
    87 */
       
    88 class CMusEngMceSession : public CBase,
       
    89                           public MLcSession,
       
    90                           public MLcAudioControl,
       
    91                           public MMceSessionObserver,
       
    92                           public MMceInSessionObserver,
       
    93                           public MMceStreamObserver,
       
    94                           public MMceRtpObserver,
       
    95                           public MMusEngSessionDurationTimerObserver,
       
    96                           public MMusSipProfileUser,
       
    97                           public MMusEngDisplayHandler,
       
    98                           public MMusEngAudioRoutingObserver
       
    99     {
       
   100     public:
       
   101 
       
   102         /**
       
   103         * Destructor
       
   104         */
       
   105         ~CMusEngMceSession();
       
   106 
       
   107         
       
   108     public: //  from MMusEngDisplayHandler
       
   109 
       
   110         /**
       
   111         * Returns currently assigned drawing area
       
   112         *
       
   113         * @return TRect This session drawing area rectangle
       
   114         */
       
   115         TRect Rect() const;
       
   116         
       
   117         /**
       
   118         * Sets new drawing area
       
   119         *
       
   120         * @param TRect This session new drawing area rectangle
       
   121         */
       
   122         void SetRectL( const TRect& aRect );
       
   123         
       
   124         /**
       
   125         * Sets secondary rect (e.g. viewfinder in twoway session)
       
   126         * @param TRect This session new secondary drawing area rectangle
       
   127         */
       
   128         void SetSecondaryRectL( const TRect& aSecondaryRect );
       
   129         
       
   130         /**
       
   131         * Gets secondary rect.
       
   132         * @return TRect This session secondary drawing area rectangle
       
   133         */
       
   134         virtual TRect SecondaryRect() const;
       
   135             
       
   136         /**
       
   137         * Returns current display orientation.
       
   138         *
       
   139         * @pre Session is ongoing
       
   140         * @return Current display orientation 
       
   141         * @leave KErrNotReady if precondition is not fullfilled
       
   142         */
       
   143         TDisplayOrientation OrientationL();
       
   144         
       
   145         /**
       
   146         * Sets display orientation.
       
   147         *
       
   148         * @pre Session is ongoing
       
   149         * @return Sets display orientation 
       
   150         * @leave KErrNotReady if precondition is not fullfilled
       
   151         */
       
   152         void SetOrientationL( TDisplayOrientation aOrientation );
       
   153 
       
   154         /**
       
   155         * Permission to draw on screen device.
       
   156         * 
       
   157         * @pre Session is ongoing
       
   158         */
       
   159         void EnableDisplayL( TBool aEnable );
       
   160         
       
   161         /**
       
   162         * Implements virtual from MMusEngDisplayHandler
       
   163         *
       
   164         * @pre Session is ongoing
       
   165         */
       
   166         TBool IsDisplayEnabled();
       
   167         
       
   168         /**
       
   169         * Implements virtual from MMusEngDisplayHandler
       
   170         *
       
   171         * @pre Session is ongoing
       
   172         */
       
   173         TBool IsDisplayActive();
       
   174 
       
   175         
       
   176     public: // From MMusEngAudioRoutingObserver
       
   177         
       
   178         void AudioRoutingChanged();        
       
   179         
       
   180         
       
   181     public: // From MLcSession
       
   182         
       
   183         virtual TLcSessionState LcSessionState() const;
       
   184         
       
   185         void SetLcSessionObserver( MLcSessionObserver* aObserver );
       
   186 
       
   187         void SetLcUiProvider( MLcUiProvider* aUiProvider );        
       
   188         
       
   189         virtual MLcVideoPlayer* RemoteVideoPlayer();
       
   190     
       
   191         virtual MLcVideoPlayer* LocalVideoPlayer();       
       
   192        
       
   193         virtual const TDesC& LocalDisplayName();
       
   194     
       
   195         virtual const TDesC& RemoteDisplayName();
       
   196 
       
   197         TInt SetParameter( TInt aId, TInt aValue );
       
   198 
       
   199         TInt ParameterValue( TInt aId );    
       
   200         
       
   201         TBool IsBackgroundStartup();
       
   202         
       
   203         TInt SetForegroundStatus( TBool aIsForeground );
       
   204         
       
   205         const TDesC& RemoteDetails();
       
   206         
       
   207         void UpdateLcSessionL();
       
   208         
       
   209         TBool SendDialTone( TChar aKey);
       
   210         
       
   211         
       
   212     public: // From MLcAudioControl
       
   213         
       
   214         TBool IsLcAudioMutedL();
       
   215 
       
   216         void MuteLcAudioL( TBool aMute );       
       
   217 
       
   218         TBool IsLcMicMutedL();    
       
   219 
       
   220         void MuteLcMicL( TBool aMute );
       
   221         
       
   222         TBool IsEnablingLcLoudspeakerAllowed();
       
   223 
       
   224         void EnableLcLoudspeakerL( TBool aEnabled );
       
   225         
       
   226         TBool IsLcLoudspeakerEnabled();
       
   227 
       
   228         TInt LcVolumeL();
       
   229      
       
   230         void SetLcVolumeL( TInt aValue );    
       
   231     
       
   232         void IncreaseLcVolumeL();
       
   233         
       
   234         void DecreaseLcVolumeL();        
       
   235 
       
   236     public:
       
   237         
       
   238         MLcSessionObserver* LcSessionObserver();
       
   239         
       
   240         MLcUiProvider* LcUiProvider();
       
   241         
       
   242     protected: // CONSTRUCTORS
       
   243 
       
   244         /**
       
   245         * Constructor
       
   246         *
       
   247         */
       
   248         CMusEngMceSession();
       
   249 
       
   250         /**
       
   251         * Second-phase constructor
       
   252         */
       
   253         void ConstructL();
       
   254         
       
   255 
       
   256     protected: // VIRTUAL HELPER FUNCTIONS
       
   257 
       
   258         /**
       
   259         * Function handling MCE session state changes.
       
   260         * To be overridden in sibling classes if needed.
       
   261         */
       
   262         virtual void HandleSessionStateChanged( CMceSession& aSession,
       
   263                                                 TInt aStatusCode,
       
   264                                                 const TDesC8& aReasonPhrase );
       
   265                         
       
   266         /**
       
   267         * Function handling MCE session termination.
       
   268         */
       
   269         virtual void HandleTermination( TInt aStatusCode,
       
   270                                         const TDesC8& aReasonPhrase );
       
   271 
       
   272         /**
       
   273         * Sets Multimediasharing specific video codec settings. This functions 
       
   274         * gets called for every video codec in session. To be overridden in 
       
   275         * sibling classes if needed.
       
   276         */ 
       
   277         virtual void AdjustVideoCodecL( CMceVideoCodec& aVideoCodec,
       
   278                                         TMceSourceType aSourceType );
       
   279         
       
   280         /**
       
   281         * Sets Multimediasharing specific audio codec settings like audio MMF 
       
   282         * priority and preference. This functions gets called for every audio 
       
   283         * codec in session. To be overridden in sibling classes if needed.
       
   284         */ 
       
   285         virtual void AdjustAudioCodecL( CMceAudioCodec& aAudioCodec );
       
   286 
       
   287        /**
       
   288         * Removes multiples of H.263 codec, prefers H263-2000 over H263-1998.
       
   289         * Additionally selects just the one with best quality from selected mode.
       
   290         * @param aVideoStream
       
   291         */
       
   292         virtual void DoCodecSelectionL( CMceVideoStream& aVideoStream );
       
   293         
       
   294         virtual void RectChangedL();
       
   295         
       
   296     protected: // HELPER FUNCTIONS
       
   297 
       
   298         void InformObserverAboutSessionStateChange();
       
   299         
       
   300         void InformObserverAboutSessionUpdate();
       
   301         
       
   302         void InformObserverAboutSessionFailure( TInt aReason );
       
   303         
       
   304         void InformObserverAboutPlayerStateChange( MLcVideoPlayer* aPlayer );
       
   305         
       
   306         void InformObserverAboutPlayerUpdate( MLcVideoPlayer* aPlayer );
       
   307         
       
   308         void InformObserverAboutPlayerFailure( 
       
   309             MLcVideoPlayer* aPlayer, 
       
   310             TInt aReason );
       
   311         
       
   312         void InformUiProviderAboutReceivingStart();
       
   313         
       
   314         MLcUiProvider& LcUiProviderL();
       
   315   
       
   316         /**
       
   317         * Sets session specific SDP lines to a session.
       
   318         */
       
   319         void SetSessionSdpLinesL( CMceSession& aSession, 
       
   320                                   TBool aForceBandwidthLine = EFalse );
       
   321         /**
       
   322         * Sets media specific SDP lines to media.
       
   323         */
       
   324         void SetMediaSdpLinesL( CMceMediaStream& aStream, 
       
   325                                 TBool aForceBandwidthLine = EFalse );
       
   326         
       
   327         /**
       
   328         * Sets the volume level of all speakers in session structure.
       
   329         * @param aNewVolume New volume level for all speakers
       
   330         */
       
   331         void SetSpeakerVolumeL( TInt aNewVolume );
       
   332 
       
   333         /**
       
   334         * Adjusts settings of all streams. Calls AdjustVideoStreamL for every
       
   335         * video stream and AdjustAudioStreamL for every audio stream in session.
       
   336         */ 
       
   337         void AdjustStreamsAndCodecsL();
       
   338 
       
   339         /**
       
   340         * Adjusts stream settings. Calls AdjustVideoCodecL for every video
       
   341         * codec in stream.
       
   342         */ 
       
   343         void AdjustVideoStreamL( CMceVideoStream& aVideoStream );
       
   344 
       
   345         /**
       
   346         * Adjusts stream settings. Calls AdjustAudioCodecL for every audio 
       
   347         * codec in stream.
       
   348         */ 
       
   349         void AdjustAudioStreamL( CMceAudioStream& aAudioStream );
       
   350 
       
   351         /*
       
   352         * Calls CMceInSession::RejectL() inside TRAP_IGNORE
       
   353         */
       
   354         void Reject( CMceInSession& aSession,
       
   355                      const TDesC8& aReason = KNullDesC8(),
       
   356                      TUint32 aCode = 0 );
       
   357         
       
   358         void SaveContactL( const TDesC8& aAddress );
       
   359             
       
   360     protected: // from MMceInSessionObserver
       
   361     
       
   362         /**
       
   363         * Incoming session invitation. The CMceInSession is given to the
       
   364         * application as a callback. This default implementation rejects
       
   365         * session immediately.
       
   366         * @param aSession, pointer to the incoming session. Ownership is
       
   367         *	     transferred.
       
   368         * @param aContainer, if present, holds details of
       
   369         *        transaction causing state change.
       
   370         */
       
   371         void IncomingSession( CMceInSession* aSession,
       
   372                               TMceTransactionDataContainer* aContainer );
       
   373 
       
   374 
       
   375         /**
       
   376         * Incoming session update. The new updated CMceInSession is given to the
       
   377         * application as a callback. This default implementation rejects
       
   378         * session immediately.
       
   379         * @param aOrigSession, the original session to be updated. This instance
       
   380         *        cannot be used anymore, all actions done using aUpdatedSession 
       
   381         *        instance.
       
   382         * @param aUpdatedSession, pointer to the new updated session. Ownership
       
   383         *        is transferred.
       
   384         * @param aContainer, if present, holds details of
       
   385         *        update transaction.
       
   386         */
       
   387         void IncomingUpdate( CMceSession& aOrigSession, 
       
   388                              CMceInSession* aUpdatedSession,
       
   389                              TMceTransactionDataContainer* aContainer );
       
   390     
       
   391     
       
   392     protected: // from MMceStreamObserver  
       
   393 
       
   394         /**
       
   395         * The state of the stream has changed.
       
   396         *
       
   397         * @param aStream, the stream that has changed.
       
   398         */
       
   399         void StreamStateChanged( CMceMediaStream& aStream );
       
   400         
       
   401         /**
       
   402         * The state of the source has changed.
       
   403         *
       
   404         * @param aStream, the stream that uses the source.
       
   405         * @param aSource, the source that has changed.
       
   406         */
       
   407         void StreamStateChanged( CMceMediaStream& aStream,
       
   408                                  CMceMediaSource& aSource );
       
   409 
       
   410         /**
       
   411         * The state of the sink has changed.
       
   412         *
       
   413         * @param aStream, the stream that uses the sink.
       
   414         * @param aSink, the sink that has changed.
       
   415         */
       
   416         void StreamStateChanged( CMceMediaStream& aStream,
       
   417                                  CMceMediaSink& aSink );    
       
   418     
       
   419     
       
   420     private: // from MMceSessionObserver
       
   421     
       
   422         /**
       
   423         * The state of the session has changed.
       
   424         *
       
   425         * @param aSession, the session that has changed.
       
   426         * @param aContainer, if present, holds details of
       
   427         *        transaction causing state change.
       
   428         */
       
   429         void SessionStateChanged( CMceSession& aSession,
       
   430                                   TMceTransactionDataContainer* aContainer );
       
   431                                   
       
   432         /**
       
   433         * The state of the connection used by the session has changed.
       
   434         *
       
   435         * @param aSession, the session that has changed.
       
   436         * @param aActive, ETrue if connection active, EFalse if
       
   437         *                 connection inactive.
       
   438         */
       
   439         void SessionConnectionStateChanged( CMceSession& aSession,
       
   440                                             TBool aActive );
       
   441 
       
   442         /**
       
   443         * An error has occurred concerning a specific session.
       
   444         * Note, that each error causes the session state to be ETerminated.
       
   445         *
       
   446         * @param aSession, The session raising the error.
       
   447         * @param aError, Error code
       
   448         */
       
   449         void Failed( CMceSession& aSession, TInt aError );
       
   450 
       
   451         /**
       
   452         * An session update has been failed concerning a specific session.
       
   453         * Note, that each error causes the session state to be ETerminated.
       
   454         *
       
   455         * @param aSession, The session raising the error.
       
   456         * @param aContainer, if present, holds details of
       
   457         *        transaction causing update.
       
   458         */
       
   459         void UpdateFailed( CMceSession& aSession,
       
   460                            TMceTransactionDataContainer* aContainer );
       
   461 
       
   462 
       
   463     private: // from MMCERtpObserver
       
   464 
       
   465         /**
       
   466         * Callback function to indicate that an RTCP sender report
       
   467         * has been received.
       
   468         * @param aSession the session that has changed
       
   469         * @param aStream the stream that has changed
       
   470         */
       
   471         void SRReceived( CMceSession& aSession, CMceMediaStream& aStream);
       
   472 
       
   473         /**
       
   474         * Callback function to indicate that an RTCP receiver report
       
   475         * has been received.
       
   476         * @param aSession the session that has changed
       
   477         * @param aStream the stream that has changed
       
   478         */
       
   479         void RRReceived( CMceSession& aSession, CMceMediaStream& aStream);
       
   480 					
       
   481         /**
       
   482         * Callback function to indicate inactivity timer timeout
       
   483         * has occurred. Timer is disabled after the timeout.
       
   484         *
       
   485         * @param aStream, the session that has changed.
       
   486         * @param aSource, the source that the timeout occurred.
       
   487         */
       
   488         void  InactivityTimeout( CMceMediaStream& aStream,
       
   489                                  CMceRtpSource& aSource );
       
   490 
       
   491         /**
       
   492         * Callback function to indicate that spesified CMceRtpSource has
       
   493         * received RTP from a new synchronization source (SSRC).
       
   494         * @param aStream the stream that new SSRC was added to
       
   495         * @param aSource the source that new SSRC was added to
       
   496         * @param aSsrc added SSRC identifier
       
   497         */			
       
   498         void SsrcAdded( CMceMediaStream& aStream,
       
   499                         CMceRtpSource& aSource,
       
   500                         TUint aSsrc );       
       
   501 	    
       
   502         /**
       
   503         * Callback function to indicate that spesified CMceRtpSource has
       
   504         * received RTP BYE message from a spesified synchronization 
       
   505         * source (SSRC).
       
   506         * @param aStream the stream that SSRC was removed from
       
   507         * @param aSource the source that SSRC was removed from
       
   508         * @param aSsrc removed SSRC identifier
       
   509         */	
       
   510         void SsrcRemoved( CMceMediaStream& aStream,
       
   511                           CMceRtpSource& aSource,
       
   512                           TUint aSsrc );       
       
   513     
       
   514         
       
   515     private: // from MMusSipProfileUser
       
   516         
       
   517         virtual TBool IsRoamingBetweenAPsAllowed();
       
   518         
       
   519         virtual void ProfileRegistered();
       
   520         
       
   521         
       
   522     private: // HELPER FUNCTIONS
       
   523 
       
   524         /**
       
   525         * Adds b=AS and b=TIAS lines to the array
       
   526         */
       
   527         void AddSdpBandwidthAttributesL( CDesC8Array& aSdpLinesArray,
       
   528                                          TInt aBandwidthAs );
       
   529 
       
   530         /**
       
   531         * Checks whether AS or TIAS bandwidth attributes present in the array 
       
   532         */
       
   533         TBool IsBandwidthAttributeSet( MDesC8Array* aSdpLinesArray );
       
   534 
       
   535 
       
   536         /**
       
   537         * Callback
       
   538         */
       
   539         void UpdateTimerEvent();
       
   540 
       
   541         /**
       
   542         * Does actual muting or unmuting of local audio playback but does not
       
   543         * mark speaker as explicitly muted so this function can be called also
       
   544         * when muting speaker as a consequence of disabling or enabling 
       
   545         * bundled display sink.
       
   546         *
       
   547         */
       
   548         void DoMuteSpeakerL( TBool aMute );
       
   549         
       
   550         /**
       
   551         * Checks if some of array items contains specific text.
       
   552         * @param aArray
       
   553         * @param aItem
       
   554         * @return ETrue if array contains aItem
       
   555         */
       
   556         TBool ContainsText( MDesC8Array* aArray, const TDesC8& aItem );
       
   557         
       
   558         void DoBitrateBasedRemovalL( CMceVideoStream& aVideoStream, 
       
   559                                      const CMceVideoCodec& aBestBitrateVideoCodec );
       
   560                                      
       
   561         void DoCodecModeBasedRemovalL( CMceVideoStream& aVideoStream );
       
   562   
       
   563         /**
       
   564         * Get session time return estabilished session time
       
   565         * @return TTime returns time if connection established else < 0
       
   566         */
       
   567         TTimeIntervalSeconds GetSessionTime() const;        
       
   568         
       
   569     protected:
       
   570         
       
   571         /**
       
   572         * Reads from CenRep and sets encoding device for a codec.
       
   573         */
       
   574         void SetEncodingDeviceL( CMceVideoCodec& aVideoCodec );
       
   575 
       
   576         /**
       
   577         * Sets configuration key for a codec
       
   578         */
       
   579         void SetCodecConfigKeyL( CMceVideoCodec& aVideoCodec );
       
   580     
       
   581         /**
       
   582         * Reads proper configuration key for a codec. NULL if not available.
       
   583         * Ownership is transferred.
       
   584         */
       
   585         HBufC8* ReadCodecConfigKeyL( const CMceVideoCodec& aVideoCodec ) const;
       
   586         
       
   587         /**
       
   588         * Constructs and stores to cenrep a concatenation of all AVC config keys.
       
   589         */
       
   590         void StoreEncoderConfigInfoL() const;
       
   591         
       
   592         /**
       
   593         * Returns config key id for the provided codec. Ownership is transferred
       
   594         */
       
   595         const TPtrC8 ConfigKeyIdL( const CMceVideoCodec& aVideoCodec ) const;
       
   596 
       
   597             
       
   598     protected: // Data
       
   599 
       
   600         /**
       
   601         * Drawing area rect.
       
   602         */
       
   603         TRect iRect;
       
   604 
       
   605         /**
       
   606         * Telephone utilities.
       
   607         */
       
   608         CMusEngTelephoneUtils* iTelephoneUtils;        
       
   609         
       
   610         /**
       
   611          * UID used to identify application, needed to create MCE manager
       
   612          */
       
   613         TUid iMceManagerUid;
       
   614         
       
   615         /**
       
   616         * Class for connecting to MCE server.
       
   617         * This class provides the connection to the MCE server and
       
   618         * provides functions
       
   619         * for setting observers for asynchronous events.
       
   620         * The user should create only one instance of this class.
       
   621         */
       
   622         CMceManager* iManager;
       
   623 
       
   624         /**
       
   625         * Base class for MCE sessions, inherited by both CMCEInSession and
       
   626         * CMCEOutSession. * CMCESession represents peer-to-peer connection
       
   627         * made with remote terminal. This connection is also known as dialog
       
   628         * and it is set up using SIP INVITE method. The characteristics of the
       
   629         * session are defined by user of this class by attaching media streams
       
   630         * into the session. After the session has been succesfully established,
       
   631         * it can be later updated and must be finally terminated. If for any
       
   632         * reason instance of this class is deleted while in established state,
       
   633         * session is automatically terminated by MCE server.
       
   634         */
       
   635         CMceSession* iSession;
       
   636 
       
   637         /**
       
   638         * ETrue if operator specific behavior is expected
       
   639         */
       
   640         TBool iOperatorVariant;
       
   641 
       
   642         /**
       
   643         * The handler for the SIP profile related to this session
       
   644         */
       
   645         CMusSipProfileHandler* iSipProfileHandler;
       
   646 
       
   647         /**
       
   648         * Session state for MLcSession 
       
   649         */
       
   650         MLcSession::TLcSessionState iLcSessionState;       
       
   651         
       
   652         /**
       
   653         * If true, configuration key of current AVC codec must be written to
       
   654         * CenRep after session establishment.
       
   655         */
       
   656         TBool iStoreEncoderConfigInfo;
       
   657         
       
   658         /**
       
   659         * Remote details 
       
   660         */
       
   661         HBufC* iRemoteDetails;
       
   662         
       
   663     private: // New functions
       
   664         
       
   665         void StreamStreaming( CMceMediaStream& aStream );
       
   666                 
       
   667     private: // Data
       
   668 
       
   669         /**
       
   670         * The session observer, if present.
       
   671         */
       
   672         MLcSessionObserver* iLcSessionObserver;
       
   673 
       
   674         /**
       
   675         * The UI provider, if present.
       
   676         */        
       
   677         MLcUiProvider* iLcUiProvider;        
       
   678         
       
   679         /**
       
   680         * It is assumed, that user has only one instance of this class.
       
   681         * The same instance is passed between MCE and user, but the data
       
   682         * inside of this container is just updated for each event.
       
   683         */
       
   684         TMceTransactionDataContainer iTransactionDataContainer;
       
   685 
       
   686         /**
       
   687         * Session time. Acts simultaneously as RTCP inactivity timer.
       
   688         */
       
   689         TTime iStartTime;
       
   690 
       
   691         CMusEngSessionDurationTimer* iUpdateTimer;
       
   692         
       
   693         /**
       
   694         * Value indicating seconds gone since last received RTCP sender or 
       
   695         * receiver report. Value 20 indicates RTCP inactivity timeout.  
       
   696         */
       
   697         TInt iSecondsFromLastRtcpReport;
       
   698 
       
   699         /**
       
   700         * Value indicating if speaker is explicitly muted instead of
       
   701         * muted as part of disabling bundled display sink 
       
   702         */
       
   703         TBool iExplicitlyMuted;
       
   704         
       
   705         /**
       
   706         * Value indicates whether session was started in background mode.
       
   707         * (see IsBackgroundStartup()). Once application comes to foreground, 
       
   708         * iBackground is set to EFalse
       
   709         */
       
   710         TBool iBackground;
       
   711         
       
   712     MUS_UNITTEST( UT_CMusEngSession )
       
   713     MUS_UNITTEST( UT_CMusEngMceSession )
       
   714     MUS_UNITTEST( UT_CMusEngReceiveSession )
       
   715     MUS_UNITTEST( UT_CMusEngSessionManager )
       
   716     };
       
   717     
       
   718 #endif // MUSENGMCESESSION_H