summaryrefslogtreecommitdiffstats
path: root/services/camera/libcameraservice/common
diff options
context:
space:
mode:
authorEino-Ville Talvala <etalvala@google.com>2015-04-07 15:55:31 -0700
committerEino-Ville Talvala <etalvala@google.com>2015-04-15 15:29:41 -0700
commit1527f07eb2b2b40f6b8f53a4644e6a400bddb460 (patch)
tree7b9bf4c2bdbb76d4d81942fab8b345f6430c3f38 /services/camera/libcameraservice/common
parentc44111b22c26236cb0b32d3fbd1cc9fad3fb28ff (diff)
downloadframeworks_av-1527f07eb2b2b40f6b8f53a4644e6a400bddb460.zip
frameworks_av-1527f07eb2b2b40f6b8f53a4644e6a400bddb460.tar.gz
frameworks_av-1527f07eb2b2b40f6b8f53a4644e6a400bddb460.tar.bz2
CameraService: Add support for module init, some logging updates
- Add support for camera HAL module init() method on v2.4 - Add logging for service errors such as failure to init - Minor cleanup to dumping of event log Bug: 20016050 Change-Id: I94e18b52c186f16fb096457015f7ae761e867fd8
Diffstat (limited to 'services/camera/libcameraservice/common')
-rw-r--r--services/camera/libcameraservice/common/CameraModule.cpp11
-rw-r--r--services/camera/libcameraservice/common/CameraModule.h5
2 files changed, 13 insertions, 3 deletions
diff --git a/services/camera/libcameraservice/common/CameraModule.cpp b/services/camera/libcameraservice/common/CameraModule.cpp
index e5b12ae..5e0ac9f 100644
--- a/services/camera/libcameraservice/common/CameraModule.cpp
+++ b/services/camera/libcameraservice/common/CameraModule.cpp
@@ -57,6 +57,14 @@ CameraModule::CameraModule(camera_module_t *module) {
mCameraInfoMap.setCapacity(getNumberOfCameras());
}
+int CameraModule::init() {
+ if (getModuleApiVersion() >= CAMERA_MODULE_API_VERSION_2_4 &&
+ mModule->init != NULL) {
+ return mModule->init();
+ }
+ return OK;
+}
+
int CameraModule::getCameraInfo(int cameraId, struct camera_info *info) {
Mutex::Autolock lock(mCameraInfoLock);
if (cameraId < 0) {
@@ -92,7 +100,7 @@ int CameraModule::getCameraInfo(int cameraId, struct camera_info *info) {
assert(index != NAME_NOT_FOUND);
// return the cached camera info
*info = mCameraInfoMap[index];
- return 0;
+ return OK;
}
int CameraModule::open(const char* id, struct hw_device_t** device) {
@@ -160,4 +168,3 @@ void* CameraModule::getDso() {
}
}; // namespace android
-
diff --git a/services/camera/libcameraservice/common/CameraModule.h b/services/camera/libcameraservice/common/CameraModule.h
index e285b21..c21092e 100644
--- a/services/camera/libcameraservice/common/CameraModule.h
+++ b/services/camera/libcameraservice/common/CameraModule.h
@@ -34,6 +34,10 @@ class CameraModule {
public:
CameraModule(camera_module_t *module);
+ // Must be called after construction
+ // Returns OK on success, NO_INIT on failure
+ int init();
+
int getCameraInfo(int cameraId, struct camera_info *info);
int getNumberOfCameras(void);
int open(const char* id, struct hw_device_t** device);
@@ -63,4 +67,3 @@ private:
} // namespace android
#endif
-