You cannot alter the preview frames as they are being displayed.
Camera preview uses a private shared interface between the camera and
SurfaceFlinger to display preview frames. It would be too costly to
pass this data across two process boundaries and a Java VM.

You might be able to get away with not passing a surface into the
camera object. I don't think we've ever tested that. If it doesn't
work, let me know and we'll file a bug to get if fixed. In that case,
you would take the preview frame, do your filter operation on it, and
draw it directly to your own view. Expect the preview to be very laggy
though.

If you just want to do an overlay, you can composite a window on top
of the preview frame. This will be much more efficient since the
native code is still doing the heavy lifting. On the G1, it's actually
a hardware display processor that takes care of color conversion,
rotation, and scaling, so it's really cheap.

On Nov 14, 1:01 am, Sean <[EMAIL PROTECTED]> wrote:
> I'm somewhat new to the Android platform. I've been digging around
> lots of sample code, and haven't seen anything that does what I want:
>
> I'd like to create my own code path for getting the camera data from
> the PreviewCallback, and then displaying it on my own SurfaceView,
> since I'd like to do some image processing of my own before display.
>
> Is there a best practice for calling startPreview() without having a
> real SurfaceView to draw on, since I want to draw on my own? Does it
> involve creating a hidden surface? If I don't set the Holder via
> setPreviewDisplay(), I get a crash in ViewRoot.draw(), which makes
> sense if it needs a surface set. What's the most efficient way to set
> a Holder that isn't seen?
>
> Thanks for anyone's input,
> Sean
>
> ps - I posted this to the beginner forum, but received no response, so
> I'm escalating it to the developer forum.
--~--~---------~--~----~------------~-------~--~----~
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]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to