mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/inc/musengmcesession.h
branchRCL_3
changeset 33 bc78a40cd63c
parent 32 73a1feb507fb
child 35 6c57ef9392d2
equal deleted inserted replaced
32:73a1feb507fb 33:bc78a40cd63c
     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 "musengcamerahandler.h"
       
    24 #include "musengdisplayhandler.h"
       
    25 #include "lcsession.h"
       
    26 #include "lcaudiocontrol.h"
       
    27 #include "svptimerobserver.h"
       
    28 
       
    29 #include <e32base.h>
       
    30 
       
    31 
       
    32 // FORWARD DECLARATIONS
       
    33 class CContactTextField;
       
    34 class CPbkContactItem;
       
    35 class CPbkContactEngine;
       
    36 class MLcSessionObserver;
       
    37 class CMusEngLiveVideoPlayer;
       
    38 class CMusEngRemoteVideoPlayer;
       
    39 class CSVPTimer;
       
    40 
       
    41 
       
    42 // CONSTANTS
       
    43 
       
    44 _LIT8( KMusEngAcceptContactHeader, 
       
    45        "Accept-Contact: *;+g.3gpp.cs-voice; explicit" );
       
    46 _LIT8( KMusAcceptHeader, 
       
    47        "Accept: application/sdp" );
       
    48 _LIT8( KMusEngSessionSdpLineXApplication, "a=X-application:com.nokia.rtvs\r\n" );
       
    49 _LIT8( KMusEngSessionSdpLineApplication , "a=application:com.gsma.rts\r\n" );
       
    50 _LIT8( KMusEngSessionSdpLineType, "a=type:videolive\r\n" );
       
    51 _LIT8( KMusEngSessionSdpLineBandwidthLine  , "b=AS:" );
       
    52 _LIT8( KMusEngSessionSdpLineBandwidthField  , "b=AS:85\r\n" );
       
    53 _LIT8( KMusEngSessionSdpLineTiasLine  , "b=TIAS:" );
       
    54 _LIT8( KMusPPreferredIdentity, "P-Preferred-Identity" );
       
    55 _LIT8( KMusEngNewLine  , "\r\n" );
       
    56 
       
    57 const TInt KMusTiasMultiplier = 1000;
       
    58 const TUint8 KMusEngRtpKeepAliveTimer = 5;
       
    59 const TUint8 KMusEngKeepAlivePayloadTypeVideoH263 = 96;
       
    60 const TUint8 KMusEngKeepAlivePayloadTypeAudio = 97;
       
    61 const TUint8 KMusEngKeepAlivePayloadTypeVideoAvc = 98;
       
    62 
       
    63 // CLASS DECLARATION
       
    64 
       
    65 /**
       
    66 * Base class for Multimedia Sharing Engine MCE sessions, inherited by
       
    67 * CMusEngLiveSession CMusEngClipSession and CMusEngReceiveSession.
       
    68 *
       
    69 * CMusEngMceSession encapsulates CMCESession and simplifies use of
       
    70 * MCE Sessions to user interface. Also splits observers messy events
       
    71 * to simplified function calls.
       
    72 *
       
    73 * @lib musengine.lib
       
    74 */
       
    75 class CMusEngMceSession : public CBase,
       
    76                           public MLcSession,
       
    77                           public MLcAudioControl,
       
    78 			  public MMusEngDisplayHandler,
       
    79 			  public MSVPTimerObserver
       
    80     {
       
    81     public:
       
    82 
       
    83         /**
       
    84         * Destructor
       
    85         */
       
    86         ~CMusEngMceSession();
       
    87 
       
    88 	void SetRemoteL( const TDesC& aRemote );
       
    89 
       
    90     public: //  from MSVPTimerObserver
       
    91 
       
    92         virtual void TimedOut( TInt aTimerId );       
       
    93 
       
    94         
       
    95     public: //  from MMusEngDisplayHandler
       
    96 
       
    97         /**
       
    98         * Returns currently assigned drawing area
       
    99         *
       
   100         * @return TRect This session drawing area rectangle
       
   101         */
       
   102         TRect Rect() const;
       
   103         
       
   104         /**
       
   105         * Sets new drawing area
       
   106         *
       
   107         * @param TRect This session new drawing area rectangle
       
   108         */
       
   109         void SetRectL( const TRect& aRect );
       
   110         
       
   111         /**
       
   112         * Sets secondary rect (e.g. viewfinder in twoway session)
       
   113         * @param TRect This session new secondary drawing area rectangle
       
   114         */
       
   115         void SetSecondaryRectL( const TRect& aSecondaryRect );
       
   116         
       
   117         /**
       
   118         * Gets secondary rect.
       
   119         * @return TRect This session secondary drawing area rectangle
       
   120         */
       
   121         virtual TRect SecondaryRect() const;
       
   122             
       
   123         /**
       
   124         * Returns current display orientation.
       
   125         *
       
   126         * @pre Session is ongoing
       
   127         * @return Current display orientation 
       
   128         * @leave KErrNotReady if precondition is not fullfilled
       
   129         */
       
   130         TDisplayOrientation OrientationL();
       
   131         
       
   132         /**
       
   133         * Sets display orientation.
       
   134         *
       
   135         * @pre Session is ongoing
       
   136         * @return Sets display orientation 
       
   137         * @leave KErrNotReady if precondition is not fullfilled
       
   138         */
       
   139         void SetOrientationL( TDisplayOrientation aOrientation );
       
   140 
       
   141         /**
       
   142         * Permission to draw on screen device.
       
   143         * 
       
   144         * @pre Session is ongoing
       
   145         */
       
   146         void EnableDisplayL( TBool aEnable );
       
   147         
       
   148         /**
       
   149         * Implements virtual from MMusEngDisplayHandler
       
   150         *
       
   151         * @pre Session is ongoing
       
   152         */
       
   153         TBool IsDisplayEnabled();
       
   154         
       
   155         /**
       
   156         * Implements virtual from MMusEngDisplayHandler
       
   157         *
       
   158         * @pre Session is ongoing
       
   159         */
       
   160         TBool IsDisplayActive();
       
   161 
       
   162         
       
   163     public: // From MMusEngAudioRoutingObserver
       
   164         
       
   165         void AudioRoutingChanged();        
       
   166         
       
   167         
       
   168     public: // From MLcSession
       
   169     
       
   170     	 virtual void UpdateLcSessionL();
       
   171         
       
   172         virtual TLcSessionState LcSessionState() const;
       
   173         
       
   174         void SetLcSessionObserver( MLcSessionObserver* aObserver );
       
   175 
       
   176         void SetLcUiProvider( MLcUiProvider* aUiProvider );        
       
   177         
       
   178         virtual MLcVideoPlayer* RemoteVideoPlayer();
       
   179     
       
   180         virtual MLcVideoPlayer* LocalVideoPlayer();       
       
   181        
       
   182         virtual const TDesC& LocalDisplayName();
       
   183     
       
   184         virtual const TDesC& RemoteDisplayName();
       
   185 
       
   186         TInt SetParameter( TInt aId, TInt aValue );
       
   187 
       
   188         TInt ParameterValue( TInt aId );    
       
   189         
       
   190         TBool IsBackgroundStartup();
       
   191         
       
   192         TInt SetForegroundStatus( TBool aIsForeground );
       
   193         
       
   194         const TDesC& RemoteDetails();
       
   195         
       
   196         TBool SendDialTone( TChar aKey);        
       
   197 
       
   198     public: // From MLcAudioControl
       
   199         
       
   200         TBool IsLcAudioMutedL();
       
   201 
       
   202         void MuteLcAudioL( TBool aMute );       
       
   203 
       
   204         TBool IsLcMicMutedL();    
       
   205 
       
   206         void MuteLcMicL( TBool aMute );
       
   207         
       
   208         TBool IsEnablingLcLoudspeakerAllowed();
       
   209 
       
   210         void EnableLcLoudspeakerL( TBool aEnabled );
       
   211         
       
   212         TBool IsLcLoudspeakerEnabled();
       
   213 
       
   214         TInt LcVolumeL();
       
   215      
       
   216         void SetLcVolumeL( TInt aValue );    
       
   217     
       
   218         void IncreaseLcVolumeL();
       
   219         
       
   220         void DecreaseLcVolumeL();        
       
   221 
       
   222         
       
   223     protected: // CONSTRUCTORS
       
   224 
       
   225         /**
       
   226         * Constructor
       
   227         *
       
   228         */
       
   229         CMusEngMceSession();
       
   230 
       
   231         /**
       
   232         * Second-phase constructor
       
   233         */
       
   234         void ConstructL();
       
   235                             
       
   236     protected: // Data
       
   237 
       
   238         /**
       
   239         * Drawing area rect.
       
   240         */
       
   241         TRect iRect;
       
   242         
       
   243         /**
       
   244         * ETrue if operator specific behavior is expected
       
   245         */
       
   246         TBool iOperatorVariant;
       
   247 
       
   248         /**
       
   249         * Session state for MLcSession 
       
   250         */
       
   251         MLcSession::TLcSessionState iLcSessionState;       
       
   252                                 
       
   253         TMusEngCameraHandler iCameraHandler;
       
   254 
       
   255         CMusEngLiveVideoPlayer* iLiveVideoPlayer;
       
   256         CMusEngRemoteVideoPlayer* iRemoteVideoPlayer;
       
   257         TRect iSetRemoteRect;
       
   258         TRect iSetLocalRect;
       
   259 	CSVPTimer* iTimer;
       
   260     	TLcSessionState lLcSessionState;
       
   261 	HBufC* iRemoteAddress;
       
   262 
       
   263     private: // Data
       
   264 
       
   265         /**
       
   266         * The session observer, if present.
       
   267         */
       
   268         MLcSessionObserver* iLcSessionObserver;
       
   269 
       
   270         /**
       
   271         * The UI provider, if present.
       
   272         */        
       
   273         MLcUiProvider* iLcUiProvider;        
       
   274                 
       
   275         /**
       
   276         * Value indicates whether session was started in background mode.
       
   277         * (see IsBackgroundStartup()). Once sending of video started, 
       
   278         * iBackground is set to EFalse
       
   279         */
       
   280         TBool iBackground;
       
   281 
       
   282 
       
   283     };
       
   284     
       
   285 #endif // MUSENGMCESESSION_H