Hello, i'm trying to use Tegra hardware to decode h.264 in an android environment.

I dlopened "/system/lib/libnvomx.so" on asus transformer.

I've been struggling with moving from Loaded state into Idle, with no success so far :/

The "OMX_SendCommand(decoder_handle, OMX_CommandStateSet, OMX_StateIdle, 0)" itself returns fine, but very soon later the callback event handler is then called with Error event of type OMX_ErrorInsufficientResources.

(And i never really move into Idle state...)

What are the first things i need to look for ?

I tried using OMX_AllocateBuffer for both input and output files,
I also tried using OMX_UseBuffer instead.

Searching for solutions, i noticed chromium code for their
"OmxVideoDecodeAccelerator"
Where in some part they set fake buffers, just in order to move from Loaded to Idle state.

Here's the comment they have there:
"// Fill the component with fake output buffers. This seems to be required for
// the component to move from Loaded to Idle. How bogus."

I tried that and it didn't work either.

Here's a link to my code:
http://pastebin.com/dAMeGAVR

Hopefully my error will be more obvious to an expert in using OpenMAX IL.

Please help me with this one, starting to go crazy here...