From b10cdadf0fb945e23ca77008d4af76584bd0e39a Mon Sep 17 00:00:00 2001 From: Zhijun He Date: Mon, 16 Jun 2014 16:38:35 -0700 Subject: cameraservice: Implement HAL1 and higher HAL API coexistence A higher hal version device like HAL3.2 can be opened as HAL1.0 device if HAL supports it. This only applies to camera API1. Change-Id: I4ae9f59f4317158cc1bd7ed7726e4032cdd1fa07 --- include/camera/Camera.h | 4 ++++ include/camera/ICameraService.h | 17 +++++++++++++++++ 2 files changed, 21 insertions(+) (limited to 'include/camera') diff --git a/include/camera/Camera.h b/include/camera/Camera.h index 79682b8..2b60842 100644 --- a/include/camera/Camera.h +++ b/include/camera/Camera.h @@ -74,6 +74,10 @@ public: const String16& clientPackageName, int clientUid); + static status_t connectLegacy(int cameraId, int halVersion, + const String16& clientPackageName, + int clientUid, sp& camera); + virtual ~Camera(); status_t reconnect(); diff --git a/include/camera/ICameraService.h b/include/camera/ICameraService.h index d7e5dac..f7f06bb 100644 --- a/include/camera/ICameraService.h +++ b/include/camera/ICameraService.h @@ -52,6 +52,7 @@ public: GET_CAMERA_VENDOR_TAG_DESCRIPTOR, GET_LEGACY_PARAMETERS, SUPPORTS_CAMERA_API, + CONNECT_LEGACY, }; enum { @@ -63,6 +64,10 @@ public: API_VERSION_2 = 2, }; + enum { + CAMERA_HAL_API_VERSION_UNSPECIFIED = -1 + }; + public: DECLARE_META_INTERFACE(CameraService); @@ -125,6 +130,18 @@ public: */ virtual status_t supportsCameraApi( int cameraId, int apiVersion) = 0; + + /** + * Connect the device as a legacy device for a given HAL version. + * For halVersion, use CAMERA_API_DEVICE_VERSION_* for a particular + * version, or CAMERA_HAL_API_VERSION_UNSPECIFIED for a service-selected version. + */ + virtual status_t connectLegacy(const sp& cameraClient, + int cameraId, int halVersion, + const String16& clientPackageName, + int clientUid, + /*out*/ + sp& device) = 0; }; // ---------------------------------------------------------------------------- -- cgit v1.1