Yep, and the setPictureSize(480,320) works fine on the G1 when taking
of this asynchronous processing.

On Nov 17, 11:48 pm, Alvin Yates <[EMAIL PROTECTED]> wrote:
> Okay, so I figured out what the problem with a series of back-and-
> forth emails with blindfold.
>
> Basically, the camera API is asynchronous to the point where my
> setting the parameters on onSurfaceChanged() is not actually
> occurring  as it should be.  In short, you need to have something that
> will definitely complete, and a method that calls startPreview()
> doesn't guarantee that at all.  So in a series of emails, the idea
> came up to monitor the preview frames, set up through locking a thread
> on a boolean.  I had a few issues with synchronization and the phone
> locking up (Although I think I broke the Camera hardware itself when I
> was doing so), but got around it by making a Camera.Shutter callback,
> which takes care of the "method needs to complete" problem on top of
> being fairly easily to do (by doing the following):
>
> ====
>         private Camera.ShutterCallback sillyDelay = new Camera.ShutterCallback
> () {
>
>                 public void onShutter() {
>                         Camera.Parameters p = mCamera.getParameters();
>
>                         p.setPictureSize(CAM_W, CAM_H);
>                         p.setPictureFormat(PixelFormat.JPEG);
>
>                         mCamera.setParameters(p);
>                 }
>         };
> ====
>
>         @Override
>         public boolean onKeyDown(int keycode, KeyEvent event){
>                 if (keycode == KeyEvent.KEYCODE_CAMERA ||
>                         keycode == KeyEvent.KEYCODE_DPAD_CENTER) {
>                         mCamera.takePicture(sillyDelay, null, writeMe);
>                 }
>
>                 super.onKeyDown(keycode, event);
>                 return true;
>         }
> ====
>

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

Reply via email to