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