Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 178
Registered: ‎11-19-2008
My Device: Not Specified
Accepted Solution

JSR-234 (AMMS): supported resolution actually unsupported

I've been playing around a bit with AMMS and CameraControl. There are two methods for retrieving and setting the camera resolution:

CameraControl.getSupportedStillResolutions();
CameraControl.setStillResolutions(int index);

 

 

Well, these are the results on a 6.0 9780 simulator:

 

>>> LIST OF SUPPORTED EXPOSURE MODES
     auto
>>> LIST OF SUPPORTED RESOLUTIONS
     2048 x 1536
     1024 x 768
     480 x 360

 

 

Tried setting the lower (480 x 360), and it throws an IllegalArgumentException. JavaDoc says it is thrown when the resolution is not supported. Then, why it is returned as supported?

 

NOTE: I remember something similar happened me with this pair of methods:

 

System.getProperty("video.snapshot.encodings");
VideoControl.getSnapshot(String encoding);

 

In that sense, the AMMS is as good as the old plain MMAPI.

 

Highlighted
Developer
Posts: 178
Registered: ‎11-19-2008
My Device: Not Specified

Re: JSR-234 (AMMS): supported resolution actually unsupported

Sorry, it was my fault.

The setStillResolution int parameter is not an index related to the supported resolutions array, but the number of the pair of resolution. Read the javadoc for more info.

 

I thougth these methods were not reliable, based on past experiences with this old method:

System.getProperty("video.snapshot.encodings")

which usually produces invalid resolutions.

 

I'm closing this as solved.