In my Android application, I process camera images and send it to a remote application for display. The image format for the camera is set to ImageFormat.YV12.
The application is intended to run on Android tablets as well as Google Glass.
The application produces the correct result from tablets. However, on Glass, the result is a grayscale image with some reds and blues randomly interspersed.
From getSupportedPreviewFormats(), ImageFormat.YV12 is supported on tablets as well as Glass.
I am wondering if YV12 format itself has multiple subformats. Perhaps Glass is creating YV12 image with a different subformat.
A little bit of extra information although it may not be relevant. I encode the camera output as VP8 and the remote application decodes it. VP8 encoding is set for VPX_IMG_FMT_YV12. Regards.
I finally figured out what is happening.
To answer the question, there are no subformats under YV12. YV12 itself is a clearly defined format. More information about it can be found on http://en.wikipedia.org/wiki/YUV.
There is a software bug in Google Glass camera module that results in a bad format.