From b2119af7f4ced0ecfefd4c7388f86b4e3a3ea7d8 Mon Sep 17 00:00:00 2001 From: Ruben Brunk Date: Fri, 9 May 2014 19:57:56 -0700 Subject: camera2: Update CameraService for HAL1 shim. Updates the camera service to handle shim connections. Changes include: - Adds begin/end configure binder calls. - Adds cache for shim client static camera metadata. - Implements basic getCameraCharacteristic functionality for shim clients. Bug: 15116722 Bug: 15117269 Change-Id: I510c5888ca15f8e7d3b8ed1680ff1c7f8f514744 --- services/camera/libcameraservice/CameraService.h | 39 ++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'services/camera/libcameraservice/CameraService.h') diff --git a/services/camera/libcameraservice/CameraService.h b/services/camera/libcameraservice/CameraService.h index 76ea7be..ee39d52 100644 --- a/services/camera/libcameraservice/CameraService.h +++ b/services/camera/libcameraservice/CameraService.h @@ -18,6 +18,7 @@ #define ANDROID_SERVERS_CAMERA_CAMERASERVICE_H #include +#include #include #include #include @@ -32,6 +33,7 @@ #include #include #include +#include #include @@ -395,6 +397,43 @@ private: bool isValidCameraId(int cameraId); bool setUpVendorTags(); + + /** + * A mapping of camera ids to CameraParameters returned by that camera device. + * + * This cache is used to generate CameraCharacteristic metadata when using + * the HAL1 shim. + */ + KeyedVector mShimParams; + + /** + * Initialize and cache the metadata used by the HAL1 shim for a given cameraId. + * + * Returns OK on success, or a negative error code. + */ + status_t initializeShimMetadata(int cameraId); + + /** + * Generate the CameraCharacteristics metadata required by the Camera2 API + * from the available HAL1 CameraParameters and CameraInfo. + * + * Returns OK on success, or a negative error code. + */ + status_t generateShimMetadata(int cameraId, /*out*/CameraMetadata* cameraInfo); + + /** + * Connect a new camera client. This should only be used while holding the + * mutex for mServiceLock. + * + * Returns OK on success, or a negative error code. + */ + status_t connectHelperLocked(const sp& cameraClient, + int cameraId, + const String16& clientPackageName, + int clientUid, + int callingPid, + /*out*/ + sp& client); }; } // namespace android -- cgit v1.1