summaryrefslogtreecommitdiffstats
path: root/services/camera/libcameraservice/common
diff options
context:
space:
mode:
authorEino-Ville Talvala <etalvala@google.com>2015-04-16 16:24:55 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-04-16 16:25:01 +0000
commitf2326ac96366ec4d05f470cc4a0b407e7805bab7 (patch)
tree3e2e98a2faa3454b9850d0b8ce902f3c8832f25a /services/camera/libcameraservice/common
parentffb9710d2c6a323519f499e5900b16cd3cd067bd (diff)
parent1527f07eb2b2b40f6b8f53a4644e6a400bddb460 (diff)
downloadframeworks_av-f2326ac96366ec4d05f470cc4a0b407e7805bab7.zip
frameworks_av-f2326ac96366ec4d05f470cc4a0b407e7805bab7.tar.gz
frameworks_av-f2326ac96366ec4d05f470cc4a0b407e7805bab7.tar.bz2
Merge "CameraService: Add support for module init, some logging updates"
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 b861d71..ac4d9a6 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) {
@@ -98,7 +106,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) {
@@ -166,4 +174,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
-