It's libaalcamera.so (https://launchpad.net/ubuntu/+source/qtubuntu-
camera) that sets illegal values:

  android_camera_set_preview_size(-1, -1)
  android_camera_set_preview_fps(0)

However, it's camera.goldfish.so that returns wrong preview fps range
values. According to Android doc[1], the returned values should be
scaled by 1000 but were not.

As for preview-size, it looks like a bug in
AalViewfinderSettingsControl::chooseOptimalSize because it may still
return invalid QSize even when there are non-optimal candidates
available. Besides, the magic number in line 213 looks dangerous because
sizes[1] may be illegal.

208 QSize AalViewfinderSettingsControl::chooseOptimalSize(const QList<QSize> 
&sizes) const
209 {
210     if (!sizes.empty()) {
211         if (m_aspectRatio == 0) {
212             // There are resolutions supported, choose one non-optimal one):
213             return sizes[1];
214         }
215
216         QList<QSize>::const_iterator it = sizes.begin();
217         while (it != sizes.end()) {
218             const float ratio = (float)(*it).width() / 
(float)(*it).height();
219             const float EPSILON = 10e-3;
220             if (fabs(ratio - m_aspectRatio) < EPSILON) {
221                 return *it;
222             }
223             ++it;
224         }
225     }
226
227     return QSize();
228 }

[1]:
http://developer.android.com/reference/android/hardware/Camera.Parameters.html#getPreviewFpsRange%28int[]%29

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1273890

Title:
  emulator camera does not take picture

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/android/+bug/1273890/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to