diff options
author | Zhijun He <zhijunhe@google.com> | 2014-06-16 16:38:35 -0700 |
---|---|---|
committer | Zhijun He <zhijunhe@google.com> | 2014-06-19 15:41:09 -0700 |
commit | b10cdadf0fb945e23ca77008d4af76584bd0e39a (patch) | |
tree | d1fd0cc1c42aec025e8f6fc52f890b96e7203653 /include/camera | |
parent | ab5cdbaf65ca509681d2726aacdf3ac8bfb6b3fa (diff) | |
download | frameworks_av-b10cdadf0fb945e23ca77008d4af76584bd0e39a.zip frameworks_av-b10cdadf0fb945e23ca77008d4af76584bd0e39a.tar.gz frameworks_av-b10cdadf0fb945e23ca77008d4af76584bd0e39a.tar.bz2 |
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
Diffstat (limited to 'include/camera')
-rw-r--r-- | include/camera/Camera.h | 4 | ||||
-rw-r--r-- | include/camera/ICameraService.h | 17 |
2 files changed, 21 insertions, 0 deletions
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>& 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<ICameraClient>& cameraClient, + int cameraId, int halVersion, + const String16& clientPackageName, + int clientUid, + /*out*/ + sp<ICamera>& device) = 0; }; // ---------------------------------------------------------------------------- |