1 /* |
|
2 * Copyright (c) 2010 Ixonos Plc. |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the "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 * Ixonos Plc |
|
14 * |
|
15 * Description: |
|
16 * Header for vedcodecchecker.cpp. |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 #ifndef __VEDCODECCHECKER_H__ |
|
22 #define __VEDCODECCHECKER_H__ |
|
23 |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 class CVedVideoClip; |
|
27 |
|
28 // CONSTANTS |
|
29 //WVGA task |
|
30 //const TInt KNumResolutions = 6; |
|
31 //const TInt KNumCodecs = 14; |
|
32 const TInt KNumResolutions = 7; |
|
33 const TInt KNumCodecs = 18; |
|
34 |
|
35 enum TResolution |
|
36 { |
|
37 EResolutionSubQCIF = 0, |
|
38 EResolutionQCIF, |
|
39 EResolutionCIF, |
|
40 EResolutionQVGA, |
|
41 EResolutionVGA16By9, |
|
42 EResolutionVGA, |
|
43 EResolutionWVGA, |
|
44 EResolutionUnsupported |
|
45 }; |
|
46 |
|
47 enum TCodec |
|
48 { |
|
49 ECodecH263BPLevel10 = 0, |
|
50 ECodecH263BPLevel45, |
|
51 ECodecMPEG4VSPLevel0, |
|
52 ECodecMPEG4VSPLevel0B, |
|
53 ECodecMPEG4VSPLevel1, |
|
54 ECodecMPEG4VSPLevel2, |
|
55 ECodecMPEG4VSPLevel3, |
|
56 ECodecMPEG4VSPLevel4, |
|
57 ECodecAVCBPLevel1, |
|
58 ECodecAVCBPLevel1B, |
|
59 ECodecAVCBPLevel1_1, |
|
60 ECodecAVCBPLevel1_2, |
|
61 ECodecAVCBPLevel1_3, |
|
62 ECodecAVCBPLevel2, |
|
63 //WVGA task |
|
64 ECodecAVCBPLevel2_1, |
|
65 ECodecAVCBPLevel2_2, |
|
66 ECodecAVCBPLevel3, |
|
67 ECodecAVCBPLevel3_1, |
|
68 ECodecUnsupported |
|
69 }; |
|
70 |
|
71 class CVedCodecChecker : public CBase |
|
72 { |
|
73 |
|
74 public: // New functions |
|
75 |
|
76 /* Constructors. */ |
|
77 static CVedCodecChecker* NewL(); |
|
78 static CVedCodecChecker* NewLC(); |
|
79 |
|
80 /* Destructor. */ |
|
81 virtual ~CVedCodecChecker(); |
|
82 |
|
83 /** |
|
84 * Returns whether the given input clip is supported, |
|
85 * i.e. if it can be decoded or not |
|
86 * |
|
87 * @param aClip Video clip |
|
88 * @return TBool Is supported ? |
|
89 */ |
|
90 TBool IsSupportedInputClipL(CVedVideoClip *aClip); |
|
91 |
|
92 /** |
|
93 * Returns whether the given output format is supported, |
|
94 * i.e. if it can be encoded or not |
|
95 * |
|
96 * @param aMimeType Codec MIME type |
|
97 * @param aResolution Desired resolution |
|
98 * @return TBool Is supported ? |
|
99 */ |
|
100 TBool IsSupportedOutputFormatL(const TPtrC8& aMimeType, TSize aResolution); |
|
101 |
|
102 private: // Private methods |
|
103 |
|
104 /** |
|
105 * By default Symbian OS constructor is private. |
|
106 */ |
|
107 void ConstructL(); |
|
108 |
|
109 /** |
|
110 * C++ default constructor |
|
111 */ |
|
112 CVedCodecChecker(); |
|
113 |
|
114 /** |
|
115 * Determines supported input formats using CTRTranscoder |
|
116 */ |
|
117 void GetSupportedInputFormatsL(); |
|
118 |
|
119 /** |
|
120 * Determines supported output formats using CTRTranscoder |
|
121 */ |
|
122 void GetSupportedOutputFormatsL(); |
|
123 |
|
124 /** |
|
125 * Maps resolution from TSize to TResolution |
|
126 * |
|
127 * @param aResolution Resolution to map |
|
128 * @return TResolution |
|
129 */ |
|
130 TResolution MapResolution(TSize aResolution); |
|
131 |
|
132 /** |
|
133 * Maps profile-level-id to TCodec |
|
134 * |
|
135 * @param aProfileLevelId id to map |
|
136 * @return TCodec Codec |
|
137 */ |
|
138 TCodec MapProfileLevelId(TInt aProfileLevelId); |
|
139 |
|
140 /** |
|
141 * Parse codec MIME type |
|
142 * |
|
143 * @param aMimeType MIME to parse |
|
144 * @param aResolution resolution to be used |
|
145 * @return TCodec Codec |
|
146 */ |
|
147 TCodec ParseMimeType(const TPtrC8& aMimeType, TSize aResolution); |
|
148 |
|
149 /** |
|
150 * Maps AVC level to TCodec |
|
151 * |
|
152 * @param aLevel Level to map |
|
153 * @return TCodec Codec |
|
154 */ |
|
155 TCodec MapAVCLevel(TInt aLevel); |
|
156 |
|
157 private: // Data |
|
158 |
|
159 // table of supported input resolutions for each codec |
|
160 TBool* iInputCodecsAndResolutions[KNumCodecs]; |
|
161 |
|
162 // table of supported output resolutions for each codec |
|
163 TBool* iOutputCodecsAndResolutions[KNumCodecs]; |
|
164 |
|
165 // have output formats been checked ?? |
|
166 TBool iOutputFormatsChecked; |
|
167 |
|
168 }; |
|
169 |
|
170 #endif // __VEDCODECCHECKER_H__ |
|
171 |
|
172 |
|
173 // End of file |
|