1 // Copyright (c) 2008-2009 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". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 |
|
17 /** |
|
18 @file |
|
19 @internalComponent |
|
20 */ |
|
21 |
|
22 #ifndef OMXILSPECVERSION_H |
|
23 #define OMXILSPECVERSION_H |
|
24 |
|
25 #include <e32def.h> |
|
26 #include <e32const.h> |
|
27 |
|
28 #include <openmax/il/khronos/v1_x/OMX_Types.h> |
|
29 |
|
30 class TOmxILVersion |
|
31 { |
|
32 |
|
33 public: |
|
34 |
|
35 inline TOmxILVersion(TUint8 aMajor, |
|
36 TUint8 aMinor, |
|
37 TUint8 aRev, |
|
38 TUint8 aStep); |
|
39 |
|
40 |
|
41 inline operator OMX_VERSIONTYPE&(); |
|
42 |
|
43 #ifdef _OMXIL_COMMON_SPEC_VERSION_CHECKS_ON |
|
44 inline TBool operator!=(const OMX_VERSIONTYPE& aVer) const; |
|
45 |
|
46 inline TBool operator==(const OMX_VERSIONTYPE& aVer) const; |
|
47 #endif |
|
48 |
|
49 private: |
|
50 |
|
51 OMX_VERSIONTYPE iSpecVersion; |
|
52 |
|
53 }; |
|
54 |
|
55 class TOmxILSpecVersion : public TOmxILVersion |
|
56 { |
|
57 |
|
58 public: |
|
59 |
|
60 static const TUint8 KSpecVersionMajor = OMX_VERSION_MAJOR; |
|
61 static const TUint8 KSpecVersionMinor = OMX_VERSION_MINOR; |
|
62 static const TUint8 KSpecVersionRevision = OMX_VERSION_REVISION; |
|
63 static const TUint8 KSpecVersionStep = OMX_VERSION_STEP; |
|
64 |
|
65 public: |
|
66 |
|
67 inline TOmxILSpecVersion(); |
|
68 |
|
69 }; |
|
70 |
|
71 inline |
|
72 TOmxILVersion::TOmxILVersion(TUint8 aMajor, |
|
73 TUint8 aMinor, |
|
74 TUint8 aRev, |
|
75 TUint8 aStep) |
|
76 { |
|
77 iSpecVersion.s.nVersionMajor = aMajor; |
|
78 iSpecVersion.s.nVersionMinor = aMinor; |
|
79 iSpecVersion.s.nRevision = aRev; |
|
80 iSpecVersion.s.nStep = aStep; |
|
81 } |
|
82 |
|
83 inline |
|
84 TOmxILVersion::operator OMX_VERSIONTYPE&() |
|
85 { |
|
86 return iSpecVersion; |
|
87 } |
|
88 |
|
89 #ifdef _OMXIL_COMMON_SPEC_VERSION_CHECKS_ON |
|
90 inline TBool |
|
91 TOmxILVersion::operator!=( |
|
92 const OMX_VERSIONTYPE& aVer) const |
|
93 { |
|
94 return !operator==(aVer); |
|
95 } |
|
96 |
|
97 inline TBool |
|
98 TOmxILVersion::operator==( |
|
99 const OMX_VERSIONTYPE& aVer) const |
|
100 { |
|
101 if (iSpecVersion.s.nVersionMajor == aVer.s.nVersionMajor && |
|
102 iSpecVersion.s.nVersionMinor == aVer.s.nVersionMinor && |
|
103 iSpecVersion.s.nRevision == aVer.s.nRevision && |
|
104 iSpecVersion.s.nStep == aVer.s.nStep) |
|
105 { |
|
106 return ETrue; |
|
107 } |
|
108 return EFalse; |
|
109 } |
|
110 #endif |
|
111 |
|
112 inline |
|
113 TOmxILSpecVersion::TOmxILSpecVersion() |
|
114 : |
|
115 TOmxILVersion(KSpecVersionMajor, |
|
116 KSpecVersionMinor, |
|
117 KSpecVersionRevision, |
|
118 KSpecVersionStep) |
|
119 { |
|
120 } |
|
121 |
|
122 #endif // OMXILSPECVERSION_H |
|
123 |
|