Methods Summary |
---|
private static int[] | getImageEncodingQualityLevels(int cameraId)
System.loadLibrary("media_jni");
native_init();
int nLevels = native_get_num_image_encoding_quality_levels(cameraId);
if (nLevels != QUALITY_HIGH + 1) {
throw new RuntimeException("Unexpected Jpeg encoding quality levels " + nLevels);
}
int[] levels = new int[nLevels];
for (int i = 0; i < nLevels; ++i) {
levels[i] = native_get_image_encoding_quality_level(cameraId, i);
}
Arrays.sort(levels); // Lower quality level ALWAYS comes before higher one
return levels;
|
public static int | getJpegEncodingQualityParameter(int quality)Returns a pre-defined still image capture (jpeg) quality level
used for the given quality level in the Camera application for
the first back-facing camera on the device. If the device has no
back-facing camera, this returns 0.
int numberOfCameras = Camera.getNumberOfCameras();
CameraInfo cameraInfo = new CameraInfo();
for (int i = 0; i < numberOfCameras; i++) {
Camera.getCameraInfo(i, cameraInfo);
if (cameraInfo.facing == CameraInfo.CAMERA_FACING_BACK) {
return getJpegEncodingQualityParameter(i, quality);
}
}
return 0;
|
public static int | getJpegEncodingQualityParameter(int cameraId, int quality)Returns a pre-defined still image capture (jpeg) quality level
used for the given quality level in the Camera application for
the specified camera.
if (quality < QUALITY_LOW || quality > QUALITY_HIGH) {
throw new IllegalArgumentException("Unsupported quality level: " + quality);
}
synchronized (sCache) {
int[] levels = sCache.get(cameraId);
if (levels == null) {
levels = getImageEncodingQualityLevels(cameraId);
sCache.put(cameraId, levels);
}
return levels[quality];
}
|
private static final native int | native_get_image_encoding_quality_level(int cameraId, int index)
|
private static final native int | native_get_num_image_encoding_quality_levels(int cameraId)
|
private static final native void | native_init()
|