title: Developing H264 hardware decoder Android - Stagefright or OpenMax IL?
body: <p>I am developing H264 H/W accelerated video decoder for android. So far, I've come around with some libraries <code>MediaCodec</code>, <code>Stagefright</code>, <code>OpenMax IL</code>, <code>OpenMax AL</code> and <code>FFmpeg</code>. After a bit research, I've found that -</p>
  <ol>
  <li><p>I found a <a href="https://vec.io/posts/use-android-hardware-decoder-with-omxcodec-in-ndk" rel="noreferrer">great resource</a> of using stagefright with FFmpeg, but I can not use FFmpeg as for its license, it is quite restrictive for distributed software. (Or possible to discard FFmpeg from this approach?)</p>
  </li>
  <li><p>I can not use MediaCodec as its a Java API and I have to call it via the JNI from C++ layer which is relatively slow and I am not allowed.</p>
  </li>
  <li><p>I can not use OpenMax AL as it only supports the decoding of MPEG-2 transport stream via a buffer queue. This rules out passing raw h264 NALUs or other media formats for that matter.</p>
  </li>
  <li><p>Now only left are - stagefright and OpenMax IL. I came to know that stagefright uses OpenMax(OMX) interface. So should I go with stagefright or OpenMax IL? Which will be more promising?</p>
  </li>
  </ol>
  <p>Also, I came to know that Android H/W accelerated decoder is vendor specific and every vendors has their own OMX interfacing APIs. Is it true? If so, do I need to write H/W vendor specific implementation incase of OpenMax IL? What about stagefright? - Is it hardware agnostic or hardware dependent? If there is no way of H/W indenpent implementation using stagefright or OpenMax IL, I need to support at least Qualcomm's Snapdragon, Samsung's Exynos and Tegra-4.</p>
  <p>Note that, I need to decode H264 Annex B stream and expect decoded data after decode which I will send to my video rendering pipeline. So basically, I only need the decoder module.</p>
  <p>I am really confused a lot. Please help me putting in right direction. Thanks in advance!</p>
  <p>EDIT</p>
  <p>My software is for commercial purpose and the source code is private as well. And I am also restricted to use ffmpeg by client. :)</p>