On Monday, May 28, 2012 1:48:35 PM UTC+3, Mark Murphy (a Commons Guy) wrote:
>
> On Mon, May 28, 2012 at 2:39 AM, Alex Cohn wrote: 
> > but also exposes a problem with the 
> > Camera API of Android: there is no way for Camera.setParameters() to 
> fail or 
> > report anything about parameters inconsistency. 
>
> This is due to backwards compatibility, because 
> getSupportedPreviewSizes() is relatively new, so developers were 
> welcome to pass in whatever values they want. 
>
> -- 
> Mark Murphy (a Commons Guy) 
> http://commonsware.com | http://github.com/commonsguy 
> http://commonsware.com/blog | http://twitter.com/commonsguy 
>
> Android Training...At Your Office: http://commonsware.com/training 
>

I cannot agree with you, Mark.

This walks and quacks like a bug specific to Galaxy Nexus. See 
https://code.google.com/p/android/issues/detail?id=24563 for a related 
problem. 

In the nutshell, camera may throw a runtime exception if set previewSize is 
not correct. But in this device, the list of "supported" sizes is simply 
incorrect, and in some cases setParameters() results in an exception, but 
sometimes it pretends to accept the new value. Unfortunately, there is no 
direct way to find that this was "just for show".

When used with setPreviewCallback(), you can see that the size of preview 
buffer does not match expected width*height*3/2.
When used with setPreviewCallbackWithBuffer(), you get buffer == null.

BR,
Alex Cohn

-- 
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