|
1 /* |
|
2 * Copyright (c) 2009 Aricent and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "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 * Aricent - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * Defines the structures shared by HwDevice and wrapper |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef ARIVIDEOENCCOMMON_H |
|
20 #define ARIVIDEOENCCOMMON_H |
|
21 |
|
22 //Includes |
|
23 #include <E32def.h> |
|
24 #include <Devvideobase.h> |
|
25 #include <Mpeg4Visual.h> |
|
26 |
|
27 #define MAX_SCALABILITY_LAYERS 1 |
|
28 |
|
29 enum TSetCommands |
|
30 { |
|
31 CONTROL_CMD_SET_BIT_RATE = 2051, |
|
32 CONTROL_CMD_SET_FRAME_RATE, |
|
33 CONTROL_CMD_SET_FORCED_I_FRAME, |
|
34 CONTROL_CMD_SET_GOVLENGTH, |
|
35 CONTROL_CMD_SET_CHANNEL_PACKET_LOSS_RATE, |
|
36 CONTROL_CMD_SET_CHANNEL_BIT_ERROR_RATE, |
|
37 CONTROL_CMD_SET_SEGMENT_TARGET_SIZE, |
|
38 CONTROL_CMD_SET_RATE_CONTROL_OPTIONS, |
|
39 CONTROL_CMD_SET_COMMIT_OPTIONS, |
|
40 CONTROL_CMD_GET_CONFIG_HEADER, |
|
41 CONTROL_CMD_SET_COMPLEXITY_LEVEL, |
|
42 CONTROL_CMD_SET_SLICELOSS, |
|
43 CONTROL_CMD_SET_PACKETSIZE |
|
44 }; |
|
45 |
|
46 enum TGetCommands |
|
47 { |
|
48 |
|
49 CONTROL_CMD_GET_MAXBUFFERLENGTH = 3051, |
|
50 CONTROL_CMD_GET_NUMOFPICTSKIPPED, |
|
51 CONTROL_CMD_GET_MAXNUMOFPACKETS, |
|
52 CONTROL_CMD_GET_NUMOFPACKETS, |
|
53 CONTROL_CMD_GET_PACKETBOUNDARYDATA, |
|
54 CONTROL_CMD_GET_PACKETSIZE, |
|
55 CONTROL_CMD_GET_CONFIGDATA, |
|
56 CONTROL_CMD_GET_CONFIGDATALENGTH |
|
57 }; |
|
58 |
|
59 |
|
60 |
|
61 /* |
|
62 * Enumeration covering SetInputFormatL, SetOutputFormatL, SetInputDevice, SetNumBitrateLayersL, |
|
63 * SetScalabilityLayerTypeL, SetGlobalReferenceOptions, SetBufferOptionsL, SetMinRandomAccessRate |
|
64 * SetSourceMemoryL of Hw Device. All these seven methods can be called only before |
|
65 * Initialize. |
|
66 */ |
|
67 |
|
68 enum TOutputFormat |
|
69 { |
|
70 EH263 = 0x00000000, |
|
71 EMpeg4 = 0x00000001, |
|
72 }; |
|
73 |
|
74 |
|
75 enum TPanicCodes |
|
76 { |
|
77 EPanicArgument=1, |
|
78 EPanicInitializationPreCondViolation, |
|
79 EPanicNotSupported, |
|
80 EPanicNotPaused, |
|
81 EPanicNotFreezed, |
|
82 EPanicInvalidState, |
|
83 EPanicAlreadyStopped |
|
84 }; |
|
85 |
|
86 enum TEncBeforeInitialize |
|
87 { |
|
88 EEncBeforeInitNone = 0x00000000, |
|
89 EEncInputFormat = 0x00000001, |
|
90 EEncOutputFormat = 0x00000002, |
|
91 EEncInputDevice = 0x00000004, |
|
92 EEncNumBitrateLayers = 0x00000008, |
|
93 EEncScalabilityLayer = 0x00000010, |
|
94 EEncGlobalRefOptions = 0x00000020, |
|
95 EEncBufferOptions = 0x00000040, |
|
96 EEncRandomAccessRate = 0x00000080, |
|
97 EEncSourceMemory = 0x00000100, |
|
98 EEncInpBufferOptions = 0x00000200, |
|
99 EEncErrorProtectionLevelFEC = 0x00000400, |
|
100 EEncSegmentTargetSize = 0x00000800, |
|
101 EEncCodingStandardSpecificOptions = 0x00001000, |
|
102 EEncOutputRectSize = 0x00002000, |
|
103 EEncErrorsExpected = 0x00004000, |
|
104 EEncSourceCamera = 0x00008000, |
|
105 EEncComplexityLevel = 0x00010000, |
|
106 EEncLayerRefOptions = 0x00020000, |
|
107 }; |
|
108 |
|
109 class TH264EncLayerReferenceOptions |
|
110 { |
|
111 public: |
|
112 TUint iMaxReferencePictures; |
|
113 TUint iMaxPictureOrderDelay; |
|
114 |
|
115 TH264EncLayerReferenceOptions () : |
|
116 iMaxReferencePictures (1), |
|
117 iMaxPictureOrderDelay (0) |
|
118 { |
|
119 } |
|
120 }; |
|
121 |
|
122 class TMpeg4H263EncoderInitParams |
|
123 { |
|
124 public: |
|
125 // Specifies which parameters are being sent in the Initialize method |
|
126 |
|
127 TUint32 iBeforeInitialize; |
|
128 TUint32 iAfterInitialize; |
|
129 |
|
130 TSize iPictureSize; |
|
131 TInt iVopRate; |
|
132 TInt iNumOfGOBHdrs; |
|
133 TInt iGOVLength; |
|
134 TInt iSceneCutDetection; |
|
135 TInt iBandwidthAdaptation; |
|
136 TInt iPreprocessing; |
|
137 TInt iRCModel; |
|
138 TInt iSearchRange; |
|
139 TUint32 iTimerResolution; |
|
140 TInt iPacketmode; |
|
141 TInt iPacketSize; |
|
142 TInt iReversibleVLC; |
|
143 TInt iDataPartitioning; |
|
144 TInt iMAPS; |
|
145 |
|
146 // For SetOutputFormatL |
|
147 TOutputFormat iOutputFormat; |
|
148 TVideoDataUnitType iDataUnitType; |
|
149 TVideoDataUnitEncapsulation iDataEncapsulation; |
|
150 TBool iSegmentationAllowed; |
|
151 |
|
152 // For SetSourceMemoryL |
|
153 TReal iMaxPictureRate; |
|
154 TBool iConstantPictureRate; |
|
155 TBool iProcessRealtime; |
|
156 |
|
157 // For SetRamdomAccessRate |
|
158 TReal iRandomAccessRate; |
|
159 |
|
160 // For SetErrorsExpected |
|
161 TBool iBitErrors; |
|
162 TBool iPacketLosses; |
|
163 |
|
164 // For SetMinRandomAccessRate |
|
165 TInt iLevel; |
|
166 |
|
167 TUint iBitRate; |
|
168 TReal iTargetPictureRate; |
|
169 // complexity level |
|
170 TUint iComplexityLevel; |
|
171 |
|
172 TUncompressedVideoFormat iInputFormat; |
|
173 TInt32 iAspectRatio; |
|
174 TUint iNumInputBuffers; |
|
175 TSize iInputSize; |
|
176 // For SetNumBitrateLayersL |
|
177 TUint iNumBitRateLayers; |
|
178 |
|
179 // For SetScalabilityLayerTypeL |
|
180 TUint iLayer; |
|
181 TScalabilityType iScalabilityType; |
|
182 TH264EncLayerReferenceOptions iLayerReferenceOptions[MAX_SCALABILITY_LAYERS]; |
|
183 |
|
184 // For SetBufferOptionsL |
|
185 TUint iMaxPreEncoderBufferPictures; |
|
186 THrdVbvSpecification iHrdVbvSpec; |
|
187 T3gppHrdVbvParams iHrdVbvParams; |
|
188 TUint iMaxOutputBufferSize; |
|
189 TUint iMaxCodedPictureSize; |
|
190 TUint iMaxCodedSegmentSize; |
|
191 TUint iMinNumOutputBuffers; |
|
192 TMPEG4VisualMode iCodingStandardSpecificOptions; |
|
193 TRect iOutputRect; |
|
194 |
|
195 }; |
|
196 |
|
197 /* |
|
198 * slice loss structure |
|
199 */ |
|
200 class TMPEG4H263EncSliceLoss |
|
201 { |
|
202 public: |
|
203 TUint iFirstMacroblock; |
|
204 TUint iNumMacroblocks; |
|
205 |
|
206 TMPEG4H263EncSliceLoss() : |
|
207 iFirstMacroblock (0), |
|
208 iNumMacroblocks (0) |
|
209 { |
|
210 } |
|
211 }; |
|
212 |
|
213 /* |
|
214 * Parameters used by the hw device which are sent to codec |
|
215 */ |
|
216 |
|
217 |
|
218 |
|
219 |
|
220 class TPictureCountersInfo |
|
221 { |
|
222 public: |
|
223 TUint iPicturesSkippedBufferOverflow; |
|
224 TUint iPicturesSkippedProcPower; |
|
225 TUint iPicturesSkippedRateControl; |
|
226 TUint iPicturesProcessed; |
|
227 TUint iInputPictures; |
|
228 }; |
|
229 |
|
230 #endif //ARIVIDEOENCCOMMON_H |