get Best Fps Range - Android android.hardware

Android examples for android.hardware:Camera Feature

Description

get Best Fps Range

Demo Code

import java.util.List;

import android.hardware.Camera;
import android.hardware.Camera.Parameters;

public class Main {

  public static int[] getBestFpsRange(Camera camera) {
    Parameters params = camera.getParameters();
    int min = Integer.MAX_VALUE;
    int max = 0;//from  w w w .j  ava  2  s  .  com

    List<int[]> ranges = params.getSupportedPreviewFpsRange();
    for (int[] range : ranges) {
      if (min >= range[0] && range[1] >= max) {
        min = range[0];
        max = range[1];
      }
    }
    return new int[] { min, max };
  }

}

Related Tutorials