If I understand correctly, you're doing something very similar to what I'm
doing in my Moseycode application. In my case I render the camera YUV data
via a GLSurfaceView.
I can't say whether this will work for certain on all/any 1.6 devices, but
my approach since 1.5 has been to make the PUSH_BUFFERS surface very small
and to position it off-screen (a nasty hack that works in the emulator at
least). I think the smallest supported dimensions that preserve the aspect
ratio are 20px x 15px.

That said, I'm just waiting for this circuitous implementation to blow-up on
me. Why the camera demands a surface in order to provide preview data is a
mystery to me (as is so much of the Camera API's operation).

Tom

2009/10/1 Anders Johansson <svi...@gmail.com>

>
> Hi all,
>
> My company has so far developed four different camera-based
> applications that all work by manipulating the viewfinder feed from
> the camera. The Android camera API expects a Surface to draw the
> viewfinder feed to, however in our apps we rely on sidestepping the
> direct drawing and grabbing the YUV_420_SP data for manipulation and
> rendering to a Surface.
>
> On 1.5, we achieved this by changing the Surface type from
> PUSH_BUFFERS to NORMAL, which would in one stroke disable the direct
> feed to the surface from the camera as well as giving us a Surface
> onto which we could render the manipulated feed.
>
> The problem arises when upgrading to 1.6, as it appears that this
> "hole" has been plugged. The Camera class now refuses to start the
> preview feed if its associated preview display surface is of the wrong
> type (such as NORMAL). I realize that this is probably correct as per
> design, unfortunately it also makes our type of app very difficult to
> implement...
>
> I have tried to work around it by creating a dummy surface view to set
> as preview display, and although I have managed to hide it, I haven't
> been able to stop the direct feed, which of course means that
> performance slows to a crawl as both the direct feed and manipulated
> feed are active and drawing at the same time.
>
> I would be most grateful for any suggestions on how to resolve this
> issue...
>
> best regards
> Anders Johansson
>
> >
>


-- 
Tom Gibara
email: m...@tomgibara.com
web: http://www.tomgibara.com
blog: http://blog.tomgibara.com
twitter: tomgibara

--~--~---------~--~----~------------~-------~--~----~
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to