diff options
author | Igor Murashkin <iam@google.com> | 2013-03-20 15:56:31 -0700 |
---|---|---|
committer | Igor Murashkin <iam@google.com> | 2013-03-26 17:16:11 -0700 |
commit | cba2c163555cd329f49d40658ea3ee902e94dda3 (patch) | |
tree | 1d125f0012a52db51a1aec733792c1b41959734c /services/camera/libcameraservice/CameraService.h | |
parent | a97d15e2e2f0b317a345d3a6f02df80b8988b1f6 (diff) | |
download | frameworks_av-cba2c163555cd329f49d40658ea3ee902e94dda3.zip frameworks_av-cba2c163555cd329f49d40658ea3ee902e94dda3.tar.gz frameworks_av-cba2c163555cd329f49d40658ea3ee902e94dda3.tar.bz2 |
Camera: Add hotplug support (for fixed # of cameras)
* Minor: also change addListener to fire the current status upon subscription
* Minor: STATUS_AVAILABLE is now an alias for STATUS_PRESENT and deprecated
Change-Id: I254608a7332095e3ef201ffea64cff156cfc1b3e
Diffstat (limited to 'services/camera/libcameraservice/CameraService.h')
-rw-r--r-- | services/camera/libcameraservice/CameraService.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/services/camera/libcameraservice/CameraService.h b/services/camera/libcameraservice/CameraService.h index c5e495f..8cb1691 100644 --- a/services/camera/libcameraservice/CameraService.h +++ b/services/camera/libcameraservice/CameraService.h @@ -45,7 +45,8 @@ class MediaPlayer; class CameraService : public BinderService<CameraService>, public BnCameraService, - public IBinder::DeathRecipient + public IBinder::DeathRecipient, + public camera_module_callbacks_t { friend class BinderService<CameraService>; public: @@ -59,6 +60,11 @@ public: virtual ~CameraService(); ///////////////////////////////////////////////////////////////////// + // HAL Callbacks + virtual void onDeviceStatusChanged(int cameraId, + int newStatus); + + ///////////////////////////////////////////////////////////////////// // ICameraService virtual int32_t getNumberOfCameras(); virtual status_t getCameraInfo(int cameraId, @@ -327,10 +333,14 @@ private: mListenerList; // guard only mStatusList and the broadcasting of ICameraServiceListener - Mutex mStatusMutex; + mutable Mutex mStatusMutex; ICameraServiceListener::Status mStatusList[MAX_CAMERAS]; + // Read the current status (locks mStatusMutex) + ICameraServiceListener::Status + getStatus(int cameraId) const; + // Broadcast the new status if it changed (locks the service mutex) void updateStatus( ICameraServiceListener::Status status, |