PDA

View Full Version : Problems moving from Loaded state to Idle



ZeDuS
10-05-2011, 06:35 AM
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... ;)

him7403
10-13-2011, 12:51 AM
I have the same problem.
Its because of OpenMax IL needs system privilege.
But the android app doesn't have it :(

So the error is shown OMX_ErrorInsufficientResources.

I Can go to loaded state to Idle in Android Shell (as su in console)
but with app it doesn't..

Looking for a solution for it.. How to get system privilege for android app? or any other workaround?

ZeDuS
11-08-2011, 11:51 PM
Thanks for the reply!

System privileges is quite tricky to get (for a non custom android build...)
:/

Strangely it does work for me on android 2.x on Motorola ATRIX 4G,
so i assume it's a change that started in 3.x for tablets.