Using OpenMAX (IL?) for audio/video decoding on Android

Christopher Corsi picture Christopher Corsi · Aug 9, 2011 · Viewed 12.6k times · Source

Many of the newer hardware platforms running Android, in particular NVIDIA's Tegra 2, support OpenMAX for media acceleration. It's effectively impossible on today's devices to decode 720p video without this support, but the number of demuxers supported on Android are quite slim. The only public API I've been able to find has been through the MediaPlayer class in the Android SDK. There are multiple places in the Android source tree with OpenMAX related tidbits, however.

On my device (Samsung Galaxy Tab 10.1) I've got access to hardware decoders through a multitude of OpenMAX libs in /system/lib, and it would be great to interface my video application with these. Can anyone point me to information on implementing a decoder powered by OpenMAX? I've found the documentation from Khronos, but nothing in the way of example code or tutorials. I've already got demuxing and even software decoding taken care of (via libavcodec/libavformat), I'd just like to put hooks in to enable hardware encoding. I'm also assuming here it would be necessary to link directly to the ones available on the device, which makes it pretty lackluster in terms of portability, but it works.

Alternatively, I'm interested in anything anyone knows about private APIs for accessing the video decoding available on Tegra 2 devices. Especially if there's a vdpau interface like what NVIDIA implements for desktop linux distributions, since there's plenty available for that - but I wasn't able to find shared libraries that indicate that support.

Answer

Christopher Corsi picture Christopher Corsi · Aug 10, 2011

https://www.uplinq.com/2011/sites/default/files/images/Snapdragon-Lab-Accessing-Hardware-Accelerated-Video-Codecs-Android-Steve-Lukas.pdf

I found documentation on using OpenMAX to get access to the hardware decoders on the newer Qualcomm processors - it's messy, requires using the android source tree in conjunction with the NDK, but it's the best that's out there so far that I can see.

The sample code it references was found on their developer website - just search the title of the document and it comes up.