diff options
author | Angus Kong <shkong@google.com> | 2013-07-31 22:21:21 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-07-31 22:21:21 +0000 |
commit | bb2848ab2a8d532956f4730c8cf7434eb3a8600f (patch) | |
tree | 3d74e88d171fce3d69ed11bced3414f8c43bcf1c /src/com/android/camera/CameraManager.java | |
parent | 5c9925a5ad7298c3e3a49bfa8fa09f7691b18c4a (diff) | |
parent | 9e76552adff6ecf8b8e4070ecd61699cb6d18269 (diff) | |
download | android_packages_apps_Snap-bb2848ab2a8d532956f4730c8cf7434eb3a8600f.tar.gz android_packages_apps_Snap-bb2848ab2a8d532956f4730c8cf7434eb3a8600f.tar.bz2 android_packages_apps_Snap-bb2848ab2a8d532956f4730c8cf7434eb3a8600f.zip |
Merge "Add wrapper for face detection listener." into gb-ub-photos-carlsbad
Diffstat (limited to 'src/com/android/camera/CameraManager.java')
-rw-r--r-- | src/com/android/camera/CameraManager.java | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/com/android/camera/CameraManager.java b/src/com/android/camera/CameraManager.java index e4a066701..90a838ca6 100644 --- a/src/com/android/camera/CameraManager.java +++ b/src/com/android/camera/CameraManager.java @@ -18,8 +18,8 @@ package com.android.camera; import android.annotation.TargetApi; import android.graphics.SurfaceTexture; +import android.hardware.Camera; import android.hardware.Camera.ErrorCallback; -import android.hardware.Camera.FaceDetectionListener; import android.hardware.Camera.OnZoomChangeListener; import android.hardware.Camera.Parameters; import android.os.Handler; @@ -30,7 +30,7 @@ import com.android.gallery3d.common.ApiHelper; import java.io.IOException; /** - * An interface which provides possible camera device operations. + * An interface which provides possible camera device operations. * * The client should call {@code CameraManager.cameraOpen} to get an instance * of {@link CameraManager.CameraProxy} to control the camera. Classes @@ -41,7 +41,6 @@ import java.io.IOException; * * TODO: provide callback interfaces for: * {@code android.hardware.Camera.ErrorCallback}, - * {@code android.hardware.Camera.FaceDetectionListener}, * {@code android.hardware.Camera.OnZoomChangeListener}, and * {@code android.hardware.Camera.Parameters}. */ @@ -88,6 +87,20 @@ public interface CameraManager { } /** + * An interface which wraps + * {@link android.hardware.Camera.FaceDetectionListener}. + */ + public interface CameraFaceDetectionCallback { + /** + * Callback for face detection. + * + * @param faces Recognized face in the preview. + * @param camera The camera which the preview image comes from. + */ + public void onFaceDetection(Camera.Face[] faces, CameraProxy camera); + } + + /** * Opens the camera of the specified ID synchronously. * * @param cameraId The camera ID to open. @@ -248,10 +261,11 @@ public interface CameraManager { /** * Sets the face detection listener. * - * @param listener The listener for face detection results. + * @param handler The handler in which the callback will be invoked. + * @param callback The callback for face detection results. */ @TargetApi(ApiHelper.VERSION_CODES.ICE_CREAM_SANDWICH) - public void setFaceDetectionListener(FaceDetectionListener listener); + public void setFaceDetectionCallback(Handler handler, CameraFaceDetectionCallback callback); /** * Starts the face detection. |