Packaging and build fixes

Reverting some of the changes from upstream, and cleaning it up to make it build without jni.h.

Also backporting the proper color format support for qcom.