The distinction between direct and indirect object can be made on the basis of semantic and positional information:
Direct object
Jesse James killed dozens of innocent people.
Our hosts gave us a warm welcome.
Indirect object
Our hosts gave us a warm welcome.