First public contribution.
2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
18 #ifndef __SURFACE_HINTS_LOCAL_H__
19 #define __SURFACE_HINTS_LOCAL_H__
21 //- Include Files ----------------------------------------------------------
26 //- Namespace ---------------------------------------------------------------
28 namespace surfaceHints
31 //- Constants ---------------------------------------------------------------
33 /** Hint of the surface content.
34 @see TSurfaceContent for possible values
36 const TInt KSurfaceContent = 0x1;
38 /** Hint of the expected update rate of the surface content.
39 Value for a surface containing e.g. 25 fps video the value should be 25.
40 For a static UI element the value should be 0.
43 const TInt KSurfaceUpdate = 0x2;
45 /** Hint whether the surface content is copy protected and can it be
46 shown on external displays.
47 @see TSurfaceProtection for possible values.
49 const TInt KSurfaceProtection = 0x3;
51 /** Hint about the surface’s characteristics or properties,
52 For example if a surface can be persisted by the effects engine.
53 @see TSurfaceCharacteristics for possible values.
55 const TInt KSurfaceCharacteristics = 0x4;
58 /** Values used for the KSurfaceContent key */
61 /** No specific use-case */
63 /** Camera viewfinder frames */
65 /** Images captured by camera */
67 /** Decoded video frames */
69 /** Video frames from video telephony */
73 /** Main UI surface */
75 /** Composition target surface */
77 /** Indicates that the surface has to accessible by ARM.
78 This can be orr'ed with other TSurfaceContent enumerations. */
79 EArmAccess = 0x80000000
83 /** Values used for the KSurfaceProtection key. The values are bitmasks and can be combined
84 * e.g. EAllowAnalogProtectionRequired | EAllowDigitalProtectionRequired.
86 enum TSurfaceProtection
89 * Not allowed on external outputs
91 EAllowInternalOnly = 0x00000000,
94 * Allowed on all external outputs
96 EAllowAllExternals = 0xFFFFFFFF,
99 * Allow passing content over analog outputs,
100 * e.g. composite and S-video
102 EAllowAnalog = 0x00000010,
105 * Allow output over an analog output channel which has a protection
108 EAllowAnalogProtectionRequired = 0x00000020,
111 * Allow passing content over digital outputs,
114 EAllowDigital = 0x00000200,
117 * Licensed product must attempt to engage HDCP to protect the content.
118 * However it should be passed through to HDMI even if HDCP is not engaged or fails to engage.
120 EAllowDigitalProtectionRequested = 0x00000400,
123 * Licensed product is required to engage HDCP to protect the content.
124 * If HDCP is not engaged or can not be engaged the content must not be passed through to HDMI.
126 EAllowDigitalProtectionRequired = 0x00000800,
130 /** Values used for the KSurfaceCharacteristics key. The values are bitmasks and can be combined.
132 enum TSurfaceCharacteristics
135 * Surface cannot be persisted once it has been closed by the creator
144 @param aUpdateRate How often the surface content is redrawn per second.
145 @param aTearingFree When ETrue surface updates should be synchronized
146 with display refresh rate, otherwise surface can
147 be updated as fast as possible.
149 inline TSurfaceUpdate(TUint aUpdateRate, TBool aTearingFree);
151 /** Converts a value to TSurfaceUpdate */
152 inline TSurfaceUpdate(TInt aValue);
154 /** Converts TSurfaceUpdate to a signed integer, so it can be used as
155 a value for KSurfaceUpdate key. */
156 inline operator TInt() const;
158 /** Getter for surface update rate.
159 @return updates per second
161 inline TUint UpdateRate() const;
163 /** Getter for surface update synchronization.
164 @return ETrue - updates should be synchronized with display refresh rate,
165 EFalse - surface can be updated as fast as possible.
167 inline TBool TearingFree() const;
174 //- Forward Declarations ----------------------------------------------------
177 //- Class Definitions -------------------------------------------------------
180 //- Inline Functions --------------------------------------------------------
182 TSurfaceUpdate::TSurfaceUpdate(TUint aUpdateRate, TBool aTearingFree)
183 : iValue( ( aUpdateRate & 0xFFFF ) | ( aTearingFree ? 0x80000000 : 0x0 ) )
186 TSurfaceUpdate::TSurfaceUpdate(TInt aValue)
187 : iValue( static_cast<TUint>( aValue ) )
191 TSurfaceUpdate::operator TInt() const
193 return static_cast<TInt>( iValue );
196 TUint TSurfaceUpdate::UpdateRate() const
198 return ( iValue & 0xFFFF );
201 TBool TSurfaceUpdate::TearingFree() const
203 return ( iValue & 0x80000000 ) ? ETrue : EFalse;
206 } //namespace surfaceHints
208 #endif //__SURFACE_HINTS_LOCAL_H__