Skip to content

Commit

Permalink
for #19 reduce framerate of preview, should help with battery
Browse files Browse the repository at this point in the history
  • Loading branch information
n8fr8 committed May 22, 2017
1 parent 787a57b commit c5a95ba
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class Preview extends SurfaceView implements SurfaceHolder.Callback {
private PreferenceManager prefs;
private int cameraFacing = 0;

private final static long PREVIEW_INTERVAL = 2000;
private final static int PREVIEW_INTERVAL = 2000;

private List<MotionAsyncTask.MotionListener> listeners = new ArrayList<MotionAsyncTask.MotionListener>();

Expand Down Expand Up @@ -315,7 +315,7 @@ public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
// the preview.
Camera.Parameters parameters = camera.getParameters();
parameters.setPreviewSize(w, h);

parameters.setPreviewFpsRange(PREVIEW_INTERVAL,PREVIEW_INTERVAL*2);
int degree = ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getRotation();
int displayOrientation = 0;
switch (degree) {
Expand Down

0 comments on commit c5a95ba

Please sign in to comment.