Update contrib.
1 // Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Surface Manager API
17 #ifndef __SURFACE_HINTS_H__
18 #define __SURFACE_HINTS_H__
20 //- Include Files ----------------------------------------------------------
25 //- Namespace ---------------------------------------------------------------
27 namespace surfaceHints
30 //- Constants ---------------------------------------------------------------
32 /** Hint of the surface content.
33 @see TSurfaceContent for possible values
35 const TInt KSurfaceContent = 0x1;
37 /** Hint of the expected update rate of the surface content.
38 Value for a surface containing e.g. 25 fps video the value should be 25.
39 For a static UI element the value should be 0.
42 const TInt KSurfaceUpdate = 0x2;
44 /** Hint whether the surface content is copy protected and can it be
45 shown on external displays.
46 @see TSurfaceProtection for possible values.
48 const TInt KSurfaceProtection = 0x3;
50 /** Hint about the surface’s characteristics or properties,
51 For example if a surface can be persisted by the effects engine.
52 @see TSurfaceCharacteristics for possible values.
54 const TInt KSurfaceCharacteristics = 0x4;
57 /** Values used for the KSurfaceContent key */
60 /** No specific use-case */
62 /** Camera viewfinder frames */
64 /** Images captured by camera */
66 /** Decoded video frames */
68 /** Video frames from video telephony */
72 /** Main UI surface */
74 /** Composition target surface */
76 /** Indicates that the surface has to accessible by ARM.
77 This can be orr'ed with other TSurfaceContent enumerations. */
78 EArmAccess = 0x80000000
82 /** Values used for the KSurfaceProtection key. The values are bitmasks and can be combined
83 * e.g. EAllowAnalogProtectionRequired | EAllowDigitalProtectionRequired.
85 enum TSurfaceProtection
88 * Not allowed on external outputs
90 EAllowInternalOnly = 0x00000000,
93 * Allowed on all external outputs
95 EAllowAllExternals = 0xFFFFFFFF,
98 * Allow passing content over analog outputs,
99 * e.g. composite and S-video
101 EAllowAnalog = 0x00000010,
104 * Allow output over an analog output channel which has a protection
107 EAllowAnalogProtectionRequired = 0x00000020,
110 * Allow passing content over digital outputs,
113 EAllowDigital = 0x00000200,
116 * Licensed product must attempt to engage HDCP to protect the content.
117 * However it should be passed through to HDMI even if HDCP is not engaged or fails to engage.
119 EAllowDigitalProtectionRequested = 0x00000400,
122 * Licensed product is required to engage HDCP to protect the content.
123 * If HDCP is not engaged or can not be engaged the content must not be passed through to HDMI.
125 EAllowDigitalProtectionRequired = 0x00000800,
129 /** Values used for the KSurfaceCharacteristics key. The values are bitmasks and can be combined.
131 enum TSurfaceCharacteristics
134 * Surface cannot be persisted once it has been closed by the creator
143 @param aUpdateRate How often the surface content is redrawn per second.
144 @param aTearingFree When ETrue surface updates should be synchronized
145 with display refresh rate, otherwise surface can
146 be updated as fast as possible.
148 inline TSurfaceUpdate(TUint aUpdateRate, TBool aTearingFree);
150 /** Converts a value to TSurfaceUpdate */
151 inline TSurfaceUpdate(TInt aValue);
153 /** Converts TSurfaceUpdate to a signed integer, so it can be used as
154 a value for KSurfaceUpdate key. */
155 inline operator TInt() const;
157 /** Getter for surface update rate.
158 @return updates per second
160 inline TUint UpdateRate() const;
162 /** Getter for surface update synchronization.
163 @return ETrue - updates should be synchronized with display refresh rate,
164 EFalse - surface can be updated as fast as possible.
166 inline TBool TearingFree() const;
173 //- Forward Declarations ----------------------------------------------------
176 //- Class Definitions -------------------------------------------------------
179 //- Inline Functions --------------------------------------------------------
181 TSurfaceUpdate::TSurfaceUpdate(TUint aUpdateRate, TBool aTearingFree)
182 : iValue( ( aUpdateRate & 0xFFFF ) | ( aTearingFree ? 0x80000000 : 0x0 ) )
185 TSurfaceUpdate::TSurfaceUpdate(TInt aValue)
186 : iValue( static_cast<TUint>( aValue ) )
190 TSurfaceUpdate::operator TInt() const
192 return static_cast<TInt>( iValue );
195 TUint TSurfaceUpdate::UpdateRate() const
197 return ( iValue & 0xFFFF );
200 TBool TSurfaceUpdate::TearingFree() const
202 return ( iValue & 0x80000000 ) ? ETrue : EFalse;
205 } //namespace surfaceHints
207 #endif //__SURFACE_HINTS_H__