summaryrefslogtreecommitdiffstats
path: root/camera/CameraHal_Module.cpp
diff options
context:
space:
mode:
authorDaniel Levin <dendy@ti.com>2012-05-29 15:33:53 +0300
committerDaniel Levin <dendy@ti.com>2012-07-25 08:56:45 -0500
commit21d4114f53d8d6c85db477437e51151591599f45 (patch)
tree8f69f8954f2d5215d727dfe56a63013f6c67e870 /camera/CameraHal_Module.cpp
parent0db69e2a940fea8c70c8259d74358c6dfd6ff1bf (diff)
downloadhardware_ti_omap4-21d4114f53d8d6c85db477437e51151591599f45.zip
hardware_ti_omap4-21d4114f53d8d6c85db477437e51151591599f45.tar.gz
hardware_ti_omap4-21d4114f53d8d6c85db477437e51151591599f45.tar.bz2
CameraHAL: Moved Camera HAL sources out of namespace android
C++ namespace android:: is reserved for base Google Android types to avoid current and further conflicts with 3rd party code. Having TI Camera HAL under namespace android:: violates this rule, adding potential conflicts. This patch moves libtiutils and Camera HAL code out of namespace android:: to custom local namespaces. Putting camera code under namespace android and 'using namespace android' is not allowed anymore. All C++ Android types should have android:: namespace prefix explicitly. Next namespaces added: - Ti:: - placeholder for all custom code - Ti::Utils:: - common utility helper library - Ti::Camera:: - Camera HAL code Also added Ti::status_t as typedef for android::status_t. Change-Id: Ie8cc00d6d6bd4e8a8ddf089421010c370ee40ebe Signed-off-by: Daniel Levin <dendy@ti.com>
Diffstat (limited to 'camera/CameraHal_Module.cpp')
-rw-r--r--camera/CameraHal_Module.cpp51
1 files changed, 33 insertions, 18 deletions
diff --git a/camera/CameraHal_Module.cpp b/camera/CameraHal_Module.cpp
index eb4a475..2d2e10b 100644
--- a/camera/CameraHal_Module.cpp
+++ b/camera/CameraHal_Module.cpp
@@ -35,8 +35,11 @@
#endif
-static android::CameraProperties gCameraProperties;
-static android::CameraHal* gCameraHals[MAX_CAMERAS_SUPPORTED];
+namespace Ti {
+namespace Camera {
+
+static CameraProperties gCameraProperties;
+static CameraHal* gCameraHals[MAX_CAMERAS_SUPPORTED];
static unsigned int gCamerasOpen = 0;
static android::Mutex gCameraHalDeviceLock;
@@ -50,6 +53,10 @@ static struct hw_module_methods_t camera_module_methods = {
open: camera_device_open
};
+} // namespace Camera
+} // namespace Ti
+
+
camera_module_t HAL_MODULE_INFO_SYM = {
common: {
tag: HARDWARE_MODULE_TAG,
@@ -58,14 +65,18 @@ camera_module_t HAL_MODULE_INFO_SYM = {
id: CAMERA_HARDWARE_MODULE_ID,
name: "TI OMAP CameraHal Module",
author: "TI",
- methods: &camera_module_methods,
+ methods: &Ti::Camera::camera_module_methods,
dso: NULL, /* remove compilation warnings */
reserved: {0}, /* remove compilation warnings */
},
- get_number_of_cameras: camera_get_number_of_cameras,
- get_camera_info: camera_get_camera_info,
+ get_number_of_cameras: Ti::Camera::camera_get_number_of_cameras,
+ get_camera_info: Ti::Camera::camera_get_camera_info,
};
+
+namespace Ti {
+namespace Camera {
+
typedef struct ti_camera_device {
camera_device_t base;
/* TI specific "private" data can go here (base.priv) */
@@ -511,7 +522,7 @@ int camera_device_close(hw_device_t* device)
int ret = 0;
ti_camera_device_t* ti_dev = NULL;
- android::Mutex::Autolock lock(gCameraHalDeviceLock);
+ android::AutoMutex lock(gCameraHalDeviceLock);
if (!device) {
ret = -EINVAL;
@@ -557,10 +568,10 @@ int camera_device_open(const hw_module_t* module, const char* name,
int cameraid;
ti_camera_device_t* camera_device = NULL;
camera_device_ops_t* camera_ops = NULL;
- android::CameraHal* camera = NULL;
- android::CameraProperties::Properties* properties = NULL;
+ CameraHal* camera = NULL;
+ CameraProperties::Properties* properties = NULL;
- android::Mutex::Autolock lock(gCameraHalDeviceLock);
+ android::AutoMutex lock(gCameraHalDeviceLock);
CAMHAL_LOGI("camera_device open");
@@ -653,7 +664,7 @@ int camera_device_open(const hw_module_t* module, const char* name,
goto fail;
}
- camera = new android::CameraHal(cameraid);
+ camera = new CameraHal(cameraid);
if(!camera)
{
@@ -662,7 +673,7 @@ int camera_device_open(const hw_module_t* module, const char* name,
goto fail;
}
- if(properties && (camera->initialize(properties) != android::NO_ERROR))
+ if(properties && (camera->initialize(properties) != NO_ERROR))
{
CAMHAL_LOGE("Couldn't initialize camera instance");
rv = -ENODEV;
@@ -698,7 +709,7 @@ int camera_get_number_of_cameras(void)
// this going to be the first call from camera service
// initialize camera properties here...
- if(gCameraProperties.initialize() != android::NO_ERROR)
+ if(gCameraProperties.initialize() != NO_ERROR)
{
CAMHAL_LOGEA("Unable to create or initialize CameraProperties");
return NULL;
@@ -715,11 +726,11 @@ int camera_get_camera_info(int camera_id, struct camera_info *info)
int face_value = CAMERA_FACING_BACK;
int orientation = 0;
const char *valstr = NULL;
- android::CameraProperties::Properties* properties = NULL;
+ CameraProperties::Properties* properties = NULL;
// this going to be the first call from camera service
// initialize camera properties here...
- if(gCameraProperties.initialize() != android::NO_ERROR)
+ if(gCameraProperties.initialize() != NO_ERROR)
{
CAMHAL_LOGEA("Unable to create or initialize CameraProperties");
rv = -EINVAL;
@@ -736,20 +747,20 @@ int camera_get_camera_info(int camera_id, struct camera_info *info)
if(properties)
{
- valstr = properties->get(android::CameraProperties::FACING_INDEX);
+ valstr = properties->get(CameraProperties::FACING_INDEX);
if(valstr != NULL)
{
- if (strcmp(valstr, (const char *) android::TICameraParameters::FACING_FRONT) == 0)
+ if (strcmp(valstr, TICameraParameters::FACING_FRONT) == 0)
{
face_value = CAMERA_FACING_FRONT;
}
- else if (strcmp(valstr, (const char *) android::TICameraParameters::FACING_BACK) == 0)
+ else if (strcmp(valstr, TICameraParameters::FACING_BACK) == 0)
{
face_value = CAMERA_FACING_BACK;
}
}
- valstr = properties->get(android::CameraProperties::ORIENTATION_INDEX);
+ valstr = properties->get(CameraProperties::ORIENTATION_INDEX);
if(valstr != NULL)
{
orientation = atoi(valstr);
@@ -766,3 +777,7 @@ int camera_get_camera_info(int camera_id, struct camera_info *info)
end:
return rv;
}
+
+
+} // namespace Camera
+} // namespace Ti