vtuis/lcvtplugin/src/common/tlcvtmediastate.cpp
branchRCL_3
changeset 25 779871d1e4f4
parent 24 f15ac8e65a02
child 26 590f6f022902
equal deleted inserted replaced
24:f15ac8e65a02 25:779871d1e4f4
     1 /*
       
     2 * Copyright (c) 2008 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:  Media state class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <cvtlogger.h>
       
    20 #include <mvtengmedia.h>
       
    21 #include <mvtengcommandhandler.h>
       
    22 
       
    23 #include "tlcvtmediastate.h"
       
    24 #include "lcvtutility.h"
       
    25 
       
    26 // -----------------------------------------------------------------------------
       
    27 // TLcVtMediaState::UpdateFlags
       
    28 // -----------------------------------------------------------------------------
       
    29 //
       
    30 void TLcVtMediaState::UpdateFlags()
       
    31     {
       
    32     __VTPRINTENTER( "MediaState.UpdateFlags" )
       
    33     TInt avail( 0 );
       
    34 
       
    35     LcVtUtility::GetOutgoingMediaState( iMedia, avail );
       
    36 
       
    37     if ( avail & MVtEngMedia::EMediaVideo )
       
    38         {
       
    39         SetFlag( EIsVideo );
       
    40         }
       
    41 
       
    42     if ( LcVtUtility::HasCameras( iMedia ) )
       
    43         {
       
    44         SetFlag( EHasCamera );
       
    45         }
       
    46 
       
    47     if ( LcVtUtility::IsFreezeSupported( iMedia ) )
       
    48         {
       
    49         SetFlag( EIsFreezeSupported );
       
    50         }
       
    51 
       
    52     if ( LcVtUtility::GetFreezeState( iMedia ) )
       
    53         {
       
    54         SetFlag( EIsFrozen );
       
    55         }
       
    56 
       
    57     MVtEngMedia::TShareObjectState shareObjectState;
       
    58     LcVtUtility::GetObjectSharingState( iMedia, shareObjectState );
       
    59 
       
    60     if ( shareObjectState == MVtEngMedia::ESharingImage )
       
    61         {
       
    62         SetFlag( EIsSharing );
       
    63         }
       
    64     else if ( ( shareObjectState == MVtEngMedia::EInitializingShareImage ) ||
       
    65          ( shareObjectState == MVtEngMedia::EInitializingShareVideoClip ) )
       
    66         {
       
    67         SetFlag( EIsInitializingShare );
       
    68         }
       
    69     else if ( shareObjectState == MVtEngMedia::ENotAbleToShare )
       
    70         {
       
    71         SetFlag( EIsNotAbleToShare );
       
    72         }
       
    73     // Camera configuration
       
    74 
       
    75     MVtEngMedia::TCameraId cameraId;
       
    76     TInt err = iMedia.GetCurrentCameraId( cameraId );
       
    77 
       
    78     // Don't care if camera is not ready, just what is selected camera
       
    79     if ( err == KErrNone || err == KErrNotReady )
       
    80         {
       
    81         SetFlag( ( cameraId == MVtEngMedia::EPrimaryCamera ) ?
       
    82             EIsPrimaryCameraInUse : EIsSecondaryCameraInUse );
       
    83         }
       
    84 
       
    85     TInt sourcesCaps( 0 );
       
    86     iMedia.GetSourcesCaps( sourcesCaps );
       
    87     if ( sourcesCaps & MVtEngMedia::ESourceCapsPrimaryCamera )
       
    88         {
       
    89         SetFlag( EHasPrimaryCamera );
       
    90         }
       
    91     if ( sourcesCaps & MVtEngMedia::ESourceCapsSecondaryCamera )
       
    92         {
       
    93         SetFlag( EHasSecondaryCamera );
       
    94         }
       
    95        
       
    96     TInt status ( 0 ); 
       
    97     iMedia.GetMediaState( MVtEngMedia::EMediaOutgoing, status );
       
    98     if ( !( status & MVtEngMedia::EMediaVideoChannelOpen ) )
       
    99         {        
       
   100         SetFlag( EIsVideoPermanentlyStopped );
       
   101         }      
       
   102 
       
   103     __VTPRINTEXITR( "MediaState.UpdateFlags bits = %b", Value() )
       
   104 
       
   105     // Video preferences
       
   106 /*
       
   107     TInt caps( iCommandHandler.GetCommandCaps( KVtEngSetContrast ) );
       
   108     if ( caps & MVtEngCommandHandler::EAttribEnabled )
       
   109         {
       
   110         SetFlag( EIsContrastSupported );
       
   111         }
       
   112 
       
   113     caps = iCommandHandler.GetCommandCaps( KVtEngSetBrightness );
       
   114     if ( caps & MVtEngCommandHandler::EAttribEnabled )
       
   115         {
       
   116         SetFlag( EIsBrightnessSupported );
       
   117         }
       
   118 
       
   119     caps = iCommandHandler.GetCommandCaps( KVtEngSetWhiteBalance );
       
   120     if ( caps & MVtEngCommandHandler::EAttribEnabled )
       
   121         {
       
   122         SetFlag( EIsWhiteBalanceSupported );
       
   123         }
       
   124 
       
   125     caps = iCommandHandler.GetCommandCaps( KVtEngSetColorTone );
       
   126     if ( caps & MVtEngCommandHandler::EAttribEnabled )
       
   127         {
       
   128         SetFlag( EIsColorToneSupported );
       
   129         }
       
   130 
       
   131 */
       
   132     }