I know the topic has already appeared multiple times but none of the solutions actually seems to be working, ranging from answers suitable for the old camera API (where the YUV data comes in a neat byte[] array), via corrupted images, to saving JPEG's all in "green scale" using RenderScript (which by the way is the best I am currently able to do).
The way the Camera2Basic example does it is that it simply sets the Type.Builder's format to JPEG. The problem with this (as discussed in multiple posts as well) is that it slows down the camera pipeline. YUV_420_888 works much much faster.
So, did anyone manage to perform a proper YUV_420_888 -> JPEG conversion?