I am trying to acquire camera preview images through
onPreviewFrame(byte[] data, Camera c)  and, within this callback
function, BitmapFactory.decodeByteArray(data, 0, data.length). The
callback works and does get called as shown by my debug output.
However, the Eclipse log file  shows error messages tagged by
CameraHardwareStub stating that only yuv422sp preview is  supported,
e.g., if I apply setPreviewFormat() to set PixelFormat.RGB_565 or
PixelFormat.JPEG. BitmapFactory.decodeByteArray indeed returns null as
expected under this pixel format restriction.

Now I do not find support for something like PixelFormat.YUV_422_SP
for use with  BitmapFactory.decodeByteArray. There is
PixelFormat.YCbCr_422_SP, but with that,
BitmapFactory.decodeByteArray(data, 0, data.length) still returns
null. What's wrong? Is  Android lacking a set of compatible image
formats across the various Camera and Bitmap APIs? That would be bad.

Moreover, data.length in the callback is twice the number of pixels,
implying a 16 bits per  pixel encoding, while yuv422sp would seem to
be an 8 bit encoding?

So what should be done here to decode preview images into a Bitmap for
further image  processing? Or is there an alternative decent way to
map camera preview images into a Bitmap? A working example would help!

Thanks.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to