summaryrefslogtreecommitdiffstats
path: root/libtiutils
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 /libtiutils
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 'libtiutils')
-rw-r--r--libtiutils/DebugUtils.cpp2
-rw-r--r--libtiutils/ErrorUtils.cpp9
-rw-r--r--libtiutils/ErrorUtils.h8
-rw-r--r--libtiutils/MessageQueue.cpp6
-rw-r--r--libtiutils/MessageQueue.h18
-rw-r--r--libtiutils/Semaphore.cpp8
-rw-r--r--libtiutils/Semaphore.h8
-rw-r--r--libtiutils/Status.h67
-rw-r--r--libtiutils/UtilsCommon.h4
9 files changed, 110 insertions, 20 deletions
diff --git a/libtiutils/DebugUtils.cpp b/libtiutils/DebugUtils.cpp
index 0165118..60ad0c8 100644
--- a/libtiutils/DebugUtils.cpp
+++ b/libtiutils/DebugUtils.cpp
@@ -53,7 +53,7 @@ Debug::Debug()
void Debug::grow()
{
- android::Mutex::Autolock locker(mMutex);
+ android::AutoMutex locker(mMutex);
(void)locker;
const int size = kDebugThreadInfoGrowSize;
diff --git a/libtiutils/ErrorUtils.cpp b/libtiutils/ErrorUtils.cpp
index df0e51c..e30fcfd 100644
--- a/libtiutils/ErrorUtils.cpp
+++ b/libtiutils/ErrorUtils.cpp
@@ -17,7 +17,8 @@
#include "ErrorUtils.h"
-namespace android {
+namespace Ti {
+namespace Utils {
/**
@brief Method to convert from POSIX to Android errors
@@ -135,7 +136,5 @@ status_t ErrorUtils::omxToAndroidError(OMX_ERRORTYPE error)
}
-};
-
-
-
+} // namespace Utils
+} // namespace Ti
diff --git a/libtiutils/ErrorUtils.h b/libtiutils/ErrorUtils.h
index 204ec97..c6c23a2 100644
--- a/libtiutils/ErrorUtils.h
+++ b/libtiutils/ErrorUtils.h
@@ -23,6 +23,8 @@
///Header file where all the OMX error codes are defined
#include "OMX_Core.h"
+#include "Status.h"
+
extern "C"
{
@@ -30,7 +32,8 @@ extern "C"
#include "timm_osal_error.h"
};
-namespace android {
+namespace Ti {
+namespace Utils {
///Generic class with static methods to convert any standard error type to Android error type
class ErrorUtils
@@ -47,6 +50,7 @@ public:
};
-};
+} // namespace Utils
+} // namespace Ti
#endif /// ERROR_UTILS_H
diff --git a/libtiutils/MessageQueue.cpp b/libtiutils/MessageQueue.cpp
index 997add2..13b1d53 100644
--- a/libtiutils/MessageQueue.cpp
+++ b/libtiutils/MessageQueue.cpp
@@ -29,7 +29,8 @@
#include "MessageQueue.h"
-namespace TIUTILS {
+namespace Ti {
+namespace Utils {
/**
@brief Constructor for the message queue class
@@ -414,4 +415,5 @@ android::status_t MessageQueue::waitForMsg(MessageQueue *queue1, MessageQueue *q
return ret;
}
-};
+} // namespace Utils
+} // namespace Ti
diff --git a/libtiutils/MessageQueue.h b/libtiutils/MessageQueue.h
index 7d6581c..a0a3468 100644
--- a/libtiutils/MessageQueue.h
+++ b/libtiutils/MessageQueue.h
@@ -33,7 +33,8 @@
#define MSGQ_LOGEA DBGUTILS_LOGEA
#define MSGQ_LOGEB DBGUTILS_LOGEB
-namespace TIUTILS {
+namespace Ti {
+namespace Utils {
///Message type
struct Message
@@ -88,6 +89,19 @@ private:
bool mHasMsg;
};
-};
+} // namespace Utils
+} // namespace Ti
+
+
+
+
+// FIXME: Temporary workaround to avoid namespace fixes in VTC test code right now.
+namespace TIUTILS {
+ typedef Ti::Utils::Message Message;
+ typedef Ti::Utils::MessageQueue MessageQueue;
+}
+
+
+
#endif
diff --git a/libtiutils/Semaphore.cpp b/libtiutils/Semaphore.cpp
index 37f3a89..512eee3 100644
--- a/libtiutils/Semaphore.cpp
+++ b/libtiutils/Semaphore.cpp
@@ -21,7 +21,8 @@
#include <utils/Log.h>
#include <time.h>
-namespace android {
+namespace Ti {
+namespace Utils {
/**
@brief Constructor for the semaphore class
@@ -227,6 +228,5 @@ status_t Semaphore::WaitTimeout(int timeoutMicroSecs)
}
-};
-
-
+} // namespace Utils
+} // namespace Ti
diff --git a/libtiutils/Semaphore.h b/libtiutils/Semaphore.h
index 6990848..8d64f3f 100644
--- a/libtiutils/Semaphore.h
+++ b/libtiutils/Semaphore.h
@@ -24,7 +24,10 @@
#include <string.h>
#include <unistd.h>
-namespace android {
+#include "Status.h"
+
+namespace Ti {
+namespace Utils {
class Semaphore
{
@@ -56,4 +59,5 @@ private:
};
-};
+} // namespace Utils
+} // namespace Ti
diff --git a/libtiutils/Status.h b/libtiutils/Status.h
new file mode 100644
index 0000000..ded2cec
--- /dev/null
+++ b/libtiutils/Status.h
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) Texas Instruments - http://www.ti.com/
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef TI_UTILS_STATUS_H
+#define TI_UTILS_STATUS_H
+
+#include <utils/Errors.h>
+
+#include "UtilsCommon.h"
+
+
+
+
+namespace Ti {
+
+
+
+
+typedef int status_t;
+
+#define TI_CAMERA_DEFINE_STATUS_CODE(x) x = android::x,
+enum {
+ TI_CAMERA_DEFINE_STATUS_CODE(OK)
+ TI_CAMERA_DEFINE_STATUS_CODE(NO_ERROR)
+ TI_CAMERA_DEFINE_STATUS_CODE(UNKNOWN_ERROR)
+ TI_CAMERA_DEFINE_STATUS_CODE(NO_MEMORY)
+ TI_CAMERA_DEFINE_STATUS_CODE(INVALID_OPERATION)
+ TI_CAMERA_DEFINE_STATUS_CODE(BAD_VALUE)
+ TI_CAMERA_DEFINE_STATUS_CODE(BAD_TYPE)
+ TI_CAMERA_DEFINE_STATUS_CODE(NAME_NOT_FOUND)
+ TI_CAMERA_DEFINE_STATUS_CODE(PERMISSION_DENIED)
+ TI_CAMERA_DEFINE_STATUS_CODE(NO_INIT)
+ TI_CAMERA_DEFINE_STATUS_CODE(ALREADY_EXISTS)
+ TI_CAMERA_DEFINE_STATUS_CODE(DEAD_OBJECT)
+ TI_CAMERA_DEFINE_STATUS_CODE(FAILED_TRANSACTION)
+ TI_CAMERA_DEFINE_STATUS_CODE(JPARKS_BROKE_IT)
+ TI_CAMERA_DEFINE_STATUS_CODE(BAD_INDEX)
+ TI_CAMERA_DEFINE_STATUS_CODE(NOT_ENOUGH_DATA)
+ TI_CAMERA_DEFINE_STATUS_CODE(WOULD_BLOCK)
+ TI_CAMERA_DEFINE_STATUS_CODE(TIMED_OUT)
+ TI_CAMERA_DEFINE_STATUS_CODE(UNKNOWN_TRANSACTION)
+ TI_CAMERA_DEFINE_STATUS_CODE(FDS_NOT_ALLOWED)
+};
+#undef TI_CAMERA_DEFINE_STATUS_CODE
+
+
+
+
+} // namespace Ti
+
+
+
+
+#endif // TI_UTILS_STATUS_H
diff --git a/libtiutils/UtilsCommon.h b/libtiutils/UtilsCommon.h
index 571bc81..8aaeee7 100644
--- a/libtiutils/UtilsCommon.h
+++ b/libtiutils/UtilsCommon.h
@@ -22,7 +22,7 @@
-namespace android {
+namespace Ti {
@@ -91,7 +91,7 @@ inline T abs(const T & x) {
-} // namespace android
+} // namespace Ti