13 // Description: |
13 // Description: |
14 // |
14 // |
15 |
15 |
16 |
16 |
17 /** |
17 /** |
18 @file |
18 @file |
19 @internalComponent |
19 @internalComponent |
20 */ |
20 */ |
21 |
21 |
22 #include "log.h" |
22 #include "log.h" |
23 #include "omxilcallbackmanagerifimpl.h" |
23 #include "omxilcallbackmanagerifimpl.h" |
24 #include "omxilportmanager.h" |
|
25 #include "omxilfsm.h" |
24 #include "omxilfsm.h" |
|
25 #include "omxilportmanagerif.h" |
|
26 #include "omxilspecversion.h" |
26 |
27 |
27 |
28 |
28 EXPORT_C |
29 EXPORT_C |
29 XOmxILCallbackManagerIfImpl::XOmxILCallbackManagerIfImpl(OMX_HANDLETYPE apComponentHandle, |
30 XOmxILCallbackManagerIfImpl::XOmxILCallbackManagerIfImpl(OMX_HANDLETYPE apComponentHandle, |
30 OMX_PTR apAppData, |
31 OMX_PTR apAppData, |
31 OMX_CALLBACKTYPE* apCallbacks) |
32 OMX_CALLBACKTYPE* apCallbacks) |
32 : |
33 : |
33 ipHandle(static_cast<OMX_COMPONENTTYPE*>(apComponentHandle)), |
34 ipHandle(static_cast<OMX_COMPONENTTYPE*>(apComponentHandle)), |
34 ipAppData(apAppData), |
35 ipAppData(apAppData), |
35 ipCallbacks(apCallbacks), |
36 ipCallbacks(apCallbacks), |
36 iRegisteredTunnels(), |
37 iRegisteredTunnels(), |
195 XOmxILCallbackManagerIfImpl::DoTransitionCompleteNotification(OMX_STATETYPE aOmxState) |
196 XOmxILCallbackManagerIfImpl::DoTransitionCompleteNotification(OMX_STATETYPE aOmxState) |
196 { |
197 { |
197 DEBUG_PRINTF(_L8("XOmxILCallbackManagerIfImpl::DoTransitionCompleteNotification")); |
198 DEBUG_PRINTF(_L8("XOmxILCallbackManagerIfImpl::DoTransitionCompleteNotification")); |
198 |
199 |
199 return DoEventNotification(OMX_EventCmdComplete, |
200 return DoEventNotification(OMX_EventCmdComplete, |
200 OMX_CommandStateSet, |
201 OMX_CommandStateSet, |
201 aOmxState, |
202 aOmxState, |
202 0); |
203 0); |
203 |
204 |
204 } |
205 } |
205 |
206 |
206 |
207 |
207 EXPORT_C OMX_ERRORTYPE |
208 EXPORT_C OMX_ERRORTYPE |
208 XOmxILCallbackManagerIfImpl::DoCommandCompleteNotification(OMX_COMMANDTYPE aOmxCommand, |
209 XOmxILCallbackManagerIfImpl::DoCommandCompleteNotification(OMX_COMMANDTYPE aOmxCommand, |
209 OMX_U32 aOmxPortIndex) |
210 OMX_U32 aOmxPortIndex) |
210 { |
211 { |
211 DEBUG_PRINTF(_L8("XOmxILCallbackManagerIfImpl::DoCommandCompleteNotification")); |
212 DEBUG_PRINTF(_L8("XOmxILCallbackManagerIfImpl::DoCommandCompleteNotification")); |
212 |
213 |
213 return DoEventNotification(OMX_EventCmdComplete, |
214 return DoEventNotification(OMX_EventCmdComplete, |
214 aOmxCommand, |
215 aOmxCommand, |
215 aOmxPortIndex, |
216 aOmxPortIndex, |
216 0); |
217 0); |
217 |
218 |
218 } |
219 } |
219 |
220 |
220 |
221 |
221 EXPORT_C OMX_ERRORTYPE |
222 EXPORT_C OMX_ERRORTYPE |
222 XOmxILCallbackManagerIfImpl::DoErrorEventNotification(OMX_ERRORTYPE aOmxError) |
223 XOmxILCallbackManagerIfImpl::DoErrorEventNotification(OMX_ERRORTYPE aOmxError) |
223 { |
224 { |
224 DEBUG_PRINTF2(_L8("XOmxILCallbackManagerIfImpl::DoErrorEventNotification : aOmxError[%X] "), aOmxError); |
225 DEBUG_PRINTF2(_L8("XOmxILCallbackManagerIfImpl::DoErrorEventNotification : aOmxError[%X] "), aOmxError); |
225 |
226 |
226 return DoEventNotification(OMX_EventError, |
227 return DoEventNotification(OMX_EventError, |
227 aOmxError, |
228 aOmxError, |
228 0, |
229 0, |
229 0); |
230 0); |
230 |
231 |
231 } |
232 } |
232 |
233 |
233 EXPORT_C OMX_ERRORTYPE |
234 EXPORT_C OMX_ERRORTYPE |
234 XOmxILCallbackManagerIfImpl::DoEventNotification(OMX_EVENTTYPE aEvent, |
235 XOmxILCallbackManagerIfImpl::DoEventNotification(OMX_EVENTTYPE aEvent, |
235 TUint32 aData1, |
236 TUint32 aData1, |
236 TUint32 aData2, |
237 TUint32 aData2, |
237 OMX_STRING aExtraInfo) |
238 OMX_STRING aExtraInfo) |
238 { |
239 { |
239 DEBUG_PRINTF4(_L8("XOmxILCallbackManagerIfImpl::DoEventNotification : aEvent[%u] aData1[%u] aData2[%u]"), aEvent, aData1, aData2); |
240 DEBUG_PRINTF5(_L8("XOmxILCallbackManagerIfImpl::DoEventNotification : Handle[%X] aEvent[%u] aData1[%u] aData2[%u]"), ipHandle, aEvent, aData1, aData2); |
240 |
241 |
241 __ASSERT_DEBUG(ipHandle && ipCallbacks, User::Panic(KOmxILCallbackManagerIfImplPanicCategory, 1)); |
242 __ASSERT_DEBUG(ipHandle && ipCallbacks, User::Panic(KOmxILCallbackManagerIfImplPanicCategory, 1)); |
|
243 |
|
244 OMX_TRACE_EVENTHANDLER_IN(ipHandle, ipAppData, aEvent, aData1, aData2, aExtraInfo); |
242 |
245 |
243 ipCallbacks->EventHandler(ipHandle, |
246 ipCallbacks->EventHandler(ipHandle, |
244 ipAppData, |
247 ipAppData, |
245 aEvent, |
248 aEvent, |
246 aData1, |
249 aData1, |
247 aData2, |
250 aData2, |
248 aExtraInfo); |
251 aExtraInfo); |
|
252 OMX_TRACE_EVENTHANDLER_OUT(ipHandle, ipAppData, aEvent, aData1, aData2, aExtraInfo, OMX_ErrorNone); |
249 return OMX_ErrorNone; |
253 return OMX_ErrorNone; |
250 |
254 |
251 } |
255 } |
252 |
256 |
253 |
257 |
254 EXPORT_C OMX_ERRORTYPE |
258 EXPORT_C OMX_ERRORTYPE |
255 XOmxILCallbackManagerIfImpl::DoBufferDoneNotification(OMX_BUFFERHEADERTYPE* apBufferHeader, |
259 XOmxILCallbackManagerIfImpl::DoBufferDoneNotification(OMX_BUFFERHEADERTYPE* apBufferHeader, |
256 OMX_U32 aLocalPortIndex, |
260 OMX_U32 aLocalPortIndex, |
257 OMX_DIRTYPE aLocalPortDirection) |
261 OMX_DIRTYPE aLocalPortDirection) |
258 { |
262 { |
259 DEBUG_PRINTF5(_L8("XOmxILCallbackManagerIfImpl::DoBufferDoneNotification : HANDLE [%X] BUFFER [%X] PORT[%d] DIR[%d]"), ipHandle, apBufferHeader, aLocalPortIndex, aLocalPortDirection); |
263 DEBUG_PRINTF5(_L8("XOmxILCallbackManagerIfImpl::DoBufferDoneNotification : HANDLE [%X] BUFFER [%X] PORT[%d] DIR[%d]"), ipHandle, apBufferHeader, aLocalPortIndex, aLocalPortDirection); |
260 |
264 |
261 __ASSERT_ALWAYS(apBufferHeader && |
265 __ASSERT_ALWAYS(apBufferHeader && |
262 (OMX_DirInput == aLocalPortDirection || |
266 (OMX_DirInput == aLocalPortDirection || |
320 ipCallbacks->FillBufferDone); |
324 ipCallbacks->FillBufferDone); |
321 |
325 |
322 // From OMX_Core.h "Callbacks should not return an error to the |
326 // From OMX_Core.h "Callbacks should not return an error to the |
323 // component, so if an error occurs, the application shall handle it |
327 // component, so if an error occurs, the application shall handle it |
324 // internally". Callback return error ignored here. |
328 // internally". Callback return error ignored here. |
|
329 #ifdef OMX_DEBUG_TRACING_ON |
|
330 if (aLocalPortDirection == OMX_DirInput) |
|
331 { |
|
332 OMX_TRACE_EMPTYBUFFERDONE_IN(ipHandle, ipAppData, apBufferHeader); |
|
333 } |
|
334 else |
|
335 { |
|
336 OMX_TRACE_FILLBUFFERDONE_IN(ipHandle, ipAppData, apBufferHeader); |
|
337 } |
|
338 #endif |
325 fp2CBackHandler(ipHandle, |
339 fp2CBackHandler(ipHandle, |
326 ipAppData, |
340 ipAppData, |
327 apBufferHeader); |
341 apBufferHeader); |
|
342 #ifdef OMX_DEBUG_TRACING_ON |
|
343 if (aLocalPortDirection == OMX_DirInput) |
|
344 { |
|
345 OMX_TRACE_EMPTYBUFFERDONE_OUT(ipHandle, ipAppData, apBufferHeader, 0); |
|
346 } |
|
347 else |
|
348 { |
|
349 OMX_TRACE_FILLBUFFERDONE_OUT(ipHandle, ipAppData, apBufferHeader, 0); |
|
350 } |
|
351 #endif |
|
352 |
328 } |
353 } |
329 |
354 |
330 return OMX_ErrorNone; |
355 return OMX_ErrorNone; |
331 |
356 |
332 } |
357 } |