58
|
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:
|
|
15 |
* Surface Manager API
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef __SURFACE_HINTS_LOCAL_H__
|
|
19 |
#define __SURFACE_HINTS_LOCAL_H__
|
|
20 |
|
|
21 |
//- Include Files ----------------------------------------------------------
|
|
22 |
|
|
23 |
#include <e32cmn.h>
|
|
24 |
|
|
25 |
|
|
26 |
//- Namespace ---------------------------------------------------------------
|
|
27 |
|
|
28 |
namespace surfaceHints
|
|
29 |
{
|
|
30 |
|
|
31 |
//- Constants ---------------------------------------------------------------
|
|
32 |
|
|
33 |
/** Hint of the surface content.
|
|
34 |
@see TSurfaceContent for possible values
|
|
35 |
*/
|
|
36 |
const TInt KSurfaceContent = 0x1;
|
|
37 |
|
|
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.
|
|
41 |
@see TSurfaceUpdate
|
|
42 |
*/
|
|
43 |
const TInt KSurfaceUpdate = 0x2;
|
|
44 |
|
|
45 |
/** Hint whether the surface content is copy protected and can it be
|
|
46 |
shown on external displays.
|
|
47 |
@see TSurfaceProtection for possible values.
|
|
48 |
*/
|
|
49 |
const TInt KSurfaceProtection = 0x3;
|
|
50 |
|
|
51 |
|
|
52 |
/** Values used for the KSurfaceContent key */
|
|
53 |
enum TSurfaceContent
|
|
54 |
{
|
|
55 |
/** No specific use-case */
|
|
56 |
EGeneric,
|
|
57 |
/** Camera viewfinder frames */
|
|
58 |
EViewFinder,
|
|
59 |
/** Images captured by camera */
|
|
60 |
EStillImage,
|
|
61 |
/** Decoded video frames */
|
|
62 |
EVideoPlayback,
|
|
63 |
/** Video frames from video telephony */
|
|
64 |
EVideoTelephony,
|
|
65 |
/** EGL surface */
|
|
66 |
EGfx,
|
|
67 |
/** Main UI surface */
|
|
68 |
EUi,
|
|
69 |
/** Composition target surface */
|
|
70 |
ECompositionTarget,
|
|
71 |
/** Indicates that the surface has to accessible by ARM.
|
|
72 |
This can be orr'ed with other TSurfaceContent enumerations. */
|
|
73 |
EArmAccess = 0x80000000
|
|
74 |
};
|
|
75 |
|
|
76 |
|
|
77 |
/** Values used for the KSurfaceProtection key. The values are bitmasks and can be combined
|
|
78 |
* e.g. EAllowAnalogProtectionRequired | EAllowDigitalProtectionRequired.
|
|
79 |
*/
|
|
80 |
enum TSurfaceProtection
|
|
81 |
{
|
|
82 |
/**
|
|
83 |
* Not allowed on external outputs
|
|
84 |
*/
|
|
85 |
EAllowInternalOnly = 0x00000000,
|
|
86 |
|
|
87 |
/**
|
|
88 |
* Allowed on all external outputs
|
|
89 |
*/
|
|
90 |
EAllowAllExternals = 0xFFFFFFFF,
|
|
91 |
|
|
92 |
/**
|
|
93 |
* Allow passing content over analog outputs,
|
|
94 |
* e.g. composite and S-video
|
|
95 |
*/
|
|
96 |
EAllowAnalog = 0x00000010,
|
|
97 |
|
|
98 |
/**
|
|
99 |
* Allow output over an analog output channel which has a protection
|
|
100 |
* mechanism
|
|
101 |
*/
|
|
102 |
EAllowAnalogProtectionRequired = 0x00000020,
|
|
103 |
|
|
104 |
/**
|
|
105 |
* Allow passing content over digital outputs,
|
|
106 |
* e.g. DVI and HDMI
|
|
107 |
*/
|
|
108 |
EAllowDigital = 0x00000200,
|
|
109 |
|
|
110 |
/**
|
|
111 |
* Licensed product must attempt to engage HDCP to protect the content.
|
|
112 |
* However it should be passed through to HDMI even if HDCP is not engaged or fails to engage.
|
|
113 |
*/
|
|
114 |
EAllowDigitalProtectionRequested = 0x00000400,
|
|
115 |
|
|
116 |
/**
|
|
117 |
* Licensed product is required to engage HDCP to protect the content.
|
|
118 |
* If HDCP is not engaged or can not be engaged the content must not be passed through to HDMI.
|
|
119 |
*/
|
|
120 |
EAllowDigitalProtectionRequired = 0x00000800,
|
|
121 |
};
|
|
122 |
|
|
123 |
|
|
124 |
class TSurfaceUpdate
|
|
125 |
{
|
|
126 |
/** Constructor.
|
|
127 |
@param aUpdateRate How often the surface content is redrawn per second.
|
|
128 |
@param aTearingFree When ETrue surface updates should be synchronized
|
|
129 |
with display refresh rate, otherwise surface can
|
|
130 |
be updated as fast as possible.
|
|
131 |
*/
|
|
132 |
inline TSurfaceUpdate(TUint aUpdateRate, TBool aTearingFree);
|
|
133 |
|
|
134 |
/** Converts a value to TSurfaceUpdate */
|
|
135 |
inline TSurfaceUpdate(TInt aValue);
|
|
136 |
|
|
137 |
/** Converts TSurfaceUpdate to a signed integer, so it can be used as
|
|
138 |
a value for KSurfaceUpdate key. */
|
|
139 |
inline operator TInt() const;
|
|
140 |
|
|
141 |
/** Getter for surface update rate.
|
|
142 |
@return updates per second
|
|
143 |
*/
|
|
144 |
inline TUint UpdateRate() const;
|
|
145 |
|
|
146 |
/** Getter for surface update synchronization.
|
|
147 |
@return ETrue - updates should be synchronized with display refresh rate,
|
|
148 |
EFalse - surface can be updated as fast as possible.
|
|
149 |
*/
|
|
150 |
inline TBool TearingFree() const;
|
|
151 |
|
|
152 |
private:
|
|
153 |
TUint iValue;
|
|
154 |
};
|
|
155 |
|
|
156 |
|
|
157 |
//- Forward Declarations ----------------------------------------------------
|
|
158 |
|
|
159 |
|
|
160 |
//- Class Definitions -------------------------------------------------------
|
|
161 |
|
|
162 |
|
|
163 |
//- Inline Functions --------------------------------------------------------
|
|
164 |
|
|
165 |
TSurfaceUpdate::TSurfaceUpdate(TUint aUpdateRate, TBool aTearingFree)
|
|
166 |
: iValue( ( aUpdateRate & 0xFFFF ) | ( aTearingFree ? 0x80000000 : 0x0 ) )
|
|
167 |
{
|
|
168 |
}
|
|
169 |
TSurfaceUpdate::TSurfaceUpdate(TInt aValue)
|
|
170 |
: iValue( static_cast<TUint>( aValue ) )
|
|
171 |
{
|
|
172 |
}
|
|
173 |
|
|
174 |
TSurfaceUpdate::operator TInt() const
|
|
175 |
{
|
|
176 |
return static_cast<TInt>( iValue );
|
|
177 |
}
|
|
178 |
|
|
179 |
TUint TSurfaceUpdate::UpdateRate() const
|
|
180 |
{
|
|
181 |
return ( iValue & 0xFFFF );
|
|
182 |
}
|
|
183 |
|
|
184 |
TBool TSurfaceUpdate::TearingFree() const
|
|
185 |
{
|
|
186 |
return ( iValue & 0x80000000 ) ? ETrue : EFalse;
|
|
187 |
}
|
|
188 |
|
|
189 |
}; //namespace surfaceHints
|
|
190 |
|
|
191 |
#endif //__SURFACE_HINTS_LOCAL_H__
|
|
192 |
|
|
193 |
// End of File
|
|
194 |
|