static OMX_ERRORTYPE demuxer_cfgport_GetConfig (const void * ap_obj, OMX_HANDLETYPE ap_hdl, OMX_INDEXTYPE a_index, OMX_PTR ap_struct) { tiz_demuxercfgport_t * p_obj = (tiz_demuxercfgport_t *) ap_obj; OMX_ERRORTYPE rc = OMX_ErrorNone; TIZ_TRACE (ap_hdl, "GetConfig [%s]...", tiz_idx_to_str (a_index)); assert (p_obj); switch (a_index) { case OMX_IndexConfigTimePosition: case OMX_IndexConfigTimeSeekMode: { /* Only the processor knows about current position or seek mode. So lets get the processor to fill this info for us. */ void * p_prc = tiz_get_prc (ap_hdl); assert (p_prc); if (OMX_ErrorNone != (rc = tiz_api_GetConfig (p_prc, ap_hdl, a_index, ap_struct))) { TIZ_ERROR (ap_hdl, "[%s] : Error retrieving [%s] " "from the processor", tiz_err_to_str (rc), tiz_idx_to_str (a_index)); } } break; default: { /* Delegate to the base port */ rc = super_GetConfig (typeOf (ap_obj, "tizdemuxercfgport"), ap_obj, ap_hdl, a_index, ap_struct); } }; return rc; }
static OMX_ERRORTYPE waitforresources_state_set (const void *ap_obj, OMX_HANDLETYPE ap_hdl, OMX_COMMANDTYPE a_cmd, OMX_U32 a_param1, OMX_PTR ap_cmd_data) { const tiz_waitforresources_t *p_obj = ap_obj; tiz_fsm_state_id_t new_state = EStateMax; OMX_ERRORTYPE omx_error = OMX_ErrorNone; assert (p_obj); assert (a_cmd == OMX_CommandStateSet); TIZ_TRACE (ap_hdl, "Requested transition to state [%s]...", tiz_fsm_state_to_str (a_param1)); /* Only allowed transitions is OMX_StateLoaded. */ switch (a_param1) { case OMX_StateLoaded: { new_state = (tiz_fsm_state_id_t)OMX_StateLoaded; break; } case OMX_StateWaitForResources: { return OMX_ErrorSameState; } default: { TIZ_ERROR (ap_hdl, "[OMX_ErrorIncorrectStateTransition] : ..."); return OMX_ErrorIncorrectStateTransition; } }; /* TODO: make state transition effective here? */ (void) new_state; /* if (OMX_ErrorNone != */ /* (omx_error = tiz_fsm_set_state */ /* (tiz_get_fsm (ap_hdl), new_state))) */ /* { */ /* return omx_error; */ /* } */ { void *p_prc = tiz_get_prc (ap_hdl); void *p_krn = tiz_get_krn (ap_hdl); /* First notify the kernel servant */ if (OMX_ErrorNone != (omx_error = tiz_api_SendCommand (p_krn, ap_hdl, a_cmd, a_param1, ap_cmd_data))) { return omx_error; } /* Now notify the processor servant */ if (OMX_ErrorNone != (omx_error = tiz_api_SendCommand (p_prc, ap_hdl, a_cmd, a_param1, ap_cmd_data))) { return omx_error; } } return omx_error; }