mmsharing/mmshengine/inc/musengmceoutsession.h
branchRCL_3
changeset 33 bc78a40cd63c
parent 32 73a1feb507fb
equal deleted inserted replaced
32:73a1feb507fb 33:bc78a40cd63c
    21 
    21 
    22 // USER
    22 // USER
    23 #include "musengmcesession.h"
    23 #include "musengmcesession.h"
    24 #include "musunittesting.h"
    24 #include "musunittesting.h"
    25 
    25 
       
    26 
    26 // FORWARD DECLARATIONS
    27 // FORWARD DECLARATIONS
    27 class MLcUiProvider;
    28 class MMusEngOutSessionObserver;
    28 class CMceStreamBundle;
    29 class CMceStreamBundle;
    29 
    30 
    30 // CLASS DECLARATION
    31 // CLASS DECLARATION
    31 /**
    32 /**
    32 * Class for handling MCE out sessions. Direct inherit classes are
    33 * Class for handling MCE out sessions. Direct inherit classes are
    43         /**
    44         /**
    44         * Destructor
    45         * Destructor
    45         */
    46         */
    46         ~CMusEngMceOutSession();
    47         ~CMusEngMceOutSession();
    47 
    48 
    48     public: // From MLcSession
    49 
    49         
    50     public: // NEW API FUNCTIONS
    50         const TDesC& RemoteDisplayName();
    51 
    51         
    52         /**
    52         void EstablishLcSessionL();
    53         * Sends invite to specified address. Session establishment is done in 
    53         
    54         * pause mode meaning that no RTP will be sent to network as a 
    54         void TerminateLcSessionL();        
    55         * consequence of established session. PlayL() can be called any time 
    55         
    56         * during session establishment or after that in order to allow 
       
    57         * RTP sending.
       
    58         * @leave KErrAlreadyExists if session establishment is already 
       
    59         *        in progress
       
    60         */
       
    61         IMPORT_C void InviteL( const TDesC& aRecipient );
       
    62 
       
    63         /**
       
    64         * Cancels Invite.
       
    65         * @pre Invite is sent
       
    66         */
       
    67         IMPORT_C void CancelInviteL( );
       
    68         
       
    69         /**
       
    70         * If codecs supported by recipient are known e.g. because of OPTIONS
       
    71         * query, they can be communicated to engine via this function
       
    72         * @param aVideoCodecs Comma separated list of supported codecs 
       
    73         */
       
    74         IMPORT_C void SetSupportedVideoCodecListL( const TDesC& aVideoCodecs );
       
    75 
       
    76 
       
    77     public: // VIRTUAL API
       
    78      
       
    79         /**
       
    80         * Resumes previously paused session. Exact behavior depends on 
       
    81         * exact session type.
       
    82         */
       
    83         virtual void PlayL() = 0;
       
    84 
       
    85         /**
       
    86         * Pauses session. Exact behavior depends on exact session type.
       
    87         */
       
    88         virtual void PauseL() = 0;
       
    89 
       
    90         /**
       
    91         * Tells whether session is paused or not
       
    92         * @pre Call of InviteL has been completed
       
    93         */
       
    94         virtual TBool IsPlayingL() = 0;
       
    95 
       
    96 
    56     protected: // Must be implemented in derived class
    97     protected: // Must be implemented in derived class
    57 
    98 
    58         /**
    99         /**
    59         * @param aLocalBundle All local streams are supposed to be added to
   100         * @param aLocalBundle All local streams are supposed to be added to
    60         *        this bundle
   101         *        this bundle
    61         */
   102         */
    62         virtual void CompleteSessionStructureL( 
   103         virtual void CompleteSessionStructureL( 
    63                                         CMceStreamBundle& aLocalBundle ) = 0;
   104                                         CMceStreamBundle& aLocalBundle ) = 0;
    64     
   105     
    65         virtual void AddDisplayL( CMceMediaStream& aStream );
       
    66     
   106     
    67     protected: // May be overridden in derived classes
   107     protected: // May be overridden in derived classes
    68          
   108          
    69         /**
   109         /**
    70         * Calls EstablishL-function of class CMceOutSession with feature tag 
   110         * Calls EstablishL-function of class CMceOutSession with feature tag 
    73         * Intention of the function is to provide subclasses means to set 
   113         * Intention of the function is to provide subclasses means to set 
    74         * preconditions to establishment, e.g. succesfull transcoding.
   114         * preconditions to establishment, e.g. succesfull transcoding.
    75         */
   115         */
    76         virtual void EstablishSessionL();
   116         virtual void EstablishSessionL();
    77         
   117         
    78         TBool IsH264Supported() const;
   118 
    79 
       
    80         /**
       
    81          *
       
    82          */        
       
    83         virtual void CreateMceSessionStructureL( TBool aForceSdpBandwidth =  
       
    84                                                   EFalse );
       
    85 
       
    86          
       
    87     protected: // helper function inherited from CMusEngMceSession
   119     protected: // helper function inherited from CMusEngMceSession
    88 
   120 
    89         /**
   121         /**
    90         * Function handling MCE session termination.
   122         * Function handling MCE session termination.
    91         */
   123         */
    95         * Sets Multimediasharing specific video codec settings like video 
   127         * Sets Multimediasharing specific video codec settings like video 
    96         * payload types. This functions gets called for every video codec in 
   128         * payload types. This functions gets called for every video codec in 
    97         * session. This function overrides function in base class and may 
   129         * session. This function overrides function in base class and may 
    98         * be further overridden. Function calls also overridden version.
   130         * be further overridden. Function calls also overridden version.
    99         */ 
   131         */ 
   100         void AdjustVideoCodecL( CMceVideoCodec& aVideoCodec, 
   132         void AdjustVideoCodecL( CMceVideoCodec& aVideoCodec );
   101                                 TMceSourceType aSourceType );
       
   102         
   133         
   103         /**
   134         /**
   104         * Sets Multimediasharing specific audio codec settings like audio and
   135         * Sets Multimediasharing specific audio codec settings like audio and
   105         * video payload types. This functions gets called for every audio 
   136         * video payload types. This functions gets called for every audio 
   106         * codec in session.  This function overrides function in base class and
   137         * codec in session.  This function overrides function in base class and
   112     protected:
   143     protected:
   113 
   144 
   114         /**
   145         /**
   115         * Constructor
   146         * Constructor
   116         */
   147         */
   117         CMusEngMceOutSession();
   148         CMusEngMceOutSession( const TRect& aRect,
       
   149                               MMusEngSessionObserver& aSessionObserver,
       
   150                               MMusEngOutSessionObserver& aOutSessionObserver );
   118 
   151 
   119         /**
   152         /**
   120         * Second-phase constructor
   153         * Second-phase constructor
   121         */
   154         */
   122         void ConstructL();
   155         void ConstructL( TUint aSipProfileId );
   123 
   156 
   124         
   157 
   125     private: // from MMusSipProfileUser, overrides base class definition
   158     private:
   126             
   159 
   127         virtual void ProfileRegistered();
   160         /**
   128  
   161         *
   129         
   162         */
   130      private:
   163         void CreateMceSessionStructureL();  
   131         
   164         
   132         void DoInviteL( const TDesC& aRecipient = KNullDesC );
   165         /**
   133        
   166         * Add privacy sip header if call privacy is switched on else otherwise.
   134         HBufC* ResolveRecipientLC();  
   167         */
   135         
   168         void AddPrivacyHeaderL( CDesC8Array& aHeaders );
   136         static TInt AsyncBrakeCompleted( TAny* aPtr );
   169         
   137         
   170         
   138         static TInt RegistrationTimerExpired( TAny* aPtr );
       
   139 
       
   140         static TInt InvitationResponseTimerExpired( TAny* aPtr );
       
   141         
       
   142         void InitRecipientNotFoundHandling();
       
   143 
       
   144         void HandleRecipientNotFound();
       
   145         
       
   146         TBool DoSyncRetryL();
       
   147 
       
   148         void SplitL( const TDesC& aDes, const TDesC& aChar, CDesCArray* aArray );
       
   149         
       
   150         HBufC* ReadDescPropertyL( TUint aKey );
       
   151 
       
   152         TBool IgnoreErrorNote();
       
   153         
       
   154         HBufC* RemoteAddressL() const;
       
   155         
       
   156         void InputRecipientL( TDes& aRecipientAddress );
       
   157     
       
   158     protected: // DATA
   171     protected: // DATA
   159     
   172 
   160         HBufC* iRemoteDisplayName;
   173         /**
   161         HBufC8* iRecipient;      
   174         * Callback reference to outsession observer interface.
       
   175         */
       
   176         MMusEngOutSessionObserver& iOutSessionObserver;
       
   177         
       
   178         /**
       
   179         * ETrue if operator specific behavior is expected
       
   180         */
       
   181         TBool iPrivate; 
       
   182         
       
   183         /**
       
   184         * ETrue if private number is turn on
       
   185         */
       
   186         TBool iPrivateNumber;
       
   187         
       
   188     
       
   189     protected: // DATA
       
   190     
       
   191         /**
       
   192         * Recipient of session to be constructed
       
   193         */
       
   194         HBufC8* iRecipient;
       
   195         
   162         HBufC8* iVideoCodecList;
   196         HBufC8* iVideoCodecList;
   163         TInt iTriedInvitations;
   197         
   164         HBufC* iRemoteSipAddressProposal;
       
   165         CDeltaTimer* iDeltaTimer;
       
   166         TCallBack iAsyncBrakeCallBack;
       
   167         TDeltaTimerEntry iAsyncBrakeEntry;
       
   168         TCallBack iRegistrationCallBack;
       
   169         TCallBack iInvitationResponseCallBack;
       
   170         TDeltaTimerEntry iRegistrationEntry;
       
   171         TDeltaTimerEntry iInvitationResponseEntry;
       
   172         TBool iRegistrationPending;
       
   173         TBool iAddressQueried;
       
   174         
   198         
   175     private:
   199     private:
   176     
   200     
   177         MUS_UNITTEST ( UT_CMusEngOutSession )
   201         MUS_UNITTEST ( UT_CMusEngOutSession )
       
   202 
   178     };
   203     };
   179 #endif //MUSHENGMCESESSION_H
   204 #endif //MUSHENGMCESESSION_H