|
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 #include "omxildummybaseilif.h" |
|
18 #include "omxildummybaseilifbody.h" |
|
19 #include "omxilcoreutils.h" |
|
20 #include "iltestuids.hrh" |
|
21 #include "milcomponentportif.h" |
|
22 #include "ilifuids.h" |
|
23 #include <openmax/il/khronos/v1_x/OMX_Types.h> |
|
24 |
|
25 const TUint32 KOMXALL = 0xFFFFFFFF; |
|
26 |
|
27 |
|
28 EXPORT_C COmxILDummyBaseILIF::COmxILDummyBaseILIF() |
|
29 { |
|
30 } |
|
31 |
|
32 EXPORT_C COmxILDummyBaseILIF::~COmxILDummyBaseILIF() |
|
33 { |
|
34 if (iBody) |
|
35 { |
|
36 delete iBody; |
|
37 } |
|
38 } |
|
39 |
|
40 EXPORT_C void COmxILDummyBaseILIF::CreateComponentL(const TDesC8& aComponentName, |
|
41 MILIfObserver& aComponentIfObserver) |
|
42 { |
|
43 iBody = CBody::NewL(*this, aComponentIfObserver, aComponentName); |
|
44 |
|
45 User::LeaveIfError(iBody->SetPortsL()); |
|
46 } |
|
47 |
|
48 EXPORT_C void COmxILDummyBaseILIF::CreateComponentL(const TUid& /*aUid*/, |
|
49 MILIfObserver& /*ComponentIfObserver*/) |
|
50 { |
|
51 // OMX Versions do not use this method of creation |
|
52 User::Leave(KErrNotSupported); |
|
53 } |
|
54 |
|
55 EXPORT_C void COmxILDummyBaseILIF::ReleaseComponent() |
|
56 { |
|
57 delete iBody; |
|
58 iBody = NULL; |
|
59 |
|
60 delete this; |
|
61 } |
|
62 |
|
63 EXPORT_C TInt COmxILDummyBaseILIF::GetComponentInputPorts(RPointerArray<MILComponentPortIf>& aComponentPorts) const |
|
64 { |
|
65 return (iBody->GetComponentPorts(aComponentPorts, OMX_DirInput)); |
|
66 } |
|
67 |
|
68 EXPORT_C TInt COmxILDummyBaseILIF::GetComponentOutputPorts(RPointerArray<MILComponentPortIf>& aComponentPorts) const |
|
69 { |
|
70 return (iBody->GetComponentPorts(aComponentPorts, OMX_DirOutput)); |
|
71 } |
|
72 |
|
73 EXPORT_C TInt COmxILDummyBaseILIF::SetConfig(const TILStruct& /*aConfig*/, |
|
74 const MILComponentPortIf* /*aComponentPort*/) |
|
75 { |
|
76 // It should be implemented in the derived class |
|
77 return KErrNotSupported; |
|
78 } |
|
79 |
|
80 EXPORT_C TInt COmxILDummyBaseILIF::GetConfig(TILStruct& /*aConfig*/, |
|
81 const MILComponentPortIf* /*aComponentPort*/) const |
|
82 { |
|
83 // It should be implemented in the derived class |
|
84 return (KErrNotSupported); |
|
85 } |
|
86 |
|
87 EXPORT_C TInt COmxILDummyBaseILIF::Initialize() |
|
88 { |
|
89 return (iBody->OmxSendCommand(OMX_CommandStateSet, OMX_StateIdle, NULL)); |
|
90 } |
|
91 |
|
92 EXPORT_C TInt COmxILDummyBaseILIF::Execute() |
|
93 { |
|
94 return (iBody->OmxSendCommand(OMX_CommandStateSet, OMX_StateExecuting, NULL)); |
|
95 } |
|
96 |
|
97 EXPORT_C TInt COmxILDummyBaseILIF::Pause() |
|
98 { |
|
99 return (iBody->OmxSendCommand(OMX_CommandStateSet, OMX_StatePause, NULL)); |
|
100 } |
|
101 |
|
102 EXPORT_C TInt COmxILDummyBaseILIF::Stop() |
|
103 { |
|
104 return (iBody->OmxSendCommand(OMX_CommandStateSet, OMX_StateIdle, NULL)); |
|
105 } |
|
106 |
|
107 EXPORT_C TInt COmxILDummyBaseILIF::UnInitialize() |
|
108 { |
|
109 return (iBody->OmxSendCommand(OMX_CommandStateSet, OMX_StateLoaded, NULL)); |
|
110 } |
|
111 |
|
112 EXPORT_C TInt COmxILDummyBaseILIF::GetState(TILComponentState& aState) const |
|
113 { |
|
114 TInt error; |
|
115 OMX_STATETYPE state; |
|
116 error = iBody->OmxGetState(&state); |
|
117 aState = ConvertOmxState(state); |
|
118 return error; |
|
119 } |
|
120 |
|
121 EXPORT_C TInt COmxILDummyBaseILIF::SendCommand(const TILCommand& aCommand) |
|
122 { |
|
123 OMX_COMMANDTYPE command = ConvertSymbianCommandType(aCommand.iCmd); |
|
124 return (iBody->OmxSendCommand(command, aCommand.iData1, aCommand.iExtraData)); |
|
125 } |
|
126 |
|
127 EXPORT_C TInt COmxILDummyBaseILIF::FlushAllPorts() |
|
128 { |
|
129 return (iBody->OmxSendCommand(OMX_CommandFlush, KOMXALL, NULL)); |
|
130 } |
|
131 |
|
132 EXPORT_C TInt COmxILDummyBaseILIF::ComponentRoleEnum(TPtr8& aComponentRole, |
|
133 TUint32 aIndex) const |
|
134 { |
|
135 return (iBody->OmxComponentRoleEnum(aComponentRole, aIndex)); |
|
136 } |
|
137 |
|
138 EXPORT_C TInt COmxILDummyBaseILIF::GetComponentVersion(TILComponentVersion& aVersion) const |
|
139 { |
|
140 return (iBody->OmxGetComponentVersion(aVersion.iComponentName, |
|
141 (OMX_VERSIONTYPE*)&aVersion.iComponentVersion, |
|
142 (OMX_VERSIONTYPE*)&aVersion.iSpecVersion, |
|
143 (OMX_UUIDTYPE*)&aVersion.iComponentUniqueID)); |
|
144 } |
|
145 |
|
146 EXPORT_C TInt COmxILDummyBaseILIF::SetComponentIfRole(const TUid& aComponentRole) |
|
147 { |
|
148 return (iBody->SetIfToRole(aComponentRole)); |
|
149 } |
|
150 |
|
151 EXPORT_C TInt COmxILDummyBaseILIF::SetComponentIfRole(const TDesC8& /*aComponentRole*/) |
|
152 { |
|
153 return (KErrNotSupported); |
|
154 } |
|
155 |
|
156 EXPORT_C TInt COmxILDummyBaseILIF::GetComponentIfRole(TUid& aComponentRole) const |
|
157 { |
|
158 return (iBody->GetIfRole(aComponentRole)); |
|
159 } |
|
160 |
|
161 EXPORT_C TInt COmxILDummyBaseILIF::GetComponentIfRole(TDes8& /*aComponentRole*/) const |
|
162 { |
|
163 return (KErrNotSupported); |
|
164 } |
|
165 |
|
166 EXPORT_C TInt COmxILDummyBaseILIF::SetExtConfig(const TDesC8& /*aParameterName*/, |
|
167 const TILStruct& /*aConfig*/, |
|
168 const MILComponentPortIf* /*aComponentPort*/) |
|
169 { |
|
170 // It should be implemented in the derived class |
|
171 return (KErrNotSupported); |
|
172 } |
|
173 |
|
174 EXPORT_C TInt COmxILDummyBaseILIF::GetExtConfig(const TDesC8& /*aParameterName*/, |
|
175 TILStruct& /*aConfig*/, |
|
176 const MILComponentPortIf* /*aComponentPort*/) const |
|
177 { |
|
178 // It should be implemented in the derived class |
|
179 return (KErrNotSupported); |
|
180 } |
|
181 EXPORT_C TAny* COmxILDummyBaseILIF::CustomInterface(TUid aUid) |
|
182 { |
|
183 if (aUid == KUidILComponentIf) |
|
184 { |
|
185 MILComponentIf* componentIf = this; |
|
186 return componentIf; |
|
187 } |
|
188 else |
|
189 { |
|
190 return NULL; |
|
191 } |
|
192 } |
|
193 |
|
194 |
|
195 EXPORT_C TInt COmxILDummyBaseILIF::FillBufferDone(CMMFBuffer* aBuffer, |
|
196 TInt aPortIndex) |
|
197 { |
|
198 return (iBody->FillBufferDone(aBuffer, aPortIndex)); |
|
199 } |
|
200 |
|
201 EXPORT_C TInt COmxILDummyBaseILIF::EmptyBufferDone(const CMMFBuffer* aBuffer, |
|
202 TInt aPortIndex) |
|
203 { |
|
204 return (iBody->EmptyBufferDone(aBuffer, aPortIndex)); |
|
205 } |
|
206 |
|
207 EXPORT_C TInt COmxILDummyBaseILIF::EventHandler(OMX_EVENTTYPE aEvent, |
|
208 TUint32 aData1, |
|
209 TUint32 aData2, |
|
210 TAny* aExtraInfo) |
|
211 { |
|
212 return (iBody->EventHandler(aEvent, aData1, aData2, aExtraInfo)); |
|
213 } |
|
214 |
|
215 EXPORT_C TInt COmxILDummyBaseILIF::OmxGetParameter(OMX_INDEXTYPE aParamIndex, |
|
216 TAny* aComponentParameterStructure) const |
|
217 { |
|
218 return (iBody->OmxGetParameter(aParamIndex, aComponentParameterStructure)); |
|
219 } |
|
220 |
|
221 EXPORT_C TInt COmxILDummyBaseILIF::OmxSetParameter(OMX_INDEXTYPE aParamIndex, |
|
222 TAny* aComponentParameterStructure) |
|
223 { |
|
224 return (iBody->OmxSetParameter(aParamIndex, aComponentParameterStructure)); |
|
225 } |
|
226 |
|
227 EXPORT_C TInt COmxILDummyBaseILIF::OmxGetConfig(OMX_INDEXTYPE aConfigIndex, |
|
228 TAny* aValue) const |
|
229 { |
|
230 return (iBody->OmxGetConfig(aConfigIndex, aValue)); |
|
231 } |
|
232 |
|
233 EXPORT_C TInt COmxILDummyBaseILIF::OmxSetConfig(OMX_INDEXTYPE aConfigIndex, |
|
234 TAny* aValue) |
|
235 { |
|
236 return (iBody->OmxSetConfig(aConfigIndex, aValue)); |
|
237 } |
|
238 |
|
239 EXPORT_C TInt COmxILDummyBaseILIF::OmxGetExtensionIndex(const TDesC8& aParameterName, |
|
240 OMX_INDEXTYPE* aIndexType) const |
|
241 { |
|
242 return (iBody->OmxGetExtensionIndex(aParameterName, aIndexType)); |
|
243 } |
|
244 |
|
245 TInt COmxILDummyBaseILIF::OmxSendCommand(OMX_COMMANDTYPE aCmd, |
|
246 TUint32 aParam1, |
|
247 TAny* aCmdData) |
|
248 { |
|
249 return (iBody->OmxSendCommand(aCmd, aParam1, aCmdData)); |
|
250 } |
|
251 |
|
252 TInt COmxILDummyBaseILIF::OmxComponentTunnelRequest(TUint32 aPortInput, |
|
253 OMX_HANDLETYPE aOutput, |
|
254 TUint32 aPortOutput) |
|
255 { |
|
256 return (iBody->OmxComponentTunnelRequest(aPortInput, aOutput, aPortOutput)); |
|
257 } |
|
258 |
|
259 TInt COmxILDummyBaseILIF::OmxComponentDisconnectTunnel(TUint32 aPortInput, |
|
260 OMX_HANDLETYPE aOutput, |
|
261 TUint32 aPortOutput) |
|
262 { |
|
263 return (iBody->OmxComponentDisconnectTunnel(aPortInput, aOutput, aPortOutput)); |
|
264 } |
|
265 |
|
266 TInt COmxILDummyBaseILIF::OmxUseBuffer(CMMFBuffer* aBuffer, |
|
267 TUint32 aPortIndex) |
|
268 { |
|
269 return (iBody->OmxUseBuffer(aBuffer, aPortIndex)); |
|
270 } |
|
271 |
|
272 CMMFBuffer* COmxILDummyBaseILIF::OmxAllocateBufferL(TUint32 aPortIndex, |
|
273 TUint32 aSizeBytes) |
|
274 { |
|
275 return (iBody->OmxAllocateBufferL(aPortIndex, aSizeBytes)); |
|
276 } |
|
277 |
|
278 TInt COmxILDummyBaseILIF::OmxFreeBuffer(CMMFBuffer* aBuffer) |
|
279 { |
|
280 return (iBody->OmxFreeBuffer(aBuffer)); |
|
281 } |
|
282 |
|
283 TInt COmxILDummyBaseILIF::OmxEmptyThisBuffer(const CMMFBuffer* aBuffer, |
|
284 MOmxILComponentIfObserver* aObserver) |
|
285 { |
|
286 return (iBody->OmxEmptyThisBuffer(aBuffer, aObserver)); |
|
287 } |
|
288 |
|
289 TInt COmxILDummyBaseILIF::OmxFillThisBuffer(CMMFBuffer* aBuffer, |
|
290 MOmxILComponentIfObserver* aObserver) |
|
291 { |
|
292 return (iBody->OmxFillThisBuffer(aBuffer, aObserver)); |
|
293 } |
|
294 |
|
295 OMX_COMPONENTTYPE* COmxILDummyBaseILIF::OmxHandle() const |
|
296 { |
|
297 return (iBody->Handle()); |
|
298 } |