Thanks Megha. So the byte[] data provided by onPreviewFrame() is
effectively useless, because there is no efficient means of converting
into a format that the rest of Android understands. Strange API
design...

I have now successfully used onPictureTaken() instead of
onPreviewFrame(), because that one does have proper image format
support, but this is likely going to run much less efficiently on real
phones because it is meant for (slow) megapixel snapshots, and I need
to take a (small) snapshot every second. Please reconsider the image
formats used in onPreviewFrame() in relation to the image formats that
Android supports, because it is quite weird to offer data in a format
that cannot be used, and for which the format is not even documented
(so every phone manufacturer can pick an arbitrary format that we
developers then need to reverse engineer).

> To draw the preview frames, you can call Camera.startPreview() and the system 
> takes care of the drawing.

I'm after computer vision applications, so mere drawing is not enough.
BTW, as I reported before, the camera preview is stuck at the top left
of the screen because there is no method for specifying its location.
I wished the API designers had a look at J2ME first.

Thanks.

On Aug 23, 12:10 am, "Megha Joshi" <[EMAIL PROTECTED]> wrote:
> There is no way to convert the preview frames that come as YUV data from
> Camera.SetPrivewCallBack() into a bitmap.To draw the preview frames, you can
> call Camera.startPreview() and the system takes care of the drawing.
> CameraPreview sample code in ApiDemos is updated to use startPreview() now.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
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