CameraProvider.java revision 18500a493634b593dc8ba1e74b46d1f10bb6d031
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 17package com.android.camera.app; 18 19import android.hardware.Camera; 20 21/** 22 * An interface which defines the camera provider. 23 */ 24public interface CameraProvider { 25 26 /** 27 * Requests the camera device. If the camera device of the same ID is 28 * already requested, then no-op here. 29 * 30 * @param id The ID of the requested camera device. 31 */ 32 public void requestCamera(int id); 33 34 /** 35 * Releases the camera device. 36 * 37 * @param id The camera ID. 38 */ 39 public void releaseCamera(int id); 40 41 /** 42 * Get the {@link android.hardware.Camera.CameraInfo} of all the cameras. 43 * 44 * @return An array of the {@link android.hardware.Camera.CameraInfo}. 45 */ 46 public Camera.CameraInfo[] getCameraInfo(); 47 48 /** 49 * Returns the total number of cameras available on the device. 50 */ 51 public int getNumberOfCameras(); 52 53 /** 54 * @returns The lowest ID of the back camera or -1 if not available. 55 */ 56 public int getFirstBackCameraId(); 57 58 /** 59 * @return The lowest ID of the front camera or -1 if not available. 60 */ 61 public int getFirstFrontCameraId(); 62} 63