diff options
author | Anu Sundararajan <sanuradha@ti.com> | 2012-03-20 13:09:20 -0500 |
---|---|---|
committer | Daniel Levin <dendy@ti.com> | 2012-07-25 08:55:47 -0500 |
commit | 8ec2813f803f7a0b9260872cfa27ac2395478814 (patch) | |
tree | 840cc3c8d6cb7a799e22cf6cdb5a1b5b17ea6694 /camera/CameraHal_Module.cpp | |
parent | de6f9a2636a291726d3620048dfaa4786e218f56 (diff) | |
download | hardware_ti_omap4-8ec2813f803f7a0b9260872cfa27ac2395478814.zip hardware_ti_omap4-8ec2813f803f7a0b9260872cfa27ac2395478814.tar.gz hardware_ti_omap4-8ec2813f803f7a0b9260872cfa27ac2395478814.tar.bz2 |
CameraHal: Fixed minor bugs that were exposed while testing multiple instances of camera
CameraHal_Module: When there is an error, camera_get_camera_info should return a
negative value. If it returns NULL, the caller would interpret it as 0 which implies OK.
CameraProperties:
- The flag mInitialized must be set to true only if the properties were loaded successfully.
Previously, the flag was being set without checking the return value from loadProperties.
- Since loadProperties could be called more than once, it is important to initialize mCamerasSupported here.
- Added additional error handling. If for some reason, CameraAdapter_Capabilities returns
that 0 cameras are available, then it must be flagged as an error. This is possible when
one tries to query the properties while a camera is in use.
Change-Id: I15e9935735f8d2c548fb2f378a310650771c54e2
Signed-off-by: Anu Sundararajan <sanuradha@ti.com>
Diffstat (limited to 'camera/CameraHal_Module.cpp')
-rw-r--r-- | camera/CameraHal_Module.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/camera/CameraHal_Module.cpp b/camera/CameraHal_Module.cpp index 69a47f3..b107bc7 100644 --- a/camera/CameraHal_Module.cpp +++ b/camera/CameraHal_Module.cpp @@ -644,7 +644,8 @@ int camera_get_camera_info(int camera_id, struct camera_info *info) if(gCameraProperties.initialize() != android::NO_ERROR) { CAMHAL_LOGEA("Unable to create or initialize CameraProperties"); - return NULL; + rv = -EINVAL; + goto end; } //Get camera properties for camera index |