vtengines/videoteleng/Inc/Media/CVtEngLocalVideo.h
changeset 0 ed9695c8bcbe
child 24 f15ac8e65a02
equal deleted inserted replaced
-1:000000000000 0:ed9695c8bcbe
       
     1 /*
       
     2 * Copyright (c) 2004-2007 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:  Local video handler.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CVTENGLOCALVIDEO_H
       
    20 #define CVTENGLOCALVIDEO_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <capivideosource.h>
       
    25 #include "TVtEngRendering.h"
       
    26 #include "TVtEngRenderingDSA.h"
       
    27 #include "TVtEngRenderingDP.h"
       
    28 #include "TVtEngRenderingNGA.h"
       
    29 #include "VtEngEvents.h"
       
    30 #include "MVtEngMedia.h" //TMediaSource
       
    31 #include "MVtEngSettingPSObserver.h"
       
    32 #include "CVTEngPubSubsListener.h"
       
    33 #include "mvtengcamerapreferencesobserver.h"
       
    34 
       
    35 // FORWARD DECLARATIONS
       
    36 class CVSDataProvider;
       
    37 class CVtEngMediaHandler;
       
    38 class CVtEngCameraPreferences;
       
    39 
       
    40 // CLASS DECLARATION
       
    41 
       
    42 /**
       
    43 *  Local (uplink) video handling.
       
    44 *
       
    45 *  @lib videoteleng.lib
       
    46 *  @since Series 60 2.6
       
    47 */
       
    48 NONSHARABLE_CLASS( CVtEngLocalVideo ) :
       
    49     public CActive,
       
    50     public MVSDataProviderObserver,
       
    51     public MVSDataSourceObserver,
       
    52     public MVSControllerObserver,
       
    53 	public MVtEngSettingPSObserver
       
    54     {
       
    55     public:  // Constructors and destructor
       
    56 
       
    57         /**
       
    58         * Symbian two-phase constructor.
       
    59         * @param aObserver callback interface to Media Handler
       
    60         * @return local video instance
       
    61         */
       
    62         static CVtEngLocalVideo* NewL(
       
    63             CVtEngMediaHandler& aObserver );
       
    64 
       
    65         /**
       
    66         * Destructor.
       
    67         */
       
    68         virtual ~CVtEngLocalVideo();
       
    69 
       
    70     public: // Public data structures
       
    71         enum TVtEngProviderType
       
    72             {
       
    73             KVtEngProviderUndefined  = -1,
       
    74             /** Blank imnage provider */
       
    75             KVtEngProviderNone       = 0,
       
    76             /** Primary camera provider */
       
    77             KVtEngProviderCam1,
       
    78             /** Secondary camera provider */
       
    79             KVtEngProviderCam2,
       
    80             /** GS image provider */
       
    81             KVtEngProviderImage,
       
    82             /** ? */
       
    83             KVtEngProviderTempImage,
       
    84             /** Still share provider */
       
    85             KVtEngProviderShareImage,
       
    86             /** Video share provider */
       
    87             KVtEngProviderShareVideoClip,
       
    88             /** Default image provider */
       
    89             KVtEngProviderDefaultStillImage
       
    90             };
       
    91 
       
    92     public: // from MVSDataProviderObserver
       
    93 
       
    94         /**
       
    95         * @see MVSDataProviderObserver::vsProviderError
       
    96         */
       
    97         virtual void vsProviderError( TInt aError );
       
    98 
       
    99         /**
       
   100         * @see MVSDataProviderObserver::vsProviderReady
       
   101         */
       
   102         virtual void vsProviderReady();
       
   103 
       
   104         /**
       
   105         * @see MVSDataProviderObserver::vsViewFinderFrameReady
       
   106         */
       
   107         virtual void vsViewFinderFrameReady( CFbsBitmap& aFrame );
       
   108 
       
   109     public: // from MVSDataSourceObserver
       
   110 
       
   111         /**
       
   112         * @see MVSDataSourceObserver::vsProviderSwitchDone
       
   113         */
       
   114         virtual void vsProviderSwitchDone( CVSDataProvider* aOldProvider );
       
   115 
       
   116     public: // from MVSControllerObserver
       
   117 
       
   118         /**
       
   119         * @see MVSControllerObserver::vsProvidersChanged
       
   120         */
       
   121         void vsProvidersChanged( TBool aAttached );
       
   122 
       
   123     public: // From MVtEngSettingPSObserver.
       
   124 
       
   125         /** @see MVtEngSettingPSObserver */
       
   126         virtual void HandleNotifyPSL( const TUid aUid,
       
   127                 const TInt& aKey, const TRequestStatus& aStatus );
       
   128 
       
   129     public:  // New functions
       
   130 
       
   131         /**
       
   132         * Pauses frame sending from video source (this method is called when
       
   133         * VT is initializing and video source has not yet been added to stack)
       
   134         *
       
   135         */
       
   136         void PauseVideoSending();
       
   137 
       
   138         /**
       
   139         * Resumes frame sending from video source.
       
   140         *
       
   141         */
       
   142         void ResumeVideoSending();
       
   143 
       
   144         /**
       
   145         * Tells if the provider has started viewfinder.
       
   146         * @return ETrue if started
       
   147         */
       
   148         TBool ViewFinderStarted() const;
       
   149 
       
   150         /**
       
   151         * Tells if the provider has been frozen.
       
   152         * @return ETrue if frozen
       
   153         */
       
   154         TBool IsFrozen() const;
       
   155 
       
   156         /**
       
   157         * Creates an audio source.
       
   158         * @return an error code
       
   159         */
       
   160         TInt CreateAudioSource();
       
   161 
       
   162         /**
       
   163         * Sets configuration for view finder.
       
   164         * @param aParams view finder configuration
       
   165         */
       
   166         void SetViewFinderParameters( const TVtEngRenderingOptions& aParams );
       
   167 
       
   168         /**
       
   169         * Sets DSA configuration for view finder.
       
   170         * @param aDSA DSA configuration
       
   171         */
       
   172         void SetViewFinderParameters( const TVtEngRenderingOptionsDSA& aDSA );
       
   173 
       
   174         /**
       
   175         * Sets DP configuration for view finder.
       
   176         * @param aDP DP configuration
       
   177         */
       
   178         void SetViewFinderParameters( const TVtEngRenderingOptionsDP& aDP );
       
   179 
       
   180         /**
       
   181         * Sets default still image.
       
   182         */
       
   183         void SetDefaultStillImageL();
       
   184 
       
   185         /**
       
   186         * Sets still image or none.
       
   187         * @param aSetAsActive sets as active provider
       
   188         */
       
   189         void SetStillImageL( TBool aSetAsActive );
       
   190 
       
   191         /**
       
   192         * Initializes default blank provider.
       
   193         */
       
   194         void InitializeL();
       
   195 
       
   196         /**
       
   197         * Selects camera1, camera2, still image or none as source.
       
   198         * @param aSource video source
       
   199         * @return ETrue if selecting started
       
   200         */
       
   201         TBool SelectSourceL( TVtEngProviderType aSource );
       
   202 
       
   203         /**
       
   204         * Returns currently active video provider.
       
   205         * @return provider type
       
   206         */
       
   207         TVtEngProviderType ActiveProvider( ) const;
       
   208 
       
   209         /**
       
   210         * Starts view finder if it was started earlier and current state is
       
   211         * ELocReady.
       
   212         */
       
   213         void StartViewFinderIfWasStartedL();
       
   214 
       
   215         /**
       
   216         * Starts view finder. Uses either DSA or WS depending on
       
   217         * which configuration is active.
       
   218         * @param aClientRequest request issued by user
       
   219         */
       
   220         void StartViewFinderL( TBool aClientRequest = EFalse );
       
   221 
       
   222         /**
       
   223         * Stops view finder.
       
   224         * @param aClientRequest request issued by user
       
   225         */
       
   226         void StopViewFinder( TBool aClientRequest = EFalse );
       
   227 
       
   228         /**
       
   229         * Freeze video sending (i.e. start sending last frame only).
       
   230         */
       
   231         void FreezeL();
       
   232 
       
   233         /**
       
   234         * Unfreeze video sending (i.e. resume sending).
       
   235         */
       
   236         void UnfreezeL();
       
   237 
       
   238         /**
       
   239         * Checks that all other providers don't have
       
   240         * view finder active and stops if found.
       
   241         * @param aProvider provider that should not be stopped
       
   242         */
       
   243         void CheckOthersStopped( const CVSDataProvider& aProvider );
       
   244 
       
   245         /**
       
   246         * Returns video source.
       
   247         * @return video source
       
   248         */
       
   249         MVTVideoSource* Source() const;
       
   250 
       
   251         /**
       
   252         * Returns audio source.
       
   253         * @return audio source
       
   254         */
       
   255         MVTAudioSource* AudioSource() const;
       
   256 
       
   257         /**
       
   258         * Gets media state.
       
   259         * @param aActiveMedia returns active TMediaType
       
   260         * @return Symbian OS error code
       
   261         */
       
   262         TInt GetMediaState( TInt& aActiveMedia );
       
   263 
       
   264         /**
       
   265         * Gets source type.
       
   266         * @return media source type
       
   267         */
       
   268         MVtEngMedia::TMediaSource GetMediaSource();
       
   269 
       
   270         /**
       
   271         * Gets source capabilities.
       
   272         * @param aCaps capability of providers
       
   273         * @return Symbian OS error code
       
   274         */
       
   275         TInt GetSourceCaps( TInt& aCaps );
       
   276 
       
   277         /**
       
   278         * Sets boolean to indicate if the provider is to be initialized only.
       
   279         * Selected camera is not necessary activated. If current media is
       
   280         * other than camera, initialization can be done on the background.
       
   281         * @param aInitOnly boolean value stating if to initialize only
       
   282         */
       
   283         void InitializeOnly( TBool aInitOnly = ETrue );
       
   284 
       
   285         /**
       
   286         * Sets boolean to indicate if the provider is to be initialized only.
       
   287         * @param aInitOnly boolean value stating if to initialize only
       
   288         */
       
   289         void InitializeOnlyEx( TBool aInitOnly = ETrue );
       
   290 
       
   291         /**
       
   292         * Indicates if camera provider is initialized.
       
   293         * @param aId provider ID
       
   294         * @param aInitialized
       
   295         * @return Symbian OS error code
       
   296         */
       
   297         TInt IsInitialized( MVtEngMedia::TCameraId aId, TBool& aInitialized );
       
   298 
       
   299         /**
       
   300         * Gets camera info.
       
   301         * @param TCameraId camera ID
       
   302         * @param aInfo camera info
       
   303         * @return Symbian OS error code
       
   304         */
       
   305         TInt GetCameraInfo( MVtEngMedia::TCameraId aId,
       
   306             MVtEngMedia::TCameraInfo& aInfo );
       
   307 
       
   308         /**
       
   309         * Gets current digital zoom step (Factor in VS camera terminology).
       
   310         * @param aCurrentStep current zoom step
       
   311         * @return Symbian OS error code
       
   312         */
       
   313         TInt GetDigitalZoomFactor( TInt& aCurrentStep );
       
   314 
       
   315         /**
       
   316         * Gets maximum digital zoom value that may be passed to camera.
       
   317         * @param aMaxZoomStep maximum zoom step
       
   318         * @return Symbian OS error code
       
   319         */
       
   320         TInt GetMaxDigitalZoomStep( TInt& aMaxZoomStep );
       
   321 
       
   322         /**
       
   323         * Gets number of major zoom level leaps.
       
   324         * One to maximum digital zoom steps plus one.
       
   325         * Less than or equal to maximum digital zoom steps plus one.
       
   326         * @param aCount number of leaps
       
   327         * @param aProviderSupplied use original or mapped
       
   328         * @return Symbian OS error code
       
   329         */
       
   330         TInt GetMajorDigitalZoomStepCount( TInt& aCount,
       
   331             TBool aProviderSupplied = EFalse );
       
   332 
       
   333         /**
       
   334         * Maps major zoom leap step to corresponding step index.
       
   335         * @param aIndex major zoom step
       
   336         * @param aStep zoom step
       
   337         */
       
   338         void GetMajorDigitalZoomStep( const TInt aIndex, TInt& aStep );
       
   339 
       
   340         /**
       
   341         * Sets video provider's digital zoom step.
       
   342         * @param aDigitalZoomFactor step
       
   343         */
       
   344         void SetDigitalZoomFactorL( TInt aDigitalZoomFactor );
       
   345 
       
   346         /**
       
   347         * Gets video provider's freeze support.
       
   348         * @param aFreezeSupported Freeze support status
       
   349         * @return KErrNotReady if provider not initialized.
       
   350         */
       
   351         TInt GetFreezeSupported( TBool& aFreezeSupported ) const;
       
   352 
       
   353         /**
       
   354         * Returns ETrue if it is ok to freeze provider.
       
   355         */
       
   356         TBool OkToFreeze() const;
       
   357 
       
   358         /**
       
   359         * Returns ETrue if it is ok to unfreeze provider.
       
   360         */
       
   361         TBool OkToUnfreeze() const;
       
   362 
       
   363         /**
       
   364         * Sets audio as muted.
       
   365         */
       
   366         void Mute();
       
   367 
       
   368         /**
       
   369         * Resumes audio output.
       
   370         */
       
   371         void UnMute();
       
   372 
       
   373         /**
       
   374         * Sets UI foreground state (i.e. is the Application
       
   375         * current active application or not).
       
   376         * @param aForeground ETrue if the VT application is
       
   377         * in foreground, EFalse otherwise.
       
   378         */
       
   379         void SetUIForeground( TBool aForeground );
       
   380 
       
   381         /**
       
   382         * Gets current media object sharing state. Only local video related
       
   383         * checks do here. Connection issues have been checked by
       
   384         * the caller.
       
   385         * @param aObjectSharingState On return contains current media object
       
   386         * sharing state. @see MVtEngMedia::TShareObjectState.
       
   387         */
       
   388         void GetObjectSharingState(
       
   389             MVtEngMedia::TShareObjectState& aObjectSharingState ) const;
       
   390 
       
   391         /**
       
   392         * Start Image sharing initialization.
       
   393         */
       
   394         void InitializeShareImageL(
       
   395             const MVtEngMedia::TShareObjectImageParameters& aParameters,
       
   396             TBool& aFirstTime );
       
   397 
       
   398         /**
       
   399         * Cancel Image sharing initialization.
       
   400         */        
       
   401         void CancelInitializeShareImage();
       
   402 
       
   403         /**
       
   404         * Start Image sharing.
       
   405         */
       
   406         void StartShareImageL();
       
   407 
       
   408         /**
       
   409         * Stop Image sharing.
       
   410         */
       
   411         void StopShareImageL();
       
   412 
       
   413         /**
       
   414         * Report error.
       
   415         */
       
   416         void ShareError( TInt aError );
       
   417 
       
   418         /**
       
   419         * Returns share's stored media source.
       
   420         */
       
   421         TVtEngProviderType ShareStoredSource() const;
       
   422 
       
   423         /**
       
   424         * General settings changed.
       
   425         */
       
   426         void SettingsChanged();
       
   427 
       
   428         /**
       
   429         * Creates camera preferences extension
       
   430         * @since S60 v3.2
       
   431         * @return pointer to extension
       
   432         * @exeption Leaves if creation fails
       
   433         */
       
   434         CVtEngCameraPreferences* CreateCameraPreferencesL();
       
   435 
       
   436         /**
       
   437         * Called when prepare camera has been handled in media handler.
       
   438         */
       
   439         void SetIsPrepareCameraCalled( TBool aCalled );
       
   440 
       
   441         /**
       
   442         * Returns ETrue if prepare camera has been handled in media handler,
       
   443         * EFalse otherwise.
       
   444         */
       
   445         TBool IsPrepareCameraCalled() const;
       
   446 
       
   447         /**
       
   448         * Reinitializes camera if onboard camera is being used as a provider.
       
   449         */
       
   450         void HandleLayoutChangeL();
       
   451 
       
   452         /**
       
   453         * Returns ETrue if delayed select is pending.
       
   454         */
       
   455         TBool IsDelayedSelectPending() const;
       
   456 
       
   457         /**
       
   458         * Completes operation to mediahandler.
       
   459         */
       
   460         void CompleteOperation( const TInt aResult );
       
   461 
       
   462         /**
       
   463         * Called when video channel is opened.
       
   464         */
       
   465         void VideoChannelOpenedL();
       
   466 
       
   467      private: // constructors
       
   468 
       
   469         /**
       
   470         * C++ constructor.
       
   471         * @param aObserver callback interface to Media Handler
       
   472         */
       
   473         CVtEngLocalVideo(
       
   474             CVtEngMediaHandler& aObserver );
       
   475 
       
   476         /**
       
   477         * By default Symbian 2nd phase constructor is private.
       
   478         */
       
   479         void ConstructL( );
       
   480 
       
   481         /**
       
   482         * Async callback method
       
   483         */
       
   484         static TInt CallBackFunc( TAny* aPtr );
       
   485 
       
   486         /**
       
   487         * Returns result.
       
   488         */
       
   489         TInt Result() const;
       
   490 
       
   491         /**
       
   492         * Sets result.
       
   493         */
       
   494         void SetResult( const TInt aResult );
       
   495 
       
   496     private:  // Rendering configuration
       
   497 
       
   498         /**
       
   499         * Options for window server rendering.
       
   500         *   iObserver callback interface
       
   501         *   iSize VF image size
       
   502         */
       
   503         struct TOptions
       
   504             {
       
   505             MVtEngFrameObserver* iObserver;
       
   506             TSize iSize;
       
   507             };
       
   508 
       
   509         /**
       
   510         * Direct screen access options.
       
   511         *   iWsSession windor server session
       
   512         *   iWsSD screen device
       
   513         *   iWindow handle to server based window
       
   514         *   iRect iRect window size
       
   515         *   iClipRect drawing size
       
   516         */
       
   517         struct TDsaOptions
       
   518             {
       
   519             RWsSession*      iWs;
       
   520             CWsScreenDevice* iWsSD;
       
   521             RWindowBase*     iWindow;
       
   522             TRect            iRect;
       
   523             TRect            iClipRect;
       
   524             };
       
   525 
       
   526         /**
       
   527         * Internal state of a video provider.
       
   528         */
       
   529         enum TProviderState
       
   530             {
       
   531             /** initial state */
       
   532             EUndefined = KErrNone,
       
   533             /** never deleted */
       
   534             EPermanent,
       
   535             /** to be deleted when another provider selected */
       
   536             EFading,
       
   537             /** waiting for blank provider switch */
       
   538             EWaiting,
       
   539             /** changing still image */
       
   540             ERefreshing
       
   541             };
       
   542 
       
   543         /**
       
   544         * Provider information.
       
   545         */
       
   546         NONSHARABLE_CLASS( TProviderItem ) :
       
   547             public MVtEngCameraPreferencesObserver
       
   548             {
       
   549             public:
       
   550 
       
   551                 /**
       
   552                 * C++ constructor
       
   553                 */
       
   554                 TProviderItem();
       
   555 
       
   556                 /**
       
   557                 * Destructor
       
   558                 */
       
   559                 ~TProviderItem();
       
   560 
       
   561                 /**
       
   562                 * Sets zoom factor to resetted state.
       
   563                 */
       
   564                 void ResetStoredValues();
       
   565 
       
   566                 /**
       
   567                 * Tries to restore preferences.
       
   568                 */
       
   569                 TInt RestoreZoomFactor();
       
   570 
       
   571                 /**
       
   572                 * Tries to restore preferences.
       
   573                 */
       
   574                 TInt RestorePreferences();
       
   575 
       
   576             public:
       
   577                 // pointer to provider
       
   578                 CVSDataProvider*   iProvider;
       
   579 
       
   580                 // provider type
       
   581                 TVtEngProviderType iType;
       
   582 
       
   583                 // provider initialized
       
   584                 TBool              iInitialized;
       
   585 
       
   586                 // provider has errors
       
   587                 TInt               iErrorCode;
       
   588 
       
   589                 // state of a provider
       
   590                 TProviderState     iProviderState;
       
   591 
       
   592                 // Stored zoom value
       
   593                 TInt               iStoredZoomFactor;
       
   594 
       
   595                 // Error code setting zoom factor
       
   596                 TInt iZFErr;
       
   597 
       
   598             public: // MVtEngCameraPreferencesObserver
       
   599 
       
   600                 /**
       
   601                 * @see MVtEngCameraPreferencesObserver::Attach
       
   602                 */
       
   603                 void Attach( MVtEngCameraPreferences& aCamPrefs );
       
   604 
       
   605                 /**
       
   606                 * @see MVtEngCameraPreferencesObserver::ColorToneUpdated
       
   607                 */
       
   608                 void ColorToneUpdated(
       
   609                     MVtEngCameraPreferences::TColorTone aColorTone );
       
   610 
       
   611                 /**
       
   612                 * @see MVtEngCameraPreferencesObserver::WhiteBalanceUpdated
       
   613                 */
       
   614                 void WhiteBalanceUpdated(
       
   615                     MVtEngCameraPreferences::TWhiteBalance aWhiteBalance );
       
   616 
       
   617                 /**
       
   618                 * @see MVtEngCameraPreferencesObserver::BrightnessUpdated
       
   619                 */
       
   620                 void BrightnessUpdated( TInt aBrightness );
       
   621 
       
   622                 /**
       
   623                 * @see MVtEngCameraPreferencesObserver::ContrastUpdated
       
   624                 */
       
   625                 void ContrastUpdated( TInt aContrast );
       
   626 
       
   627                 /**
       
   628                 * @see MVtEngCameraPreferencesObserver::Detach
       
   629                 */
       
   630                 void Detach( MVtEngCameraPreferences& aCamPrefs );
       
   631 
       
   632             public:
       
   633 
       
   634                 /**
       
   635                 * Detach from preference and reset pointer.
       
   636                 */
       
   637                 void DetachFromCameraPreferences();
       
   638 
       
   639             private:
       
   640 
       
   641                 // Pointer to camera preferences object this provider item is
       
   642                 // attached to
       
   643                 MVtEngCameraPreferences* iCamPrefs;
       
   644 
       
   645                 // Stored color tone value
       
   646                 MVtEngCameraPreferences::TColorTone iColorTone;
       
   647 
       
   648                 // Error code reading color tone value
       
   649                 TInt iCtErr;
       
   650 
       
   651                 // Stored white balance
       
   652                 MVtEngCameraPreferences::TWhiteBalance iWhiteBalance;
       
   653 
       
   654                 // Error code reading white balance value
       
   655                 TInt iWbErr;
       
   656 
       
   657                 // Stored brightness
       
   658                 TInt iBrightness;
       
   659 
       
   660                 // Error code reading brightness value
       
   661                 TInt iBrErr;
       
   662 
       
   663                 // Stored contrast
       
   664                 TInt iContrast;
       
   665 
       
   666                 // Error code reading contrast value
       
   667                 TInt iCrErr;
       
   668 
       
   669                 // ETrue if Attach is called first time
       
   670                 TBool iFirstTime;
       
   671 
       
   672             };
       
   673 
       
   674     /**
       
   675     * Inner class for hiding image sharing details.
       
   676     */
       
   677     NONSHARABLE_CLASS( CVtEngShareImage ) : public CBase
       
   678         {
       
   679         private: // enumerations
       
   680 
       
   681             /**
       
   682             * Media object sharing internal state.
       
   683             */
       
   684             enum TState
       
   685                 {
       
   686                 EStopped,
       
   687                 EInitializing,
       
   688                 ESharing
       
   689                 };
       
   690 
       
   691         public: // New public methods
       
   692 
       
   693             /**
       
   694             * Constructor.
       
   695             */
       
   696             static CVtEngShareImage* NewL( CVtEngLocalVideo& aLocalVideo );
       
   697 
       
   698             /**
       
   699             * C++ destructor.
       
   700             */
       
   701             ~CVtEngShareImage();
       
   702 
       
   703             /**
       
   704             * Start initialization of image sharing.
       
   705             * @param aParameters Image sharing parameters (from UI)
       
   706             * @param aCurrent Currently active provider's type.
       
   707             * @param aFirstTime After call ETrue if this call was first to
       
   708             * share initialize, EFalse otherwise.
       
   709             * @exception May leave with KErrNotReady already initializing. May
       
   710             * also leave with system wide error code if something goes wrong
       
   711             * during provider initialization.
       
   712             */
       
   713             void InitializeL(
       
   714                 const MVtEngMedia::TShareObjectImageParameters& aParameters,
       
   715                 TVtEngProviderType aCurrent,
       
   716                 TBool& aFirstTime );
       
   717 
       
   718             /**
       
   719             * Cancel sharing initialized image.
       
   720             */            
       
   721             void CancelInitialize();
       
   722 
       
   723             /**
       
   724             * Start sharing initialized image.
       
   725             * @exception May leave with KErrNotReady if not initialized. May
       
   726             * also leave with system wide error code if something goes wrong
       
   727             * during provider swap.
       
   728             */
       
   729             void ShareL();
       
   730 
       
   731             /**
       
   732             * Stop sharing image.
       
   733             * @exception May leave with KErrNotReady if not sharing. May also
       
   734             * leave with system wide error code if something goes wrong during
       
   735             * provider swap.
       
   736             */
       
   737             void StopL();
       
   738 
       
   739             /**
       
   740             * An error happened during initialization, sharing or stopping.
       
   741             * @param aError Error reason.
       
   742             */
       
   743             void Error( TInt aError );
       
   744 
       
   745             /**
       
   746             * Returns stored source from sharer.
       
   747             * @return Stored source (source that was selected before share).
       
   748             */
       
   749             TVtEngProviderType StoredSource() const;
       
   750 
       
   751             /**
       
   752             * Get sharing state.
       
   753             * @param aObjectSharingState On return contains current object
       
   754             * sharing state.
       
   755             */
       
   756             void GetObjectSharingState(
       
   757                 MVtEngMedia::TShareObjectState& aObjectSharingState ) const;
       
   758 
       
   759             /**
       
   760             * Check whether share is being initialized or not.
       
   761             * @return ETrue if share is being initialized EFalse otherwise.
       
   762             */
       
   763             TBool IsInitializingShare() const;
       
   764 
       
   765             /**
       
   766             * Called when General settings have been changed.
       
   767             */
       
   768             void SettingsChanged();
       
   769 
       
   770             /**
       
   771             * Called when vsProviderSwitchDone() is called to local video.
       
   772             */
       
   773             void ProviderSwitchDone( CVSDataProvider* aOldProvider );
       
   774 
       
   775             /**
       
   776             * Called when camera change event is received from PS.
       
   777             */
       
   778             void NotifyCameraChanged( const TVtEngProviderType& aProviderType );
       
   779 
       
   780         private: // New private methods
       
   781 
       
   782             /**
       
   783             * C++ constructor.
       
   784             */
       
   785             CVtEngShareImage( CVtEngLocalVideo& aLocalVideo );
       
   786 
       
   787             /**
       
   788             * 2nd constructor, may leave.
       
   789             */
       
   790             void ConstructL();
       
   791 
       
   792             /**
       
   793             * Get image sharing parameters.
       
   794             * @return Constant reference to image sharing parameters.
       
   795             */
       
   796             const MVtEngMedia::TShareObjectImageParameters& Parameters() const;
       
   797 
       
   798             /**
       
   799             * Get initialization state.
       
   800             * @return ETrue if sharing is being initialized, EFalse otherwise.
       
   801             */
       
   802             TBool IsInitializing() const;
       
   803 
       
   804             /**
       
   805             * Set sharing state.
       
   806             * @param aNewState New image sharing state.
       
   807             */
       
   808             void SetState( const TState aNewState );
       
   809 
       
   810             /**
       
   811             * Fetches next available provider item pointer.
       
   812             * @return Pointer to next available provider item or NULL if none
       
   813             * could be found.
       
   814             */
       
   815             TProviderItem* FetchProviderItem() const;
       
   816 
       
   817             /**
       
   818             * Creates provider.
       
   819             */
       
   820             void CreateProviderL( TProviderItem& aProviderItem );
       
   821 
       
   822             /**
       
   823             * Initializes provider.
       
   824             */
       
   825             void InitializeProviderL( TProviderItem& aProviderItem );
       
   826 
       
   827             /**
       
   828             * Deletes provider.
       
   829             */
       
   830             void DeleteProvider( TVtEngProviderType aProviderType );
       
   831 
       
   832             /**
       
   833             * Deletes all precreated providers.
       
   834             */
       
   835             void DeleteProviders();
       
   836 
       
   837         private: // Data
       
   838 
       
   839             // Pointer to local video instance
       
   840             CVtEngLocalVideo* iLocalVideo;
       
   841 
       
   842             // Current state
       
   843             TState iState;
       
   844 
       
   845             // Previous state
       
   846             TState iPreviousState;
       
   847 
       
   848             // Copy of image sharing parameters
       
   849             MVtEngMedia::TShareObjectImageParameters iParameters;
       
   850 
       
   851             // Type of provider that was active before image sharing
       
   852             TVtEngProviderType iStoredType;
       
   853 
       
   854             // Type of provider that was originally active before image sharing
       
   855             // This is needed because iStoredType may change according to PS
       
   856             // events.
       
   857             TVtEngProviderType iOriginalStoredType;
       
   858 
       
   859             // Currently active provider
       
   860             TProviderItem* iActiveProvider;
       
   861 
       
   862             // Currently initialized provider
       
   863             TProviderItem* iInitializingProvider;
       
   864 
       
   865             // Buffered items
       
   866             RPointerArray< TProviderItem > iBuffered;
       
   867 
       
   868             // General settings were changed while sharing
       
   869             TBool iSettingsChanged;
       
   870         };
       
   871 
       
   872     /**
       
   873     * Inner class for handling delayed provider switches (e.g. PS signalled
       
   874     * camera changes)
       
   875     */
       
   876     NONSHARABLE_CLASS( TVtEngDelayedSelect )
       
   877         {
       
   878     public:
       
   879 
       
   880         /**
       
   881         * Constructor
       
   882         */
       
   883         TVtEngDelayedSelect();
       
   884 
       
   885        /**
       
   886         * Called when camera change event is received from PS.
       
   887         */
       
   888         void NotifyDelayedSelect( const TVtEngProviderType& aProviderType );
       
   889 
       
   890         /**
       
   891         * Returns ETrue if delayed select is pending, EFalse otherwise.
       
   892         */
       
   893         TBool IsDelayedSelectPending() const;
       
   894 
       
   895         /**
       
   896         * Returns delayed select target and resets stored value.
       
   897         */
       
   898         TVtEngProviderType DelayedSelectTarget();
       
   899 
       
   900     private: // data
       
   901 
       
   902         TVtEngProviderType iDelayedProviderType;
       
   903         };
       
   904 
       
   905     /**
       
   906     * Inner class for handling layout change reinitialization.
       
   907     */
       
   908     NONSHARABLE_CLASS( TVtEngLayoutChangeHandler )
       
   909         {
       
   910 
       
   911     public:
       
   912 
       
   913         /**
       
   914         * Constructor
       
   915         */
       
   916         TVtEngLayoutChangeHandler( CVtEngLocalVideo& aLocalVideo );
       
   917 
       
   918         /**
       
   919         * Called when layout change has happened
       
   920         */
       
   921         void HandleLayoutChangeL();
       
   922 
       
   923         /**
       
   924         * Called when layout change needs to be cancelled
       
   925         */
       
   926         void CancelHandleLayoutChange();
       
   927 
       
   928         /**
       
   929         * Called when provider is unfrozen.
       
   930         * @return ETrue if unfreeze was handled by the layout change handler,
       
   931         * EFalse otherwise.
       
   932         */
       
   933         TBool UnfreezeL();
       
   934 
       
   935         /**
       
   936         * Called by the local video when provider error happens.
       
   937         * @param aError Type of error
       
   938         * @return ETrue If error was handled by the layout change handler
       
   939         */
       
   940         TBool ProviderError( TInt aError );
       
   941 
       
   942         /**
       
   943         * Called by the local video when provider is ready after initialization.
       
   944         * @return ETrue If callback was handled by the layout change handler.
       
   945         */
       
   946         TBool ProviderReady();
       
   947 
       
   948         /**
       
   949         * Called by the local video when provider has been switched.
       
   950         * @param CVSDataProvider Pointer of old provider instance.
       
   951         * @return ETrue If callback was handled by the layout change handler.
       
   952         */
       
   953         TBool ProviderSwitchDone( CVSDataProvider* aOldProvider );
       
   954 
       
   955     private:
       
   956 
       
   957         /**
       
   958         * 2nd constructor
       
   959         */
       
   960         void ConstructL();
       
   961 
       
   962         /**
       
   963         * Does the layout change handling.
       
   964         */
       
   965         void DoHandleLayoutChangeL();
       
   966 
       
   967         /**
       
   968         * Call to CompleteL() that is trapped.
       
   969         */
       
   970         TInt Complete( const TInt aError );
       
   971 
       
   972         /**
       
   973         * Completes handling and resets state to EIdle.
       
   974         */
       
   975         void CompleteL( const TInt aError );
       
   976 
       
   977         /**
       
   978         * Completes asynchronous request.
       
   979         */
       
   980         void CompleteOperation( const TInt aError );
       
   981 
       
   982     private: // data
       
   983 
       
   984         // Pointer to local video instance
       
   985         CVtEngLocalVideo* iLocalVideo;
       
   986 
       
   987         /**
       
   988         * Layout change handler internal state.
       
   989         */
       
   990         enum TState
       
   991             {
       
   992             /** Layout change handler is ready to be called */
       
   993             EIdle,
       
   994             /** Layout change handler has been called, but layout update is
       
   995                 pending */
       
   996             ELayoutChangePending,
       
   997             /** Layout change handler is switching blank provider */
       
   998             ESwitchingBlank,
       
   999             /** Layout change handler is initializing camera provider */
       
  1000             EInitializingCamera,
       
  1001             /** Layout change handler is switching camera provider */
       
  1002             ESwitchingCamera
       
  1003             };
       
  1004 
       
  1005         // Handler's internal state
       
  1006         TState iState;
       
  1007 
       
  1008         // Stored provider type
       
  1009         TVtEngProviderType iStored;
       
  1010 
       
  1011         };
       
  1012 
       
  1013         private:
       
  1014 
       
  1015         /**
       
  1016         * Rendering method.
       
  1017         */
       
  1018         enum TRenderingMethod
       
  1019             {
       
  1020             // Unspecified
       
  1021             EUnspecified,
       
  1022             // Through window server
       
  1023             EWindowServer,
       
  1024             // Direct screen access
       
  1025             EDSA,
       
  1026             // Display posting
       
  1027             EDP
       
  1028             };
       
  1029 
       
  1030         /**
       
  1031         * View finder state.
       
  1032         */
       
  1033         enum TViewFinderState
       
  1034             {
       
  1035             // View finder not active.
       
  1036             EVFNone,
       
  1037             // View finder started to reveive bitmaps.
       
  1038             EVFReceivingBitmaps,
       
  1039             // View finder started to render with DSA.
       
  1040             EVFRenderingDsa
       
  1041             };
       
  1042 
       
  1043         /**
       
  1044         * Internal state.
       
  1045         */
       
  1046         enum TState
       
  1047             {
       
  1048             // Initial and state when error occurred.
       
  1049             ELocNone,
       
  1050             // Provider initialization ongoing.
       
  1051             ELocInitializing,
       
  1052             // Switch to another provider ongoing.
       
  1053             ELocSwichingProvider,
       
  1054             // Provider initialization or switch completed.
       
  1055             ELocReady
       
  1056             };
       
  1057 
       
  1058     public:
       
  1059 
       
  1060         /**
       
  1061         * Deletes provider.
       
  1062         * @param aItem provider to delete
       
  1063         */
       
  1064         void DeleteProvider( TProviderItem& aItem );
       
  1065 
       
  1066         /**
       
  1067         * Deletes provider.
       
  1068         * @param aType type of provider to delete.
       
  1069         */
       
  1070         void DeleteProvider( TVtEngProviderType aType );
       
  1071 
       
  1072         /**
       
  1073         * Resets local video after a video call.
       
  1074         */
       
  1075         void Reset();
       
  1076 
       
  1077     private:  // New functions
       
  1078 
       
  1079         /**
       
  1080         * Sets current camera id.
       
  1081         */
       
  1082         void SetCurrentCameraId( MVtEngMedia::TCameraId aCamId );
       
  1083 
       
  1084     	/**
       
  1085     	 * Configures provider item for outwards camera in
       
  1086     	 * construction phase.
       
  1087     	 */
       
  1088     	void ConfigureOutwardsCameraItem(
       
  1089     		TProviderItem& aItem,
       
  1090     		const TInt aCurrentIndex );
       
  1091 
       
  1092         /**
       
  1093         * Calculater digital zoom steps.
       
  1094         * @param aProvider the used provider in counting
       
  1095         * @return amount of major zoom steps
       
  1096         */
       
  1097         TInt CalculateMajorDigitalZoomStepCount(
       
  1098             CVSDataProvider* aProvider );
       
  1099 
       
  1100         /**
       
  1101         * Calculater digital zoom steps.
       
  1102         * @param aInfo provider info structure from which zoom steps will be
       
  1103         * calculated
       
  1104         * @return amount of major zoom steps
       
  1105         */
       
  1106         TInt CalculateMajorDigitalZoomStepCount(
       
  1107             const TVSDataProviderInfo& aInfo ) const;
       
  1108 
       
  1109         /**
       
  1110         * Deletes audio source.
       
  1111         */
       
  1112         void DeleteAudioSource();
       
  1113 
       
  1114         /**
       
  1115         * Gets a provider for a given type.
       
  1116         * @param aType type to search for
       
  1117         * @param aItem returned provider item
       
  1118         * @return index in provider array or KErrNotFound
       
  1119         */
       
  1120         TInt GetProviderByType(
       
  1121             TVtEngProviderType aType, TProviderItem& aItem );
       
  1122 
       
  1123         /**
       
  1124         * Gets a provider for a given type.
       
  1125         * @param aType type to search for
       
  1126         * @param aItem returned provider item
       
  1127         * @return index in provider array or KErrNotFound
       
  1128         */
       
  1129         TInt GetProviderByType(
       
  1130             TVtEngProviderType aType, TProviderItem*& aItem );
       
  1131 
       
  1132         /**
       
  1133         * Gets a provider for a given provider instance.
       
  1134         * @param aInstance Instance to search for
       
  1135         * @param aItem returned provider item
       
  1136         * @return index in provider array or KErrNotFound
       
  1137         */
       
  1138         TInt GetProviderByInstance(
       
  1139             const CVSDataProvider* aInstance,
       
  1140             TProviderItem*& aItem ) const;
       
  1141 
       
  1142         /**
       
  1143         * Initializes provider.
       
  1144         * @param aProviderItem provider
       
  1145         */
       
  1146         void InitializeProviderL( TProviderItem& aProviderItem );
       
  1147 
       
  1148         /**
       
  1149         * Initializes provider for sharing.
       
  1150         */
       
  1151         void InitializeShareProviderL( TProviderItem& aProviderItem,
       
  1152             const TDesC8& aParams );
       
  1153 
       
  1154         /**
       
  1155         * Re-creates provider. First deletes old instance inside provider
       
  1156         * item structure and then creates a new instance, using given
       
  1157         * provider type.
       
  1158         * @param aProviderItem Provider to be recreated.
       
  1159         * @param aType Type of the new provider to be created.
       
  1160         */
       
  1161         void ReCreateProviderL(
       
  1162             TProviderItem& aProviderItem, const TVtEngProviderType aType );
       
  1163 
       
  1164         /**
       
  1165         * Provider index by provider type.
       
  1166         * @param aType Type of provider
       
  1167         */
       
  1168         TInt ProviderIndex( TVtEngProviderType aType ) const;
       
  1169 
       
  1170         /**
       
  1171         * Gets a provider index by state.
       
  1172         * @param aState state of returned provider
       
  1173         * @return Index of provider
       
  1174         */
       
  1175         TInt ProviderIndexByState( TProviderState aState ) const;
       
  1176 
       
  1177         /**
       
  1178         * Gets a provider index by provider instance.
       
  1179         * @param aInstance instance of provider to be found
       
  1180         * @return Index of provider or KErrNotFound if given provider item
       
  1181         * is not found
       
  1182         */
       
  1183         TInt ProviderIndexByInstance( const CVSDataProvider* aInstance ) const;
       
  1184 
       
  1185         /**
       
  1186         * Creates VideoSource provider by type.
       
  1187         * @param aType Engine provider type
       
  1188         * @return CVSDataProvider pointer
       
  1189         */
       
  1190         CVSDataProvider* CreateDataProviderL( TVtEngProviderType aType );
       
  1191 
       
  1192         /**
       
  1193         * Maps camera orientation to provider type.
       
  1194         * @param aOrientation camera orientation
       
  1195         * @return provider type
       
  1196         */
       
  1197         static TVtEngProviderType
       
  1198             OrientationToType( TCameraInfo::TCameraOrientation aOrientation );
       
  1199 
       
  1200         /**
       
  1201         * Maps camera ID to provider type.
       
  1202         * @param aId camera ID
       
  1203         * @return provider type
       
  1204         */
       
  1205         static TVtEngProviderType CameraIdToType( MVtEngMedia::TCameraId aId );
       
  1206 
       
  1207         /**
       
  1208         * Creates blank still image provider.
       
  1209         * @param aIndex index of still image provider
       
  1210         */
       
  1211         void CreateBlankProviderL( const TInt aIndex );
       
  1212 
       
  1213         /**
       
  1214         * Creates default still image provider.
       
  1215         * @param aIndex index of default still image provider
       
  1216         */
       
  1217         void CreateDefaultStillImageProviderL( const TInt aIndex );
       
  1218 
       
  1219         /**
       
  1220         * Updates available camera providers.
       
  1221         * @return primary provider
       
  1222         */
       
  1223         TVtEngProviderType UpdateAvailableProvidersL();
       
  1224 
       
  1225         /**
       
  1226         * Switches to active provider.
       
  1227         */
       
  1228         void SwitchProvider( TProviderItem* aProviderItem );
       
  1229 
       
  1230         /**
       
  1231         * Overloaded SwitchProvider() that takes new provider as a parameter.
       
  1232         */
       
  1233         void SwitchProvider( TProviderItem& aProviderItem );
       
  1234 
       
  1235         /**
       
  1236         * Uninitializes non-permanent provider.
       
  1237         */
       
  1238         void UninitializeProviderL();
       
  1239 
       
  1240         /**
       
  1241         * Updates iState if view finder is active.
       
  1242         */
       
  1243         void UpdateState();
       
  1244 
       
  1245         /**
       
  1246         * Checks if initialization or provider switch is pending.
       
  1247         * @return ETrue if either one is pending
       
  1248         */
       
  1249         TBool InitializingOrSwitching() const;
       
  1250 
       
  1251         /**
       
  1252         * Resets provider info index variables.
       
  1253         */
       
  1254         void ResetIndices();
       
  1255 
       
  1256         /**
       
  1257         * Sets active camera tracking.
       
  1258         * @param aProviderIndex current camera in use
       
  1259         * @return error code
       
  1260         */
       
  1261         TInt SetCameraTrackingL( TInt& aProviderIndex );
       
  1262 
       
  1263         /**
       
  1264         * Maps pubsub provided camera id to internal indexes.
       
  1265         * @param aCameraId id to map
       
  1266         * @return internally mapped id
       
  1267         */
       
  1268         MVtEngMedia::TCameraId MapCameraInternally( TInt aCameraId );
       
  1269 
       
  1270         /**
       
  1271         * Checks if desired camera is available.
       
  1272         * @param aType provider type to return
       
  1273         */
       
  1274         void CameraAvailable( CVtEngLocalVideo::TVtEngProviderType &aType );
       
  1275 
       
  1276         /**
       
  1277         * checks if given provider type is already waiting for initialization
       
  1278         * or switch.
       
  1279         * @param aType Provider type.
       
  1280         * @return ETrue if given provider type is in waiting state, EFalse
       
  1281         * otherwise.
       
  1282         */
       
  1283         TBool IsProviderWaiting( TVtEngProviderType aType ) const;
       
  1284 
       
  1285         /**
       
  1286         * Returns highest provider type which is available for selection.
       
  1287         * Priority is following:
       
  1288         *    KVtEngProviderCam1         << highest
       
  1289         *    KVtEngProviderCam2
       
  1290         *    KVtEngProviderImage
       
  1291         *    KVtEngProviderNone
       
  1292         * If eg. cam2 is designated as preferred, possible returns values are
       
  1293         * Cam2, Image and None.
       
  1294         *
       
  1295         * @param aType in/out argument. In  => preferred provider which
       
  1296         *        caller of the method wishes to select
       
  1297         *                               Out => highest available provider
       
  1298         * @return ETrue if preferred == highest i.e. aPreferred is intact
       
  1299         *
       
  1300         */
       
  1301         TBool GetHighestSelectableProvider( TVtEngProviderType& aPreferred ) const;
       
  1302 
       
  1303         /**
       
  1304         * checks if given provider type is acitven
       
  1305         * @param aType Provider type.
       
  1306         * @return ETrue if given provider is already active, EFalse
       
  1307         * otherwise.
       
  1308         */
       
  1309         TBool IsActiveProvider( TVtEngProviderType aType ) const;
       
  1310 
       
  1311 
       
  1312     private: // From CActive.
       
  1313 
       
  1314         /**
       
  1315         * Handles sync operations as async.
       
  1316         * @see CActive::RunL
       
  1317         */
       
  1318         virtual void RunL();
       
  1319 
       
  1320         /**
       
  1321         * @see CActive::DoCancel()
       
  1322         */
       
  1323         virtual void DoCancel();
       
  1324 
       
  1325     private:
       
  1326 
       
  1327         // Local video flags
       
  1328         enum TVtEngLocalVideoFlags
       
  1329             {
       
  1330             // Camera 1 is available (inwards)
       
  1331             EFlagCamera1Available = 0x00000001,
       
  1332             // Camera 2 is available (outwards)
       
  1333             EFlagCamera2Available = 0x00000002,
       
  1334             // video call ongoing
       
  1335             EFlagInitialized      = 0x00000004,
       
  1336             // view finder enabled from UI
       
  1337             EFlagVFEnabled        = 0x00000008,
       
  1338             // Non-user orginated switch
       
  1339             EFlagAutomaticSwitchCallback = 0x00000010,
       
  1340             // Audio muted
       
  1341             EFlagAudioMuted       = 0x00000020,
       
  1342             // Only initialize a provider (no switch when initialized)
       
  1343             EFlagInitializeOnly   = 0x00000040,
       
  1344             // Signal observer when switch is complete
       
  1345             EFlagSignalSourceSelection = 0x00000080,
       
  1346             // Provider event received while switch ongoing.
       
  1347             // When this is set and switch completes it
       
  1348             // is checked if revert to previous is needed.
       
  1349             EFlagCheckRevertToPrevious = 0x00000100,
       
  1350             // Avoid calculating the step count by using flag.
       
  1351             EFlagZoomStepCountNeedsMapping = 0x00000200,
       
  1352             // VT application foreground state
       
  1353             EFlagUIForeground           = 0x00000400,
       
  1354             // VT application background state ( notification purpose)
       
  1355             EFlagUIBackground           = 0x00000800,
       
  1356             // Provider is frozen
       
  1357             EFlagFrozen                 = 0x00001000
       
  1358             };
       
  1359 
       
  1360         /**
       
  1361         * Sets a flag on.
       
  1362         * @param aFlag flag to set
       
  1363         */
       
  1364         void SetFlag( const TInt aFlag );
       
  1365 
       
  1366         /**
       
  1367         * Removes a flag.
       
  1368         * @param aFlag flag to remove
       
  1369         */
       
  1370         void ClearFlag( const TInt aFlag );
       
  1371 
       
  1372         /**
       
  1373         * Checks if a flag has been set.
       
  1374         * @param aFlag flag to check
       
  1375         * @return ETsrue if set
       
  1376         */
       
  1377         TBool IsFlag( const TInt aFlag ) const;
       
  1378 
       
  1379     private:    // Data
       
  1380 
       
  1381         // Options for window server rendering.
       
  1382         TOptions                iOptions;
       
  1383 
       
  1384         // Options for DSA rendering.
       
  1385         TDsaOptions             iDsaOptions;
       
  1386 
       
  1387         // Video source controller.
       
  1388         CVSController*          iSourceController;
       
  1389 
       
  1390         // Video source.
       
  1391         CVSDataSource*          iSource;
       
  1392 
       
  1393         // Audio source.
       
  1394         MVTAudioSource*          iAudioSource;
       
  1395 
       
  1396         // Video providers (cameras and still image).
       
  1397         CArrayFixFlat<TProviderItem>* iVideoProviders;
       
  1398 
       
  1399         // Currently active provider.
       
  1400         TProviderItem*          iActiveProvider;
       
  1401 
       
  1402         // Provider item we're switching away from.
       
  1403         TProviderItem*          iFadingProvider;
       
  1404 
       
  1405         // Provider that is selected as next one and
       
  1406         // is initializing or switching.
       
  1407         TProviderItem*          iSelectedProvider;
       
  1408 
       
  1409         // DSA or window server.
       
  1410         TRenderingMethod        iRenderingMethod;
       
  1411 
       
  1412         // Local video status.
       
  1413         TState                  iState;
       
  1414 
       
  1415         // View finder state.
       
  1416         TViewFinderState        iViewFinderState;
       
  1417 
       
  1418         // Callback interface to Media Handler.
       
  1419         CVtEngMediaHandler&     iObserver;
       
  1420 
       
  1421         // Still image file name.
       
  1422         TFileName               iStillImage;
       
  1423 
       
  1424         // Local video state flags.
       
  1425         TInt                    iFlags;
       
  1426 
       
  1427         // Friend declaration provides extended access.
       
  1428         friend class TProviderItem;
       
  1429 
       
  1430         // Member variables to use in referencing to
       
  1431         // provider information
       
  1432         TInt iProviderInfoIndexCam1;
       
  1433         TInt iProviderInfoIndexCam2;
       
  1434         TInt iProviderInfoIndexStill;
       
  1435 
       
  1436         // Used for default camera notifications.
       
  1437         CVtEngPubSubsListener* iCameraListener;
       
  1438 
       
  1439         // Camera received from pubsub.
       
  1440         MVtEngMedia::TCameraId iCurrentCamera;
       
  1441 
       
  1442         // Contains logics for image sharing.
       
  1443         CVtEngShareImage* iShareImage;
       
  1444 
       
  1445         // Pointer to camera preferences extension
       
  1446         CVtEngCameraPreferences* iCameraPref;
       
  1447 
       
  1448         // Logics for delayed provider selection
       
  1449         TVtEngDelayedSelect iDelayedSelect;
       
  1450 
       
  1451         // Active provider's info
       
  1452         TVSDataProviderInfo iProviderInfo;
       
  1453 
       
  1454         // ETrue if prepare camera has been handled in media handler
       
  1455         TBool iPrepareCameraCalled;
       
  1456 
       
  1457         // Layout change handler
       
  1458         TVtEngLayoutChangeHandler iLayoutChangeHandler;
       
  1459 
       
  1460         // ASync callback
       
  1461         CAsyncCallBack* iAsyncCallBack;
       
  1462 
       
  1463         // Result
       
  1464         TInt iResult;
       
  1465 
       
  1466         // Pointer to provider item that is being initialized
       
  1467         TProviderItem* iInitializingProvider;
       
  1468 
       
  1469         // Number of cameras in the device
       
  1470         TInt iNumSupportedCameras;
       
  1471     };
       
  1472 
       
  1473 #endif      // CVTENGLOCALVIDEO_H
       
  1474 
       
  1475 // End of File