mmsharing/mmshengine/inc/musengmceoutsession.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 MUSHENGMCEOUTSESSION_H
       
    20 #define MUSHENGMCEOUTSESSION_H
       
    21 
       
    22 // USER
       
    23 #include "musengmcesession.h"
       
    24 #include "musunittesting.h"
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class MLcUiProvider;
       
    28 class CMceStreamBundle;
       
    29 
       
    30 // CLASS DECLARATION
       
    31 /**
       
    32 * Class for handling MCE out sessions. Direct inherit classes are
       
    33 * CMusEngLiveSession and CMusEngClipSession.
       
    34 *
       
    35 * @lib musengine.lib
       
    36 */
       
    37 class CMusEngMceOutSession : public CMusEngMceSession
       
    38     {
       
    39     MUS_UNITTEST( UT_CMusEngOutSession )
       
    40 
       
    41     public:
       
    42 
       
    43         /**
       
    44         * Destructor
       
    45         */
       
    46         ~CMusEngMceOutSession();
       
    47 
       
    48     public: // From MLcSession
       
    49         
       
    50         const TDesC& RemoteDisplayName();
       
    51         
       
    52         void EstablishLcSessionL();
       
    53         
       
    54         void TerminateLcSessionL();        
       
    55         
       
    56     protected: // Must be implemented in derived class
       
    57 
       
    58         /**
       
    59         * @param aLocalBundle All local streams are supposed to be added to
       
    60         *        this bundle
       
    61         */
       
    62         virtual void CompleteSessionStructureL( 
       
    63                                         CMceStreamBundle& aLocalBundle ) = 0;
       
    64     
       
    65         virtual void AddDisplayL( CMceMediaStream& aStream );
       
    66     
       
    67     protected: // May be overridden in derived classes
       
    68          
       
    69         /**
       
    70         * Calls EstablishL-function of class CMceOutSession with feature tag 
       
    71         * in Accept-Contact header. Functions also adjusts stream and codec
       
    72         * settings by calling CMusEngMceSession::AdjustStreamsAndCodecsL.
       
    73         * Intention of the function is to provide subclasses means to set 
       
    74         * preconditions to establishment, e.g. succesfull transcoding.
       
    75         */
       
    76         virtual void EstablishSessionL();
       
    77         
       
    78         TBool IsH264Supported() const;
       
    79 
       
    80         /**
       
    81          *
       
    82          */        
       
    83         virtual void CreateMceSessionStructureL( TBool aForceSdpBandwidth =  
       
    84                                                   EFalse );
       
    85 
       
    86          
       
    87     protected: // helper function inherited from CMusEngMceSession
       
    88 
       
    89         /**
       
    90         * Function handling MCE session termination.
       
    91         */
       
    92         void HandleTermination( TInt aStatusCode, const TDesC8& aReasonPhrase );
       
    93 
       
    94         /**
       
    95         * Sets Multimediasharing specific video codec settings like video 
       
    96         * payload types. This functions gets called for every video codec in 
       
    97         * session. This function overrides function in base class and may 
       
    98         * be further overridden. Function calls also overridden version.
       
    99         */ 
       
   100         void AdjustVideoCodecL( CMceVideoCodec& aVideoCodec, 
       
   101                                 TMceSourceType aSourceType );
       
   102         
       
   103         /**
       
   104         * Sets Multimediasharing specific audio codec settings like audio and
       
   105         * video payload types. This functions gets called for every audio 
       
   106         * codec in session.  This function overrides function in base class and
       
   107         * may be further overridden. Function calls also overridden version.
       
   108         */ 
       
   109         void AdjustAudioCodecL( CMceAudioCodec& aAudioCodec );
       
   110         
       
   111 
       
   112     protected:
       
   113 
       
   114         /**
       
   115         * Constructor
       
   116         */
       
   117         CMusEngMceOutSession();
       
   118 
       
   119         /**
       
   120         * Second-phase constructor
       
   121         */
       
   122         void ConstructL();
       
   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 );
       
   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
       
   159     
       
   160         HBufC* iRemoteDisplayName;
       
   161         HBufC8* iRecipient;      
       
   162         HBufC8* iVideoCodecList;
       
   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;
       
   174         
       
   175     private:
       
   176     
       
   177         MUS_UNITTEST ( UT_CMusEngOutSession )
       
   178     };
       
   179 #endif //MUSHENGMCESESSION_H