Camera preview to an invisible SurfaceView

Showing 1-5 of 5 messages
Camera preview to an invisible SurfaceView Boshik 12/19/08 7:35 AM
Hi Guys,

Is it possible to capture camera snapshots to bitmaps WITHOUT creating
a visible surface view? All samples I saw over internet uses camera
preview directly to a surface view and the surface view underneath
must be visible.

I need a way to capture camera images in the background and only then
show captured images somewhere on the screen. Is it possible?


Thanks,
Alex
Re: Camera preview to an invisible SurfaceView Mark K 12/19/08 8:46 AM

   I don't think this is possible. Doesn't seem like Android supports
'headless' graphics implementations.

                      Mark
Re: Camera preview to an invisible SurfaceView blindfold 12/19/08 12:54 PM
> Is it possible to capture camera snapshots to bitmaps WITHOUT creating
> a visible surface view? All samples I saw over internet uses camera
> preview directly to a surface view and the surface view underneath
> must be visible.

Just do not use setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS) and
the preview remains invisible. (The surface view itself may be
visible, but now without the camera preview, so you have full control
over what you display.)

> I need a way to capture camera images in the background and only then
> show captured images somewhere on the screen. Is it possible?

Yes, my app at http://www.seeingwithsound.com/android.htm does exactly
that.

Without the SURFACE_TYPE_PUSH_BUFFERS, the preview callback will still
give you the (header-less) image data[] that you can use to fill a
Bitmap, although you must use your own (very slow, pixel-by-pixel)
preview decoder for that because Android SDK 1.0r2 is still lacking
any support for preview decoding. The bitmap can then be drawn to a
Canvas for display at any size and anywhere on the screen.

Regards
Re: Camera preview to an invisible SurfaceView Boshik 12/20/08 1:37 AM
Thank you very much! Now it works! in the emulator BUT on my G1 it
shows only black screen.
The problem possibly caused by using GLSurfaceView (from the API
Demos) as a preview surface. Is it possible to avoid that?

On Dec 19, 10:54 pm, blindfold <seeingwithso...@gmail.com> wrote:
> > Is it possible to capture camera snapshots to bitmaps WITHOUT creating
> > a visible surface view? All samples I saw over internet uses camera
> > preview directly to a surface view and the surface view underneath
> > must be visible.
>
> Just do not use setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS) and
> the preview remains invisible. (The surface view itself may be
> visible, but now without the camera preview, so you have full control
> over what you display.)
>
> > I need a way to capture camera images in the background and only then
> > show captured images somewhere on the screen. Is it possible?
>
> Yes, my app athttp://www.seeingwithsound.com/android.htmdoes exactly
Re: Camera preview to an invisible SurfaceView blindfold 12/20/08 2:04 AM
> The problem possibly caused by using GLSurfaceView (from the API
> Demos) as a preview surface. Is it possible to avoid that?

Don't know, I use a SurfaceView but no OpenGL, so maybe the hardware
acceleration and buffers on the G1 make the difference when using
OpenGL. I have no experience with that.