Question on codec identification software vs hardware

I want to write an application that can perform video encode and work across different processors. How can I identify if a given OMX component is hardware accelerated or on software without searching company specific name strings in component name.
I want to use a hardware codec in preference against a software one or a better performing codec. Is there some priority ordering and if so, how can I fetch it.