1 /* 2 * Copyright (C) 2013 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.testingcamera2; 18 19 /** 20 * A camera control class wraps the control parameters. 21 */ 22 public class CameraControls { 23 private int mSensitivity = 100; 24 private long mExposure = 10000000L; //10ms 25 private long mFrameDuration = 50000000L; // 50ms 26 private boolean mManualControlEnabled = false; 27 28 public CameraControls() { 29 } 30 31 public synchronized void setSensitivity(int sensitivity) { 32 mSensitivity = sensitivity; 33 } 34 35 public synchronized void setExposure(long exposure) { 36 mExposure = exposure; 37 } 38 39 public synchronized void setFrameDuration(long frameDuration) { 40 mFrameDuration = frameDuration; 41 } 42 43 public synchronized void enableManualControl(boolean enable) { 44 mManualControlEnabled = enable; 45 } 46 47 public synchronized boolean isManualControlEnabled() { 48 return mManualControlEnabled; 49 } 50 51 public synchronized int getSensitivity() { 52 return mSensitivity; 53 } 54 55 public synchronized long getExposure() { 56 return mExposure; 57 } 58 59 public synchronized long getFrameDuration() { 60 return mFrameDuration; 61 } 62 } 63