os/mm/mdfdevvideoextensions/nga_mdf_postprocessor/inc/surface_hints.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200 (2012-06-15)
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
/*
sl@0
     2
* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     3
* All rights reserved.
sl@0
     4
* This component and the accompanying materials are made available
sl@0
     5
* under the terms of "Eclipse Public License v1.0"
sl@0
     6
* which accompanies this distribution, and is available
sl@0
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     8
*
sl@0
     9
* Initial Contributors:
sl@0
    10
* Nokia Corporation - initial contribution.
sl@0
    11
*
sl@0
    12
* Contributors:
sl@0
    13
*
sl@0
    14
* Description:
sl@0
    15
* Surface Manager API
sl@0
    16
*/
sl@0
    17
sl@0
    18
#ifndef __SURFACE_HINTS_LOCAL_H__
sl@0
    19
#define __SURFACE_HINTS_LOCAL_H__
sl@0
    20
sl@0
    21
//- Include Files  ----------------------------------------------------------
sl@0
    22
sl@0
    23
#include <e32cmn.h>
sl@0
    24
sl@0
    25
sl@0
    26
//- Namespace ---------------------------------------------------------------
sl@0
    27
sl@0
    28
namespace surfaceHints
sl@0
    29
{
sl@0
    30
sl@0
    31
//- Constants ---------------------------------------------------------------
sl@0
    32
sl@0
    33
/** Hint of the surface content.
sl@0
    34
    @see TSurfaceContent for possible values
sl@0
    35
*/
sl@0
    36
const TInt KSurfaceContent = 0x1;
sl@0
    37
sl@0
    38
/** Hint of the expected update rate of the surface content.
sl@0
    39
    Value for a surface containing e.g. 25 fps video the value should be 25.
sl@0
    40
    For a static UI element the value should be 0.
sl@0
    41
    @see TSurfaceUpdate
sl@0
    42
*/
sl@0
    43
const TInt KSurfaceUpdate = 0x2;
sl@0
    44
sl@0
    45
/** Hint whether the surface content is copy protected and can it be
sl@0
    46
    shown on external displays.
sl@0
    47
    @see TSurfaceProtection for possible values.
sl@0
    48
*/
sl@0
    49
const TInt KSurfaceProtection = 0x3;
sl@0
    50
sl@0
    51
/** Hint about the surface’s characteristics or properties,
sl@0
    52
   For example if a surface can be persisted by the effects engine.
sl@0
    53
   @see TSurfaceCharacteristics for possible values.
sl@0
    54
*/
sl@0
    55
const TInt KSurfaceCharacteristics = 0x4;
sl@0
    56
sl@0
    57
sl@0
    58
/** Values used for the KSurfaceContent key */
sl@0
    59
enum TSurfaceContent
sl@0
    60
    {
sl@0
    61
    /** No specific use-case */
sl@0
    62
    EGeneric,
sl@0
    63
    /** Camera viewfinder frames */
sl@0
    64
    EViewFinder,
sl@0
    65
    /** Images captured by camera */
sl@0
    66
    EStillImage,
sl@0
    67
    /** Decoded video frames */
sl@0
    68
    EVideoPlayback,
sl@0
    69
    /** Video frames from video telephony */
sl@0
    70
    EVideoTelephony,
sl@0
    71
    /** EGL surface */
sl@0
    72
    EGfx,
sl@0
    73
    /** Main UI surface */
sl@0
    74
    EUi,
sl@0
    75
    /** Composition target surface */
sl@0
    76
    ECompositionTarget,
sl@0
    77
    /** Indicates that the surface has to accessible by ARM.
sl@0
    78
        This can be orr'ed with other TSurfaceContent enumerations. */
sl@0
    79
    EArmAccess = 0x80000000
sl@0
    80
    };
sl@0
    81
sl@0
    82
sl@0
    83
/** Values used for the KSurfaceProtection key. The values are bitmasks and can be combined
sl@0
    84
* e.g. EAllowAnalogProtectionRequired | EAllowDigitalProtectionRequired.
sl@0
    85
*/
sl@0
    86
enum TSurfaceProtection
sl@0
    87
    {
sl@0
    88
    /**
sl@0
    89
    * Not allowed on external outputs
sl@0
    90
    */
sl@0
    91
    EAllowInternalOnly                  = 0x00000000,
sl@0
    92
sl@0
    93
    /**
sl@0
    94
    * Allowed on all external outputs
sl@0
    95
    */
sl@0
    96
    EAllowAllExternals                  = 0xFFFFFFFF,
sl@0
    97
sl@0
    98
    /**
sl@0
    99
    * Allow passing content over analog outputs,
sl@0
   100
    * e.g. composite and S-video
sl@0
   101
    */
sl@0
   102
    EAllowAnalog                        = 0x00000010,
sl@0
   103
sl@0
   104
    /**
sl@0
   105
    * Allow output over an analog output channel which has a protection
sl@0
   106
    * mechanism
sl@0
   107
    */
sl@0
   108
    EAllowAnalogProtectionRequired      = 0x00000020,
sl@0
   109
sl@0
   110
    /**
sl@0
   111
    * Allow passing content over digital outputs,
sl@0
   112
    * e.g. DVI and HDMI
sl@0
   113
    */
sl@0
   114
    EAllowDigital                       = 0x00000200,
sl@0
   115
sl@0
   116
    /**
sl@0
   117
    * Licensed product must attempt to engage HDCP to protect the content.
sl@0
   118
    * However it should be passed through to HDMI even if HDCP is not engaged or fails to engage.
sl@0
   119
    */
sl@0
   120
    EAllowDigitalProtectionRequested    = 0x00000400,
sl@0
   121
sl@0
   122
    /**
sl@0
   123
    * Licensed product is required to engage HDCP to protect the content.
sl@0
   124
    * If HDCP is not engaged or can not be engaged the content must not be passed through to HDMI.
sl@0
   125
    */
sl@0
   126
    EAllowDigitalProtectionRequired     = 0x00000800,
sl@0
   127
    };
sl@0
   128
sl@0
   129
sl@0
   130
/** Values used for the KSurfaceCharacteristics key. The values are bitmasks and can be combined.
sl@0
   131
*/
sl@0
   132
enum TSurfaceCharacteristics
sl@0
   133
    {
sl@0
   134
    /**
sl@0
   135
    * Surface cannot be persisted once it has been closed by the creator
sl@0
   136
    */
sl@0
   137
    ENotPersistable = 1,
sl@0
   138
    };
sl@0
   139
sl@0
   140
sl@0
   141
class TSurfaceUpdate
sl@0
   142
    {
sl@0
   143
    /** Constructor.
sl@0
   144
        @param aUpdateRate   How often the surface content is redrawn per second.
sl@0
   145
        @param aTearingFree  When ETrue surface updates should be synchronized
sl@0
   146
                             with display refresh rate, otherwise surface can
sl@0
   147
                             be updated as fast as possible.
sl@0
   148
    */
sl@0
   149
    inline TSurfaceUpdate(TUint aUpdateRate, TBool aTearingFree);
sl@0
   150
sl@0
   151
    /** Converts a value to TSurfaceUpdate */
sl@0
   152
    inline TSurfaceUpdate(TInt aValue);
sl@0
   153
sl@0
   154
    /** Converts TSurfaceUpdate to a signed integer, so it can be used as
sl@0
   155
        a value for KSurfaceUpdate key. */
sl@0
   156
    inline operator TInt() const;
sl@0
   157
sl@0
   158
    /** Getter for surface update rate.
sl@0
   159
        @return updates per second
sl@0
   160
    */
sl@0
   161
    inline TUint UpdateRate() const;
sl@0
   162
sl@0
   163
    /** Getter for surface update synchronization.
sl@0
   164
        @return ETrue - updates should be synchronized with display refresh rate,
sl@0
   165
                EFalse - surface can be updated as fast as possible.
sl@0
   166
    */
sl@0
   167
    inline TBool TearingFree() const;
sl@0
   168
sl@0
   169
    private:
sl@0
   170
        TUint iValue;
sl@0
   171
    };
sl@0
   172
sl@0
   173
sl@0
   174
//- Forward Declarations ----------------------------------------------------
sl@0
   175
sl@0
   176
sl@0
   177
//- Class Definitions -------------------------------------------------------
sl@0
   178
sl@0
   179
sl@0
   180
//- Inline Functions --------------------------------------------------------
sl@0
   181
sl@0
   182
TSurfaceUpdate::TSurfaceUpdate(TUint aUpdateRate, TBool aTearingFree)
sl@0
   183
    : iValue( ( aUpdateRate & 0xFFFF ) | ( aTearingFree ? 0x80000000 : 0x0 ) )
sl@0
   184
    {
sl@0
   185
    }
sl@0
   186
TSurfaceUpdate::TSurfaceUpdate(TInt aValue)
sl@0
   187
    : iValue( static_cast<TUint>( aValue ) )
sl@0
   188
    {
sl@0
   189
    }
sl@0
   190
sl@0
   191
TSurfaceUpdate::operator TInt() const
sl@0
   192
    {
sl@0
   193
    return static_cast<TInt>( iValue );
sl@0
   194
    }
sl@0
   195
sl@0
   196
TUint TSurfaceUpdate::UpdateRate() const
sl@0
   197
    {
sl@0
   198
    return ( iValue & 0xFFFF );
sl@0
   199
    }
sl@0
   200
sl@0
   201
TBool TSurfaceUpdate::TearingFree() const
sl@0
   202
    {
sl@0
   203
    return ( iValue & 0x80000000 ) ? ETrue : EFalse;
sl@0
   204
    }
sl@0
   205
sl@0
   206
} //namespace surfaceHints
sl@0
   207
sl@0
   208
#endif //__SURFACE_HINTS_LOCAL_H__
sl@0
   209
sl@0
   210
// End of File
sl@0
   211