|
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 #include <openmax/il/common/omxilimageport.h> |
|
23 #include <openmax/il/common/omxilutil.h> |
|
24 #include "log.h" |
|
25 #include "omxilimageportimpl.h" |
|
26 |
|
27 EXPORT_C |
|
28 COmxILImagePort::COmxILImagePort() |
|
29 { |
|
30 DEBUG_PRINTF(_L8("COmxILImagePort::COmxILImagePort")); |
|
31 } |
|
32 |
|
33 EXPORT_C |
|
34 COmxILImagePort::~COmxILImagePort() |
|
35 { |
|
36 DEBUG_PRINTF(_L8("COmxILImagePort::~COmxILImagePort")) |
|
37 delete ipImagePortImpl; |
|
38 } |
|
39 |
|
40 EXPORT_C OMX_ERRORTYPE |
|
41 COmxILImagePort::GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const |
|
42 { |
|
43 DEBUG_PRINTF(_L8("COmxILImagePort::GetLocalOmxParamIndexes")); |
|
44 |
|
45 // Always collect local indexes from parent |
|
46 OMX_ERRORTYPE omxRetValue = COmxILPort::GetLocalOmxParamIndexes(aIndexArray); |
|
47 |
|
48 if (OMX_ErrorNone != omxRetValue) |
|
49 { |
|
50 return omxRetValue; |
|
51 } |
|
52 |
|
53 TInt err = aIndexArray.InsertInOrder(OMX_IndexParamImagePortFormat); |
|
54 |
|
55 // Note that index duplication is OK. |
|
56 if (KErrNone != err && KErrAlreadyExists != err) |
|
57 { |
|
58 return OMX_ErrorInsufficientResources; |
|
59 } |
|
60 |
|
61 return OMX_ErrorNone; |
|
62 |
|
63 } |
|
64 |
|
65 EXPORT_C OMX_ERRORTYPE |
|
66 COmxILImagePort::GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const |
|
67 { |
|
68 DEBUG_PRINTF(_L8("COmxILImagePort::GetLocalOmxConfigIndexes")); |
|
69 |
|
70 // Always collect local indexes from parent |
|
71 return COmxILPort::GetLocalOmxConfigIndexes(aIndexArray); |
|
72 |
|
73 } |
|
74 |
|
75 EXPORT_C OMX_ERRORTYPE COmxILImagePort::GetParameter(OMX_INDEXTYPE aParamIndex, TAny* apComponentParameterStructure) const |
|
76 { |
|
77 DEBUG_PRINTF(_L8("COmxILImagePort::GetParameter")); |
|
78 OMX_ERRORTYPE omxRetValue = OMX_ErrorNone; |
|
79 switch(aParamIndex) |
|
80 { |
|
81 case OMX_IndexParamImagePortFormat: |
|
82 { |
|
83 __ASSERT_ALWAYS(ipImagePortImpl, User::Panic(KOmxILImagePortPanicCategory, 1)); |
|
84 omxRetValue = ipImagePortImpl->GetParameter(aParamIndex, apComponentParameterStructure); |
|
85 } |
|
86 break; |
|
87 default: |
|
88 { |
|
89 // Try the parent's indexes |
|
90 omxRetValue = COmxILPort::GetParameter(aParamIndex, apComponentParameterStructure); |
|
91 } |
|
92 }; |
|
93 |
|
94 return omxRetValue; |
|
95 } |
|
96 |
|
97 EXPORT_C OMX_ERRORTYPE COmxILImagePort::SetParameter(OMX_INDEXTYPE aParamIndex, const TAny* apComponentParameterStructure, TBool& aUpdateProcessingFunction) |
|
98 { |
|
99 DEBUG_PRINTF(_L8("COmxILImagePort::SetParameter")); |
|
100 OMX_ERRORTYPE omxRetValue = OMX_ErrorNone; |
|
101 |
|
102 switch(aParamIndex) |
|
103 { |
|
104 case OMX_IndexParamImagePortFormat: |
|
105 { |
|
106 __ASSERT_ALWAYS(ipImagePortImpl, User::Panic(KOmxILImagePortPanicCategory, 1)); |
|
107 omxRetValue = ipImagePortImpl->SetParameter(aParamIndex, apComponentParameterStructure, aUpdateProcessingFunction); |
|
108 } |
|
109 break; |
|
110 default: |
|
111 { |
|
112 // Try the parent's indexes |
|
113 omxRetValue = COmxILPort::SetParameter(aParamIndex, apComponentParameterStructure, aUpdateProcessingFunction); |
|
114 } |
|
115 }; |
|
116 return omxRetValue; |
|
117 } |
|
118 |
|
119 EXPORT_C |
|
120 void COmxILImagePort::ConstructL(const TOmxILCommonPortData& aCommonPortData, |
|
121 const RArray<OMX_IMAGE_CODINGTYPE>& aSupportedImageFormats, |
|
122 const RArray<OMX_COLOR_FORMATTYPE>& aSupportedColorFormats) |
|
123 { |
|
124 COmxILPort::ConstructL(aCommonPortData); //create COmxILPortImpl |
|
125 ipImagePortImpl=COmxILImagePortImpl::NewL(aCommonPortData, aSupportedImageFormats, aSupportedColorFormats); //create COmxILImagePortImpl |
|
126 } |
|
127 |
|
128 EXPORT_C OMX_ERRORTYPE |
|
129 COmxILImagePort::GetConfig(OMX_INDEXTYPE aConfigIndex, |
|
130 TAny* apComponentConfigStructure) const |
|
131 { |
|
132 DEBUG_PRINTF(_L8("COmxILPort::GetConfig")); |
|
133 return COmxILPort::GetConfig(aConfigIndex, |
|
134 apComponentConfigStructure); |
|
135 } |
|
136 |
|
137 EXPORT_C OMX_ERRORTYPE |
|
138 COmxILImagePort::SetConfig(OMX_INDEXTYPE aConfigIndex, |
|
139 const TAny* apComponentConfigStructure, |
|
140 TBool& aUpdateProcessingFunction) |
|
141 { |
|
142 DEBUG_PRINTF(_L8("COmxILPort::SetConfig")); |
|
143 return COmxILPort::SetConfig(aConfigIndex, |
|
144 apComponentConfigStructure, |
|
145 aUpdateProcessingFunction); |
|
146 |
|
147 } |
|
148 |
|
149 EXPORT_C OMX_ERRORTYPE |
|
150 COmxILImagePort::GetExtensionIndex(OMX_STRING aParameterName, |
|
151 OMX_INDEXTYPE* apIndexType) const |
|
152 { |
|
153 return COmxILPort::GetExtensionIndex(aParameterName, |
|
154 apIndexType); |
|
155 } |
|
156 |
|
157 EXPORT_C OMX_ERRORTYPE |
|
158 COmxILImagePort::PopulateBuffer(OMX_BUFFERHEADERTYPE** appBufferHdr, |
|
159 const OMX_PTR apAppPrivate, |
|
160 OMX_U32 aSizeBytes, |
|
161 OMX_U8* apBuffer, |
|
162 TBool& aPortPopulationCompleted) |
|
163 { |
|
164 DEBUG_PRINTF2(_L8("COmxILImagePort::PopulateBuffer : pBuffer [%X]"), apBuffer); |
|
165 return COmxILPort::PopulateBuffer(appBufferHdr, |
|
166 apAppPrivate, |
|
167 aSizeBytes, |
|
168 apBuffer, |
|
169 aPortPopulationCompleted); |
|
170 } |
|
171 |
|
172 |
|
173 EXPORT_C OMX_ERRORTYPE |
|
174 COmxILImagePort::FreeBuffer(OMX_BUFFERHEADERTYPE* apBufferHeader, |
|
175 TBool& aPortDepopulationCompleted) |
|
176 { |
|
177 DEBUG_PRINTF2(_L8("COmxILImagePort::FreeBuffer : BUFFER [%X]"), apBufferHeader); |
|
178 return COmxILPort::FreeBuffer(apBufferHeader, aPortDepopulationCompleted); |
|
179 } |
|
180 |
|
181 |
|
182 EXPORT_C OMX_ERRORTYPE |
|
183 COmxILImagePort::TunnelRequest(OMX_HANDLETYPE aTunneledComp, |
|
184 OMX_U32 aTunneledPort, |
|
185 OMX_TUNNELSETUPTYPE* apTunnelSetup) |
|
186 { |
|
187 DEBUG_PRINTF(_L8("COmxILImagePort::TunnelRequest")); |
|
188 return COmxILPort::TunnelRequest(aTunneledComp, |
|
189 aTunneledPort, |
|
190 apTunnelSetup); |
|
191 } |
|
192 |
|
193 |
|
194 EXPORT_C OMX_ERRORTYPE |
|
195 COmxILImagePort::PopulateTunnel(TBool& portPopulationCompleted) |
|
196 { |
|
197 DEBUG_PRINTF(_L8("COmxILImagePort::PopulateTunnel")); |
|
198 return COmxILPort::PopulateTunnel(portPopulationCompleted); |
|
199 } |
|
200 |
|
201 |
|
202 EXPORT_C OMX_ERRORTYPE |
|
203 COmxILImagePort::FreeTunnel(TBool& portDepopulationCompleted) |
|
204 { |
|
205 DEBUG_PRINTF(_L8("COmxILImagePort::FreeTunnel")); |
|
206 return COmxILPort::FreeTunnel(portDepopulationCompleted); |
|
207 } |
|
208 |
|
209 EXPORT_C TBool |
|
210 COmxILImagePort::SetBufferSent(OMX_BUFFERHEADERTYPE* apBufferHeader, |
|
211 TBool& aBufferMarkedWithOwnMark) |
|
212 { |
|
213 DEBUG_PRINTF(_L8("COmxILImagePort::SetBufferSent")); |
|
214 return COmxILPort::SetBufferSent(apBufferHeader, |
|
215 aBufferMarkedWithOwnMark); |
|
216 } |
|
217 |
|
218 EXPORT_C TBool |
|
219 COmxILImagePort::SetBufferReturned(OMX_BUFFERHEADERTYPE* apBufferHeader) |
|
220 { |
|
221 DEBUG_PRINTF(_L8("COmxILImagePort::SetBufferReturned")); |
|
222 return COmxILPort::SetBufferReturned(apBufferHeader); |
|
223 } |
|
224 |
|
225 EXPORT_C void |
|
226 COmxILImagePort::SetTransitionToEnabled() |
|
227 { |
|
228 DEBUG_PRINTF(_L8("COmxILImagePort::SetTransitionToEnabled")); |
|
229 return COmxILPort::SetTransitionToEnabled(); |
|
230 } |
|
231 |
|
232 EXPORT_C void |
|
233 COmxILImagePort::SetTransitionToDisabled() |
|
234 { |
|
235 DEBUG_PRINTF(_L8("COmxILImagePort::SetTransitionToDisabled")); |
|
236 return COmxILPort::SetTransitionToDisabled(); |
|
237 } |
|
238 |
|
239 EXPORT_C void |
|
240 COmxILImagePort::SetTransitionToDisabledCompleted() |
|
241 { |
|
242 DEBUG_PRINTF(_L8("COmxILImagePort::SetTransitionToDisabledCompleted")); |
|
243 return COmxILPort::SetTransitionToDisabledCompleted(); |
|
244 } |
|
245 |
|
246 EXPORT_C void |
|
247 COmxILImagePort::SetTransitionToEnabledCompleted() |
|
248 { |
|
249 DEBUG_PRINTF(_L8("COmxILImagePort::SetTransitionToEnabledCompleted")); |
|
250 return COmxILPort::SetTransitionToEnabledCompleted(); |
|
251 } |
|
252 |
|
253 EXPORT_C OMX_ERRORTYPE |
|
254 COmxILImagePort::StoreBufferMark(const OMX_MARKTYPE* apMark) |
|
255 { |
|
256 DEBUG_PRINTF(_L8("COmxILImagePort::StoreBufferMark")); |
|
257 return COmxILPort::StoreBufferMark(apMark); |
|
258 } |
|
259 |
|
260 EXPORT_C OMX_ERRORTYPE |
|
261 COmxILImagePort::SetComponentRoleDefaults(TUint aComponentRoleIndex) |
|
262 { |
|
263 DEBUG_PRINTF(_L8("COmxILImagePort::SetComponentRoleDefaults")); |
|
264 |
|
265 return COmxILPort::SetComponentRoleDefaults(aComponentRoleIndex); |
|
266 } |
|
267 |
|
268 EXPORT_C TBool |
|
269 COmxILImagePort::HasAllBuffersAtHome() const |
|
270 { |
|
271 return COmxILPort::HasAllBuffersAtHome(); |
|
272 } |
|
273 |
|
274 EXPORT_C TBool |
|
275 COmxILImagePort::IsBufferAtHome(OMX_BUFFERHEADERTYPE* apBufferHeader) const |
|
276 { |
|
277 DEBUG_PRINTF2(_L8("COmxILImagePort::IsBufferAtHome : [%X]"), apBufferHeader); |
|
278 return COmxILPort::IsBufferAtHome(apBufferHeader); |
|
279 } |
|
280 |
|
281 EXPORT_C OMX_ERRORTYPE |
|
282 COmxILImagePort::DoPortReconfiguration(TUint aPortSettingsIndex, |
|
283 const TDesC8& aPortSettings, |
|
284 OMX_EVENTTYPE& aEventForILClient) |
|
285 { |
|
286 DEBUG_PRINTF(_L8("COmxILImagePort::DoPortReconfiguration")); |
|
287 |
|
288 return COmxILPort::DoPortReconfiguration(aPortSettingsIndex, |
|
289 aPortSettings, |
|
290 aEventForILClient); |
|
291 } |
|
292 |
|
293 EXPORT_C OMX_ERRORTYPE |
|
294 COmxILImagePort::DoBufferAllocation(OMX_U32 aSizeBytes, |
|
295 OMX_U8*& apPortSpecificBuffer, |
|
296 OMX_PTR& apPortPrivate, |
|
297 OMX_PTR& apPlatformPrivate, |
|
298 OMX_PTR apAppPrivate) |
|
299 { |
|
300 DEBUG_PRINTF2(_L8("COmxILImagePort::DoBufferAllocation : aSizeBytes[%u]"), aSizeBytes); |
|
301 return COmxILPort::DoBufferAllocation(aSizeBytes, |
|
302 apPortSpecificBuffer, |
|
303 apPortPrivate, |
|
304 apPlatformPrivate, |
|
305 apAppPrivate); |
|
306 } |
|
307 |
|
308 EXPORT_C void |
|
309 COmxILImagePort::DoBufferDeallocation(OMX_PTR apPortSpecificBuffer, |
|
310 OMX_PTR apPortPrivate, |
|
311 OMX_PTR apPlatformPrivate, |
|
312 OMX_PTR apAppPrivate) |
|
313 { |
|
314 DEBUG_PRINTF(_L8("COmxILImagePort::DoBufferDeallocation")); |
|
315 return COmxILPort::DoBufferDeallocation(apPortSpecificBuffer, |
|
316 apPortPrivate, |
|
317 apPlatformPrivate, |
|
318 apAppPrivate); |
|
319 } |
|
320 |
|
321 |
|
322 EXPORT_C OMX_ERRORTYPE |
|
323 COmxILImagePort::DoBufferWrapping(OMX_U32 aSizeBytes, |
|
324 OMX_U8* apBuffer, |
|
325 OMX_PTR& apPortPrivate, |
|
326 OMX_PTR& apPlatformPrivate, |
|
327 OMX_PTR apAppPrivate) |
|
328 { |
|
329 DEBUG_PRINTF(_L8("COmxILImagePort::DoBufferWrapping")); |
|
330 return COmxILPort::DoBufferWrapping(aSizeBytes, |
|
331 apBuffer, |
|
332 apPortPrivate, |
|
333 apPlatformPrivate, |
|
334 apAppPrivate); |
|
335 } |
|
336 |
|
337 EXPORT_C void |
|
338 COmxILImagePort::DoBufferUnwrapping(OMX_PTR apBuffer, |
|
339 OMX_PTR appPortPrivate, |
|
340 OMX_PTR apPlatformPrivate, |
|
341 OMX_PTR apAppPrivate) |
|
342 { |
|
343 |
|
344 DEBUG_PRINTF(_L8("COmxILImagePort::DoBufferUnwrapping")); |
|
345 return COmxILPort::DoBufferUnwrapping(apBuffer, |
|
346 appPortPrivate, |
|
347 apPlatformPrivate, |
|
348 apAppPrivate); |
|
349 } |
|
350 |
|
351 EXPORT_C OMX_ERRORTYPE |
|
352 COmxILImagePort::DoOmxUseBuffer(OMX_HANDLETYPE aTunnelledComponent, |
|
353 OMX_BUFFERHEADERTYPE** appBufferHdr, |
|
354 OMX_U32 aTunnelledPortIndex, |
|
355 OMX_PTR apPortPrivate, |
|
356 OMX_PTR apPlatformPrivate, |
|
357 OMX_U32 aSizeBytes, |
|
358 OMX_U8* apBuffer) |
|
359 { |
|
360 |
|
361 DEBUG_PRINTF(_L8("COmxILImagePort::DoOmxUseBuffer")); |
|
362 return COmxILPort::DoOmxUseBuffer(aTunnelledComponent, |
|
363 appBufferHdr, |
|
364 aTunnelledPortIndex, |
|
365 apPortPrivate, |
|
366 apPlatformPrivate, |
|
367 aSizeBytes, |
|
368 apBuffer); |
|
369 } |
|
370 |
|
371 |
|
372 EXPORT_C |
|
373 TInt COmxILImagePort::Extension_(TUint aExtensionId, TAny *&a0, TAny *a1) |
|
374 { |
|
375 return COmxILPort::Extension_(aExtensionId, a0, a1); |
|
376 } |
|
377 |
|
378 EXPORT_C |
|
379 const RArray<OMX_IMAGE_CODINGTYPE>& COmxILImagePort::GetSupportedImageFormats() const |
|
380 { |
|
381 __ASSERT_ALWAYS(ipImagePortImpl, User::Panic(KOmxILImagePortPanicCategory, 1)); |
|
382 return ipImagePortImpl->GetSupportedImageFormats(); |
|
383 } |
|
384 |
|
385 EXPORT_C |
|
386 const RArray<OMX_COLOR_FORMATTYPE>& COmxILImagePort::GetSupportedColorFormats() const |
|
387 { |
|
388 __ASSERT_ALWAYS(ipImagePortImpl, User::Panic(KOmxILImagePortPanicCategory, 1)); |
|
389 return ipImagePortImpl->GetSupportedColorFormats(); |
|
390 } |
|
391 |
|
392 EXPORT_C |
|
393 const OMX_IMAGE_PARAM_PORTFORMATTYPE& COmxILImagePort::GetParamImagePortFormat() const |
|
394 { |
|
395 __ASSERT_ALWAYS(ipImagePortImpl, User::Panic(KOmxILImagePortPanicCategory, 1)); |
|
396 return ipImagePortImpl->GetParamImagePortFormat(); |
|
397 } |
|
398 |
|
399 EXPORT_C |
|
400 RArray<OMX_IMAGE_CODINGTYPE>& COmxILImagePort::GetSupportedImageFormats() |
|
401 { |
|
402 __ASSERT_ALWAYS(ipImagePortImpl, User::Panic(KOmxILImagePortPanicCategory, 1)); |
|
403 return ipImagePortImpl->GetSupportedImageFormats(); |
|
404 } |
|
405 |
|
406 EXPORT_C |
|
407 RArray<OMX_COLOR_FORMATTYPE>& COmxILImagePort::GetSupportedColorFormats() |
|
408 { |
|
409 __ASSERT_ALWAYS(ipImagePortImpl, User::Panic(KOmxILImagePortPanicCategory, 1)); |
|
410 return ipImagePortImpl->GetSupportedColorFormats(); |
|
411 } |
|
412 |
|
413 EXPORT_C |
|
414 OMX_IMAGE_PARAM_PORTFORMATTYPE& COmxILImagePort::GetParamImagePortFormat() |
|
415 { |
|
416 __ASSERT_ALWAYS(ipImagePortImpl, User::Panic(KOmxILImagePortPanicCategory, 1)); |
|
417 return ipImagePortImpl->GetParamImagePortFormat(); |
|
418 } |