aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJan Engelmohr <jan.engelmohr@mailbox.tu-dresden.de>2016-08-16 00:02:57 +0200
committerJan Engelmohr <jan.engelmohr@mailbox.tu-dresden.de>2016-08-16 00:02:57 +0200
commit27d23ae4b8ba7e4bbd34a06f8c2e17ac8fa535bf (patch)
treeddad3e769e79b3222c61bb0f0e208c9993ca378f /include
set up mt6753 device tree
Diffstat (limited to 'include')
-rw-r--r--include/cutils/alelog.h59
-rw-r--r--include/cutils/xlog.h185
-rw-r--r--include/hardware/gps.h1890
-rw-r--r--include/hardware/include/gralloc_mtk_defs.h94
-rw-r--r--include/hardware/include/graphics_mtk_defs.h53
-rw-r--r--include/hardware/include/hwc_priv.h100
-rw-r--r--include/hardware/include/mmsdk/effect_device.h115
-rw-r--r--include/hardware/include/mmsdk/gesture_device.h130
-rw-r--r--include/hardware/include/mmsdk/heartrate_device.h67
-rw-r--r--include/hardware/include/mmsdk/imageTransform_device.h109
-rw-r--r--include/hardware/include/mmsdk/mmsdk_common.h102
-rw-r--r--include/hardware/include/mmutils/IGrallocHelper.h216
-rw-r--r--include/hardware/include/mtkcam/BasicTypes.h85
-rw-r--r--include/hardware/include/mtkcam/BuiltinTypes.h92
-rw-r--r--include/hardware/include/mtkcam/Errors.h95
-rw-r--r--include/hardware/include/mtkcam/IImageBuffer.h606
-rw-r--r--include/hardware/include/mtkcam/IPlatform.h106
-rw-r--r--include/hardware/include/mtkcam/ImageFormat.h164
-rw-r--r--include/hardware/include/mtkcam/Log.h127
-rw-r--r--include/hardware/include/mtkcam/Modes.h102
-rw-r--r--include/hardware/include/mtkcam/Trace.h86
-rw-r--r--include/hardware/include/mtkcam/TypeManip.h77
-rw-r--r--include/hardware/include/mtkcam/UITypes.h331
-rw-r--r--include/hardware/include/mtkcam/acdk/AcdkCommon.h306
-rw-r--r--include/hardware/include/mtkcam/acdk/AcdkIF.h114
-rw-r--r--include/hardware/include/mtkcam/acdk/AcdkTypes.h151
-rw-r--r--include/hardware/include/mtkcam/acdk/CctIF.h107
-rw-r--r--include/hardware/include/mtkcam/acdk/MdkIF.h103
-rw-r--r--include/hardware/include/mtkcam/common.h60
-rw-r--r--include/hardware/include/mtkcam/device/Cam1Device.h354
-rw-r--r--include/hardware/include/mtkcam/device/Cam1DeviceBase.h238
-rw-r--r--include/hardware/include/mtkcam/device/Cam3Device.h191
-rw-r--r--include/hardware/include/mtkcam/device/Cam3DeviceBase.h141
-rw-r--r--include/hardware/include/mtkcam/device/CamDeviceManagerBase.h184
-rw-r--r--include/hardware/include/mtkcam/device/ICamDevice.h101
-rw-r--r--include/hardware/include/mtkcam/device/ICamDeviceManager.h173
-rw-r--r--include/hardware/include/mtkcam/device/device1.h69
-rw-r--r--include/hardware/include/mtkcam/device/module.h93
-rw-r--r--include/hardware/include/mtkcam/exif/CamExif.h341
-rw-r--r--include/hardware/include/mtkcam/exif/IBaseCamExif.h218
-rw-r--r--include/hardware/include/mtkcam/exif/IDbgInfoContainer.h103
-rw-r--r--include/hardware/include/mtkcam/exif/StdExif.h255
-rw-r--r--include/hardware/include/mtkcam/hal/IHalMemory.h130
-rw-r--r--include/hardware/include/mtkcam/hal/IHalSensor.h594
-rw-r--r--include/hardware/include/mtkcam/hal/IResManager.h64
-rw-r--r--include/hardware/include/mtkcam/hal/aaa_hal_base.h756
-rw-r--r--include/hardware/include/mtkcam/hal/sensor_hal.h501
-rw-r--r--include/hardware/include/mtkcam/metadata/IMetadata.h247
-rw-r--r--include/hardware/include/mtkcam/metadata/IMetadataConverter.h83
-rw-r--r--include/hardware/include/mtkcam/metadata/IMetadataProvider.h105
-rw-r--r--include/hardware/include/mtkcam/metadata/IMetadataTagSet.h99
-rw-r--r--include/hardware/include/mtkcam/metadata/ITemplateRequest.h82
-rw-r--r--include/hardware/include/mtkcam/metadata/client/TagMap.h251
-rw-r--r--include/hardware/include/mtkcam/metadata/client/mtk_metadata_tag.h943
-rwxr-xr-xinclude/hardware/include/mtkcam/metadata/client/mtk_metadata_tag_info.inl591
-rw-r--r--include/hardware/include/mtkcam/metadata/mtk_metadata_types.h82
-rw-r--r--include/hardware/include/mtkcam/mmp/Profile.h65
-rw-r--r--include/hardware/include/mtkcam/mmp/mmp.h259
-rw-r--r--include/hardware/include/mtkcam/utils/CpuCtrl.h28
-rw-r--r--include/hardware/include/mtkcam/utils/Format.h191
-rw-r--r--include/hardware/include/mtkcam/utils/ImageBufferHeap.h182
-rw-r--r--include/hardware/include/mtkcam/utils/Misc.h169
-rw-r--r--include/hardware/include/mtkcam/utils/Profile.h157
-rw-r--r--include/hardware/include/mtkcam/utils/Property.h111
-rw-r--r--include/hardware/include/mtkcam/utils/SensorListener.h31
-rw-r--r--include/hardware/include/mtkcam/utils/Sync.h207
-rw-r--r--include/hardware/include/mtkcam/utils/common.h55
-rw-r--r--include/hardware/include/mtkcam/utils/imagebuf/BaseImageBufferHeap.h346
-rw-r--r--include/hardware/include/mtkcam/utils/imagebuf/IDummyImageBufferHeap.h116
-rw-r--r--include/hardware/include/mtkcam/utils/imagebuf/IGrallocImageBufferHeap.h109
-rw-r--r--include/hardware/include/mtkcam/utils/imagebuf/IGraphicImageBufferHeap.h98
-rw-r--r--include/hardware/include/mtkcam/utils/imagebuf/IIonImageBufferHeap.h104
-rw-r--r--include/hardware/include/mtkcam/v1/ExtImgProc/ExtImgProc.h28
-rw-r--r--include/hardware/include/mtkcam/v1/ExtImgProc/IExtImgProc.h49
-rw-r--r--include/hardware/include/mtkcam/v1/ICamAdapter.h206
-rw-r--r--include/hardware/include/mtkcam/v1/ICamClient.h177
-rw-r--r--include/hardware/include/mtkcam/v1/IDisplayClient.h130
-rw-r--r--include/hardware/include/mtkcam/v1/IParamsManager.h224
-rw-r--r--include/hardware/include/mtkcam/v1/PriorityDefs.h80
-rw-r--r--include/hardware/include/mtkcam/v1/camutils/CamFormat.h192
-rw-r--r--include/hardware/include/mtkcam/v1/camutils/CamFormatTransform.h99
-rw-r--r--include/hardware/include/mtkcam/v1/camutils/CamInfo.h275
-rw-r--r--include/hardware/include/mtkcam/v1/camutils/CamMisc.h182
-rw-r--r--include/hardware/include/mtkcam/v1/camutils/CamProfile.h152
-rw-r--r--include/hardware/include/mtkcam/v1/camutils/CamProperty.h99
-rw-r--r--include/hardware/include/mtkcam/v1/camutils/IBuffer.h127
-rw-r--r--include/hardware/include/mtkcam/v1/camutils/ICameraBuffer.h106
-rw-r--r--include/hardware/include/mtkcam/v1/camutils/IImgBufQueue.h243
-rw-r--r--include/hardware/include/mtkcam/v1/camutils/ImgBufQueue.h170
-rw-r--r--include/hardware/include/mtkcam/v1/client/IFDClient.h106
-rw-r--r--include/hardware/include/mtkcam/v1/client/IOTClient.h108
-rw-r--r--include/hardware/include/mtkcam/v1/client/IPreviewClient.h117
-rw-r--r--include/hardware/include/mtkcam/v1/client/IPreviewFeatureClient.h107
-rw-r--r--include/hardware/include/mtkcam/v1/client/IRecordClient.h117
-rw-r--r--include/hardware/include/mtkcam/v1/common.h54
-rw-r--r--include/hardware/include/mtkcam/v1/featureio/3DF_hal_base.h198
-rw-r--r--include/hardware/include/mtkcam/v1/featureio/autorama_hal_base.h239
-rw-r--r--include/hardware/include/mtkcam/v1/featureio/motiontrack_hal_base.h210
-rw-r--r--include/hardware/include/mtkcam/v1/featureio/utility_hal_base.h130
-rw-r--r--include/hardware/include/mtkcam/v1/sdkClient/IGestureClient.h85
-rw-r--r--include/hardware/include/mtkcam/v3/app/AppStreamBuffers.h177
-rw-r--r--include/hardware/include/mtkcam/v3/app/Cam3ImageStreamInfo.h164
-rw-r--r--include/hardware/include/mtkcam/v3/app/IAppStreamManager.h288
-rw-r--r--include/hardware/include/mtkcam/v3/app/StreamId.h69
-rw-r--r--include/hardware/include/mtkcam/v3/device/default/Cam3DeviceCommon.h115
-rw-r--r--include/hardware/include/mtkcam/v3/pipeline/DefaultPipelineModel/DefaultPipelineModel.h334
-rw-r--r--include/hardware/include/mtkcam/v3/pipeline/DefaultPipelineModel/DefaultStrategy.h585
-rw-r--r--include/hardware/include/mtkcam/v3/pipeline/IPipelineBufferSetFrameControl.h270
-rw-r--r--include/hardware/include/mtkcam/v3/pipeline/IPipelineDAG.h363
-rw-r--r--include/hardware/include/mtkcam/v3/pipeline/IPipelineFrameControl.h100
-rw-r--r--include/hardware/include/mtkcam/v3/pipeline/IPipelineFrameNumberGenerator.h83
-rw-r--r--include/hardware/include/mtkcam/v3/pipeline/IPipelineModel.h166
-rw-r--r--include/hardware/include/mtkcam/v3/pipeline/IPipelineNode.h314
-rw-r--r--include/hardware/include/mtkcam/v3/pipeline/IPipelineNodeMapControl.h101
-rw-r--r--include/hardware/include/mtkcam/v3/stream/IStreamBuffer.h185
-rw-r--r--include/hardware/include/mtkcam/v3/stream/IStreamBufferSet.h206
-rw-r--r--include/hardware/include/mtkcam/v3/stream/IStreamInfo.h274
-rw-r--r--include/hardware/include/mtkcam/v3/stream/IUsersManager.h482
-rw-r--r--include/hardware/include/mtkcam/v3/utils/streambuf/IStreamBufferPool.h184
-rw-r--r--include/hardware/include/mtkcam/v3/utils/streambuf/IStreamBufferSetControl.h160
-rw-r--r--include/hardware/include/mtkcam/v3/utils/streambuf/StreamBufferPool.h466
-rw-r--r--include/hardware/include/mtkcam/v3/utils/streambuf/StreamBufferPoolImpl.h125
-rw-r--r--include/hardware/include/mtkcam/v3/utils/streambuf/StreamBuffers.h500
-rw-r--r--include/hardware/include/mtkcam/v3/utils/streambuf/UsersManager.h329
-rw-r--r--include/hardware/include/mtkcam/v3/utils/streaminfo/BaseStreamInfoImp.h102
-rw-r--r--include/hardware/include/mtkcam/v3/utils/streaminfo/IStreamInfoSetControl.h279
-rw-r--r--include/hardware/include/mtkcam/v3/utils/streaminfo/ImageStreamInfo.h127
-rw-r--r--include/hardware/include/mtkcam/v3/utils/streaminfo/MetaStreamInfo.h100
128 files changed, 25707 insertions, 0 deletions
diff --git a/include/cutils/alelog.h b/include/cutils/alelog.h
new file mode 100644
index 0000000..294c7a9
--- /dev/null
+++ b/include/cutils/alelog.h
@@ -0,0 +1,59 @@
+#if !defined(__ALE_H__)
+#define __ALE_H__
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#define LOGGER_ALE_MASK 0xf0
+
+#define LOGGER_ALE_MSG_RAW 0x00
+#define LOGGER_ALE_MSG_K 0x10
+#define LOGGER_ALE_MSG_N 0x20
+#define LOGGER_ALE_MSG_J 0x30
+#define LOGGER_ALE_XMSG_K 0x40
+#define LOGGER_ALE_XMSG_N 0x50
+#define LOGGER_ALE_XMSG_J 0x60
+
+#define LOGGER_ALE_MSG_SIZE 768
+
+#define LOGGER_ALE_ARGS_MAX 16
+struct ale_convert {
+ const char *tag_str;
+ const char *fmt_ptr;
+ const char *file;
+ int lineno;
+ unsigned int hash;
+ char params[LOGGER_ALE_ARGS_MAX];
+};
+
+int ale_log_output_binary(int prio, const char *tag, const void *payload, size_t len);
+
+int ale_log_output(int bufid, int prio, const struct ale_convert *convert, ...);
+
+#define ale_log_print(bufid, prio, tag, fmt, ...) \
+ ({ \
+ if (__builtin_constant_p(tag) && __builtin_constant_p(fmt)) { \
+ static const struct ale_convert ____ale_rec____ = \
+ { \
+ __builtin_constant_p(tag) ? tag : NULL, \
+ __builtin_constant_p(fmt) ? fmt : NULL, \
+ __FILE__, \
+ __builtin_constant_p(prio) ? prio : 0, \
+ 0, \
+ "" }; \
+ ale_log_output(bufid, prio, &____ale_rec____, ##__VA_ARGS__); \
+ } \
+ else { \
+ struct ale_convert ale = \
+ {tag, fmt, NULL, \
+ 0, 0, ""}; \
+ ale_log_output(bufid, prio, &ale, ##__VA_ARGS__); \
+ } \
+ })
+
+#if defined(__cplusplus)
+};
+#endif
+
+#endif
diff --git a/include/cutils/xlog.h b/include/cutils/xlog.h
new file mode 100644
index 0000000..a8089b7
--- /dev/null
+++ b/include/cutils/xlog.h
@@ -0,0 +1,185 @@
+#if !defined(_XLOG_H)
+#define _XLOG_H
+
+#include <cutils/log.h>
+#include <cutils/alelog.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int xlogf_java_tag_is_on(const char *name, int level);
+int xlogf_native_tag_is_on(const char *name, int level);
+
+int xlogf_java_xtag_is_on(const char *name, int level);
+int xlogf_native_xtag_is_on(const char *name, int level);
+
+#ifndef XLOG_TAG
+#define XLOG_TAG NULL
+#endif
+
+#ifndef SXLOGV
+#define SXLOGV(...) ((void)SXLOG_PRI(ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__))
+#endif
+#ifndef SXLOGD
+#define SXLOGD(...) ((void)SXLOG_PRI(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__))
+#endif
+#ifndef SXLOGI
+#define SXLOGI(...) ((void)SXLOG_PRI(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__))
+#endif
+#ifndef SXLOGW
+#define SXLOGW(...) ((void)SXLOG_PRI(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__))
+#endif
+#ifndef SXLOGE
+#define SXLOGE(...) ((void)SXLOG_PRI(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__))
+#endif
+#ifndef SXLOGF
+#define SXLOGF(...) ((void)SXLOG_PRI(ANDROID_LOG_FATAL, LOG_TAG, __VA_ARGS__))
+#endif
+#if LOG_NDEBUG
+#define SXLOG_ASSERT(cond, ...) \
+ ( (CONDITION(cond)) \
+ ? ((void)SXLOGF(LOG_TAG, __VA_ARGS__)) \
+ : (void)0 )
+#else
+#define SXLOG_ASSERT(cond, ...) ((void)0)
+#endif
+
+#define SXLOG_ALWAYS_ASSERT(cond,...) \
+ ( (CONDITION(cond)) \
+ ? ((void)SXLOGF(LOG_TAG, __VA_ARGS__)) \
+ : (void)0 )
+
+#ifndef XLOGV
+#define XLOGV(...) ((void)XLOG_PRI(ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__))
+#endif
+#ifndef XLOGD
+#define XLOGD(...) ((void)XLOG_PRI(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__))
+#endif
+#ifndef XLOGI
+#define XLOGI(...) ((void)XLOG_PRI(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__))
+#endif
+#ifndef XLOGW
+#define XLOGW(...) ((void)XLOG_PRI(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__))
+#endif
+#ifndef XLOGE
+#define XLOGE(...) ((void)XLOG_PRI(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__))
+#endif
+#ifndef XLOGF
+#define XLOGF(...) ((void)XLOG_PRI(ANDROID_LOG_FATAL, LOG_TAG, __VA_ARGS__))
+#endif
+
+#if LOG_NDEBUG
+#define XLOG_ASSERT(cond, ...) \
+ (!(cond) \
+ ? ((void)XLOGF(__VA_ARGS__)) \
+ : (void)0)
+#else
+#define XLOG_ASSERT(cond, ...) ((void)0)
+#endif
+
+#define XLOG_ALWAY_ASSERT(cond, ...) \
+ (!(cond) \
+ ? ((void)XLOGF(__VA_ARGS__)) \
+ : (void)0)
+
+
+#ifndef SXLOGV2
+#define SXLOGV2(...) ((void)SXLOG_PRI(ANDROID_LOG_VERBOSE, XLOG_TAG, __VA_ARGS__))
+#endif
+#ifndef SXLOGD2
+#define SXLOGD2(...) ((void)SXLOG_PRI(ANDROID_LOG_DEBUG, XLOG_TAG, __VA_ARGS__))
+#endif
+#ifndef SXLOGI2
+#define SXLOGI2(...) ((void)SXLOG_PRI(ANDROID_LOG_INFO, XLOG_TAG, __VA_ARGS__))
+#endif
+#ifndef SXLOGW2
+#define SXLOGW2(...) ((void)SXLOG_PRI(ANDROID_LOG_WARN, XLOG_TAG, __VA_ARGS__))
+#endif
+#ifndef SXLOGE2
+#define SXLOGE2(...) ((void)SXLOG_PRI(ANDROID_LOG_ERROR, XLOG_TAG, __VA_ARGS__))
+#endif
+#ifndef SXLOGF2
+#define SXLOGF2(...) ((void)SXLOG_PRI(ANDROID_LOG_FATAL, XLOG_TAG, __VA_ARGS__))
+#endif
+
+#ifndef XLOGV2
+#define XLOGV2(...) ((void)XLOG_PRI(ANDROID_LOG_VERBOSE, XLOG_TAG, __VA_ARGS__))
+#endif
+#ifndef XLOGD2
+#define XLOGD2(...) ((void)XLOG_PRI(ANDROID_LOG_DEBUG, XLOG_TAG, __VA_ARGS__))
+#endif
+#ifndef XLOGI2
+#define XLOGI2(...) ((void)XLOG_PRI(ANDROID_LOG_INFO, XLOG_TAG, __VA_ARGS__))
+#endif
+#ifndef XLOGW2
+#define XLOGW2(...) ((void)XLOG_PRI(ANDROID_LOG_WARN, XLOG_TAG, __VA_ARGS__))
+#endif
+#ifndef XLOGE2
+#define XLOGE2(...) ((void)XLOG_PRI(ANDROID_LOG_ERROR, XLOG_TAG, __VA_ARGS__))
+#endif
+#ifndef XLOGF2
+#define XLOGF2(...) ((void)XLOG_PRI(ANDROID_LOG_FATAL, XLOG_TAG, __VA_ARGS__))
+#endif
+
+struct xlog_record {
+ const char *tag_str;
+ const char *fmt_str;
+ int prio;
+};
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+int __xlog_buf_printf(int bufid, const struct xlog_record *rec, ...);
+
+#if defined(__cplusplus)
+}
+#endif
+
+#if !defined(HAVE_ALE_FEATURE)
+
+#define xlog_buf_printf(bufid, prio, tag, fmt, ...) \
+ ({ \
+ static const struct xlog_record _xlog_rec = \
+ {tag, fmt, prio}; \
+ __xlog_buf_printf(bufid, &_xlog_rec, ##__VA_ARGS__); \
+ })
+
+#else
+
+#define xlog_buf_printf(bufid, prio, tag, fmt, ...) \
+ ({ \
+ static const struct ale_convert ____xlog_ale_rec____ = \
+ { tag, fmt, __FILE__, prio, 0, "" }; \
+ ale_log_output(bufid, prio, &____xlog_ale_rec____, \
+ ##__VA_ARGS__); \
+ })
+
+#endif
+
+#ifdef HAVE_XLOG_FEATURE
+#define XLOG_PRI(priority, tag, ...) \
+ xlog_buf_printf(LOG_ID_MAIN, priority, tag, __VA_ARGS__)
+
+#define SXLOG_PRI(priority, tag, ...) \
+ xlog_buf_printf(LOG_ID_MAIN, priority, tag, __VA_ARGS__)
+
+#define xlog_printf(priority, tag, ...) \
+ xlog_buf_printf(LOG_ID_MAIN, priority, tag, __VA_ARGS__)
+
+#define sxlog_printf(priority, tag, ...) \
+ xlog_buf_printf(LOG_ID_SYSTEM, priority, tag, __VA_ARGS__)
+#else //HAVE_XLOG_FEATURE
+#define XLOG_PRI(priority, tag, ...) ((void)0)
+#define SXLOG_PRI(priority, tag, ...) ((void)0)
+#define xlog_printf(priority, tag, ...) ((void)0)
+#define sxlog_printf(priority, tag, ...) ((void)0)
+#endif //HAVE_XLOG_FEATURE
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/include/hardware/gps.h b/include/hardware/gps.h
new file mode 100644
index 0000000..580d5a4
--- /dev/null
+++ b/include/hardware/gps.h
@@ -0,0 +1,1890 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * 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 ANDROID_INCLUDE_HARDWARE_GPS_H
+#define ANDROID_INCLUDE_HARDWARE_GPS_H
+
+#include <stdint.h>
+#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <pthread.h>
+#include <sys/socket.h>
+#include <stdbool.h>
+
+#include <hardware/hardware.h>
+
+__BEGIN_DECLS
+
+/**
+ * The id of this module
+ */
+#define GPS_HARDWARE_MODULE_ID "gps"
+
+
+/** Milliseconds since January 1, 1970 */
+typedef int64_t GpsUtcTime;
+
+/** Maximum number of GNSS SVs for gps_sv_status_callback(). */
+#define GNSS_MAX_SVS 256
+
+/** Maximum number of SVs for gps_sv_status_callback(). */
+#define GPS_MAX_SVS 32
+
+/** Maximum number of Measurements in gps_measurement_callback(). */
+#define GPS_MAX_MEASUREMENT 32
+
+/** Requested operational mode for GPS operation. */
+typedef uint32_t GpsPositionMode;
+// IMPORTANT: Note that the following values must match
+// constants in GpsLocationProvider.java.
+/** Mode for running GPS standalone (no assistance). */
+#define GPS_POSITION_MODE_STANDALONE 0
+/** AGPS MS-Based mode. */
+#define GPS_POSITION_MODE_MS_BASED 1
+/** AGPS MS-Assisted mode. */
+#define GPS_POSITION_MODE_MS_ASSISTED 2
+
+/** Requested recurrence mode for GPS operation. */
+typedef uint32_t GpsPositionRecurrence;
+// IMPORTANT: Note that the following values must match
+// constants in GpsLocationProvider.java.
+/** Receive GPS fixes on a recurring basis at a specified period. */
+#define GPS_POSITION_RECURRENCE_PERIODIC 0
+/** Request a single shot GPS fix. */
+#define GPS_POSITION_RECURRENCE_SINGLE 1
+
+/** GPS status event values. */
+typedef uint16_t GpsStatusValue;
+// IMPORTANT: Note that the following values must match
+// constants in GpsLocationProvider.java.
+/** GPS status unknown. */
+#define GPS_STATUS_NONE 0
+/** GPS has begun navigating. */
+#define GPS_STATUS_SESSION_BEGIN 1
+/** GPS has stopped navigating. */
+#define GPS_STATUS_SESSION_END 2
+/** GPS has powered on but is not navigating. */
+#define GPS_STATUS_ENGINE_ON 3
+/** GPS is powered off. */
+#define GPS_STATUS_ENGINE_OFF 4
+
+/** Flags to indicate which values are valid in a GpsLocation. */
+typedef uint16_t GpsLocationFlags;
+// IMPORTANT: Note that the following values must match
+// constants in GpsLocationProvider.java.
+/** GpsLocation has valid latitude and longitude. */
+#define GPS_LOCATION_HAS_LAT_LONG 0x0001
+/** GpsLocation has valid altitude. */
+#define GPS_LOCATION_HAS_ALTITUDE 0x0002
+/** GpsLocation has valid speed. */
+#define GPS_LOCATION_HAS_SPEED 0x0004
+/** GpsLocation has valid bearing. */
+#define GPS_LOCATION_HAS_BEARING 0x0008
+/** GpsLocation has valid accuracy. */
+#define GPS_LOCATION_HAS_ACCURACY 0x0010
+
+/** Flags for the gps_set_capabilities callback. */
+
+/** GPS HAL schedules fixes for GPS_POSITION_RECURRENCE_PERIODIC mode.
+ If this is not set, then the framework will use 1000ms for min_interval
+ and will start and call start() and stop() to schedule the GPS.
+ */
+#define GPS_CAPABILITY_SCHEDULING 0x0000001
+/** GPS supports MS-Based AGPS mode */
+#define GPS_CAPABILITY_MSB 0x0000002
+/** GPS supports MS-Assisted AGPS mode */
+#define GPS_CAPABILITY_MSA 0x0000004
+/** GPS supports single-shot fixes */
+#define GPS_CAPABILITY_SINGLE_SHOT 0x0000008
+/** GPS supports on demand time injection */
+#define GPS_CAPABILITY_ON_DEMAND_TIME 0x0000010
+/** GPS supports Geofencing */
+#define GPS_CAPABILITY_GEOFENCING 0x0000020
+/** GPS supports Measurements */
+#define GPS_CAPABILITY_MEASUREMENTS 0x0000040
+/** GPS supports Navigation Messages */
+#define GPS_CAPABILITY_NAV_MESSAGES 0x0000080
+
+/** Flags used to specify which aiding data to delete
+ when calling delete_aiding_data(). */
+typedef uint32_t GpsAidingData;
+// IMPORTANT: Note that the following values must match
+// constants in GpsLocationProvider.java.
+#define GPS_DELETE_EPHEMERIS 0x00000001
+#define GPS_DELETE_ALMANAC 0x00000002
+#define GPS_DELETE_POSITION 0x00000004
+#define GPS_DELETE_TIME 0x00000008
+#define GPS_DELETE_IONO 0x00000010
+#define GPS_DELETE_UTC 0x00000020
+#define GPS_DELETE_HEALTH 0x00000040
+#define GPS_DELETE_SVDIR 0x00000080
+#define GPS_DELETE_SVSTEER 0x00000100
+#define GPS_DELETE_SADATA 0x00000200
+#define GPS_DELETE_RTI 0x00000400
+#define GPS_DELETE_CELLDB_INFO 0x00000800
+#define GPS_DELETE_ALMANAC_CORR 0x00001000
+#define GPS_DELETE_FREQ_BIAS_EST 0x00002000
+#define GLO_DELETE_EPHEMERIS 0x00004000
+#define GLO_DELETE_ALMANAC 0x00008000
+#define GLO_DELETE_SVDIR 0x00010000
+#define GLO_DELETE_SVSTEER 0x00020000
+#define GLO_DELETE_ALMANAC_CORR 0x00040000
+#define GPS_DELETE_TIME_GPS 0x00080000
+#define GLO_DELETE_TIME 0x00100000
+#define BDS_DELETE_SVDIR 0X00200000
+#define BDS_DELETE_SVSTEER 0X00400000
+#define BDS_DELETE_TIME 0X00800000
+#define BDS_DELETE_ALMANAC_CORR 0X01000000
+#define BDS_DELETE_EPHEMERIS 0X02000000
+#define BDS_DELETE_ALMANAC 0X04000000
+
+#define GPS_DELETE_ALL 0xFFFFFFFF
+
+/** AGPS type */
+typedef uint16_t AGpsType;
+#define AGPS_TYPE_SUPL 1
+#define AGPS_TYPE_C2K 2
+
+typedef uint16_t AGpsSetIDType;
+#define AGPS_SETID_TYPE_NONE 0
+#define AGPS_SETID_TYPE_IMSI 1
+#define AGPS_SETID_TYPE_MSISDN 2
+
+typedef uint16_t ApnIpType;
+#define APN_IP_INVALID 0
+#define APN_IP_IPV4 1
+#define APN_IP_IPV6 2
+#define APN_IP_IPV4V6 3
+
+/**
+ * String length constants
+ */
+#define GPS_NI_SHORT_STRING_MAXLEN 256
+#define GPS_NI_LONG_STRING_MAXLEN 2048
+
+/**
+ * GpsNiType constants
+ */
+typedef uint32_t GpsNiType;
+#define GPS_NI_TYPE_VOICE 1
+#define GPS_NI_TYPE_UMTS_SUPL 2
+#define GPS_NI_TYPE_UMTS_CTRL_PLANE 3
+
+/**
+ * GpsNiNotifyFlags constants
+ */
+typedef uint32_t GpsNiNotifyFlags;
+/** NI requires notification */
+#define GPS_NI_NEED_NOTIFY 0x0001
+/** NI requires verification */
+#define GPS_NI_NEED_VERIFY 0x0002
+/** NI requires privacy override, no notification/minimal trace */
+#define GPS_NI_PRIVACY_OVERRIDE 0x0004
+
+/**
+ * GPS NI responses, used to define the response in
+ * NI structures
+ */
+typedef int GpsUserResponseType;
+#define GPS_NI_RESPONSE_ACCEPT 1
+#define GPS_NI_RESPONSE_DENY 2
+#define GPS_NI_RESPONSE_NORESP 3
+
+/**
+ * NI data encoding scheme
+ */
+typedef int GpsNiEncodingType;
+#define GPS_ENC_NONE 0
+#define GPS_ENC_SUPL_GSM_DEFAULT 1
+#define GPS_ENC_SUPL_UTF8 2
+#define GPS_ENC_SUPL_UCS2 3
+#define GPS_ENC_UNKNOWN -1
+
+/** AGPS status event values. */
+typedef uint16_t AGpsStatusValue;
+/** GPS requests data connection for AGPS. */
+#define GPS_REQUEST_AGPS_DATA_CONN 1
+/** GPS releases the AGPS data connection. */
+#define GPS_RELEASE_AGPS_DATA_CONN 2
+/** AGPS data connection initiated */
+#define GPS_AGPS_DATA_CONNECTED 3
+/** AGPS data connection completed */
+#define GPS_AGPS_DATA_CONN_DONE 4
+/** AGPS data connection failed */
+#define GPS_AGPS_DATA_CONN_FAILED 5
+
+#define AGPS_REF_LOCATION_TYPE_GSM_CELLID 1
+#define AGPS_REF_LOCATION_TYPE_UMTS_CELLID 2
+#define AGPS_REG_LOCATION_TYPE_MAC 3
+
+/** Network types for update_network_state "type" parameter */
+#define AGPS_RIL_NETWORK_TYPE_MOBILE 0
+#define AGPS_RIL_NETWORK_TYPE_WIFI 1
+#define AGPS_RIL_NETWORK_TYPE_MOBILE_MMS 2
+#define AGPS_RIL_NETWORK_TYPE_MOBILE_SUPL 3
+#define AGPS_RIL_NETWORK_TTYPE_MOBILE_DUN 4
+#define AGPS_RIL_NETWORK_TTYPE_MOBILE_HIPRI 5
+#define AGPS_RIL_NETWORK_TTYPE_WIMAX 6
+
+/**
+ * Flags to indicate what fields in GpsClock are valid.
+ */
+typedef uint16_t GpsClockFlags;
+/** A valid 'leap second' is stored in the data structure. */
+#define GPS_CLOCK_HAS_LEAP_SECOND (1<<0)
+/** A valid 'time uncertainty' is stored in the data structure. */
+#define GPS_CLOCK_HAS_TIME_UNCERTAINTY (1<<1)
+/** A valid 'full bias' is stored in the data structure. */
+#define GPS_CLOCK_HAS_FULL_BIAS (1<<2)
+/** A valid 'bias' is stored in the data structure. */
+#define GPS_CLOCK_HAS_BIAS (1<<3)
+/** A valid 'bias uncertainty' is stored in the data structure. */
+#define GPS_CLOCK_HAS_BIAS_UNCERTAINTY (1<<4)
+/** A valid 'drift' is stored in the data structure. */
+#define GPS_CLOCK_HAS_DRIFT (1<<5)
+/** A valid 'drift uncertainty' is stored in the data structure. */
+#define GPS_CLOCK_HAS_DRIFT_UNCERTAINTY (1<<6)
+
+/**
+ * Enumeration of the available values for the GPS Clock type.
+ */
+typedef uint8_t GpsClockType;
+/** The type is not available ot it is unknown. */
+#define GPS_CLOCK_TYPE_UNKNOWN 0
+/** The source of the time value reported by GPS clock is the local hardware clock. */
+#define GPS_CLOCK_TYPE_LOCAL_HW_TIME 1
+/**
+ * The source of the time value reported by GPS clock is the GPS time derived from satellites
+ * (epoch = Jan 6, 1980)
+ */
+#define GPS_CLOCK_TYPE_GPS_TIME 2
+
+/**
+ * Flags to indicate what fields in GpsMeasurement are valid.
+ */
+typedef uint32_t GpsMeasurementFlags;
+/** A valid 'snr' is stored in the data structure. */
+#define GPS_MEASUREMENT_HAS_SNR (1<<0)
+/** A valid 'elevation' is stored in the data structure. */
+#define GPS_MEASUREMENT_HAS_ELEVATION (1<<1)
+/** A valid 'elevation uncertainty' is stored in the data structure. */
+#define GPS_MEASUREMENT_HAS_ELEVATION_UNCERTAINTY (1<<2)
+/** A valid 'azimuth' is stored in the data structure. */
+#define GPS_MEASUREMENT_HAS_AZIMUTH (1<<3)
+/** A valid 'azimuth uncertainty' is stored in the data structure. */
+#define GPS_MEASUREMENT_HAS_AZIMUTH_UNCERTAINTY (1<<4)
+/** A valid 'pseudorange' is stored in the data structure. */
+#define GPS_MEASUREMENT_HAS_PSEUDORANGE (1<<5)
+/** A valid 'pseudorange uncertainty' is stored in the data structure. */
+#define GPS_MEASUREMENT_HAS_PSEUDORANGE_UNCERTAINTY (1<<6)
+/** A valid 'code phase' is stored in the data structure. */
+#define GPS_MEASUREMENT_HAS_CODE_PHASE (1<<7)
+/** A valid 'code phase uncertainty' is stored in the data structure. */
+#define GPS_MEASUREMENT_HAS_CODE_PHASE_UNCERTAINTY (1<<8)
+/** A valid 'carrier frequency' is stored in the data structure. */
+#define GPS_MEASUREMENT_HAS_CARRIER_FREQUENCY (1<<9)
+/** A valid 'carrier cycles' is stored in the data structure. */
+#define GPS_MEASUREMENT_HAS_CARRIER_CYCLES (1<<10)
+/** A valid 'carrier phase' is stored in the data structure. */
+#define GPS_MEASUREMENT_HAS_CARRIER_PHASE (1<<11)
+/** A valid 'carrier phase uncertainty' is stored in the data structure. */
+#define GPS_MEASUREMENT_HAS_CARRIER_PHASE_UNCERTAINTY (1<<12)
+/** A valid 'bit number' is stored in the data structure. */
+#define GPS_MEASUREMENT_HAS_BIT_NUMBER (1<<13)
+/** A valid 'time from last bit' is stored in the data structure. */
+#define GPS_MEASUREMENT_HAS_TIME_FROM_LAST_BIT (1<<14)
+/** A valid 'doppler shift' is stored in the data structure. */
+#define GPS_MEASUREMENT_HAS_DOPPLER_SHIFT (1<<15)
+/** A valid 'doppler shift uncertainty' is stored in the data structure. */
+#define GPS_MEASUREMENT_HAS_DOPPLER_SHIFT_UNCERTAINTY (1<<16)
+/** A valid 'used in fix' flag is stored in the data structure. */
+#define GPS_MEASUREMENT_HAS_USED_IN_FIX (1<<17)
+
+/**
+ * Enumeration of the available values for the GPS Measurement's loss of lock.
+ */
+typedef uint8_t GpsLossOfLock;
+/** The indicator is not available or it is unknown. */
+#define GPS_LOSS_OF_LOCK_UNKNOWN 0
+/** The measurement does not present any indication of loss of lock. */
+#define GPS_LOSS_OF_LOCK_OK 1
+/** Loss of lock between previous and current observation: cycle slip possible. */
+#define GPS_LOSS_OF_LOCK_CYCLE_SLIP 2
+
+/**
+ * Enumeration of available values for the GPS Measurement's multipath indicator.
+ */
+typedef uint8_t GpsMultipathIndicator;
+/** The indicator is not available or unknown. */
+#define GPS_MULTIPATH_INDICATOR_UNKNOWN 0
+/** The measurement has been indicated to use multipath. */
+#define GPS_MULTIPATH_INDICATOR_DETECTED 1
+/** The measurement has been indicated Not to use multipath. */
+#define GPS_MULTIPATH_INDICATOR_NOT_USED 2
+
+/**
+ * Flags indicating the GPS measurement state.
+ * The expected behavior here is for GPS HAL to set all the flags that applies. For
+ * example, if the state for a satellite is only C/A code locked and bit synchronized,
+ * and there is still millisecond ambiguity, the state should be set as:
+ * GPS_MEASUREMENT_STATE_CODE_LOCK|GPS_MEASUREMENT_STATE_BIT_SYNC|GPS_MEASUREMENT_STATE_MSEC_AMBIGUOUS
+ * If GPS is still searching for a satellite, the corresponding state should be set to
+ * GPS_MEASUREMENT_STATE_UNKNOWN(0).
+ */
+typedef uint16_t GpsMeasurementState;
+#define GPS_MEASUREMENT_STATE_UNKNOWN 0
+#define GPS_MEASUREMENT_STATE_CODE_LOCK (1<<0)
+#define GPS_MEASUREMENT_STATE_BIT_SYNC (1<<1)
+#define GPS_MEASUREMENT_STATE_SUBFRAME_SYNC (1<<2)
+#define GPS_MEASUREMENT_STATE_TOW_DECODED (1<<3)
+#define GPS_MEASUREMENT_STATE_MSEC_AMBIGUOUS (1<<4)
+
+/**
+ * Flags indicating the Accumulated Delta Range's states.
+ */
+typedef uint16_t GpsAccumulatedDeltaRangeState;
+#define GPS_ADR_STATE_UNKNOWN 0
+#define GPS_ADR_STATE_VALID (1<<0)
+#define GPS_ADR_STATE_RESET (1<<1)
+#define GPS_ADR_STATE_CYCLE_SLIP (1<<2)
+
+/**
+ * Enumeration of available values to indicate the available GPS Navigation message types.
+ */
+typedef uint8_t GpsNavigationMessageType;
+/** The message type is unknown. */
+#define GPS_NAVIGATION_MESSAGE_TYPE_UNKNOWN 0
+/** L1 C/A message contained in the structure. */
+#define GPS_NAVIGATION_MESSAGE_TYPE_L1CA 1
+/** L2-CNAV message contained in the structure. */
+#define GPS_NAVIGATION_MESSAGE_TYPE_L2CNAV 2
+/** L5-CNAV message contained in the structure. */
+#define GPS_NAVIGATION_MESSAGE_TYPE_L5CNAV 3
+/** CNAV-2 message contained in the structure. */
+#define GPS_NAVIGATION_MESSAGE_TYPE_CNAV2 4
+
+/**
+ * Status of Navigation Message
+ * When a message is received properly without any parity error in its navigation words, the
+ * status should be set to NAV_MESSAGE_STATUS_PARITY_PASSED. But if a message is received
+ * with words that failed parity check, but GPS is able to correct those words, the status
+ * should be set to NAV_MESSAGE_STATUS_PARITY_REBUILT.
+ * No need to send any navigation message that contains words with parity error and cannot be
+ * corrected.
+ */
+typedef uint16_t NavigationMessageStatus;
+#define NAV_MESSAGE_STATUS_UNKONW 0
+#define NAV_MESSAGE_STATUS_PARITY_PASSED (1<<0)
+#define NAV_MESSAGE_STATUS_PARITY_REBUILT (1<<1)
+
+/**
+ * Name for the GPS XTRA interface.
+ */
+#define GPS_XTRA_INTERFACE "gps-xtra"
+
+/**
+ * Name for the GPS DEBUG interface.
+ */
+#define GPS_DEBUG_INTERFACE "gps-debug"
+
+/**
+ * Name for the AGPS interface.
+ */
+#define AGPS_INTERFACE "agps"
+
+/**
+ * Name of the Supl Certificate interface.
+ */
+#define SUPL_CERTIFICATE_INTERFACE "supl-certificate"
+
+/**
+ * Name for NI interface
+ */
+#define GPS_NI_INTERFACE "gps-ni"
+
+/**
+ * Name for the AGPS-RIL interface.
+ */
+#define AGPS_RIL_INTERFACE "agps_ril"
+
+/**
+ * Name for the GPS_Geofencing interface.
+ */
+#define GPS_GEOFENCING_INTERFACE "gps_geofencing"
+
+/**
+ * Name of the GPS Measurements interface.
+ */
+#define GPS_MEASUREMENT_INTERFACE "gps_measurement"
+
+/**
+ * Name of the GPS navigation message interface.
+ */
+#define GPS_NAVIGATION_MESSAGE_INTERFACE "gps_navigation_message"
+
+/**
+ * Name of the GNSS/GPS configuration interface.
+ */
+#define GNSS_CONFIGURATION_INTERFACE "gnss_configuration"
+
+
+/** Represents a location. */
+typedef struct {
+ /** set to sizeof(GpsLocation) */
+ size_t size;
+ /** Contains GpsLocationFlags bits. */
+ uint16_t flags;
+ /** Represents latitude in degrees. */
+ double latitude;
+ /** Represents longitude in degrees. */
+ double longitude;
+ /** Represents altitude in meters above the WGS 84 reference
+ * ellipsoid. */
+ double altitude;
+ /** Represents speed in meters per second. */
+ float speed;
+ /** Represents heading in degrees. */
+ float bearing;
+ /** Represents expected accuracy in meters. */
+ float accuracy;
+ /** Timestamp for the location fix. */
+ GpsUtcTime timestamp;
+} GpsLocation;
+
+/** Represents the status. */
+typedef struct {
+ /** set to sizeof(GpsStatus) */
+ size_t size;
+ GpsStatusValue status;
+} GpsStatus;
+
+/** Represents SV information. */
+typedef struct {
+ /** set to sizeof(GpsSvInfo) */
+ size_t size;
+ /** Pseudo-random number for the SV. */
+ int prn;
+ /** Signal to noise ratio. */
+ float snr;
+ /** Elevation of SV in degrees. */
+ float elevation;
+ /** Azimuth of SV in degrees. */
+ float azimuth;
+} GpsSvInfo;
+
+
+/** Represents GNSS SV information. */
+typedef struct {
+ /** set to sizeof(GnssSvInfo) */
+ size_t size;
+ /** Pseudo-random number for the SV. */
+ int prn;
+ /** Signal to noise ratio. */
+ float snr;
+ /** Elevation of SV in degrees. */
+ float elevation;
+ /** Azimuth of SV in degrees. */
+ float azimuth;
+ /**
+ * SVs have ephemeris data.
+ */
+ bool has_ephemeris;
+ /**
+ * SVs have almanac data.
+ */
+ bool has_almanac;
+ /**
+ * SVs were used for computing the most recent position fix.
+ */
+ bool used_in_fix;
+} GnssSvInfo;
+
+/** Represents SV status. */
+typedef struct {
+ /** set to sizeof(GpsSvStatus) */
+ size_t size;
+
+ /** Number of SVs currently visible. */
+ int num_svs;
+
+ /** Contains an array of SV information. */
+ GpsSvInfo sv_list[GPS_MAX_SVS];
+
+ /** Represents a bit mask indicating which SVs
+ * have ephemeris data.
+ */
+ uint32_t ephemeris_mask;
+
+ /** Represents a bit mask indicating which SVs
+ * have almanac data.
+ */
+ uint32_t almanac_mask;
+
+ /**
+ * Represents a bit mask indicating which SVs
+ * were used for computing the most recent position fix.
+ */
+ uint32_t used_in_fix_mask;
+} GpsSvStatus;
+
+
+/** Represents GNSS SV status. */
+typedef struct {
+ /** set to sizeof(GnssSvStatus) */
+ size_t size;
+
+ /** Number of SVs currently visible. */
+ int num_svs;
+
+ /** Contains an array of GNSS SV information. */
+ GnssSvInfo sv_list[GNSS_MAX_SVS];
+} GnssSvStatus;
+
+/* 2G and 3G */
+/* In 3G lac is discarded */
+typedef struct {
+ uint16_t type;
+ uint16_t mcc;
+ uint16_t mnc;
+ uint16_t lac;
+ uint32_t cid;
+} AGpsRefLocationCellID;
+
+typedef struct {
+ uint8_t mac[6];
+} AGpsRefLocationMac;
+
+/** Represents ref locations */
+typedef struct {
+ uint16_t type;
+ union {
+ AGpsRefLocationCellID cellID;
+ AGpsRefLocationMac mac;
+ } u;
+} AGpsRefLocation;
+
+/** Callback with location information.
+ * Can only be called from a thread created by create_thread_cb.
+ */
+typedef void (* gps_location_callback)(GpsLocation* location);
+
+/** Callback with status information.
+ * Can only be called from a thread created by create_thread_cb.
+ */
+typedef void (* gps_status_callback)(GpsStatus* status);
+
+/**
+ * Callback with SV status information.
+ * Can only be called from a thread created by create_thread_cb.
+ */
+typedef void (* gps_sv_status_callback)(GpsSvStatus* sv_info);
+
+/**
+ * Callback with GNSS SV status information.
+ * Can only be called from a thread created by create_thread_cb.
+ */
+typedef void (* gnss_sv_status_callback)(GnssSvStatus* sv_info);
+
+/** Callback for reporting NMEA sentences.
+ * Can only be called from a thread created by create_thread_cb.
+ */
+typedef void (* gps_nmea_callback)(GpsUtcTime timestamp, const char* nmea, int length);
+
+/** Callback to inform framework of the GPS engine's capabilities.
+ * Capability parameter is a bit field of GPS_CAPABILITY_* flags.
+ */
+typedef void (* gps_set_capabilities)(uint32_t capabilities);
+
+/** Callback utility for acquiring the GPS wakelock.
+ * This can be used to prevent the CPU from suspending while handling GPS events.
+ */
+typedef void (* gps_acquire_wakelock)();
+
+/** Callback utility for releasing the GPS wakelock. */
+typedef void (* gps_release_wakelock)();
+
+/** Callback for requesting NTP time */
+typedef void (* gps_request_utc_time)();
+
+/** Callback for creating a thread that can call into the Java framework code.
+ * This must be used to create any threads that report events up to the framework.
+ */
+typedef pthread_t (* gps_create_thread)(const char* name, void (*start)(void *), void* arg);
+
+/** GPS callback structure. */
+typedef struct {
+ /** set to sizeof(GpsCallbacks) */
+ size_t size;
+ gps_location_callback location_cb;
+ gps_status_callback status_cb;
+ gps_sv_status_callback sv_status_cb;
+ gnss_sv_status_callback gnss_sv_status_cb;
+ gps_nmea_callback nmea_cb;
+ gps_set_capabilities set_capabilities_cb;
+ gps_acquire_wakelock acquire_wakelock_cb;
+ gps_release_wakelock release_wakelock_cb;
+ gps_create_thread create_thread_cb;
+ gps_request_utc_time request_utc_time_cb;
+} GpsCallbacks;
+
+
+/** Represents the standard GPS interface. */
+typedef struct {
+ /** set to sizeof(GpsInterface) */
+ size_t size;
+ /**
+ * Opens the interface and provides the callback routines
+ * to the implementation of this interface.
+ */
+ int (*init)( GpsCallbacks* callbacks );
+
+ /** Starts navigating. */
+ int (*start)( void );
+
+ /** Stops navigating. */
+ int (*stop)( void );
+
+ /** Closes the interface. */
+ void (*cleanup)( void );
+
+ /** Injects the current time. */
+ int (*inject_time)(GpsUtcTime time, int64_t timeReference,
+ int uncertainty);
+
+ /** Injects current location from another location provider
+ * (typically cell ID).
+ * latitude and longitude are measured in degrees
+ * expected accuracy is measured in meters
+ */
+ int (*inject_location)(double latitude, double longitude, float accuracy);
+
+ /**
+ * Specifies that the next call to start will not use the
+ * information defined in the flags. GPS_DELETE_ALL is passed for
+ * a cold start.
+ */
+ void (*delete_aiding_data)(GpsAidingData flags);
+
+ /**
+ * min_interval represents the time between fixes in milliseconds.
+ * preferred_accuracy represents the requested fix accuracy in meters.
+ * preferred_time represents the requested time to first fix in milliseconds.
+ */
+ int (*set_position_mode)(GpsPositionMode mode, GpsPositionRecurrence recurrence,
+ uint32_t min_interval, uint32_t preferred_accuracy, uint32_t preferred_time);
+
+ /** Get a pointer to extension information. */
+ const void* (*get_extension)(const char* name);
+} GpsInterface;
+
+/** Callback to request the client to download XTRA data.
+ * The client should download XTRA data and inject it by calling inject_xtra_data().
+ * Can only be called from a thread created by create_thread_cb.
+ */
+typedef void (* gps_xtra_download_request)();
+
+/** Callback structure for the XTRA interface. */
+typedef struct {
+ gps_xtra_download_request download_request_cb;
+ gps_create_thread create_thread_cb;
+} GpsXtraCallbacks;
+
+/** Extended interface for XTRA support. */
+typedef struct {
+ /** set to sizeof(GpsXtraInterface) */
+ size_t size;
+ /**
+ * Opens the XTRA interface and provides the callback routines
+ * to the implementation of this interface.
+ */
+ int (*init)( GpsXtraCallbacks* callbacks );
+ /** Injects XTRA data into the GPS. */
+ int (*inject_xtra_data)( char* data, int length );
+} GpsXtraInterface;
+
+/** Extended interface for DEBUG support. */
+typedef struct {
+ /** set to sizeof(GpsDebugInterface) */
+ size_t size;
+
+ /**
+ * This function should return any information that the native
+ * implementation wishes to include in a bugreport.
+ */
+ size_t (*get_internal_state)(char* buffer, size_t bufferSize);
+} GpsDebugInterface;
+
+/** Represents the status of AGPS. */
+typedef struct {
+ /** set to sizeof(AGpsStatus_v1) */
+ size_t size;
+
+ AGpsType type;
+ AGpsStatusValue status;
+} AGpsStatus_v1;
+
+/** Represents the status of AGPS augmented with a IPv4 address field. */
+typedef struct {
+ /** set to sizeof(AGpsStatus_v2) */
+ size_t size;
+
+ AGpsType type;
+ AGpsStatusValue status;
+ uint32_t ipaddr;
+} AGpsStatus_v2;
+
+/* Represents the status of AGPS augmented to support IPv4 and IPv6. */
+typedef struct {
+ /** set to sizeof(AGpsStatus_v3) */
+ size_t size;
+
+ AGpsType type;
+ AGpsStatusValue status;
+
+ /**
+ * Must be set to a valid IPv4 address if the field 'addr' contains an IPv4
+ * address, or set to INADDR_NONE otherwise.
+ */
+ uint32_t ipaddr;
+
+ /**
+ * Must contain the IPv4 (AF_INET) or IPv6 (AF_INET6) address to report.
+ * Any other value of addr.ss_family will be rejected.
+ * */
+ struct sockaddr_storage addr;
+} AGpsStatus_v3;
+
+typedef AGpsStatus_v3 AGpsStatus;
+
+/** Callback with AGPS status information.
+ * Can only be called from a thread created by create_thread_cb.
+ */
+typedef void (* agps_status_callback)(AGpsStatus* status);
+
+/** Callback structure for the AGPS interface. */
+typedef struct {
+ agps_status_callback status_cb;
+ gps_create_thread create_thread_cb;
+} AGpsCallbacks;
+
+
+/** Extended interface for AGPS support. */
+typedef struct {
+ /** set to sizeof(AGpsInterface_v1) */
+ size_t size;
+
+ /**
+ * Opens the AGPS interface and provides the callback routines
+ * to the implementation of this interface.
+ */
+ void (*init)( AGpsCallbacks* callbacks );
+ /**
+ * Notifies that a data connection is available and sets
+ * the name of the APN to be used for SUPL.
+ */
+ int (*data_conn_open)( const char* apn );
+ /**
+ * Notifies that the AGPS data connection has been closed.
+ */
+ int (*data_conn_closed)();
+ /**
+ * Notifies that a data connection is not available for AGPS.
+ */
+ int (*data_conn_failed)();
+ /**
+ * Sets the hostname and port for the AGPS server.
+ */
+ int (*set_server)( AGpsType type, const char* hostname, int port );
+} AGpsInterface_v1;
+
+/**
+ * Extended interface for AGPS support, it is augmented to enable to pass
+ * extra APN data.
+ */
+typedef struct {
+ /** set to sizeof(AGpsInterface_v2) */
+ size_t size;
+
+ /**
+ * Opens the AGPS interface and provides the callback routines to the
+ * implementation of this interface.
+ */
+ void (*init)(AGpsCallbacks* callbacks);
+ /**
+ * Deprecated.
+ * If the HAL supports AGpsInterface_v2 this API will not be used, see
+ * data_conn_open_with_apn_ip_type for more information.
+ */
+ int (*data_conn_open)(const char* apn);
+ /**
+ * Notifies that the AGPS data connection has been closed.
+ */
+ int (*data_conn_closed)();
+ /**
+ * Notifies that a data connection is not available for AGPS.
+ */
+ int (*data_conn_failed)();
+ /**
+ * Sets the hostname and port for the AGPS server.
+ */
+ int (*set_server)(AGpsType type, const char* hostname, int port);
+
+ /**
+ * Notifies that a data connection is available and sets the name of the
+ * APN, and its IP type, to be used for SUPL connections.
+ */
+ int (*data_conn_open_with_apn_ip_type)(
+ const char* apn,
+ ApnIpType apnIpType);
+} AGpsInterface_v2;
+
+typedef AGpsInterface_v2 AGpsInterface;
+
+/** Error codes associated with certificate operations */
+#define AGPS_CERTIFICATE_OPERATION_SUCCESS 0
+#define AGPS_CERTIFICATE_ERROR_GENERIC -100
+#define AGPS_CERTIFICATE_ERROR_TOO_MANY_CERTIFICATES -101
+
+/** A data structure that represents an X.509 certificate using DER encoding */
+typedef struct {
+ size_t length;
+ u_char* data;
+} DerEncodedCertificate;
+
+/**
+ * A type definition for SHA1 Fingerprints used to identify X.509 Certificates
+ * The Fingerprint is a digest of the DER Certificate that uniquely identifies it.
+ */
+typedef struct {
+ u_char data[20];
+} Sha1CertificateFingerprint;
+
+/** AGPS Interface to handle SUPL certificate operations */
+typedef struct {
+ /** set to sizeof(SuplCertificateInterface) */
+ size_t size;
+
+ /**
+ * Installs a set of Certificates used for SUPL connections to the AGPS server.
+ * If needed the HAL should find out internally any certificates that need to be removed to
+ * accommodate the certificates to install.
+ * The certificates installed represent a full set of valid certificates needed to connect to
+ * AGPS SUPL servers.
+ * The list of certificates is required, and all must be available at the same time, when trying
+ * to establish a connection with the AGPS Server.
+ *
+ * Parameters:
+ * certificates - A pointer to an array of DER encoded certificates that are need to be
+ * installed in the HAL.
+ * length - The number of certificates to install.
+ * Returns:
+ * AGPS_CERTIFICATE_OPERATION_SUCCESS if the operation is completed successfully
+ * AGPS_CERTIFICATE_ERROR_TOO_MANY_CERTIFICATES if the HAL cannot store the number of
+ * certificates attempted to be installed, the state of the certificates stored should
+ * remain the same as before on this error case.
+ *
+ * IMPORTANT:
+ * If needed the HAL should find out internally the set of certificates that need to be
+ * removed to accommodate the certificates to install.
+ */
+ int (*install_certificates) ( const DerEncodedCertificate* certificates, size_t length );
+
+ /**
+ * Notifies the HAL that a list of certificates used for SUPL connections are revoked. It is
+ * expected that the given set of certificates is removed from the internal store of the HAL.
+ *
+ * Parameters:
+ * fingerprints - A pointer to an array of SHA1 Fingerprints to identify the set of
+ * certificates to revoke.
+ * length - The number of fingerprints provided.
+ * Returns:
+ * AGPS_CERTIFICATE_OPERATION_SUCCESS if the operation is completed successfully.
+ *
+ * IMPORTANT:
+ * If any of the certificates provided (through its fingerprint) is not known by the HAL,
+ * it should be ignored and continue revoking/deleting the rest of them.
+ */
+ int (*revoke_certificates) ( const Sha1CertificateFingerprint* fingerprints, size_t length );
+} SuplCertificateInterface;
+
+/** Represents an NI request */
+typedef struct {
+ /** set to sizeof(GpsNiNotification) */
+ size_t size;
+
+ /**
+ * An ID generated by HAL to associate NI notifications and UI
+ * responses
+ */
+ int notification_id;
+
+ /**
+ * An NI type used to distinguish different categories of NI
+ * events, such as GPS_NI_TYPE_VOICE, GPS_NI_TYPE_UMTS_SUPL, ...
+ */
+ GpsNiType ni_type;
+
+ /**
+ * Notification/verification options, combinations of GpsNiNotifyFlags constants
+ */
+ GpsNiNotifyFlags notify_flags;
+
+ /**
+ * Timeout period to wait for user response.
+ * Set to 0 for no time out limit.
+ */
+ int timeout;
+
+ /**
+ * Default response when time out.
+ */
+ GpsUserResponseType default_response;
+
+ /**
+ * Requestor ID
+ */
+ char requestor_id[GPS_NI_SHORT_STRING_MAXLEN];
+
+ /**
+ * Notification message. It can also be used to store client_id in some cases
+ */
+ char text[GPS_NI_LONG_STRING_MAXLEN];
+
+ /**
+ * Client name decoding scheme
+ */
+ GpsNiEncodingType requestor_id_encoding;
+
+ /**
+ * Client name decoding scheme
+ */
+ GpsNiEncodingType text_encoding;
+
+ /**
+ * A pointer to extra data. Format:
+ * key_1 = value_1
+ * key_2 = value_2
+ */
+ char extras[GPS_NI_LONG_STRING_MAXLEN];
+
+} GpsNiNotification;
+
+/** Callback with NI notification.
+ * Can only be called from a thread created by create_thread_cb.
+ */
+typedef void (*gps_ni_notify_callback)(GpsNiNotification *notification);
+
+/** GPS NI callback structure. */
+typedef struct
+{
+ /**
+ * Sends the notification request from HAL to GPSLocationProvider.
+ */
+ gps_ni_notify_callback notify_cb;
+ gps_create_thread create_thread_cb;
+} GpsNiCallbacks;
+
+/**
+ * Extended interface for Network-initiated (NI) support.
+ */
+typedef struct
+{
+ /** set to sizeof(GpsNiInterface) */
+ size_t size;
+
+ /** Registers the callbacks for HAL to use. */
+ void (*init) (GpsNiCallbacks *callbacks);
+
+ /** Sends a response to HAL. */
+ void (*respond) (int notif_id, GpsUserResponseType user_response);
+} GpsNiInterface;
+
+struct gps_device_t {
+ struct hw_device_t common;
+
+ /**
+ * Set the provided lights to the provided values.
+ *
+ * Returns: 0 on succes, error code on failure.
+ */
+ const GpsInterface* (*get_gps_interface)(struct gps_device_t* dev);
+};
+
+#define AGPS_RIL_REQUEST_SETID_IMSI (1<<0L)
+#define AGPS_RIL_REQUEST_SETID_MSISDN (1<<1L)
+
+#define AGPS_RIL_REQUEST_REFLOC_CELLID (1<<0L)
+#define AGPS_RIL_REQUEST_REFLOC_MAC (1<<1L)
+
+typedef void (*agps_ril_request_set_id)(uint32_t flags);
+typedef void (*agps_ril_request_ref_loc)(uint32_t flags);
+
+typedef struct {
+ agps_ril_request_set_id request_setid;
+ agps_ril_request_ref_loc request_refloc;
+ gps_create_thread create_thread_cb;
+} AGpsRilCallbacks;
+
+/** Extended interface for AGPS_RIL support. */
+typedef struct {
+ /** set to sizeof(AGpsRilInterface) */
+ size_t size;
+ /**
+ * Opens the AGPS interface and provides the callback routines
+ * to the implementation of this interface.
+ */
+ void (*init)( AGpsRilCallbacks* callbacks );
+
+ /**
+ * Sets the reference location.
+ */
+ void (*set_ref_location) (const AGpsRefLocation *agps_reflocation, size_t sz_struct);
+ /**
+ * Sets the set ID.
+ */
+ void (*set_set_id) (AGpsSetIDType type, const char* setid);
+
+ /**
+ * Send network initiated message.
+ */
+ void (*ni_message) (uint8_t *msg, size_t len);
+
+ /**
+ * Notify GPS of network status changes.
+ * These parameters match values in the android.net.NetworkInfo class.
+ */
+ void (*update_network_state) (int connected, int type, int roaming, const char* extra_info);
+
+ /**
+ * Notify GPS of network status changes.
+ * These parameters match values in the android.net.NetworkInfo class.
+ */
+ void (*update_network_availability) (int avaiable, const char* apn);
+} AGpsRilInterface;
+
+/**
+ * GPS Geofence.
+ * There are 3 states associated with a Geofence: Inside, Outside, Unknown.
+ * There are 3 transitions: ENTERED, EXITED, UNCERTAIN.
+ *
+ * An example state diagram with confidence level: 95% and Unknown time limit
+ * set as 30 secs is shown below. (confidence level and Unknown time limit are
+ * explained latter)
+ * ____________________________
+ * | Unknown (30 secs) |
+ * """"""""""""""""""""""""""""
+ * ^ | | ^
+ * UNCERTAIN| |ENTERED EXITED| |UNCERTAIN
+ * | v v |
+ * ________ EXITED _________
+ * | Inside | -----------> | Outside |
+ * | | <----------- | |
+ * """""""" ENTERED """""""""
+ *
+ * Inside state: We are 95% confident that the user is inside the geofence.
+ * Outside state: We are 95% confident that the user is outside the geofence
+ * Unknown state: Rest of the time.
+ *
+ * The Unknown state is better explained with an example:
+ *
+ * __________
+ * | c|
+ * | ___ | _______
+ * | |a| | | b |
+ * | """ | """""""
+ * | |
+ * """"""""""
+ * In the diagram above, "a" and "b" are 2 geofences and "c" is the accuracy
+ * circle reported by the GPS subsystem. Now with regard to "b", the system is
+ * confident that the user is outside. But with regard to "a" is not confident
+ * whether it is inside or outside the geofence. If the accuracy remains the
+ * same for a sufficient period of time, the UNCERTAIN transition would be
+ * triggered with the state set to Unknown. If the accuracy improves later, an
+ * appropriate transition should be triggered. This "sufficient period of time"
+ * is defined by the parameter in the add_geofence_area API.
+ * In other words, Unknown state can be interpreted as a state in which the
+ * GPS subsystem isn't confident enough that the user is either inside or
+ * outside the Geofence. It moves to Unknown state only after the expiry of the
+ * timeout.
+ *
+ * The geofence callback needs to be triggered for the ENTERED and EXITED
+ * transitions, when the GPS system is confident that the user has entered
+ * (Inside state) or exited (Outside state) the Geofence. An implementation
+ * which uses a value of 95% as the confidence is recommended. The callback
+ * should be triggered only for the transitions requested by the
+ * add_geofence_area call.
+ *
+ * Even though the diagram and explanation talks about states and transitions,
+ * the callee is only interested in the transistions. The states are mentioned
+ * here for illustrative purposes.
+ *
+ * Startup Scenario: When the device boots up, if an application adds geofences,
+ * and then we get an accurate GPS location fix, it needs to trigger the
+ * appropriate (ENTERED or EXITED) transition for every Geofence it knows about.
+ * By default, all the Geofences will be in the Unknown state.
+ *
+ * When the GPS system is unavailable, gps_geofence_status_callback should be
+ * called to inform the upper layers of the same. Similarly, when it becomes
+ * available the callback should be called. This is a global state while the
+ * UNKNOWN transition described above is per geofence.
+ *
+ * An important aspect to note is that users of this API (framework), will use
+ * other subsystems like wifi, sensors, cell to handle Unknown case and
+ * hopefully provide a definitive state transition to the third party
+ * application. GPS Geofence will just be a signal indicating what the GPS
+ * subsystem knows about the Geofence.
+ *
+ */
+#define GPS_GEOFENCE_ENTERED (1<<0L)
+#define GPS_GEOFENCE_EXITED (1<<1L)
+#define GPS_GEOFENCE_UNCERTAIN (1<<2L)
+
+#define GPS_GEOFENCE_UNAVAILABLE (1<<0L)
+#define GPS_GEOFENCE_AVAILABLE (1<<1L)
+
+#define GPS_GEOFENCE_OPERATION_SUCCESS 0
+#define GPS_GEOFENCE_ERROR_TOO_MANY_GEOFENCES -100
+#define GPS_GEOFENCE_ERROR_ID_EXISTS -101
+#define GPS_GEOFENCE_ERROR_ID_UNKNOWN -102
+#define GPS_GEOFENCE_ERROR_INVALID_TRANSITION -103
+#define GPS_GEOFENCE_ERROR_GENERIC -149
+
+/**
+ * The callback associated with the geofence.
+ * Parameters:
+ * geofence_id - The id associated with the add_geofence_area.
+ * location - The current GPS location.
+ * transition - Can be one of GPS_GEOFENCE_ENTERED, GPS_GEOFENCE_EXITED,
+ * GPS_GEOFENCE_UNCERTAIN.
+ * timestamp - Timestamp when the transition was detected.
+ *
+ * The callback should only be called when the caller is interested in that
+ * particular transition. For instance, if the caller is interested only in
+ * ENTERED transition, then the callback should NOT be called with the EXITED
+ * transition.
+ *
+ * IMPORTANT: If a transition is triggered resulting in this callback, the GPS
+ * subsystem will wake up the application processor, if its in suspend state.
+ */
+typedef void (*gps_geofence_transition_callback) (int32_t geofence_id, GpsLocation* location,
+ int32_t transition, GpsUtcTime timestamp);
+
+/**
+ * The callback associated with the availability of the GPS system for geofencing
+ * monitoring. If the GPS system determines that it cannot monitor geofences
+ * because of lack of reliability or unavailability of the GPS signals, it will
+ * call this callback with GPS_GEOFENCE_UNAVAILABLE parameter.
+ *
+ * Parameters:
+ * status - GPS_GEOFENCE_UNAVAILABLE or GPS_GEOFENCE_AVAILABLE.
+ * last_location - Last known location.
+ */
+typedef void (*gps_geofence_status_callback) (int32_t status, GpsLocation* last_location);
+
+/**
+ * The callback associated with the add_geofence call.
+ *
+ * Parameter:
+ * geofence_id - Id of the geofence.
+ * status - GPS_GEOFENCE_OPERATION_SUCCESS
+ * GPS_GEOFENCE_ERROR_TOO_MANY_GEOFENCES - geofence limit has been reached.
+ * GPS_GEOFENCE_ERROR_ID_EXISTS - geofence with id already exists
+ * GPS_GEOFENCE_ERROR_INVALID_TRANSITION - the monitorTransition contains an
+ * invalid transition
+ * GPS_GEOFENCE_ERROR_GENERIC - for other errors.
+ */
+typedef void (*gps_geofence_add_callback) (int32_t geofence_id, int32_t status);
+
+/**
+ * The callback associated with the remove_geofence call.
+ *
+ * Parameter:
+ * geofence_id - Id of the geofence.
+ * status - GPS_GEOFENCE_OPERATION_SUCCESS
+ * GPS_GEOFENCE_ERROR_ID_UNKNOWN - for invalid id
+ * GPS_GEOFENCE_ERROR_GENERIC for others.
+ */
+typedef void (*gps_geofence_remove_callback) (int32_t geofence_id, int32_t status);
+
+
+/**
+ * The callback associated with the pause_geofence call.
+ *
+ * Parameter:
+ * geofence_id - Id of the geofence.
+ * status - GPS_GEOFENCE_OPERATION_SUCCESS
+ * GPS_GEOFENCE_ERROR_ID_UNKNOWN - for invalid id
+ * GPS_GEOFENCE_ERROR_INVALID_TRANSITION -
+ * when monitor_transitions is invalid
+ * GPS_GEOFENCE_ERROR_GENERIC for others.
+ */
+typedef void (*gps_geofence_pause_callback) (int32_t geofence_id, int32_t status);
+
+/**
+ * The callback associated with the resume_geofence call.
+ *
+ * Parameter:
+ * geofence_id - Id of the geofence.
+ * status - GPS_GEOFENCE_OPERATION_SUCCESS
+ * GPS_GEOFENCE_ERROR_ID_UNKNOWN - for invalid id
+ * GPS_GEOFENCE_ERROR_GENERIC for others.
+ */
+typedef void (*gps_geofence_resume_callback) (int32_t geofence_id, int32_t status);
+
+typedef struct {
+ gps_geofence_transition_callback geofence_transition_callback;
+ gps_geofence_status_callback geofence_status_callback;
+ gps_geofence_add_callback geofence_add_callback;
+ gps_geofence_remove_callback geofence_remove_callback;
+ gps_geofence_pause_callback geofence_pause_callback;
+ gps_geofence_resume_callback geofence_resume_callback;
+ gps_create_thread create_thread_cb;
+} GpsGeofenceCallbacks;
+
+/** Extended interface for GPS_Geofencing support */
+typedef struct {
+ /** set to sizeof(GpsGeofencingInterface) */
+ size_t size;
+
+ /**
+ * Opens the geofence interface and provides the callback routines
+ * to the implementation of this interface.
+ */
+ void (*init)( GpsGeofenceCallbacks* callbacks );
+
+ /**
+ * Add a geofence area. This api currently supports circular geofences.
+ * Parameters:
+ * geofence_id - The id for the geofence. If a geofence with this id
+ * already exists, an error value (GPS_GEOFENCE_ERROR_ID_EXISTS)
+ * should be returned.
+ * latitude, longtitude, radius_meters - The lat, long and radius
+ * (in meters) for the geofence
+ * last_transition - The current state of the geofence. For example, if
+ * the system already knows that the user is inside the geofence,
+ * this will be set to GPS_GEOFENCE_ENTERED. In most cases, it
+ * will be GPS_GEOFENCE_UNCERTAIN.
+ * monitor_transition - Which transitions to monitor. Bitwise OR of
+ * GPS_GEOFENCE_ENTERED, GPS_GEOFENCE_EXITED and
+ * GPS_GEOFENCE_UNCERTAIN.
+ * notification_responsiveness_ms - Defines the best-effort description
+ * of how soon should the callback be called when the transition
+ * associated with the Geofence is triggered. For instance, if set
+ * to 1000 millseconds with GPS_GEOFENCE_ENTERED, the callback
+ * should be called 1000 milliseconds within entering the geofence.
+ * This parameter is defined in milliseconds.
+ * NOTE: This is not to be confused with the rate that the GPS is
+ * polled at. It is acceptable to dynamically vary the rate of
+ * sampling the GPS for power-saving reasons; thus the rate of
+ * sampling may be faster or slower than this.
+ * unknown_timer_ms - The time limit after which the UNCERTAIN transition
+ * should be triggered. This parameter is defined in milliseconds.
+ * See above for a detailed explanation.
+ */
+ void (*add_geofence_area) (int32_t geofence_id, double latitude, double longitude,
+ double radius_meters, int last_transition, int monitor_transitions,
+ int notification_responsiveness_ms, int unknown_timer_ms);
+
+ /**
+ * Pause monitoring a particular geofence.
+ * Parameters:
+ * geofence_id - The id for the geofence.
+ */
+ void (*pause_geofence) (int32_t geofence_id);
+
+ /**
+ * Resume monitoring a particular geofence.
+ * Parameters:
+ * geofence_id - The id for the geofence.
+ * monitor_transitions - Which transitions to monitor. Bitwise OR of
+ * GPS_GEOFENCE_ENTERED, GPS_GEOFENCE_EXITED and
+ * GPS_GEOFENCE_UNCERTAIN.
+ * This supersedes the value associated provided in the
+ * add_geofence_area call.
+ */
+ void (*resume_geofence) (int32_t geofence_id, int monitor_transitions);
+
+ /**
+ * Remove a geofence area. After the function returns, no notifications
+ * should be sent.
+ * Parameter:
+ * geofence_id - The id for the geofence.
+ */
+ void (*remove_geofence_area) (int32_t geofence_id);
+} GpsGeofencingInterface;
+
+
+/**
+ * Represents an estimate of the GPS clock time.
+ */
+typedef struct {
+ /** set to sizeof(GpsClock) */
+ size_t size;
+
+ /** A set of flags indicating the validity of the fields in this data structure. */
+ GpsClockFlags flags;
+
+ /**
+ * Leap second data.
+ * The sign of the value is defined by the following equation:
+ * utc_time_ns = time_ns + (full_bias_ns + bias_ns) - leap_second * 1,000,000,000
+ *
+ * If the data is available 'flags' must contain GPS_CLOCK_HAS_LEAP_SECOND.
+ */
+ int16_t leap_second;
+
+ /**
+ * Indicates the type of time reported by the 'time_ns' field.
+ * This is a Mandatory field.
+ */
+ GpsClockType type;
+
+ /**
+ * The GPS receiver internal clock value. This can be either the local hardware clock value
+ * (GPS_CLOCK_TYPE_LOCAL_HW_TIME), or the current GPS time derived inside GPS receiver
+ * (GPS_CLOCK_TYPE_GPS_TIME). The field 'type' defines the time reported.
+ *
+ * For local hardware clock, this value is expected to be monotonically increasing during
+ * the reporting session. The real GPS time can be derived by compensating the 'full bias'
+ * (when it is available) from this value.
+ *
+ * For GPS time, this value is expected to be the best estimation of current GPS time that GPS
+ * receiver can achieve. Set the 'time uncertainty' appropriately when GPS time is specified.
+ *
+ * Sub-nanosecond accuracy can be provided by means of the 'bias' field.
+ * The value contains the 'time uncertainty' in it.
+ *
+ * This is a Mandatory field.
+ */
+ int64_t time_ns;
+
+ /**
+ * 1-Sigma uncertainty associated with the clock's time in nanoseconds.
+ * The uncertainty is represented as an absolute (single sided) value.
+ *
+ * This value should be set if GPS_CLOCK_TYPE_GPS_TIME is set.
+ * If the data is available 'flags' must contain GPS_CLOCK_HAS_TIME_UNCERTAINTY.
+ */
+ double time_uncertainty_ns;
+
+ /**
+ * The difference between hardware clock ('time' field) inside GPS receiver and the true GPS
+ * time since 0000Z, January 6, 1980, in nanoseconds.
+ * This value is used if and only if GPS_CLOCK_TYPE_LOCAL_HW_TIME is set, and GPS receiver
+ * has solved the clock for GPS time.
+ * The caller is responsible for using the 'bias uncertainty' field for quality check.
+ *
+ * The sign of the value is defined by the following equation:
+ * true time (GPS time) = time_ns + (full_bias_ns + bias_ns)
+ *
+ * This value contains the 'bias uncertainty' in it.
+ * If the data is available 'flags' must contain GPS_CLOCK_HAS_FULL_BIAS.
+
+ */
+ int64_t full_bias_ns;
+
+ /**
+ * Sub-nanosecond bias.
+ * The value contains the 'bias uncertainty' in it.
+ *
+ * If the data is available 'flags' must contain GPS_CLOCK_HAS_BIAS.
+ */
+ double bias_ns;
+
+ /**
+ * 1-Sigma uncertainty associated with the clock's bias in nanoseconds.
+ * The uncertainty is represented as an absolute (single sided) value.
+ *
+ * If the data is available 'flags' must contain GPS_CLOCK_HAS_BIAS_UNCERTAINTY.
+ */
+ double bias_uncertainty_ns;
+
+ /**
+ * The clock's drift in nanoseconds (per second).
+ * A positive value means that the frequency is higher than the nominal frequency.
+ *
+ * The value contains the 'drift uncertainty' in it.
+ * If the data is available 'flags' must contain GPS_CLOCK_HAS_DRIFT.
+ */
+ double drift_nsps;
+
+ /**
+ * 1-Sigma uncertainty associated with the clock's drift in nanoseconds (per second).
+ * The uncertainty is represented as an absolute (single sided) value.
+ *
+ * If the data is available 'flags' must contain GPS_CLOCK_HAS_DRIFT_UNCERTAINTY.
+ */
+ double drift_uncertainty_nsps;
+} GpsClock;
+
+/**
+ * Represents a GPS Measurement, it contains raw and computed information.
+ */
+typedef struct {
+ /** set to sizeof(GpsMeasurement) */
+ size_t size;
+
+ /** A set of flags indicating the validity of the fields in this data structure. */
+ GpsMeasurementFlags flags;
+
+ /**
+ * Pseudo-random number in the range of [1, 32]
+ * This is a Mandatory value.
+ */
+ int8_t prn;
+
+ /**
+ * Time offset at which the measurement was taken in nanoseconds.
+ * The reference receiver's time is specified by GpsData::clock::time_ns and should be
+ * interpreted in the same way as indicated by GpsClock::type.
+ *
+ * The sign of time_offset_ns is given by the following equation:
+ * measurement time = GpsClock::time_ns + time_offset_ns
+ *
+ * It provides an individual time-stamp for the measurement, and allows sub-nanosecond accuracy.
+ * This is a Mandatory value.
+ */
+ double time_offset_ns;
+
+ /**
+ * Per satellite sync state. It represents the current sync state for the associated satellite.
+ * Based on the sync state, the 'received GPS tow' field should be interpreted accordingly.
+ *
+ * This is a Mandatory value.
+ */
+ GpsMeasurementState state;
+
+ /**
+ * Received GPS Time-of-Week at the measurement time, in nanoseconds.
+ * The value is relative to the beginning of the current GPS week.
+ *
+ * Given the highest sync state that can be achieved, per each satellite, valid range for
+ * this field can be:
+ * Searching : [ 0 ] : GPS_MEASUREMENT_STATE_UNKNOWN
+ * C/A code lock : [ 0 1ms ] : GPS_MEASUREMENT_STATE_CODE_LOCK is set
+ * Bit sync : [ 0 20ms ] : GPS_MEASUREMENT_STATE_BIT_SYNC is set
+ * Subframe sync : [ 0 6s ] : GPS_MEASUREMENT_STATE_SUBFRAME_SYNC is set
+ * TOW decoded : [ 0 1week ] : GPS_MEASUREMENT_STATE_TOW_DECODED is set
+ *
+ * However, if there is any ambiguity in integer millisecond,
+ * GPS_MEASUREMENT_STATE_MSEC_AMBIGUOUS should be set accordingly, in the 'state' field.
+ */
+ int64_t received_gps_tow_ns;
+
+ /**
+ * 1-Sigma uncertainty of the Received GPS Time-of-Week in nanoseconds.
+ */
+ int64_t received_gps_tow_uncertainty_ns;
+
+ /**
+ * Carrier-to-noise density in dB-Hz, in the range [0, 63].
+ * It contains the measured C/N0 value for the signal at the antenna input.
+ *
+ * This is a Mandatory value.
+ */
+ double c_n0_dbhz;
+
+ /**
+ * Pseudorange rate at the timestamp in m/s.
+ * The value also includes the effects of the receiver clock frequency and satellite clock
+ * frequency errors.
+ *
+ * The value includes the 'pseudorange rate uncertainty' in it.
+ * A positive value indicates that the pseudorange is getting larger.
+ *
+ * This is a Mandatory value.
+ */
+ double pseudorange_rate_mps;
+
+ /**
+ * 1-Sigma uncertainty of the pseudurange rate in m/s.
+ * The uncertainty is represented as an absolute (single sided) value.
+ *
+ * This is a Mandatory value.
+ */
+ double pseudorange_rate_uncertainty_mps;
+
+ /**
+ * Accumulated delta range's state. It indicates whether ADR is reset or there is a cycle slip
+ * (indicating loss of lock).
+ *
+ * This is a Mandatory value.
+ */
+ GpsAccumulatedDeltaRangeState accumulated_delta_range_state;
+
+ /**
+ * Accumulated delta range since the last channel reset in meters.
+ * The data is available if 'accumulated delta range state' != GPS_ADR_STATE_UNKNOWN.
+ */
+ double accumulated_delta_range_m;
+
+ /**
+ * 1-Sigma uncertainty of the accumulated delta range in meters.
+ * The data is available if 'accumulated delta range state' != GPS_ADR_STATE_UNKNOWN.
+ */
+ double accumulated_delta_range_uncertainty_m;
+
+ /**
+ * Best derived Pseudorange by the chip-set, in meters.
+ * The value contains the 'pseudorange uncertainty' in it.
+ *
+ * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_PSEUDORANGE.
+ */
+ double pseudorange_m;
+
+ /**
+ * 1-Sigma uncertainty of the pseudorange in meters.
+ * The value contains the 'pseudorange' and 'clock' uncertainty in it.
+ * The uncertainty is represented as an absolute (single sided) value.
+ *
+ * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_PSEUDORANGE_UNCERTAINTY.
+ */
+ double pseudorange_uncertainty_m;
+
+ /**
+ * A fraction of the current C/A code cycle, in the range [0.0, 1023.0]
+ * This value contains the time (in Chip units) since the last C/A code cycle (GPS Msec epoch).
+ *
+ * The reference frequency is given by the field 'carrier_frequency_hz'.
+ * The value contains the 'code-phase uncertainty' in it.
+ *
+ * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_CODE_PHASE.
+ */
+ double code_phase_chips;
+
+ /**
+ * 1-Sigma uncertainty of the code-phase, in a fraction of chips.
+ * The uncertainty is represented as an absolute (single sided) value.
+ *
+ * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_CODE_PHASE_UNCERTAINTY.
+ */
+ double code_phase_uncertainty_chips;
+
+ /**
+ * Carrier frequency at which codes and messages are modulated, it can be L1 or L2.
+ * If the field is not set, the carrier frequency is assumed to be L1.
+ *
+ * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_CARRIER_FREQUENCY.
+ */
+ float carrier_frequency_hz;
+
+ /**
+ * The number of full carrier cycles between the satellite and the receiver.
+ * The reference frequency is given by the field 'carrier_frequency_hz'.
+ *
+ * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_CARRIER_CYCLES.
+ */
+ int64_t carrier_cycles;
+
+ /**
+ * The RF phase detected by the receiver, in the range [0.0, 1.0].
+ * This is usually the fractional part of the complete carrier phase measurement.
+ *
+ * The reference frequency is given by the field 'carrier_frequency_hz'.
+ * The value contains the 'carrier-phase uncertainty' in it.
+ *
+ * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_CARRIER_PHASE.
+ */
+ double carrier_phase;
+
+ /**
+ * 1-Sigma uncertainty of the carrier-phase.
+ * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_CARRIER_PHASE_UNCERTAINTY.
+ */
+ double carrier_phase_uncertainty;
+
+ /**
+ * An enumeration that indicates the 'loss of lock' state of the event.
+ */
+ GpsLossOfLock loss_of_lock;
+
+ /**
+ * The number of GPS bits transmitted since Sat-Sun midnight (GPS week).
+ * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_BIT_NUMBER.
+ */
+ int32_t bit_number;
+
+ /**
+ * The elapsed time since the last received bit in milliseconds, in the range [0, 20]
+ * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_TIME_FROM_LAST_BIT.
+ */
+ int16_t time_from_last_bit_ms;
+
+ /**
+ * Doppler shift in Hz.
+ * A positive value indicates that the SV is moving toward the receiver.
+ *
+ * The reference frequency is given by the field 'carrier_frequency_hz'.
+ * The value contains the 'doppler shift uncertainty' in it.
+ *
+ * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_DOPPLER_SHIFT.
+ */
+ double doppler_shift_hz;
+
+ /**
+ * 1-Sigma uncertainty of the doppler shift in Hz.
+ * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_DOPPLER_SHIFT_UNCERTAINTY.
+ */
+ double doppler_shift_uncertainty_hz;
+
+ /**
+ * An enumeration that indicates the 'multipath' state of the event.
+ */
+ GpsMultipathIndicator multipath_indicator;
+
+ /**
+ * Signal-to-noise ratio in dB.
+ * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_SNR.
+ */
+ double snr_db;
+
+ /**
+ * Elevation in degrees, the valid range is [-90, 90].
+ * The value contains the 'elevation uncertainty' in it.
+ * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_ELEVATION.
+ */
+ double elevation_deg;
+
+ /**
+ * 1-Sigma uncertainty of the elevation in degrees, the valid range is [0, 90].
+ * The uncertainty is represented as the absolute (single sided) value.
+ *
+ * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_ELEVATION_UNCERTAINTY.
+ */
+ double elevation_uncertainty_deg;
+
+ /**
+ * Azimuth in degrees, in the range [0, 360).
+ * The value contains the 'azimuth uncertainty' in it.
+ * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_AZIMUTH.
+ * */
+ double azimuth_deg;
+
+ /**
+ * 1-Sigma uncertainty of the azimuth in degrees, the valid range is [0, 180].
+ * The uncertainty is represented as an absolute (single sided) value.
+ *
+ * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_AZIMUTH_UNCERTAINTY.
+ */
+ double azimuth_uncertainty_deg;
+
+ /**
+ * Whether the GPS represented by the measurement was used for computing the most recent fix.
+ * If the data is available, 'flags' must contain GPS_MEASUREMENT_HAS_USED_IN_FIX.
+ */
+ bool used_in_fix;
+} GpsMeasurement;
+
+/** Represents a reading of GPS measurements. */
+typedef struct {
+ /** set to sizeof(GpsData) */
+ size_t size;
+
+ /** Number of measurements. */
+ size_t measurement_count;
+
+ /** The array of measurements. */
+ GpsMeasurement measurements[GPS_MAX_MEASUREMENT];
+
+ /** The GPS clock time reading. */
+ GpsClock clock;
+} GpsData;
+
+/**
+ * The callback for to report measurements from the HAL.
+ *
+ * Parameters:
+ * data - A data structure containing the measurements.
+ */
+typedef void (*gps_measurement_callback) (GpsData* data);
+
+typedef struct {
+ /** set to sizeof(GpsMeasurementCallbacks) */
+ size_t size;
+ gps_measurement_callback measurement_callback;
+} GpsMeasurementCallbacks;
+
+#define GPS_MEASUREMENT_OPERATION_SUCCESS 0
+#define GPS_MEASUREMENT_ERROR_ALREADY_INIT -100
+#define GPS_MEASUREMENT_ERROR_GENERIC -101
+
+/**
+ * Extended interface for GPS Measurements support.
+ */
+typedef struct {
+ /** Set to sizeof(GpsMeasurementInterface) */
+ size_t size;
+
+ /**
+ * Initializes the interface and registers the callback routines with the HAL.
+ * After a successful call to 'init' the HAL must begin to provide updates at its own phase.
+ *
+ * Status:
+ * GPS_MEASUREMENT_OPERATION_SUCCESS
+ * GPS_MEASUREMENT_ERROR_ALREADY_INIT - if a callback has already been registered without a
+ * corresponding call to 'close'
+ * GPS_MEASUREMENT_ERROR_GENERIC - if any other error occurred, it is expected that the HAL
+ * will not generate any updates upon returning this error code.
+ */
+ int (*init) (GpsMeasurementCallbacks* callbacks);
+
+ /**
+ * Stops updates from the HAL, and unregisters the callback routines.
+ * After a call to stop, the previously registered callbacks must be considered invalid by the
+ * HAL.
+ * If stop is invoked without a previous 'init', this function should perform no work.
+ */
+ void (*close) ();
+
+} GpsMeasurementInterface;
+
+
+/** Represents a GPS navigation message (or a fragment of it). */
+typedef struct {
+ /** set to sizeof(GpsNavigationMessage) */
+ size_t size;
+
+ /**
+ * Pseudo-random number in the range of [1, 32]
+ * This is a Mandatory value.
+ */
+ int8_t prn;
+
+ /**
+ * The type of message contained in the structure.
+ * This is a Mandatory value.
+ */
+ GpsNavigationMessageType type;
+
+ /**
+ * The status of the received navigation message.
+ * No need to send any navigation message that contains words with parity error and cannot be
+ * corrected.
+ */
+ NavigationMessageStatus status;
+
+ /**
+ * Message identifier.
+ * It provides an index so the complete Navigation Message can be assembled. i.e. fo L1 C/A
+ * subframe 4 and 5, this value corresponds to the 'frame id' of the navigation message.
+ * Subframe 1, 2, 3 does not contain a 'frame id' and this value can be set to -1.
+ */
+ int16_t message_id;
+
+ /**
+ * Sub-message identifier.
+ * If required by the message 'type', this value contains a sub-index within the current
+ * message (or frame) that is being transmitted.
+ * i.e. for L1 C/A the submessage id corresponds to the sub-frame id of the navigation message.
+ */
+ int16_t submessage_id;
+
+ /**
+ * The length of the data (in bytes) contained in the current message.
+ * If this value is different from zero, 'data' must point to an array of the same size.
+ * e.g. for L1 C/A the size of the sub-frame will be 40 bytes (10 words, 30 bits/word).
+ *
+ * This is a Mandatory value.
+ */
+ size_t data_length;
+
+ /**
+ * The data of the reported GPS message.
+ * The bytes (or words) specified using big endian format (MSB first).
+ *
+ * For L1 C/A, each subframe contains 10 30-bit GPS words. Each GPS word (30 bits) should be
+ * fitted into the last 30 bits in a 4-byte word (skip B31 and B32), with MSB first.
+ */
+ uint8_t* data;
+
+} GpsNavigationMessage;
+
+/**
+ * The callback to report an available fragment of a GPS navigation messages from the HAL.
+ *
+ * Parameters:
+ * message - The GPS navigation submessage/subframe representation.
+ */
+typedef void (*gps_navigation_message_callback) (GpsNavigationMessage* message);
+
+typedef struct {
+ /** set to sizeof(GpsNavigationMessageCallbacks) */
+ size_t size;
+ gps_navigation_message_callback navigation_message_callback;
+} GpsNavigationMessageCallbacks;
+
+#define GPS_NAVIGATION_MESSAGE_OPERATION_SUCCESS 0
+#define GPS_NAVIGATION_MESSAGE_ERROR_ALREADY_INIT -100
+#define GPS_NAVIGATION_MESSAGE_ERROR_GENERIC -101
+
+/**
+ * Extended interface for GPS navigation message reporting support.
+ */
+typedef struct {
+ /** Set to sizeof(GpsNavigationMessageInterface) */
+ size_t size;
+
+ /**
+ * Initializes the interface and registers the callback routines with the HAL.
+ * After a successful call to 'init' the HAL must begin to provide updates as they become
+ * available.
+ *
+ * Status:
+ * GPS_NAVIGATION_MESSAGE_OPERATION_SUCCESS
+ * GPS_NAVIGATION_MESSAGE_ERROR_ALREADY_INIT - if a callback has already been registered
+ * without a corresponding call to 'close'.
+ * GPS_NAVIGATION_MESSAGE_ERROR_GENERIC - if any other error occurred, it is expected that
+ * the HAL will not generate any updates upon returning this error code.
+ */
+ int (*init) (GpsNavigationMessageCallbacks* callbacks);
+
+ /**
+ * Stops updates from the HAL, and unregisters the callback routines.
+ * After a call to stop, the previously registered callbacks must be considered invalid by the
+ * HAL.
+ * If stop is invoked without a previous 'init', this function should perform no work.
+ */
+ void (*close) ();
+
+} GpsNavigationMessageInterface;
+
+/**
+ * Interface for passing GNSS configuration contents from platform to HAL.
+ */
+typedef struct {
+ /** Set to sizeof(GnssConfigurationInterface) */
+ size_t size;
+
+ /**
+ * Deliver GNSS configuration contents to HAL.
+ * Parameters:
+ * config_data - a pointer to a char array which holds what usually is expected from
+ file(/etc/gps.conf), i.e., a sequence of UTF8 strings separated by '\n'.
+ * length - total number of UTF8 characters in configuraiton data.
+ *
+ * IMPORTANT:
+ * GPS HAL should expect this function can be called multiple times. And it may be
+ * called even when GpsLocationProvider is already constructed and enabled. GPS HAL
+ * should maintain the existing requests for various callback regardless the change
+ * in configuration data.
+ */
+ void (*configuration_update) (const char* config_data, int32_t length);
+} GnssConfigurationInterface;
+
+__END_DECLS
+
+#endif /* ANDROID_INCLUDE_HARDWARE_GPS_H */
+
diff --git a/include/hardware/include/gralloc_mtk_defs.h b/include/hardware/include/gralloc_mtk_defs.h
new file mode 100644
index 0000000..602bec0
--- /dev/null
+++ b/include/hardware/include/gralloc_mtk_defs.h
@@ -0,0 +1,94 @@
+#ifndef __GRALLOC_MTK_DEFS_H__
+#define __GRALLOC_MTK_DEFS_H__
+
+#include <stdint.h>
+#include <hardware/gralloc.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ [Important]
+ Define the MTK specific enumeration values for gralloc usage in order to avoid "polute" AOSP file
+ (hardware/libhardware/include/hardware/gralloc.h)
+ The enumeration value definition must not be conflict with the gralloc.h in original AOSP file
+*/
+enum {
+
+#if 0
+ /* buffer is never read in software */
+ GRALLOC_USAGE_SW_READ_NEVER = 0x00000000,
+ /* buffer is rarely read in software */
+ GRALLOC_USAGE_SW_READ_RARELY = 0x00000002,
+ /* buffer is often read in software */
+ GRALLOC_USAGE_SW_READ_OFTEN = 0x00000003,
+ /* mask for the software read values */
+ GRALLOC_USAGE_SW_READ_MASK = 0x0000000F,
+
+ /* buffer is never written in software */
+ GRALLOC_USAGE_SW_WRITE_NEVER = 0x00000000,
+ /* buffer is rarely written in software */
+ GRALLOC_USAGE_SW_WRITE_RARELY = 0x00000020,
+ /* buffer is often written in software */
+ GRALLOC_USAGE_SW_WRITE_OFTEN = 0x00000030,
+ /* mask for the software write values */
+ GRALLOC_USAGE_SW_WRITE_MASK = 0x000000F0,
+
+ /* buffer will be used as an OpenGL ES texture */
+ GRALLOC_USAGE_HW_TEXTURE = 0x00000100,
+ /* buffer will be used as an OpenGL ES render target */
+ GRALLOC_USAGE_HW_RENDER = 0x00000200,
+ /* buffer will be used by the 2D hardware blitter */
+ GRALLOC_USAGE_HW_2D = 0x00000400,
+ /* buffer will be used by the HWComposer HAL module */
+ GRALLOC_USAGE_HW_COMPOSER = 0x00000800,
+ /* buffer will be used with the framebuffer device */
+ GRALLOC_USAGE_HW_FB = 0x00001000,
+ /* buffer will be used with the HW video encoder */
+ GRALLOC_USAGE_HW_VIDEO_ENCODER = 0x00010000,
+ /* buffer will be written by the HW camera pipeline */
+ GRALLOC_USAGE_HW_CAMERA_WRITE = 0x00020000,
+ /* buffer will be read by the HW camera pipeline */
+ GRALLOC_USAGE_HW_CAMERA_READ = 0x00040000,
+ /* buffer will be used as part of zero-shutter-lag queue */
+ GRALLOC_USAGE_HW_CAMERA_ZSL = 0x00060000,
+ /* mask for the camera access values */
+ GRALLOC_USAGE_HW_CAMERA_MASK = 0x00060000,
+ /* mask for the software usage bit-mask */
+ GRALLOC_USAGE_HW_MASK = 0x00071F00,
+
+ /* buffer will be used as a RenderScript Allocation */
+ GRALLOC_USAGE_RENDERSCRIPT = 0x00100000,
+
+ /* buffer should be displayed full-screen on an external display when
+ * possible
+ */
+ GRALLOC_USAGE_EXTERNAL_DISP = 0x00002000,
+
+ /* Must have a hardware-protected path to external display sink for
+ * this buffer. If a hardware-protected path is not available, then
+ * either don't composite only this buffer (preferred) to the
+ * external sink, or (less desirable) do not route the entire
+ * composition to the external sink.
+ */
+ GRALLOC_USAGE_PROTECTED = 0x00004000,
+
+ /* implementation-specific private usage flags */
+ GRALLOC_USAGE_PRIVATE_0 = 0x10000000,
+ GRALLOC_USAGE_PRIVATE_1 = 0x20000000,
+ GRALLOC_USAGE_PRIVATE_2 = 0x40000000,
+ GRALLOC_USAGE_PRIVATE_3 = 0x80000000,
+ GRALLOC_USAGE_PRIVATE_MASK = 0xF0000000,
+#endif /// #if 0
+
+ /// the following define the extended gralloc enumeration value of
+ GRALLOC_USAGE_NULL_BUFFER = GRALLOC_USAGE_PRIVATE_3,
+ GRALLOC_USAGE_SECURE = 0x01000000,
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __GRALLOC_MTK_DEFS_H__ */
diff --git a/include/hardware/include/graphics_mtk_defs.h b/include/hardware/include/graphics_mtk_defs.h
new file mode 100644
index 0000000..2a323a0
--- /dev/null
+++ b/include/hardware/include/graphics_mtk_defs.h
@@ -0,0 +1,53 @@
+#ifndef __GRAPHICS_MTK_DEFS_H__
+#define __GRAPHICS_MTK_DEFS_H__
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ [Important]
+ Define the OMX MTK specific enum values in order to avoid "polute" AOSP files(system/core/graphics.h)
+ The format enum value definition must be align to the enum value in the following file
+ frameworks\av\media\libstagefright\include\omx_core\OMX_IVCommon.h
+*/
+#define OMX_COLOR_FormatVendorMTKYUV 0x7F000001
+#define OMX_COLOR_FormatVendorMTKYUV_FCM 0x7F000002
+
+/**
+ * MTK pixel format definitions
+ */
+enum {
+#ifndef MTK_BUILD_IMG_DDK
+ HAL_PIXEL_FORMAT_BGRX_8888 = 0xFFFF0002,
+#endif
+
+ HAL_PIXEL_FORMAT_I420 = 0x32315659 + 0x10, /// MTK I420
+ HAL_PIXEL_FORMAT_YUV_PRIVATE = 0x32315659 + 0x20, /// I420 or NV12_BLK or NV12_BLK_FCM
+
+ HAL_PIXEL_FORMAT_NV12_BLK = OMX_COLOR_FormatVendorMTKYUV, /// MTK NV12 block progressive mode
+ HAL_PIXEL_FORMAT_NV12_BLK_FCM = OMX_COLOR_FormatVendorMTKYUV_FCM, /// MTK NV12 block field mode
+
+/**
+ * IMG Driver use 0x1X0-0x1X6 as they "vendor formats"
+ */
+ HAL_PIXEL_FORMAT_IMG0 = 0x00000100,
+ HAL_PIXEL_FORMAT_IMG1_BGRX_8888 = 0x00000101,
+ HAL_PIXEL_FORMAT_IMG2 = 0x00000102,
+ HAL_PIXEL_FORMAT_IMG3 = 0x00000103,
+ HAL_PIXEL_FORMAT_IMG4 = 0x00000105,
+ HAL_PIXEL_FORMAT_IMG5 = 0x00000106,
+
+ HAL_PIXEL_FORMAT_YUYV = 0x0000010c, /// for HWC output (bpp=2)
+ HAL_PIXEL_FORMAT_I420_DI = 0x0000010d, /// MTK I420 for deinterlace
+ HAL_PIXEL_FORMAT_YV12_DI = 0x0000010e, /// MTK YV12 for deinterlace
+ HAL_PIXEL_FORMAT_UFO = 0x0000010f, /// MTK UFO
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __GRAPHICS_MTK_DEFS_H__ */
diff --git a/include/hardware/include/hwc_priv.h b/include/hardware/include/hwc_priv.h
new file mode 100644
index 0000000..9c3492d
--- /dev/null
+++ b/include/hardware/include/hwc_priv.h
@@ -0,0 +1,100 @@
+#ifndef MTK_HWC_PRIV_H
+#define MTK_HWC_PRIV_H
+
+#include <hardware/hwcomposer.h>
+
+__BEGIN_DECLS
+
+/*****************************************************************************/
+
+typedef struct hwc_feature {
+ int externals;
+ int virtuals;
+ int enhance;
+ int copyvds;
+ int svp;
+ int phy_rotation_180;
+ int rotation_offset;
+} hwc_feature_t;
+
+enum {
+ // Availability: MTK specific
+ // Returns MTK platform features
+ HWC_FEATURES_STATE = 100,
+
+ HWC_NUM_EXTRA_BUFFER = 101,
+};
+
+/*
+ * hwc_layer_t::hints values extension
+ * Need to check if these values are conflict to original AOSP
+ */
+enum {
+ /*
+ * HWC sets HWC_HINT_SECURE_COMP to tell SurfaceFlinger that
+ * this layer is handled by HWC with secure buffer
+ */
+ HWC_HINT_SECURE_COMP = 0x10000000,
+};
+
+/*
+ * hwc_layer_1_t::flags values extension
+ * Need to check if these values are conflict to original AOSP
+ */
+enum {
+ /* HWC_SECURE_LAYER is set by SurfaceFlinger to indicat that the HAL
+ * this layer is secure
+ */
+ HWC_SECURE_LAYER = 0x80000000,
+
+ /*
+ * HWC_DIRTY_LAYER is set by SurfaceFlinger to indicate that the HAL
+ * this layer has updated content.
+ */
+ HWC_DIRTY_LAYER = 0x20000000,
+
+ /*
+ * HWC_DIM_LAYER is set by SurfaceFlinger to indicate that the HAL
+ * this layer is dim
+ */
+ HWC_DIM_LAYER = 0x40000000,
+};
+
+/*
+ * hwc_display_contents_1_t::flags values extension
+ * Need to check if these values are conflict to original AOSP
+ */
+enum {
+ HWC_MIRROR_DISPLAY = 0x20000000,
+
+ // HWC_SKIP_DISPLAY is set by SurfaceFlinger to indicate that
+ // the composition can be skipped this time
+ HWC_SKIP_DISPLAY = 0x40000000,
+
+ // HWC_MIRRORED_DISP_MASK is using second byte for checking mirror display
+ HWC_MIRRORED_DISP_MASK = 0x0000FF00,
+
+ // HWC_ORIENTATION_MASK is using third byte for external orientation
+ // Added for HWC_DEVICE_API_VERSION_1_0
+ HWC_ORIENTATION_MASK = 0x00FF0000,
+};
+
+/* more display attributes returned by getDisplayAttributes() */
+enum {
+ HWC_DISPLAY_SUBTYPE = 6,
+};
+
+/* Display subtypes */
+enum {
+ HWC_DISPLAY_LCM = 0,
+ HWC_DISPLAY_HDMI_MHL = 1,
+ HWC_DISPLAY_SMARTBOOK = 2,
+ HWC_DISPLAY_MEMORY = 3,
+ HWC_DISPLAY_WIRELESS = 4,
+};
+
+/*****************************************************************************/
+
+__END_DECLS
+
+#endif /* MTK_HWC_PRIV_H */
diff --git a/include/hardware/include/mmsdk/effect_device.h b/include/hardware/include/mmsdk/effect_device.h
new file mode 100644
index 0000000..5ddea63
--- /dev/null
+++ b/include/hardware/include/mmsdk/effect_device.h
@@ -0,0 +1,115 @@
+/*
+ * Copyright (C) 2010-2011 The Android Open Source Project
+ *
+ * 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 _MTK_HARDWARE_INCLUDE_MMSDK_DEVICE_EFFECT_H_
+#define _MTK_HARDWARE_INCLUDE_MMSDK_DEVICE_EFFECT_H_
+
+#include "mmsdk_common.h"
+
+/**
+ * Effect device HAL, initial version [ EFFECT_DEVICE_API_VERSION_1_0 ]
+ *
+ */
+#define EFFECT_DEVICE_API_VERSION_1_0 HARDWARE_DEVICE_API_VERSION(1, 0)
+//
+#define EFFECT_DEVICE_API_VERSION_CURRENT EFFECT_DEVICE_API_VERSION_1_0
+
+__BEGIN_DECLS
+
+
+struct effect_device;
+
+/*
+ *
+ */
+enum eEFFECT_MODE
+{
+ EFFECT_MODE_VIDEO,
+ EFFECT_MODE_STILL
+};
+
+
+/*
+ * face beauty parameter
+ */
+#define FACE_EFFECT_SMOOTH_LEVEL "SMOOTH_LEVEL"
+#define FACE_EFFECT_SKIN_COLOR "SKIN_COLOR_LEVEL"
+#define FACE_EFFECT_ENLARGE_EYE_LEVEL "ENLARGE_EYE_LEVEL"
+#define FACE_EFFECT_SLIM_FACE_LEVEL "SLIM_FACE_LEVEL"
+#define FACE_EFFECT_MODE "EFFECT_MODE"
+
+/*
+ *
+ */
+typedef struct effect_device_ops {
+ /**
+ * set_parameters
+ *
+ */
+ bool (*create_effect)(struct effect_device *,
+ char const* effect_name,
+ eEFFECT_MODE eMode,
+ void *cookie
+ );
+
+ /*
+ * get the effect name
+ */
+ char *(*get_effect_name)(struct effect_device *, void *cookie);
+
+ /*
+ * set the parameter
+ *
+ */
+ bool (*set_parameters)(struct effect_device *,
+ const char *param,
+ const void *value,
+ void *cookie
+ );
+
+ /**
+ * applyTransform
+ * apply the transform from source iamge to target image by the options
+ */
+ bool (*apply)(struct effect_device *,
+ NSCam::IImageBuffer const *srcImage,
+ NSCam::IImageBuffer const *destImage,
+ void *cookie
+ );
+
+
+ /**
+ * release the hardware resource owned by this object.
+ *
+ */
+ bool (*release)(struct effect_device*, void *cookie);
+
+} effect_device_ops_t;
+
+typedef struct effect_device {
+ /**
+ * effect_device.common.version must be in the range
+ * HARDWARE_DEVICE_API_VERSION(0,0)-(1,FF). EFFECT_DEVICE_API_VERSION_1_0 is
+ * recommended.
+ */
+ hw_device_t common;
+ effect_device_ops_t *ops;
+ void *priv;
+} effect_device_t;
+
+__END_DECLS
+
+#endif /* #ifdef _MTK_HARDWARE_INCLUDE_MMSDK_DEVICE_EFFECT_H_ */
diff --git a/include/hardware/include/mmsdk/gesture_device.h b/include/hardware/include/mmsdk/gesture_device.h
new file mode 100644
index 0000000..8d1c23a
--- /dev/null
+++ b/include/hardware/include/mmsdk/gesture_device.h
@@ -0,0 +1,130 @@
+/*
+ * Copyright (C) 2010-2011 The Android Open Source Project
+ *
+ * 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 _MTK_HARDWARE_INCLUDE_MMSDK_DEVICE_GESTURE_H_
+#define _MTK_HARDWARE_INCLUDE_MMSDK_DEVICE_GESTURE_H_
+
+#include "mmsdk_common.h"
+
+/**
+ * Gesture device HAL, initial version [ GESTURE_DEVICE_API_VERSION_1_0 ]
+ *
+ */
+#define GESTURE_DEVICE_API_VERSION_1_0 HARDWARE_DEVICE_API_VERSION(1, 0)
+
+//
+#define GESTURE_DEVICE_API_VERSION_CURRENT GESTURE_DEVICE_API_VERSION_1_0
+
+
+__BEGIN_DECLS
+
+
+struct gesture_device;
+
+/*
+ * HAND pose
+ *
+ */
+enum eHAHND_POSE
+{
+ HAND_POSE_OPEN = 0x00000000,
+ HAND_POSE_VICTORY = 0x00000001,
+};
+
+/*
+ * HAND detection mode
+ *
+ */
+enum eGESTURE_MODE
+{
+ GESTURE_SW_ONLY_MODE,
+ GESTURE_SW_HW_HYBRID_MODE,
+ GESTURE_HW_ONLY_MODE,
+};
+
+
+/*
+ * hand detection listener
+ *
+ */
+typedef struct hand_detection_result
+{
+ /*
+ * hand_detection_result rect
+ */
+ NSCam::MRect rect;
+ /*
+ * confidence value
+ */
+ float confidence;
+ /*
+ * Identifier associated with this dtection.
+ */
+ int id;
+ /*
+ * detected pose
+ */
+ int pose;
+}hand_detection_result_t;
+
+/*
+ * gesture device operation
+ *
+ */
+typedef struct gesture_device_ops
+{
+ /*
+ * init gesture mode
+ */
+ bool (*init)(struct gesture_device *,
+ eGESTURE_MODE eMode,
+ int imageWidth,
+ int imageHeight,
+ int *max_num_of_detected /*out*/);
+ /*
+ *
+ */
+ bool (*hand_detect)(struct gesture_device *,
+ NSCam::IImageBuffer const *image,
+ unsigned int hand_pose,
+ int *num_of_detected, /*out*/
+ hand_detection_result_t *result /*out*/
+ );
+ /*
+ *
+ */
+ bool (*uninit)(struct gesture_device *);
+
+
+} gesture_device_ops_t;
+
+/*
+ * gesture device
+ */
+typedef struct gesture_device {
+ /**
+ * gesture_device.common.version must be in the range
+ * HARDWARE_DEVICE_API_VERSION(0,0)-(1,FF). GESTURE_DEVICE_API_VERSION_1_0 is
+ * recommended.
+ */
+ hw_device_t common;
+ gesture_device_ops_t *ops;
+ void *priv;
+} gesture_device_t;
+
+__END_DECLS
+
+#endif /* #ifdef _MTK_HARDWARE_INCLUDE_MMSDK_DEVICE_GESTURE_H_ */
diff --git a/include/hardware/include/mmsdk/heartrate_device.h b/include/hardware/include/mmsdk/heartrate_device.h
new file mode 100644
index 0000000..069fa49
--- /dev/null
+++ b/include/hardware/include/mmsdk/heartrate_device.h
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2010-2011 The Android Open Source Project
+ *
+ * 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 _MTK_HARDWARE_INCLUDE_MMSDK_DEVICE_HEARTRATE_H_
+#define _MTK_HARDWARE_INCLUDE_MMSDK_DEVICE_HEARTRATE_H_
+
+#include "mmsdk_common.h"
+
+/**
+ * Gesture device HAL, initial version [ GESTURE_DEVICE_API_VERSION_1_0 ]
+ *
+ */
+#define HEARTRATE_DEVICE_API_VERSION_1_0 HARDWARE_DEVICE_API_VERSION(1, 0)
+
+//
+#define HEARTRATE_DEVICE_API_VERSION_CURRENT GESTURE_DEVICE_API_VERSION_1_0
+
+
+__BEGIN_DECLS
+
+#define HEARTRATE_DEVICE_REPLYTYPE_RESULT (1)
+#define HEARTRATE_DEVICE_REPLYTYPE_CAMCONNECT (2)
+#define HEARTRATE_DEVICE_REPLYTYPE_CAMDISCONNECT (4)
+
+
+/*
+ * heartrate detection listener
+ *
+ */
+typedef struct HR_detection_result
+{
+ /*
+ * heartrate_detection_result rect
+ */
+ NSCam::MRect rect;
+ /*
+ * confidence value
+ */
+ float confidence;
+ /*
+ * Identifier associated with this dtection.
+ */
+ int id;
+ /*
+ * detected heart beats
+ */
+ int heartbeats;
+
+ int ReplyType;
+}HR_detection_result_t;
+
+__END_DECLS
+
+#endif /* #ifdef _MTK_HARDWARE_INCLUDE_MMSDK_DEVICE_HEARTRATE_H_ */
diff --git a/include/hardware/include/mmsdk/imageTransform_device.h b/include/hardware/include/mmsdk/imageTransform_device.h
new file mode 100644
index 0000000..8f685c4
--- /dev/null
+++ b/include/hardware/include/mmsdk/imageTransform_device.h
@@ -0,0 +1,109 @@
+/*
+ * Copyright (C) 2010-2011 The Android Open Source Project
+ *
+ * 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 _MTK_HARDWARE_INCLUDE_MMSDK_IMAGE_TRANSFORM_DEVICE_H_
+#define _MTK_HARDWARE_INCLUDE_MMSDK_IMAGE_TRANSFORM_DEVICE_H_
+
+#include "mmsdk_common.h"
+
+/**
+ * image transform device HAL, initial version [ IMAGE_TRANSFORM_DEVICE_API_VERSION_1_0 ]
+ *
+ */
+#define IMAGE_TRANSFORM_DEVICE_API_VERSION_1_0 HARDWARE_DEVICE_API_VERSION(1, 0)
+/*
+ *
+ */
+#define IMAGE_TRANSFORM_DEVICE_API_VERSION_CURRENT IMAGE_TRANSFORM_DEVICE_API_VERSION_1_0
+
+__BEGIN_DECLS
+
+
+struct imageTransform_device;
+
+/*
+ *
+ *
+ */
+typedef struct transformOptions
+{
+ /*
+ * crop rect
+ */
+ NSCam::MRect rect;
+ /*
+ * transform, {flip or rotation}
+ */
+ int transform;
+ /*
+ * encode quality {0~100}
+ */
+ int encodeQuality;
+ /*
+ * is dither enable (true, false}
+ */
+ bool isDither;
+ /*
+ * sharpness level (0~5)
+ */
+ int sharpnessLevel;
+
+ inline transformOptions()
+ :rect(NSCam::MRect(0,0))
+ ,transform(0)
+ ,encodeQuality(50)
+ ,isDither(false)
+ ,sharpnessLevel(0)
+ {
+ }
+
+
+} transformOptions_t;
+
+/*
+ *
+ *
+ */
+typedef struct imageTransfrom_device_ops {
+ /**
+ * applyTransform
+ * apply the transform from source iamge to target image by the options
+ */
+ bool (*applyTransform)(struct imageTransform_device *,
+ NSCam::IImageBuffer const *srcImage,
+ NSCam::IImageBuffer const *destImage,
+ transformOptions_t const *options);
+
+} imageTransfrom_device_ops_t;
+
+/*
+ *
+ *
+ */
+typedef struct imageTransform_device {
+ /**
+ * imageTransform_device.common.version must be in the range
+ * HARDWARE_DEVICE_API_VERSION(0,0)-(1,FF). IMAGE_TRANSFORM_DEVICE_API_VERSION_1_0 is
+ * recommended.
+ */
+ hw_device_t common;
+ imageTransfrom_device_ops_t *ops;
+ void *priv;
+} imageTransform_device_t;
+
+__END_DECLS
+
+#endif /* #ifdef _MTK_HARDWARE_INCLUDE_MMSDK_IMAGE_TRANSFORM_DEVICE_H_ */
diff --git a/include/hardware/include/mmsdk/mmsdk_common.h b/include/hardware/include/mmsdk/mmsdk_common.h
new file mode 100644
index 0000000..8a70595
--- /dev/null
+++ b/include/hardware/include/mmsdk/mmsdk_common.h
@@ -0,0 +1,102 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * 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 _MTK_HARDWARE_INCLUDE_MMSDK_COMMON_H_
+#define _MTK_HARDWARE_INCLUDE_MMSDK_COMMON_H_
+
+#include <stdint.h>
+#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <hardware/hardware.h>
+
+__BEGIN_DECLS
+
+/**
+ * The id of this module
+ */
+#define MMSDK_HARDWARE_MODULE_ID "mmsdk"
+
+/**
+ * Module versioning information for the MMSDK hardware module, based on
+ * mmsdk_module_t.common.module_api_version. The two most significant hex
+ * digits represent the major version, and the two least significant represent
+ * the minor version.
+ *
+ *******************************************************************************
+ * Versions: 1.0 [MMSDK_MODULE_API_VERSION_1_0]
+ *
+ *
+ *******************************************************************************
+ */
+
+/**
+ * Predefined macros for currently-defined version numbers
+ */
+
+/**
+ * All module versions <= HARDWARE_MODULE_API_VERSION(1, 0xFF) must be treated
+ * as MMSDK_MODULE_API_VERSION_1_0
+ */
+#define MMSDK_MODULE_API_VERSION_1_0 HARDWARE_MODULE_API_VERSION(1, 0)
+#define MMSDK_MODULE_API_VERSION_CURRENT MMSDK_MODULE_API_VERSION_1_0
+
+
+/*
+ * MMSDK hardware device name
+ */
+#define MMSDK_HARDWARE_GESTURE "gesture"
+#define MMSDK_HARDWARE_EFFECT "effect"
+#define MMSDK_HARDWARE_IMAGE_TRANSFORM "image_transform"
+
+
+typedef struct mmsdk_device_info {
+ /**
+ * The device name of xxxx_device_t
+ *
+ * Device name
+ */
+ char const *device_name;
+ /**
+ * The value of xxxx_device_t.common.version.
+ *
+ * Version information
+ *
+ */
+ uint32_t device_version;
+
+} mmsdk_device_info_t;
+
+
+typedef struct mmsdk_module {
+ hw_module_t common;
+
+ /**
+ * get_supported_device_info:
+ *
+ * Return the static supported device informations for all supported devices.
+ * This information may not change for a device.
+ *
+ */
+ int (*get_supported_device_info)(int &num_of_devices, struct mmsdk_device_info **info);
+
+ /* reserved for future use */
+ void* reserved[8];
+} mmsdk_module_t;
+
+__END_DECLS
+
+#endif /* _MTK_HARDWARE_INCLUDE_MMSDK_COMMON_H_ */
diff --git a/include/hardware/include/mmutils/IGrallocHelper.h b/include/hardware/include/mmutils/IGrallocHelper.h
new file mode 100644
index 0000000..8b3fde3
--- /dev/null
+++ b/include/hardware/include/mmutils/IGrallocHelper.h
@@ -0,0 +1,216 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MMUTILS_IGRALLOCHELPER_H_
+#define _MTK_HARDWARE_INCLUDE_MMUTILS_IGRALLOCHELPER_H_
+//
+#include <utils/String8.h>
+#include <utils/Vector.h>
+#include <system/graphics.h>
+#include <hardware/gralloc.h>
+#include "../gralloc_mtk_defs.h"
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace mmutils {
+
+
+/**
+ *
+ */
+struct GrallocRequest {
+
+ /**
+ * The gralloc usage.
+ */
+ int usage;
+
+ /**
+ * The image format to request.
+ */
+ int format;
+
+ /**
+ * The image width in pixels. For formats where some color channels are
+ * subsampled, this is the width of the largest-resolution plane.
+ */
+ int widthInPixels;
+
+ /**
+ * The image height in pixels. For formats where some color channels are
+ * subsampled, this is the height of the largest-resolution plane.
+ */
+ int heightInPixels;
+
+};
+
+
+/**
+ *
+ */
+struct GrallocStaticInfo {
+
+ struct Plane {
+ /**
+ * The size for this color plane, in bytes.
+ */
+ size_t sizeInBytes;
+
+ /**
+ * The row stride for this color plane, in bytes.
+ *
+ * This is the distance between the start of two consecutive rows of
+ * pixels in the image. The row stride is always greater than 0.
+ */
+ size_t rowStrideInBytes;
+
+ };
+
+ /**
+ * The resulting image format.
+ */
+ int format;
+
+ /**
+ * The image width in pixels. For formats where some color channels are
+ * subsampled, this is the width of the largest-resolution plane.
+ */
+ int widthInPixels;
+
+ /**
+ * The image height in pixels. For formats where some color channels are
+ * subsampled, this is the height of the largest-resolution plane.
+ */
+ int heightInPixels;
+
+ /**
+ * A vector of planes.
+ */
+ android::Vector<Plane> planes;
+
+};
+
+
+/**
+ *
+ */
+struct GrallocDynamicInfo {
+
+ /**
+ * A vector of ion Fds.
+ */
+ android::Vector<int> ionFds;
+
+};
+
+
+/**
+ *
+ */
+class IGrallocHelper
+{
+public: //// Definitions.
+
+ typedef android::String8 String8;
+
+public: //// Instantiation.
+
+ virtual ~IGrallocHelper() {}
+
+ /**
+ * Get a singleton instance.
+ */
+ static IGrallocHelper* singleton();
+
+public: //// Interfaces.
+
+ /**
+ * Given a gralloc request, return its information.
+ */
+ virtual int query(
+ struct GrallocRequest const* pRequest,
+ struct GrallocStaticInfo* pStaticInfo
+ ) const = 0;
+
+ /**
+ * Given a gralloc buffer handle, return its information.
+ */
+ virtual int query(
+ buffer_handle_t bufHandle,
+ struct GrallocStaticInfo* pStaticInfo,
+ struct GrallocDynamicInfo* pDynamicInfo
+ ) const = 0;
+
+ /**
+ * Set a given buffer's attribute with dirty camera.
+ */
+ virtual int setDirtyCamera(
+ buffer_handle_t bufHandle
+ ) const = 0;
+
+ /**
+ * Set a given buffer's colorspace to JFIF.
+ */
+ virtual int setColorspace_JFIF(
+ buffer_handle_t bufHandle
+ ) const = 0;
+
+ /**
+ * Given a HAL_PIXEL_FORMAT_xxx format, return a String8 name.
+ */
+ virtual String8 queryPixelFormatName(int format) const = 0;
+
+ /**
+ * Given a combination of usage, return a String8 name.
+ */
+ virtual String8 queryGrallocUsageName(int usage) const = 0;
+
+ /**
+ * Dump to the log for debug.
+ */
+ virtual void dumpToLog() const = 0;
+
+};
+
+
+}; //namespace mmutils
+/******************************************************************************
+ *
+ ******************************************************************************/
+#endif //_MTK_HARDWARE_INCLUDE_MMUTILS_IGRALLOCHELPER_H_
+
diff --git a/include/hardware/include/mtkcam/BasicTypes.h b/include/hardware/include/mtkcam/BasicTypes.h
new file mode 100644
index 0000000..1cd53a0
--- /dev/null
+++ b/include/hardware/include/mtkcam/BasicTypes.h
@@ -0,0 +1,85 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_BASICTYPES_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_BASICTYPES_H_
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+
+
+/******************************************************************************
+ * Rational
+ ******************************************************************************/
+struct MRational
+{
+ MINT32 numerator;
+ MINT32 denominator;
+ //
+ MRational(MINT32 _numerator = 0, MINT32 _denominator = 1)
+ : numerator(_numerator)
+ , denominator(_denominator)
+ {
+ }
+};
+
+
+/******************************************************************************
+ *
+ * @brief Sensor type enumeration.
+ *
+ ******************************************************************************/
+namespace NSSensorType
+{
+ enum Type
+ {
+ eUNKNOWN = 0xFFFFFFFF, /*!< Unknown */
+ eRAW = 0, /*!< RAW */
+ eYUV, /*!< YUV */
+ };
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_BASICTYPES_H_
+
diff --git a/include/hardware/include/mtkcam/BuiltinTypes.h b/include/hardware/include/mtkcam/BuiltinTypes.h
new file mode 100644
index 0000000..c137454
--- /dev/null
+++ b/include/hardware/include/mtkcam/BuiltinTypes.h
@@ -0,0 +1,92 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_BUILTTYPES_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_BUILTTYPES_H_
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+#include <stdint.h>
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+//
+typedef signed char MINT8;
+typedef unsigned char MUINT8;
+//
+typedef signed short MINT16;
+typedef unsigned short MUINT16;
+//
+typedef signed int MINT32;
+typedef unsigned int MUINT32;
+//
+typedef int64_t MINT64;
+typedef uint64_t MUINT64;
+//
+typedef signed int MINT;
+typedef unsigned int MUINT;
+//
+typedef intptr_t MINTPTR;
+typedef uintptr_t MUINTPTR;
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+//
+typedef void MVOID;
+typedef float MFLOAT;
+typedef double MDOUBLE;
+//
+typedef int MBOOL;
+//
+#ifndef MTRUE
+ #define MTRUE 1
+#endif
+#ifndef MFALSE
+ #define MFALSE 0
+#endif
+#ifndef MNULL
+ #define MNULL 0
+#endif
+/******************************************************************************
+ *
+ ******************************************************************************/
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_BUILTTYPES_H_
+
diff --git a/include/hardware/include/mtkcam/Errors.h b/include/hardware/include/mtkcam/Errors.h
new file mode 100644
index 0000000..117b08b
--- /dev/null
+++ b/include/hardware/include/mtkcam/Errors.h
@@ -0,0 +1,95 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_ERRORS_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_ERRORS_H_
+/******************************************************************************
+ *
+ ******************************************************************************/
+#include <utils/Errors.h>
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+
+
+/******************************************************************************
+ * Error codes.
+ * All error codes are negative values.
+ ******************************************************************************/
+typedef int MERROR;
+
+
+/******************************************************************************
+ * Error codes.
+ * All error codes are negative values.
+ ******************************************************************************/
+enum
+{
+#define OK android::OK // 0: Everything's swell.
+#define UNKNOWN_ERROR android::UNKNOWN_ERROR // 0x80000000,
+
+#define NO_MEMORY android::NO_MEMORY
+#define INVALID_OPERATION android::INVALID_OPERATION
+#define BAD_VALUE android::BAD_VALUE
+#define BAD_TYPE android::BAD_TYPE
+#define NAME_NOT_FOUND android::NAME_NOT_FOUND
+#define PERMISSION_DENIED android::PERMISSION_DENIED
+#define NO_INIT android::NO_INIT
+#define ALREADY_EXISTS android::ALREADY_EXISTS
+#define DEAD_OBJECT android::DEAD_OBJECT
+#define FAILED_TRANSACTION android::FAILED_TRANSACTION
+#define JPARKS_BROKE_IT android::JPARKS_BROKE_IT //-EPIPE
+
+#define BAD_INDEX android::BAD_INDEX
+#define NOT_ENOUGH_DATA android::NOT_ENOUGH_DATA
+#define WOULD_BLOCK android::WOULD_BLOCK
+#define TIMED_OUT android::TIMED_OUT
+#define UNKNOWN_TRANSACTION android::UNKNOWN_TRANSACTION
+#define FDS_NOT_ALLOWED android::FDS_NOT_ALLOWED
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_ERRORS_H_
+
diff --git a/include/hardware/include/mtkcam/IImageBuffer.h b/include/hardware/include/mtkcam/IImageBuffer.h
new file mode 100644
index 0000000..c7ce617
--- /dev/null
+++ b/include/hardware/include/mtkcam/IImageBuffer.h
@@ -0,0 +1,606 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_IIMAGEBUFFER_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_IIMAGEBUFFER_H_
+//
+#include <hardware/gralloc.h>
+#include "common.h"
+//
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+
+
+/******************************************************************************
+ * Image Buffer Usage.
+ ******************************************************************************/
+enum
+{
+ /* buffer is rarely read in software */
+ eBUFFER_USAGE_SW_READ_RARELY = GRALLOC_USAGE_SW_READ_RARELY,
+ /* buffer is often read in software */
+ eBUFFER_USAGE_SW_READ_OFTEN = GRALLOC_USAGE_SW_READ_OFTEN,
+ /* mask for the software read values */
+ eBUFFER_USAGE_SW_READ_MASK = GRALLOC_USAGE_SW_READ_MASK,
+
+ /* buffer is rarely written in software */
+ eBUFFER_USAGE_SW_WRITE_RARELY = GRALLOC_USAGE_SW_WRITE_RARELY,
+ /* buffer is often written in software */
+ eBUFFER_USAGE_SW_WRITE_OFTEN = GRALLOC_USAGE_SW_WRITE_OFTEN,
+ /* mask for the software write values */
+ eBUFFER_USAGE_SW_WRITE_MASK = GRALLOC_USAGE_SW_WRITE_MASK,
+
+ /* mask for the software access */
+ eBUFFER_USAGE_SW_MASK = eBUFFER_USAGE_SW_READ_MASK | eBUFFER_USAGE_SW_WRITE_MASK,
+
+ /* buffer will be used as an OpenGL ES texture (read by GPU) */
+ eBUFFER_USAGE_HW_TEXTURE = GRALLOC_USAGE_HW_TEXTURE,
+ /* buffer will be used as an OpenGL ES render target (written by GPU) */
+ eBUFFER_USAGE_HW_RENDER = GRALLOC_USAGE_HW_RENDER,
+
+ /* buffer will be read by the HW camera pipeline */
+ eBUFFER_USAGE_HW_CAMERA_READ = GRALLOC_USAGE_HW_CAMERA_READ,
+ /* buffer will be written by the HW camera pipeline */
+ eBUFFER_USAGE_HW_CAMERA_WRITE = GRALLOC_USAGE_HW_CAMERA_WRITE,
+ /* buffer will be read and written by the HW camera pipeline */
+ eBUFFER_USAGE_HW_CAMERA_READWRITE = eBUFFER_USAGE_HW_CAMERA_WRITE | eBUFFER_USAGE_HW_CAMERA_READ,
+
+ /* mask for the hardware access */
+ eBUFFER_USAGE_HW_MASK = GRALLOC_USAGE_HW_MASK,
+
+};
+
+
+/******************************************************************************
+ * Cache Flush Control Type.
+ ******************************************************************************/
+enum eCacheCtrl
+{
+ eCACHECTRL_FLUSH =0,
+ eCACHECTRL_INVALID =1
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+class IImageBufferHeap;
+
+
+/******************************************************************************
+ * Image Buffer Interface.
+ ******************************************************************************/
+class IImageBuffer
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Instantiation.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+private: //// Disallowed.
+ /**
+ * Copy constructor and Copy assignment are disallowed.
+ */
+ IImageBuffer(IImageBuffer const&);
+ IImageBuffer& operator=(IImageBuffer const&);
+
+protected: //// Destructor.
+ IImageBuffer() {}
+
+ // Disallowed to directly delete a raw pointer.
+ virtual ~IImageBuffer() {}
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Reference Counting.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Reference Counting.
+ virtual MVOID incStrong(MVOID const* id) const = 0;
+ virtual MVOID decStrong(MVOID const* id) const = 0;
+ virtual MINT32 getStrongCount() const = 0;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Image Attributes.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Image Attributes.
+ virtual MINT getImgFormat() const = 0;
+ virtual MSize const& getImgSize() const = 0;
+ virtual size_t getImgBitsPerPixel() const = 0;
+ virtual size_t getPlaneBitsPerPixel(size_t index) const = 0;
+ virtual size_t getPlaneCount() const = 0;
+ virtual size_t getBitstreamSize() const = 0;
+ virtual MBOOL setBitstreamSize(size_t const bitstreamsize)= 0;
+ virtual IImageBufferHeap* getImageBufferHeap() const = 0;
+ virtual MBOOL setExtParam(MSize const& imgSize, size_t offsetInBytes = 0) = 0;
+ virtual size_t getExtOffsetInBytes(size_t index) const = 0;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Buffer Attributes.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Buffer Attributes.
+
+ /**
+ * Return a pointer to a null-terminated string to indicate a magic name of
+ * buffer type.
+ */
+ virtual char const* getMagicName() const = 0;
+
+ /**
+ * Legal only after lockBuf().
+ */
+ virtual MINT32 getFD(size_t index = 0) const = 0;
+
+ /**
+ * Legal only after lockBuf().
+ */
+ virtual size_t getFDCount() const = 0;
+
+ /**
+ * Buffer offset in bytes of a given plane.
+ * Buf VA(i) = Buf Offset(i) + Heap VA(i)
+ */
+ virtual size_t getBufOffsetInBytes(size_t index) const = 0;
+
+ /**
+ * Buffer physical address of a given plane;
+ * legal only after lockBuf() with a HW usage.
+ */
+ virtual MINTPTR getBufPA(size_t index) const = 0;
+
+ /**
+ * Buffer virtual address of a given plane;
+ * legal only after lockBuf() with a SW usage.
+ */
+ virtual MINTPTR getBufVA(size_t index) const = 0;
+
+ /**
+ * Buffer size in bytes of a given plane; always legal.
+ *
+ * buffer size in bytes = buffer size in pixels x getPlaneBitsPerPixel(index)
+ *
+ * buffer size in pixels = buffer width stride in pixels
+ * x(buffer height stride in pixels - 1)
+ * + image width in pixels
+ *
+ * +---------+---------+---------+----------+
+ * | Heap Pixel Array |
+ * | O ROI Image |
+ * | = Buffer Size |
+ * | |
+ * | OOOOOOOOO===========|
+ * |====================OOOOOOOOO===========|
+ * |====================OOOOOOOOO===========|
+ * |====================OOOOOOOOO |
+ * | |
+ * | |
+ * +---------+---------+---------+----------+
+ *
+ */
+ virtual size_t getBufSizeInBytes(size_t index) const = 0;
+
+ /**
+ * Buffer Strides in bytes of a given plane; always legal.
+ */
+ virtual size_t getBufStridesInBytes(size_t index) const = 0;
+
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Buffer Operations.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: ////
+
+ /**
+ * A buffer is allowed to access only between the interval of lockBuf() and
+ * unlockBuf(). Call lockBuf() with a usage flag before accessing a buffer,
+ * and call unlockBuf() after finishing accessing it.
+ *
+ * Physical address of a buffer, from getBufPA(), is legal only if a HW
+ * usage is specified when lockBuf().
+ *
+ * Virtual address of a buffer, from getBufVA(), is legal only if a SW usage
+ * is specified when lockBuf().
+ *
+ * Physical and virtual addresses are legal if HW and SW usages are
+ * specified when lockBuf().
+ *
+ */
+ virtual MBOOL lockBuf(
+ char const* szCallerName,
+ MINT usage = eBUFFER_USAGE_HW_CAMERA_READWRITE | eBUFFER_USAGE_SW_READ_OFTEN
+ ) = 0;
+ virtual MBOOL unlockBuf(
+ char const* szCallerName
+ ) = 0;
+
+public: //// Cache.
+ virtual MBOOL syncCache(
+ eCacheCtrl const ctrl = eCACHECTRL_FLUSH
+ ) = 0;
+
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// File Operations.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// File Operations.
+ virtual MBOOL saveToFile(char const* filepath) = 0;
+ virtual MBOOL loadFromFile(char const* filepath) = 0;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Timestamp Accesssors.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Timestamp Accesssors.
+ virtual MINT64 getTimestamp() const = 0;
+ virtual MVOID setTimestamp(MINT64 const timestamp) = 0;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Fence Operations.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Fence Operations.
+ /**
+ * The acquire sync fence for this buffer. The HAL must wait on this fence
+ * fd before attempting to read from or write to this buffer.
+ *
+ * The framework may be set to -1 to indicate that no waiting is necessary
+ * for this buffer.
+ *
+ * When the HAL returns an output buffer to the framework with
+ * process_capture_result(), the acquire_fence must be set to -1. If the HAL
+ * never waits on the acquire_fence due to an error in filling a buffer,
+ * when calling process_capture_result() the HAL must set the release_fence
+ * of the buffer to be the acquire_fence passed to it by the framework. This
+ * will allow the framework to wait on the fence before reusing the buffer.
+ *
+ * For input buffers, the HAL must not change the acquire_fence field during
+ * the process_capture_request() call.
+ */
+ virtual MINT getAcquireFence() const = 0;
+ virtual MVOID setAcquireFence(MINT fence) = 0;
+
+ /**
+ * The release sync fence for this buffer. The HAL must set this fence when
+ * returning buffers to the framework, or write -1 to indicate that no
+ * waiting is required for this buffer.
+ *
+ * For the input buffer, the release fence must be set by the
+ * process_capture_request() call. For the output buffers, the fences must
+ * be set in the output_buffers array passed to process_capture_result().
+ */
+ virtual MINT getReleaseFence() const = 0;
+ virtual MVOID setReleaseFence(MINT fence) = 0;
+
+};
+
+
+/******************************************************************************
+ * Image Buffer Heap Interface.
+ ******************************************************************************/
+class IImageBufferHeap
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Instantiation.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+private: //// Disallowed.
+ /**
+ * Copy assignment are disallowed.
+ */
+ IImageBufferHeap& operator=(IImageBufferHeap const&);
+
+protected: //// Destructor.
+
+ /**
+ * Disallowed to directly delete a raw pointer.
+ */
+ virtual ~IImageBufferHeap() {}
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Reference Counting.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Reference Counting.
+ virtual MVOID incStrong(MVOID const* id) const = 0;
+ virtual MVOID decStrong(MVOID const* id) const = 0;
+ virtual MINT32 getStrongCount() const = 0;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Image Attributes.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Image Attributes.
+ virtual MINT getImgFormat() const = 0;
+ virtual MSize const& getImgSize() const = 0;
+ virtual size_t getImgBitsPerPixel() const = 0;
+ virtual size_t getPlaneBitsPerPixel(size_t index) const = 0;
+ virtual size_t getPlaneCount() const = 0;
+ virtual size_t getBitstreamSize() const = 0;
+ virtual MBOOL setBitstreamSize(size_t const bitstreamsize)= 0;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Buffer Attributes.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Buffer Attributes.
+
+ /**
+ * Return log condition to enable/disable printing log.
+ */
+ virtual MBOOL getLogCond() const = 0;
+
+ /**
+ * Return a pointer to a null-terminated string to indicate a magic name of
+ * buffer type.
+ */
+ virtual char const* getMagicName() const = 0;
+
+ /**
+ * Heap ID could be ION fd, PMEM fd, and so on.
+ * Legal only after lockBuf().
+ */
+ virtual MINT32 getHeapID(size_t index = 0) const = 0;
+
+ /**
+ * 0 <= Heap ID count <= plane count.
+ * Legal only after lockBuf().
+ */
+ virtual size_t getHeapIDCount() const = 0;
+
+ /**
+ * Buffer physical address of a given plane;
+ * legal only after lockBuf() with a HW usage.
+ */
+ virtual MINTPTR getBufPA(size_t index) const = 0;
+
+ /**
+ * Buffer virtual address of a given plane;
+ * legal only after lockBuf() with a SW usage.
+ */
+ virtual MINTPTR getBufVA(size_t index) const = 0;
+
+ /**
+ * Buffer size in bytes of a given plane; always legal.
+ */
+ virtual size_t getBufSizeInBytes(size_t index) const = 0;
+
+ /**
+ * Buffer Strides in bytes of a given plane; always legal.
+ */
+ virtual size_t getBufStridesInBytes(size_t index) const = 0;
+
+ /**
+ * Graphic buffer from grallocImageBufferHeap.
+ */
+ virtual void* getGraphicBuffer() const = 0;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Buffer Operations.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: ////
+
+ /**
+ * A buffer is allowed to access only between the interval of lockBuf() and
+ * unlockBuf(). Call lockBuf() with a usage flag before accessing a buffer,
+ * and call unlockBuf() after finishing accessing it.
+ *
+ * Physical address of a buffer, from getBufPA(), is legal only if a HW
+ * usage is specified when lockBuf().
+ *
+ * Virtual address of a buffer, from getBufVA(), is legal only if a SW usage
+ * is specified when lockBuf().
+ *
+ * Physical and virtual addresses are legal if HW and SW usages are
+ * specified when lockBuf().
+ *
+ */
+ virtual MBOOL lockBuf(
+ char const* szCallerName,
+ MINT usage = eBUFFER_USAGE_HW_CAMERA_READWRITE | eBUFFER_USAGE_SW_READ_OFTEN
+ ) = 0;
+ virtual MBOOL unlockBuf(
+ char const* szCallerName
+ ) = 0;
+
+public: //// Cache.
+ virtual MBOOL syncCache(
+ eCacheCtrl const ctrl
+ ) = 0;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// IImageBuffer Operations.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: ////
+
+ /**
+ * Create an IImageBuffer instance with its ROI equal to the image full
+ * resolution of this heap.
+ */
+ virtual IImageBuffer* createImageBuffer() = 0;
+
+ /**
+ * This call is legal only if the heap format is blob.
+ *
+ * From the given blob heap, create an IImageBuffer instance with a specified
+ * offset and size, and its format equal to blob.
+ */
+ virtual IImageBuffer* createImageBuffer_FromBlobHeap(
+ size_t offsetInBytes,
+ size_t sizeInBytes
+ ) = 0;
+
+ /**
+ * This call is legal only if the heap format is blob.
+ *
+ * From the given blob heap, create an IImageBuffer instance with a specified
+ * offset, image format, image size in pixels, and buffer strides in pixels.
+ */
+ virtual IImageBuffer* createImageBuffer_FromBlobHeap(
+ size_t offsetInBytes,
+ MINT32 imgFormat,
+ MSize const&imgSize,
+ size_t const bufStridesInBytes[3]
+ ) = 0;
+
+ /**
+ * Create an IImageBuffer instance indicating the left-side or right-side
+ * buffer within a side-by-side image.
+ *
+ * Left side if isRightSide = 0; otherwise right side.
+ */
+ virtual IImageBuffer* createImageBuffer_SideBySide(
+ MBOOL isRightSide
+ ) = 0;
+
+};
+
+
+/******************************************************************************
+ * Image Buffer Allocator Interface.
+ ******************************************************************************/
+class IImageBufferAllocator
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Definitions.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Params for Allocations.
+
+ struct ImgParam
+ {
+ MINT32 imgFormat; // image format.
+ MSize imgSize; // image resolution in pixels.
+ MSize jpgSize; // jpeg resolution in pixels. for JPEG memory.
+ size_t bufSize; // buffer size in bytes. for JPEG memory.
+ size_t bufStridesInBytes[3]; // buffer strides(width) in bytes.
+ size_t bufBoundaryInBytes[3]; // the address will be a multiple of boundary in bytes, which must be a power of two.
+ //
+ // Image (width strides in bytes).
+ // Both T1 and T2 are expected to size_t.
+ template <typename T1, typename T2>
+ ImgParam(
+ MINT32 const _imgFormat,
+ MSize const& _imgSize,
+ T1 const _bufStridesInBytes[],
+ T2 const _bufBoundaryInBytes[],
+ size_t const _planeCount
+ )
+ : imgFormat(_imgFormat)
+ , imgSize(_imgSize)
+ , jpgSize(_imgSize)
+ , bufSize(0)
+ {
+ for (size_t i = 0; i < _planeCount; i++)
+ {
+ bufStridesInBytes[i] = _bufStridesInBytes[i];
+ bufBoundaryInBytes[i] = _bufBoundaryInBytes[i];
+ }
+ }
+ //
+ // BLOB memory.
+ ImgParam(
+ size_t const _bufSize, // buffer size in bytes.
+ size_t const _bufBoundaryInBytes // the address will be a multiple of boundary in bytes, which must be a power of two.
+ )
+ : imgFormat(eImgFmt_BLOB)
+ , imgSize(MSize(_bufSize, 1))
+ , jpgSize(MSize(_bufSize, 1))
+ , bufSize(_bufSize)
+ {
+ bufStridesInBytes[0] = _bufSize;
+ bufBoundaryInBytes[0] = _bufBoundaryInBytes;
+ }
+ //
+ // JPEG memory.
+ ImgParam(
+ MSize const& _imgSize, // image resolution in pixels.
+ size_t const _bufSize, // buffer size in bytes.
+ size_t const _bufBoundaryInBytes // the address will be a multiple of boundary in bytes, which must be a power of two.
+ )
+ : imgFormat(eImgFmt_JPEG)
+ , imgSize(MSize(_bufSize, 1))
+ , jpgSize(_imgSize)
+ , bufSize(_bufSize)
+ {
+ bufStridesInBytes[0] = _bufSize;
+ bufBoundaryInBytes[0] = _bufBoundaryInBytes;
+ }
+ };
+
+ struct ExtraParam
+ {
+ MINT32 usage;
+ MINT32 nocache;
+ //
+ ExtraParam(
+ MINT32 _usage = eBUFFER_USAGE_SW_MASK|eBUFFER_USAGE_HW_MASK,
+ MINT32 _nocache = 0
+ )
+ : usage(_usage)
+ , nocache(_nocache)
+ {
+ }
+ };
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Interfaces.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Operations.
+ static IImageBufferAllocator* getInstance();
+
+ IImageBuffer* alloc(
+ char const* szCallerName,
+ ImgParam const& rImgParam,
+ ExtraParam const& rExtraParam = ExtraParam()
+ );
+
+ IImageBuffer* alloc_ion(
+ char const* szCallerName,
+ ImgParam const& rImgParam,
+ ExtraParam const& rExtraParam = ExtraParam()
+ );
+
+ IImageBuffer* alloc_gb(
+ char const* szCallerName,
+ ImgParam const& rImgParam,
+ ExtraParam const& rExtraParam
+ );
+
+ MVOID free(IImageBuffer* pImageBuffer);
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_IIMAGEBUFFER_H_
+
diff --git a/include/hardware/include/mtkcam/IPlatform.h b/include/hardware/include/mtkcam/IPlatform.h
new file mode 100644
index 0000000..40fab93
--- /dev/null
+++ b/include/hardware/include/mtkcam/IPlatform.h
@@ -0,0 +1,106 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_IPLATFORM_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_IPLATFORM_H_
+//
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+class IHalMemory;
+class ICamDevice;
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+class IPlatform
+{
+protected: //// Destructor.
+ /**
+ * Disallowed to directly delete a raw pointer.
+ */
+ virtual ~IPlatform() {}
+
+public: //// Interfaces.
+
+ /**
+ * create IHalMemory instance.
+ */
+ virtual IHalMemory* createHalMemory(char const* szCallerName) = 0;
+
+ /**
+ * create ICamDevice-derived Cam1Device instance.
+ */
+ virtual ICamDevice* createCam1Device(
+ char const* szClientAppMode,
+ int32_t const i4OpenId
+ ) = 0;
+
+ /**
+ * create ICamDevice-derived Cam3Device instance.
+ */
+ virtual ICamDevice* createCam3Device(
+ char const* szClientAppMode,
+ int32_t const i4OpenId
+ ) = 0;
+
+};
+}; //namespace NSCam
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+extern "C"
+NSCam::IPlatform*
+getHandleToPlatform();
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_IPLATFORM_H_
+
diff --git a/include/hardware/include/mtkcam/ImageFormat.h b/include/hardware/include/mtkcam/ImageFormat.h
new file mode 100644
index 0000000..213347e
--- /dev/null
+++ b/include/hardware/include/mtkcam/ImageFormat.h
@@ -0,0 +1,164 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_IMAGEFORMAT_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_IMAGEFORMAT_H_
+//
+#include <system/graphics.h>
+#include <graphics_mtk_defs.h>
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+
+
+/******************************************************************************
+ *
+ * @enum
+ * @brief Transformation definitions.
+ * ROT_90 is applied CLOCKWISE and AFTER TRANSFORM_FLIP_{H|V}.
+ *
+ ******************************************************************************/
+enum
+{
+ /* flip source image horizontally (around the vertical axis) */
+ eTransform_FLIP_H = 0x01,
+
+ /* flip source image vertically (around the horizontal axis)*/
+ eTransform_FLIP_V = 0x02,
+
+ /* rotate source image 90 degrees clockwise */
+ eTransform_ROT_90 = 0x04,
+
+ /* rotate source image 180 degrees */
+ eTransform_ROT_180 = 0x03,
+
+ /* rotate source image 270 degrees clockwise */
+ eTransform_ROT_270 = 0x07,
+};
+
+
+/******************************************************************************
+ *
+ * @enum EImageFormat
+ * @brief Image format Enumeration.
+ *
+ ******************************************************************************/
+enum EImageFormat
+{
+ eImgFmt_IMPLEMENTATION_DEFINED = HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED,
+
+ eImgFmt_RAW_SENSOR = HAL_PIXEL_FORMAT_RAW_SENSOR, /*!< deprecated */
+ eImgFmt_RAW16 = HAL_PIXEL_FORMAT_RAW16, /*!< raw 16-bit 1 plane */
+ eImgFmt_RAW_OPAQUE = HAL_PIXEL_FORMAT_RAW_OPAQUE, /*!< raw 1 plane */
+
+ /*
+ * This format is used to carry task-specific data which does not have a
+ * standard image structure. The details of the format are left to the two
+ * endpoints.
+ *
+ * Buffers of this format must have a height of 1, and width equal to their
+ * size in bytes.
+ */
+ eImgFmt_BLOB = HAL_PIXEL_FORMAT_BLOB,
+
+ eImgFmt_RGBA8888 = HAL_PIXEL_FORMAT_RGBA_8888, /*!< RGBA (32-bit; LSB:R, MSB:A), 1 plane */
+ eImgFmt_RGBX8888 = HAL_PIXEL_FORMAT_RGBX_8888, /*!< RGBX (32-bit; LSB:R, MSB:X), 1 plane */
+ eImgFmt_RGB888 = HAL_PIXEL_FORMAT_RGB_888, /*!< RGB 888 (24-bit), 1 plane (RGB) */
+ eImgFmt_RGB565 = HAL_PIXEL_FORMAT_RGB_565, /*!< RGB 565 (16-bit), 1 plane */
+ eImgFmt_BGRA8888 = HAL_PIXEL_FORMAT_BGRA_8888, /*!< BGRA (32-bit; LSB:B, MSB:A), 1 plane */
+
+ eImgFmt_YUY2 = HAL_PIXEL_FORMAT_YCbCr_422_I, /*!< 422 format, 1 plane (YUYV) */
+
+ eImgFmt_NV16 = HAL_PIXEL_FORMAT_YCbCr_422_SP, /*!< 422 format, 2 plane (Y),(UV) */
+ eImgFmt_NV21 = HAL_PIXEL_FORMAT_YCrCb_420_SP, /*!< 420 format, 2 plane (Y),(VU) */
+
+ eImgFmt_YV12 = HAL_PIXEL_FORMAT_YV12, /*!< 420 format, 3 plane (Y),(V),(U) */
+
+ eImgFmt_Y8 = HAL_PIXEL_FORMAT_Y8, /*!< 8-bit Y plane */
+ eImgFmt_Y800 = eImgFmt_Y8, /*!< deprecated; Replace it with eImgFmt_Y8 */
+ eImgFmt_Y16 = HAL_PIXEL_FORMAT_Y16, /*!< 16-bit Y plane */
+
+ /**************************************************************************
+ * 0x100 - 0x1FF
+ *
+ * This range is reserved for pixel formats that are specific to the HAL implementation.
+ **************************************************************************/
+ eImgFmt_UNKNOWN = 0x000, /*!< unknow */
+ eImgFmt_VENDOR_DEFINED_START = 0x100, /*!< vendor definition start */
+
+ eImgFmt_YVYU, /*!< 422 format, 1 plane (YVYU) */
+ eImgFmt_UYVY, /*!< 422 format, 1 plane (UYVY) */
+ eImgFmt_VYUY, /*!< 422 format, 1 plane (VYUY) */
+
+ eImgFmt_NV61, /*!< 422 format, 2 plane (Y),(VU) */
+ eImgFmt_NV12, /*!< 420 format, 2 plane (Y),(UV) */
+ eImgFmt_NV12_BLK, /*!< 420 format block mode, 2 plane (Y),(UV) */
+ eImgFmt_NV21_BLK, /*!< 420 format block mode, 2 plane (Y),(VU) */
+
+ eImgFmt_YV16, /*!< 422 format, 3 plane (Y),(V),(U) */
+ eImgFmt_I420, /*!< 420 format, 3 plane (Y),(U),(V) */
+ eImgFmt_I422, /*!< 422 format, 3 plane (Y),(U),(V) */
+
+ eImgFmt_ARGB8888, /*!< ARGB (32-bit; LSB:A, MSB:B), 1 plane */
+ eImgFmt_ARGB888 = eImgFmt_ARGB8888, /*!< deprecated; Replace it with eImgFmt_ARGB8888 */
+
+ eImgFmt_BAYER8, /*!< Bayer format, 8-bit */
+ eImgFmt_BAYER10, /*!< Bayer format, 10-bit */
+ eImgFmt_BAYER12, /*!< Bayer format, 12-bit */
+ eImgFmt_BAYER14, /*!< Bayer format, 14-bit */
+
+ eImgFmt_FG_BAYER8, /*!< Full-G (8-bit) */
+ eImgFmt_FG_BAYER10, /*!< Full-G (10-bit) */
+ eImgFmt_FG_BAYER12, /*!< Full-G (12-bit) */
+ eImgFmt_FG_BAYER14, /*!< Full-G (14-bit) */
+ eImgFmt_UFO_BAYER10, /*!< UFO (10-bit) */
+
+ eImgFmt_JPEG, /*!< JPEG format */
+
+ eImgFmt_JPG_I420, /*!< JPEG 420 format, 3 plane (Y),(U),(V) */
+ eImgFmt_JPG_I422, /*!< JPEG 422 format, 3 plane (Y),(U),(V) */
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_IMAGEFORMAT_H_
+
diff --git a/include/hardware/include/mtkcam/Log.h b/include/hardware/include/mtkcam/Log.h
new file mode 100644
index 0000000..4e8e1b9
--- /dev/null
+++ b/include/hardware/include/mtkcam/Log.h
@@ -0,0 +1,127 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_LOG_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_LOG_H_
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+#include <inttypes.h>
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+
+#ifndef USING_MTK_LDVT
+//
+#if (defined(MTKCAM_BASIC_PACKAGE) && MTKCAM_BASIC_PACKAGE == 1)
+//
+#include <cutils/log.h>
+#define CAM_LOGV(fmt, arg...) ALOGV(fmt, ##arg)
+#define CAM_LOGD(fmt, arg...) ALOGD(fmt, ##arg)
+#define CAM_LOGI(fmt, arg...) ALOGI(fmt, ##arg)
+#define CAM_LOGW(fmt, arg...) ALOGW(fmt, ##arg)
+#define CAM_LOGE(fmt, arg...) ALOGE(fmt" (%s){#%d:%s}", ##arg, __FUNCTION__, __LINE__, __FILE__)
+//
+#else
+//
+#include <cutils/xlog.h>
+#define CAM_LOGV(fmt, arg...) XLOGV(fmt"\r\n", ##arg)
+#define CAM_LOGD(fmt, arg...) XLOGD(fmt"\r\n", ##arg)
+#define CAM_LOGI(fmt, arg...) XLOGI(fmt"\r\n", ##arg)
+#define CAM_LOGW(fmt, arg...) XLOGW(fmt"\r\n", ##arg)
+#define CAM_LOGE(fmt, arg...) XLOGE(fmt" (%s){#%d:%s}""\r\n", ##arg, __FUNCTION__, __LINE__, __FILE__)
+//
+#endif
+
+#else //using LDVT
+
+#ifndef DBG_LOG_TAG
+#define DBG_LOG_TAG
+#endif
+
+#include <uvvf.h>
+#define NEW_LINE_CHAR "\n"
+
+#define CAM_LOGV(fmt, arg...) VV_MSG(DBG_LOG_TAG "[%s] " fmt NEW_LINE_CHAR, __func__, ##arg) // <Verbose>: Show more detail debug information. E.g. Entry/exit of private function; contain of local variable in function or code block; return value of system function/API...
+#define CAM_LOGD(fmt, arg...) VV_MSG(DBG_LOG_TAG "[%s] " fmt NEW_LINE_CHAR, __func__, ##arg) // <Debug>: Show general debug information. E.g. Change of state machine; entry point or parameters of Public function or OS callback; Start/end of process thread...
+#define CAM_LOGI(fmt, arg...) VV_MSG(DBG_LOG_TAG "[%s] " fmt NEW_LINE_CHAR, __func__, ##arg) // <Info>: Show general system information. Like OS version, start/end of Service...
+#define CAM_LOGW(fmt, arg...) VV_MSG(DBG_LOG_TAG "[%s] WARNING: " fmt NEW_LINE_CHAR, __func__, ##arg) // <Warning>: Some errors are encountered, but after exception handling, user won't notice there were errors happened.
+#define CAM_LOGE(fmt, arg...) VV_ERRMSG(DBG_LOG_TAG "[%s, %s, line%04d] ERROR: " fmt NEW_LINE_CHAR, __FILE__, __func__, __LINE__, ##arg) // When MP, will only show log of this level. // <Fatal>: Serious error that cause program can not execute. <Error>: Some error that causes some part of the functionality can not operate normally.
+#define BASE_LOG_AST(cond, fmt, arg...) \
+ do { \
+ if (!(cond)) \
+ VV_ERRMSG("[%s, %s, line%04d] ASSERTION FAILED! : " fmt NEW_LINE_CHAR, __FILE__, __func__, __LINE__, ##arg); \
+ } while (0)
+
+#endif
+//
+// ASSERT
+#define CAM_LOGA(...) \
+ do { \
+ CAM_LOGE("[Assert] "__VA_ARGS__); \
+ while(1) { ::usleep(500 * 1000); } \
+ } while (0)
+//
+//
+// FATAL
+#define CAM_LOGF(...) \
+ do { \
+ CAM_LOGE("[Fatal] "__VA_ARGS__); \
+ LOG_ALWAYS_FATAL_IF(1, "(%s){#%d:%s}""\r\n", __FUNCTION__, __LINE__, __FILE__); \
+ } while (0)
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+#define CAM_LOGV_IF(cond, ...) do { if ( (cond) ) { CAM_LOGV(__VA_ARGS__); } }while(0)
+#define CAM_LOGD_IF(cond, ...) do { if ( (cond) ) { CAM_LOGD(__VA_ARGS__); } }while(0)
+#define CAM_LOGI_IF(cond, ...) do { if ( (cond) ) { CAM_LOGI(__VA_ARGS__); } }while(0)
+#define CAM_LOGW_IF(cond, ...) do { if ( (cond) ) { CAM_LOGW(__VA_ARGS__); } }while(0)
+#define CAM_LOGE_IF(cond, ...) do { if ( (cond) ) { CAM_LOGE(__VA_ARGS__); } }while(0)
+#define CAM_LOGA_IF(cond, ...) do { if ( (cond) ) { CAM_LOGA(__VA_ARGS__); } }while(0)
+#define CAM_LOGF_IF(cond, ...) do { if ( (cond) ) { CAM_LOGF(__VA_ARGS__); } }while(0)
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_LOG_H_
+
diff --git a/include/hardware/include/mtkcam/Modes.h b/include/hardware/include/mtkcam/Modes.h
new file mode 100644
index 0000000..ae87585
--- /dev/null
+++ b/include/hardware/include/mtkcam/Modes.h
@@ -0,0 +1,102 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_MODES_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_MODES_H_
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+
+
+/**
+ * @enum EAppMode
+ * @brief App Mode Enumeration.
+ *
+ */
+enum EAppMode
+{
+ eAppMode_DefaultMode = 0, /*!< Default Mode */
+ eAppMode_EngMode, /*!< Engineer Mode */
+ eAppMode_AtvMode, /*!< ATV Mode */
+ eAppMode_StereoMode, /*!< Stereo Mode */
+ eAppMode_VtMode, /*!< VT Mode */
+ eAppMode_PhotoMode, /*!< Photo Mode */
+ eAppMode_VideoMode, /*!< Video Mode */
+ eAppMode_ZsdMode, /*!< ZSD Mode */
+ eAppMode_FactoryMode, /*!< Factory Mode */
+};
+
+
+/**
+ * @enum EShotMode
+ * @brief Shot Mode Enumeration.
+ *
+ */
+enum EShotMode
+{
+ eShotMode_NormalShot, /*!< Normal Shot */
+ eShotMode_ContinuousShot, /*!< Continuous Shot Ncc*/
+ eShotMode_ContinuousShotCc, /*!< Continuous Shot Cc*/
+ eShotMode_BestShot, /*!< Best Select Shot */
+ eShotMode_EvShot, /*!< Ev-bracketshot Shot */
+ eShotMode_SmileShot, /*!< Smile-detection Shot */
+ eShotMode_HdrShot, /*!< High-dynamic-range Shot */
+ eShotMode_AsdShot, /*!< Auto-scene-detection Shot */
+ eShotMode_ZsdShot, /*!< Zero-shutter-delay Shot */
+ eShotMode_FaceBeautyShot, /*!< Face-beautifier Shot */
+ eShotMode_Mav, /*!< Multi-angle view Shot */
+ eShotMode_Autorama, /*!< Auto-panorama Shot */
+ eShotMode_MultiMotionShot, /*!< Multi-motion Shot */
+ eShotMode_Panorama3D, /*!< Panorama 3D Shot */
+ eShotMode_Single3D, /*!< Single Camera 3D Shot */
+ eShotMode_EngShot, /*!< Engineer Mode Shot */
+ eShotMode_VideoSnapShot, /*!< Video Snap Shot */
+ eShotMode_FaceBeautyShotCc, /*!< Video Snap Shot */
+ eShotMode_ZsdHdrShot, /*!< ZSD with High-dynamic-range Shot */
+ eShotMode_ZsdMfllShot, /*!< ZSD with MFLL shot */
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_MODES_H_
+
diff --git a/include/hardware/include/mtkcam/Trace.h b/include/hardware/include/mtkcam/Trace.h
new file mode 100644
index 0000000..cb172a1
--- /dev/null
+++ b/include/hardware/include/mtkcam/Trace.h
@@ -0,0 +1,86 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_TRACE_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_TRACE_H_
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+#ifndef ATRACE_TAG
+#define ATRACE_TAG ATRACE_TAG_CAMERA
+#endif
+//
+#if 1
+#include <utils/Trace.h>
+#define CAM_TRACE_NAME_LENGTH 32
+#define CAM_TRACE_CALL() ATRACE_CALL()
+#define CAM_TRACE_NAME(name) ATRACE_NAME(name)
+#define CAM_TRACE_INT(name, value) ATRACE_INT(name, value)
+#define CAM_TRACE_BEGIN(name) ATRACE_BEGIN(name)
+#define CAM_TRACE_END() ATRACE_END()
+#define CAM_TRACE_ASYNC_BEGIN(name, cookie) ATRACE_ASYNC_BEGIN(name, cookie)
+#define CAM_TRACE_ASYNC_END(name, cookie) ATRACE_ASYNC_END(name, cookie)
+#define CAM_TRACE_FMT_BEGIN(fmt, arg...) \
+do{ \
+ if( ATRACE_ENABLED() ) \
+ { \
+ char buf[CAM_TRACE_NAME_LENGTH]; \
+ snprintf(buf, CAM_TRACE_NAME_LENGTH, fmt, ##arg); \
+ CAM_TRACE_BEGIN(buf); \
+ } \
+}while(0)
+#define CAM_TRACE_FMT_END() CAM_TRACE_END()
+#else
+#define CAM_TRACE_CALL()
+#define CAM_TRACE_NAME(name)
+#define CAM_TRACE_INT(name, value)
+#define CAM_TRACE_BEGIN(name)
+#define CAM_TRACE_END()
+#define CAM_TRACE_ASYNC_BEGIN(name, cookie)
+#define CAM_TRACE_ASYNC_END(name, cookie)
+#define CAM_TRACE_FMT_BEGIN(fmt, arg...)
+#define CAM_TRACE_FMT_END()
+#endif
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_TRACE_H_
+
diff --git a/include/hardware/include/mtkcam/TypeManip.h b/include/hardware/include/mtkcam/TypeManip.h
new file mode 100644
index 0000000..bef13c4
--- /dev/null
+++ b/include/hardware/include/mtkcam/TypeManip.h
@@ -0,0 +1,77 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_TYPEMANIP_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_TYPEMANIP_H_
+
+
+/******************************************************************************
+ * Type manipulation.
+ ******************************************************************************/
+#ifdef __cplusplus
+namespace NSCam {
+
+
+/**
+ * @class template Int2Type.
+ * @brief Int2Type<v> converts an integral constant v into a unique type.
+ */
+template <int v>
+struct Int2Type
+{
+ enum { value = v };
+};
+
+
+/**
+ * @class template Type2Type.
+ * @brief Type2Type<T> converts a type T into a unique type.
+ */
+template <typename T>
+struct Type2Type
+{
+ typedef T OriginalType;
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace NSCam
+#endif //__cplusplus
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_TYPEMANIP_H_
+
diff --git a/include/hardware/include/mtkcam/UITypes.h b/include/hardware/include/mtkcam/UITypes.h
new file mode 100644
index 0000000..10e2b6c
--- /dev/null
+++ b/include/hardware/include/mtkcam/UITypes.h
@@ -0,0 +1,331 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_UITYPES_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_UITYPES_H_
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+
+
+/******************************************************************************
+ * Camera UI Types.
+ ******************************************************************************/
+struct MPoint;
+struct MSize;
+struct MRect;
+
+
+/**
+ *
+ * @brief Camera point type.
+ *
+ */
+struct MPoint
+{
+ typedef int value_type;
+
+ value_type x;
+ value_type y;
+
+#ifdef __cplusplus
+public: //// Instantiation.
+
+ // we don't provide copy-ctor and copy assignment on purpose
+ // because we want the compiler generated versions
+ inline MPoint(int _x = 0, int _y = 0)
+ : x(_x), y(_y)
+ {
+ }
+
+public: //// Operators.
+
+ // Checks for equality between two points.
+ inline bool operator == (MPoint const& rhs) const
+ {
+ return (x == rhs.x) && (y == rhs.y);
+ }
+
+ // Checks for inequality between two points.
+ inline bool operator != (MPoint const& rhs) const
+ {
+ return ! operator == (rhs);
+ }
+
+ inline bool operator < (MPoint const& rhs) const
+ {
+ return y<rhs.y || (y==rhs.y && x<rhs.x);
+ }
+
+ inline MPoint& operator += (MPoint const& rhs)
+ {
+ x += rhs.x;
+ y += rhs.y;
+ return *this;
+ }
+
+ inline MPoint& operator -= (MPoint const& rhs)
+ {
+ x -= rhs.x;
+ y -= rhs.y;
+ return *this;
+ }
+
+ inline MPoint operator + (MPoint const& rhs) const
+ {
+ MPoint const result(x+rhs.x, y+rhs.y);
+ return result;
+ }
+
+ inline MPoint operator - (MPoint const& rhs) const
+ {
+ MPoint const result(x-rhs.x, y-rhs.y);
+ return result;
+ }
+
+ inline MPoint& operator - ()
+ {
+ x = -x;
+ y = -y;
+ return *this;
+ }
+
+public: //// Attributes.
+
+ inline bool isOrigin() const
+ {
+ return !(x|y);
+ }
+#endif //__cplusplus
+};
+
+
+/**
+ *
+ * @brief Camera size type.
+ *
+ */
+struct MSize
+{
+ typedef int value_type;
+ value_type w;
+ value_type h;
+
+#ifdef __cplusplus
+public: //// Instantiation.
+
+ // we don't provide copy-ctor and copy assignment on purpose
+ // because we want the compiler generated versions
+
+ inline MSize(int _w = 0, int _h = 0)
+ : w(_w), h(_h)
+ {
+ }
+
+ inline MSize(MPoint const& topLeft, MPoint const& bottomRight)
+ : w(bottomRight.x-topLeft.x), h(bottomRight.y-topLeft.y)
+ {
+ }
+
+public: //// Operations.
+
+ // Returns the product of w and h.
+ inline value_type size() const
+ {
+ return w * h;
+ }
+
+public: //// Operators.
+
+ // Checks for invalid size with width <= 0 or height <= 0.
+ inline bool operator ! () const
+ {
+ return (w <= 0) || (h <= 0);
+ }
+
+ // Checks for equality between two sizes.
+ inline bool operator == (MSize const& rhs) const
+ {
+ return (w == rhs.w) && (h == rhs.h);
+ }
+
+ // Checks for inequality between two sizes.
+ inline bool operator != (MSize const& rhs) const
+ {
+ return ! operator == (rhs);
+ }
+
+ // Adds a size to this size.
+ inline MSize& operator += (MSize const& rhs)
+ {
+ w += rhs.w;
+ h += rhs.h;
+ return *this;
+ }
+
+ // Subtracts a size from this size.
+ inline MSize& operator -= (MSize const& rhs)
+ {
+ w -= rhs.w;
+ h -= rhs.h;
+ return *this;
+ }
+
+ // Adds two sizes.
+ inline MSize operator + (MSize const& rhs) const
+ {
+ MSize const result(w+rhs.w, h+rhs.h);
+ return result;
+ }
+
+ // Subtracts two sizes.
+ inline MSize operator - (MSize const& rhs) const
+ {
+ MSize const result(w-rhs.w, h-rhs.h);
+ return result;
+ }
+
+ // Multiplies a size by a scalar.
+ inline MSize operator * (value_type scalar) const
+ {
+ MSize const result(w*scalar, h*scalar);
+ return result;
+ }
+
+ // Divides a size by a scalar.
+ inline MSize operator / (value_type scalar) const
+ {
+ MSize const result(w/scalar, h/scalar);
+ return result;
+ }
+
+ // Shifts bits in a size to the right.
+ inline MSize operator >> (value_type shift) const
+ {
+ MSize const result(w>>shift, h>>shift);
+ return result;
+ }
+
+ // Shifts bits in a size to the left.
+ inline MSize operator << (value_type shift) const
+ {
+ MSize const result(w<<shift, h<<shift);
+ return result;
+ }
+
+#endif //__cplusplus
+};
+
+
+/**
+ *
+ * @brief Camera rectangle type.
+ *
+ */
+struct MRect
+{
+ typedef int value_type;
+ MPoint p; // left-top corner
+ MSize s; // width, height
+
+#ifdef __cplusplus
+public: //// Instantiation.
+
+ // we don't provide copy-ctor and copy assignment on purpose
+ // because we want the compiler generated versions
+
+ inline MRect(int _w = 0, int _h = 0)
+ : p(0, 0), s(_w, _h)
+ {
+ }
+
+ inline MRect(MPoint const& topLeft, MPoint const& bottomRight)
+ : p(topLeft), s(topLeft, bottomRight)
+ {
+ }
+
+ inline MRect(MPoint const& _p, MSize const& _s)
+ : p(_p), s(_s)
+ {
+ }
+
+public: //// Operators.
+
+ // Checks for equality between two rectangles.
+ inline bool operator == (MRect const& rhs) const
+ {
+ return (p == rhs.p) && (s == rhs.s);
+ }
+
+ // Checks for inequality between two rectangles.
+ inline bool operator != (MRect const& rhs) const
+ {
+ return ! operator == (rhs);
+ }
+
+public: //// Accessors.
+
+ inline MPoint leftTop() const { return p; }
+ inline MPoint leftBottom() const { return MPoint(p.x, p.y+s.h); }
+ inline MPoint rightTop() const { return MPoint(p.x+s.w, p.y); }
+ inline MPoint rightBottom() const { return MPoint(p.x+s.w, p.y+s.h); }
+
+ inline MSize const& size() const { return s; }
+
+ inline value_type width() const { return s.w; }
+ inline value_type height() const { return s.h; }
+
+public: //// Operations.
+
+ inline void clear()
+ {
+ p.x = p.y = s.w = s.h = 0;
+ }
+
+#endif //__cplusplus
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_UITYPES_H_
+
diff --git a/include/hardware/include/mtkcam/acdk/AcdkCommon.h b/include/hardware/include/mtkcam/acdk/AcdkCommon.h
new file mode 100644
index 0000000..e03a287
--- /dev/null
+++ b/include/hardware/include/mtkcam/acdk/AcdkCommon.h
@@ -0,0 +1,306 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein
+ * is confidential and proprietary to MediaTek Inc. and/or its licensors.
+ * Without the prior written permission of MediaTek inc. and/or its licensors,
+ * any reproduction, modification, use or disclosure of MediaTek Software,
+ * and information contained herein, in whole or in part, shall be strictly prohibited.
+ */
+/* MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON
+ * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+ * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+ * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+ * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
+ * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
+ * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
+ * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
+ * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
+ * CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+ * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+ * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
+ * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek Software")
+ * have been modified by MediaTek Inc. All revisions are subject to any receiver's
+ * applicable license agreements with MediaTek Inc.
+ */
+
+///////////////////////////////////////////////////////////////////////////////
+// No Warranty
+// Except as may be otherwise agreed to in writing, no warranties of any
+// kind, whether express or implied, are given by MTK with respect to any MTK
+// Deliverables or any use thereof, and MTK Deliverables are provided on an
+// "AS IS" basis. MTK hereby expressly disclaims all such warranties,
+// including any implied warranties of merchantability, non-infringement and
+// fitness for a particular purpose and any warranties arising out of course
+// of performance, course of dealing or usage of trade. Parties further
+// acknowledge that Company may, either presently and/or in the future,
+// instruct MTK to assist it in the development and the implementation, in
+// accordance with Company's designs, of certain softwares relating to
+// Company's product(s) (the "Services"). Except as may be otherwise agreed
+// to in writing, no warranties of any kind, whether express or implied, are
+// given by MTK with respect to the Services provided, and the Services are
+// provided on an "AS IS" basis. Company further acknowledges that the
+// Services may contain errors, that testing is important and Company is
+// solely responsible for fully testing the Services and/or derivatives
+// thereof before they are used, sublicensed or distributed. Should there be
+// any third party action brought against MTK, arising out of or relating to
+// the Services, Company agree to fully indemnify and hold MTK harmless.
+// If the parties mutually agree to enter into or continue a business
+// relationship or other arrangement, the terms and conditions set forth
+// hereunder shall remain effective and, unless explicitly stated otherwise,
+// shall prevail in the event of a conflict in the terms in any agreements
+// entered into between the parties.
+////////////////////////////////////////////////////////////////////////////////
+// Copyright (c) 2008, MediaTek Inc.
+// All rights reserved.
+//
+// Unauthorized use, practice, perform, copy, distribution, reproduction,
+// or disclosure of this information in whole or in part is prohibited.
+////////////////////////////////////////////////////////////////////////////////
+
+//! \file AcdkCommon.h
+
+#ifndef _ACDKCOMMON_H_
+#define _ACDKCOMMON_H_
+
+#include "mtkcam/acdk/AcdkTypes.h"
+
+/**
+*@enum eACDK_COMMAND
+*/
+typedef enum
+{
+ ACDK_COMMAND_START = 0x80001000,
+ ACDK_CMD_PREVIEW_START,
+ ACDK_CMD_PREVIEW_STOP,
+ ACDK_CMD_CAPTURE,
+ ACDK_CMD_QV_IMAGE,
+ ACDK_CMD_RESET_LAYER_BUFFER,
+ ACDK_CMD_SET_SRC_DEV,
+ ACDK_CMD_SET_OPERATION_MODE,
+ ACDK_CMD_SET_SHUTTER_TIME,
+ ACDK_CMD_GET_SHUTTER_TIME,
+ ACDK_CMD_GET_CHECKSUM,
+ ACDK_CMD_GET_AF_INFO,
+ ACDK_CMD_GET_SENSOR_MODE_NUM,
+ ACDK_COMMAND_END
+}eACDK_COMMAND;
+
+/**
+*@enum eACDK_CAP_MODE
+*/
+typedef enum
+{
+ PREVIEW_MODE = 0,
+ CAPTURE_MODE,
+ VIDEO_MODE,
+ VIDEO1_MODE,
+ VIDEO2_MODE,
+ VIDEO3_MODE,
+ VIDEO4_MODE,
+ VIDEO5_MODE,
+ VIDEO6_MODE,
+ VIDEO7_MODE,
+ CAMERA_MODE_NUM
+}eACDK_CAMERA_MODE, eCAMERA_MODE;
+
+/**
+*@enum eACDK_OPERA_MODE
+*/
+typedef enum
+{
+ ACDK_OPT_NONE_MODE = 0,
+ ACDK_OPT_META_MODE,
+ ACDK_OPT_FACTORY_MODE
+}eACDK_OPERA_MODE;
+
+/**
+*@enum eIMAGE_TYPE
+*/
+typedef enum
+{
+ RGB565_TYPE = 0x00000001,
+ RGB888_TYPE = 0x00000002,
+ PURE_RAW8_TYPE = 0x00000004,
+ PURE_RAW10_TYPE = 0x00000008,
+ PROCESSED_RAW8_TYPE = 0x00000010,
+ PROCESSED_RAW10_TYPE = 0x00000020,
+ JPEG_TYPE = 0x00000040,
+ YUV_TYPE = 0x00000080,
+ JPEG_RAW10_TYPE = 0x00000100
+}eACDK_CAP_FORMAT;
+
+/**
+*@struct ACDK_FEATURE_INFO_STRUCT
+*/
+typedef struct
+{
+ MUINT8 *puParaIn;
+ MUINT8 *puParaOut;
+ MUINT32 u4ParaInLen;
+ MUINT32 u4ParaOutLen;
+ MUINT32 *pu4RealParaOutLen;
+}ACDK_FEATURE_INFO_STRUCT, *PACDK_FEATURE_INFO_STRUCT;
+
+/**
+*@struct ACDK_PREVIEW_STRUCT
+*/
+typedef struct
+{
+ MUINT32 u4PrvW;
+ MUINT32 u4PrvH;
+ MUINT16 u16PreviewTestPatEn;
+ MUINT16 u16HDRModeEn;
+ Func_CB fpPrvCB;
+ eACDK_OPERA_MODE eOperaMode;
+ MUINT32 u4OperaType; /* 0: Pure ISP, 1: Eng ISP */
+ MUINT32 u4SensorMode;
+}ACDK_PREVIEW_STRUCT, *PACDK_PREVIEW_STRUCT;
+
+typedef enum
+{
+ EMultiNR_Off = 0,
+ EMultiNR_HW,
+ EMultiNR_SW
+} EMultiNR_Mode;
+
+
+/**
+*@struct ACDK_SINGLE_CAP_STRUCT_S
+*/
+typedef struct ACDK_CAPTURE_STRUCT_S
+{
+ eACDK_CAMERA_MODE eCameraMode;
+ eACDK_OPERA_MODE eOperaMode;
+ eACDK_CAP_FORMAT eOutputFormat;
+ MUINT16 u2JPEGEncWidth;
+ MUINT16 u2JPEGEncHeight;
+ Func_CB fpCapCB;
+ MUINT32 u4CapCount;
+ MINT32 i4IsSave; //0-don't save, 1-save
+ MBOOL bUnPack;
+ MBOOL MFLL_En; //MFLL mode enable setting
+ MUINT16 HDRModeEn; // 0: diable HDR, 1: Enable IHDR
+ EMultiNR_Mode eMultiNR;
+ MUINT32 u4OperaType; /* 0: Pure ISP, 1: Eng ISP */
+public :
+ ACDK_CAPTURE_STRUCT_S(eACDK_CAMERA_MODE a_camMode = CAPTURE_MODE,
+ eACDK_OPERA_MODE a_operaMode = ACDK_OPT_META_MODE,
+ eACDK_CAP_FORMAT a_outFormat = PURE_RAW10_TYPE,
+ MUINT16 a_jpegEncWdth = 0,
+ MUINT16 a_jpegEncHeight = 0,
+ Func_CB a_funCB = NULL,
+ MUINT32 a_capCnt = 1,
+ MINT32 a_isSave = 0,
+ MBOOL a_unPack = MFALSE,
+ MBOOL a_MFLL_En = MFALSE,
+ MUINT16 a_u16HDRModeEn = 0,
+ EMultiNR_Mode a_MultiNR = EMultiNR_Off,
+ MUINT32 a_u4OperaType = 0)
+ : eCameraMode(a_camMode),
+ eOperaMode(a_operaMode),
+ eOutputFormat(a_outFormat),
+ u2JPEGEncWidth(a_jpegEncWdth),
+ u2JPEGEncHeight(a_jpegEncHeight),
+ fpCapCB(a_funCB),
+ u4CapCount(a_capCnt),
+ i4IsSave(a_isSave),
+ bUnPack(a_unPack),
+ MFLL_En(a_MFLL_En),
+ HDRModeEn(a_u16HDRModeEn),
+ eMultiNR(a_MultiNR),
+ u4OperaType(a_u4OperaType)
+ {
+ }
+}ACDK_CAPTURE_STRUCT, *PACDK_CAPTURE_STRUCT;
+
+/**
+*@enum eRAW_ColorOrder
+*@brief Color order of RAW image
+*/
+typedef enum
+{
+ RawPxlOrder_B = 0, //! B Gb Gr R
+ RawPxlOrder_Gb, //! Gb B R Gr
+ RawPxlOrderr_Gr, //! Gr R B Gb
+ RawPxlOrder_R //! R Gr Gb B
+}eRAW_ColorOrder;
+
+/**
+*@enum eYUV_ColorOrder
+*@brief YUV format
+*/
+typedef enum
+{
+ YUVFmt_Unknown = 0,
+ YUVFmt_UYVY,
+ YUVFmt_VYUY,
+ YUVFmt_YUY2,
+ YUVFmt_YVYU
+}eYUV_ColorOrder;
+
+/**
+*@struct bufInfo
+*@brief Infomation of image (except RAW)
+*/
+typedef struct
+{
+ MUINT8 *bufAddr;
+ MUINT32 imgWidth;
+ MUINT32 imgHeight;
+ MUINT32 imgSize;
+ MINT32 imgFmt;
+} bufInfo;
+
+/**
+*@struct RAWBufInfo
+*@brief Infomation of RAW image
+*/
+typedef struct
+{
+ MUINT8 *bufAddr;
+ MUINT32 bitDepth;
+ MUINT32 imgWidth;
+ MUINT32 imgHeight;
+ MUINT32 imgSize;
+ MBOOL isPacked;
+ eRAW_ColorOrder eColorOrder;
+}RAWBufInfo;
+
+/**
+*@struct ImageBufInfo
+*@brief Infomation of image buffer
+*/
+typedef struct
+{
+ eACDK_CAP_FORMAT eImgType; //! Image type
+ union
+ {
+ bufInfo imgBufInfo;
+ RAWBufInfo RAWImgBufInfo;
+ };
+}ImageBufInfo;
+
+/**
+*@struct ROIRect
+*@brief CCT Application
+*/
+typedef struct
+{
+ MUINT32 u4StartX; //! Start X position for clip
+ MUINT32 u4StartY; //! Start Y position for clip
+ MUINT32 u4ROIWidth; //! Width of ROI
+ MUINT32 u4ROIHeight; //! Height of ROI
+}ROIRect;
+
+#endif //end AcdkCommon.h
+
diff --git a/include/hardware/include/mtkcam/acdk/AcdkIF.h b/include/hardware/include/mtkcam/acdk/AcdkIF.h
new file mode 100644
index 0000000..24937b4
--- /dev/null
+++ b/include/hardware/include/mtkcam/acdk/AcdkIF.h
@@ -0,0 +1,114 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein
+ * is confidential and proprietary to MediaTek Inc. and/or its licensors.
+ * Without the prior written permission of MediaTek inc. and/or its licensors,
+ * any reproduction, modification, use or disclosure of MediaTek Software,
+ * and information contained herein, in whole or in part, shall be strictly prohibited.
+ */
+/* MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON
+ * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+ * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+ * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+ * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
+ * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
+ * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
+ * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
+ * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
+ * CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+ * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+ * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
+ * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek Software")
+ * have been modified by MediaTek Inc. All revisions are subject to any receiver's
+ * applicable license agreements with MediaTek Inc.
+ */
+
+///////////////////////////////////////////////////////////////////////////////
+// No Warranty
+// Except as may be otherwise agreed to in writing, no warranties of any
+// kind, whether express or implied, are given by MTK with respect to any MTK
+// Deliverables or any use thereof, and MTK Deliverables are provided on an
+// "AS IS" basis. MTK hereby expressly disclaims all such warranties,
+// including any implied warranties of merchantability, non-infringement and
+// fitness for a particular purpose and any warranties arising out of course
+// of performance, course of dealing or usage of trade. Parties further
+// acknowledge that Company may, either presently and/or in the future,
+// instruct MTK to assist it in the development and the implementation, in
+// accordance with Company's designs, of certain softwares relating to
+// Company's product(s) (the "Services"). Except as may be otherwise agreed
+// to in writing, no warranties of any kind, whether express or implied, are
+// given by MTK with respect to the Services provided, and the Services are
+// provided on an "AS IS" basis. Company further acknowledges that the
+// Services may contain errors, that testing is important and Company is
+// solely responsible for fully testing the Services and/or derivatives
+// thereof before they are used, sublicensed or distributed. Should there be
+// any third party action brought against MTK, arising out of or relating to
+// the Services, Company agree to fully indemnify and hold MTK harmless.
+// If the parties mutually agree to enter into or continue a business
+// relationship or other arrangement, the terms and conditions set forth
+// hereunder shall remain effective and, unless explicitly stated otherwise,
+// shall prevail in the event of a conflict in the terms in any agreements
+// entered into between the parties.
+////////////////////////////////////////////////////////////////////////////////
+// Copyright (c) 2008, MediaTek Inc.
+// All rights reserved.
+//
+// Unauthorized use, practice, perform, copy, distribution, reproduction,
+// or disclosure of this information in whole or in part is prohibited.
+////////////////////////////////////////////////////////////////////////////////
+
+
+//! \file AcdkIF.h
+//! notice : must be included after AcdkCommon.h
+
+#ifndef _ACDKIF_H_
+#define _ACDKIF_H_
+
+#include "AcdkTypes.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+*@brief Create ACDK Object
+*/
+MBOOL MDK_Open();
+
+/**
+*@brief Destory ACDK Object
+*/
+MBOOL MDK_Close();
+
+/**
+*@brief Initialize
+*@note Must call right after MDK_Open() and before MDK_IOControl
+*/
+MBOOL MDK_Init();
+
+/**
+*@brief Uninitialize
+*/
+MBOOL MDK_DeInit();
+
+/**
+*@brief Command interface
+*/
+MBOOL MDK_IOControl(MUINT32 a_u4Ioctl, ACDK_FEATURE_INFO_STRUCT *a_prAcdkFeatureInfo);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif
+
diff --git a/include/hardware/include/mtkcam/acdk/AcdkTypes.h b/include/hardware/include/mtkcam/acdk/AcdkTypes.h
new file mode 100644
index 0000000..997ede7
--- /dev/null
+++ b/include/hardware/include/mtkcam/acdk/AcdkTypes.h
@@ -0,0 +1,151 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein
+ * is confidential and proprietary to MediaTek Inc. and/or its licensors.
+ * Without the prior written permission of MediaTek inc. and/or its licensors,
+ * any reproduction, modification, use or disclosure of MediaTek Software,
+ * and information contained herein, in whole or in part, shall be strictly prohibited.
+ */
+/* MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON
+ * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+ * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+ * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+ * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
+ * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
+ * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
+ * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
+ * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
+ * CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+ * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+ * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
+ * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek Software")
+ * have been modified by MediaTek Inc. All revisions are subject to any receiver's
+ * applicable license agreements with MediaTek Inc.
+ */
+
+///////////////////////////////////////////////////////////////////////////////
+// No Warranty
+// Except as may be otherwise agreed to in writing, no warranties of any
+// kind, whether express or implied, are given by MTK with respect to any MTK
+// Deliverables or any use thereof, and MTK Deliverables are provided on an
+// "AS IS" basis. MTK hereby expressly disclaims all such warranties,
+// including any implied warranties of merchantability, non-infringement and
+// fitness for a particular purpose and any warranties arising out of course
+// of performance, course of dealing or usage of trade. Parties further
+// acknowledge that Company may, either presently and/or in the future,
+// instruct MTK to assist it in the development and the implementation, in
+// accordance with Company's designs, of certain softwares relating to
+// Company's product(s) (the "Services"). Except as may be otherwise agreed
+// to in writing, no warranties of any kind, whether express or implied, are
+// given by MTK with respect to the Services provided, and the Services are
+// provided on an "AS IS" basis. Company further acknowledges that the
+// Services may contain errors, that testing is important and Company is
+// solely responsible for fully testing the Services and/or derivatives
+// thereof before they are used, sublicensed or distributed. Should there be
+// any third party action brought against MTK, arising out of or relating to
+// the Services, Company agree to fully indemnify and hold MTK harmless.
+// If the parties mutually agree to enter into or continue a business
+// relationship or other arrangement, the terms and conditions set forth
+// hereunder shall remain effective and, unless explicitly stated otherwise,
+// shall prevail in the event of a conflict in the terms in any agreements
+// entered into between the parties.
+////////////////////////////////////////////////////////////////////////////////
+// Copyright (c) 2008, MediaTek Inc.
+// All rights reserved.
+//
+// Unauthorized use, practice, perform, copy, distribution, reproduction,
+// or disclosure of this information in whole or in part is prohibited.
+////////////////////////////////////////////////////////////////////////////////
+
+//! \file AcdkTyeps.h
+
+#ifndef _ACDKTYPES_H_
+#define _ACDKTYPES_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <stdint.h>
+
+/**********************************************************************
+*!Typedefs
+**********************************************************************/
+//
+typedef signed char MINT8;
+typedef unsigned char MUINT8;
+//
+typedef signed short MINT16;
+typedef unsigned short MUINT16;
+//
+typedef signed int MINT32;
+typedef unsigned int MUINT32;
+//
+typedef int64_t MINT64;
+typedef uint64_t MUINT64;
+//
+typedef signed int MINT;
+typedef unsigned int MUINT;
+//
+typedef intptr_t MINTPTR;
+typedef uintptr_t MUINTPTR;
+/******************************************************************************
+ *
+ ******************************************************************************/
+//
+typedef void MVOID;
+typedef float MFLOAT;
+typedef double MDOUBLE;
+//
+typedef int MBOOL;
+//
+#ifndef MTRUE
+ #define MTRUE 1
+#endif
+#ifndef MFALSE
+ #define MFALSE 0
+#endif
+#ifndef MNULL
+ #define MNULL 0
+#endif
+
+typedef MVOID (*Func_CB)(MVOID* a_pParam);
+/**********************************************************************
+*! Nucamera commands
+**********************************************************************/
+typedef struct Acdk_CLICmd_t
+{
+ //! Command string, include shortcut key
+ const char *pucCmdStr;
+
+ //! Help string, include functionality and parameter description
+ const char *pucHelpStr;
+
+ //! Handling function
+ //! \param a_u4Argc [IN] Number of arguments plus 1
+ //! \param a_pprArgv [IN] Array of command and arguments, element 0 is
+ //! command string
+ //! \return error code
+ //FIXME: return MRESULT is good?
+ MINT32 (*handleCmd)(const MUINT32 a_u4Argc, MUINT8 *a_pprArgv[]);
+
+} Acdk_CLICmd;
+
+#define NULL_CLI_CMD {NULL, NULL, NULL}
+#define MAX_CLI_CMD_ARGS (25) //! Maximum CLI command arguments including the command itself
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif //end _ACDKTYPES_H_
+
diff --git a/include/hardware/include/mtkcam/acdk/CctIF.h b/include/hardware/include/mtkcam/acdk/CctIF.h
new file mode 100644
index 0000000..a0ef652
--- /dev/null
+++ b/include/hardware/include/mtkcam/acdk/CctIF.h
@@ -0,0 +1,107 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_ACDK_CCTIF_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_ACDK_CCTIF_H_
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+#include "AcdkCommon.h"
+
+/**********************************************************************
+*!Typedefs
+**********************************************************************/
+//
+typedef signed char MINT8;
+typedef unsigned char MUINT8;
+//
+typedef signed short MINT16;
+typedef unsigned short MUINT16;
+//
+typedef signed int MINT32;
+typedef unsigned int MUINT32;
+//
+typedef int64_t MINT64;
+typedef uint64_t MUINT64;
+//
+typedef signed int MINT;
+typedef unsigned int MUINT;
+//
+typedef intptr_t MINTPTR;
+typedef uintptr_t MUINTPTR;
+/******************************************************************************
+ *
+ ******************************************************************************/
+//
+typedef void MVOID;
+typedef float MFLOAT;
+typedef double MDOUBLE;
+//
+typedef int MBOOL;
+//
+#ifndef MTRUE
+ #define MTRUE 1
+#endif
+ //
+#ifndef MFALSE
+ #define MFALSE 0
+#endif
+ //
+#ifndef MNULL
+ #define MNULL 0
+#endif
+
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+MBOOL CctIF_Open();
+MBOOL CctIF_Close();
+MBOOL CctIF_Init(MINT32 dev = 1);
+MBOOL CctIF_DeInit();
+MBOOL CctIF_IOControl(MUINT32 a_u4Ioctl, ACDK_FEATURE_INFO_STRUCT *a_prAcdkFeatureInfo);
+MBOOL CctIF_FeatureCtrl(MUINT32 a_u4Ioctl, MUINT8 *puParaIn, MUINT32 u4ParaInLen, MUINT8 *puParaOut, MUINT32 u4ParaOutLen, MUINT32 *pu4RealParaOutLen);
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_ACDK_CCTIF_H_
+
diff --git a/include/hardware/include/mtkcam/acdk/MdkIF.h b/include/hardware/include/mtkcam/acdk/MdkIF.h
new file mode 100644
index 0000000..232a722
--- /dev/null
+++ b/include/hardware/include/mtkcam/acdk/MdkIF.h
@@ -0,0 +1,103 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_ACDK_MDKIF_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_ACDK_MDKIF_H_
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+#include "AcdkCommon.h"
+
+/**********************************************************************
+*!Typedefs
+**********************************************************************/
+//
+typedef signed char MINT8;
+typedef unsigned char MUINT8;
+//
+typedef signed short MINT16;
+typedef unsigned short MUINT16;
+//
+typedef signed int MINT32;
+typedef unsigned int MUINT32;
+//
+typedef int64_t MINT64;
+typedef uint64_t MUINT64;
+//
+typedef signed int MINT;
+typedef unsigned int MUINT;
+//
+typedef intptr_t MINTPTR;
+typedef uintptr_t MUINTPTR;
+/******************************************************************************
+ *
+ ******************************************************************************/
+//
+typedef void MVOID;
+typedef float MFLOAT;
+typedef double MDOUBLE;
+//
+typedef int MBOOL;
+//
+#ifndef MTRUE
+ #define MTRUE 1
+#endif
+//
+#ifndef MFALSE
+ #define MFALSE 0
+#endif
+//
+#ifndef MNULL
+ #define MNULL 0
+#endif
+/******************************************************************************
+ *
+ ******************************************************************************/
+MBOOL Mdk_Open();
+MBOOL Mdk_Close();
+MBOOL Mdk_Init();
+MBOOL Mdk_DeInit();
+MBOOL Mdk_IOControl(MUINT32 a_u4Ioctl, ACDK_FEATURE_INFO_STRUCT *a_prAcdkFeatureInfo);
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_ACDK_MDKIF_H_
+
diff --git a/include/hardware/include/mtkcam/common.h b/include/hardware/include/mtkcam/common.h
new file mode 100644
index 0000000..8d2bc64
--- /dev/null
+++ b/include/hardware/include/mtkcam/common.h
@@ -0,0 +1,60 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_COMMON_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_COMMON_H_
+/******************************************************************************
+ *
+ ******************************************************************************/
+//
+#include "Log.h"
+#include "Errors.h"
+#include "BuiltinTypes.h"
+#include "BasicTypes.h"
+#include "UITypes.h"
+#include "TypeManip.h"
+#include "Trace.h"
+//
+#include "ImageFormat.h"
+#include "IImageBuffer.h"
+#include "Modes.h"
+//
+/******************************************************************************
+ *
+ ******************************************************************************/
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_COMMON_H_
+
diff --git a/include/hardware/include/mtkcam/device/Cam1Device.h b/include/hardware/include/mtkcam/device/Cam1Device.h
new file mode 100644
index 0000000..2000aa5
--- /dev/null
+++ b/include/hardware/include/mtkcam/device/Cam1Device.h
@@ -0,0 +1,354 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein
+ * is confidential and proprietary to MediaTek Inc. and/or its licensors.
+ * Without the prior written permission of MediaTek inc. and/or its licensors,
+ * any reproduction, modification, use or disclosure of MediaTek Software,
+ * and information contained herein, in whole or in part, shall be strictly prohibited.
+ */
+/* MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON
+ * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+ * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+ * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+ * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
+ * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
+ * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
+ * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
+ * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
+ * CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+ * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+ * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
+ * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek Software")
+ * have been modified by MediaTek Inc. All revisions are subject to any receiver's
+ * applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_DEVICE_CAM1DEVICE_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_DEVICE_CAM1DEVICE_H_
+//
+#include <utils/String8.h>
+//
+#include "device1.h"
+#include "ICamDevice.h"
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace android {
+class ICamClient;
+}; //namespace android
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+class Cam1Device : public ICamDevice
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Definitions.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Definitions.
+ typedef android::status_t status_t;
+ typedef android::ICamClient ICamClient;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Data Members.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected: //// Data Members.
+
+ camera_module_callbacks_t const*mpModuleCallbacks;
+ camera_device mDevice;
+ mtk_camera_device_ops mDeviceOps; // which is pointed to by mDevice.ops.
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Operations.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Attributes.
+ //
+ static inline Cam1Device* getDevice(camera_device* device)
+ {
+ return (NULL == device)
+ ? NULL
+ : (Cam1Device*)((device)->priv)
+ ;
+ }
+
+ static inline Cam1Device* getDevice(hw_device_t* device)
+ {
+ return getDevice((camera_device*)device);
+ }
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Operations.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected: //// Instantiation.
+ virtual ~Cam1Device() {}
+ Cam1Device();
+
+ virtual void onLastStrongRef(const void* id);
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Interfaces.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: ////
+
+ virtual status_t closeDevice() = 0;
+
+ /**
+ * Initialize the device resources owned by this object.
+ *
+ * Return values:
+ *
+ * 0: On successful initialization
+ *
+ * -ENODEV: If initialization fails. Only uninitialize() can be called
+ * successfully by the framework after this.
+ */
+ virtual status_t initialize() = 0;
+
+ /**
+ * Uninitialize the device resources owned by this object. Note that this
+ * is *not* done in the destructor.
+ */
+ virtual void uninitialize() = 0;
+
+ /**
+ * Set the notification and data callbacks
+ */
+ virtual void setCallbacks(
+ camera_notify_callback notify_cb,
+ camera_data_callback data_cb,
+ camera_data_timestamp_callback data_cb_timestamp,
+ camera_request_memory get_memory,
+ void *user
+ ) = 0;
+
+ virtual void setCallbacks(
+ mtk_camera_metadata_callback metadata_cb,
+ void *user
+ ) = 0;
+
+ /**
+ * Enable a message, or set of messages.
+ */
+ virtual void enableMsgType(int32_t msgType) = 0;
+
+ /**
+ * Disable a message, or a set of messages.
+ *
+ * Once received a call to disableMsgType(CAMERA_MSG_VIDEO_FRAME), camera hal
+ * should not rely on its client to call releaseRecordingFrame() to release
+ * video recording frames sent out by the cameral hal before and after the
+ * disableMsgType(CAMERA_MSG_VIDEO_FRAME) call. Camera hal clients must not
+ * modify/access any video recording frame after calling
+ * disableMsgType(CAMERA_MSG_VIDEO_FRAME).
+ */
+ virtual void disableMsgType(int32_t msgType) = 0;
+
+ /**
+ * Query whether a message, or a set of messages, is enabled.
+ * Note that this is operates as an AND, if any of the messages
+ * queried are off, this will return false.
+ */
+ virtual bool msgTypeEnabled(int32_t msgType) = 0;
+
+ /**
+ * Set the preview_stream_ops to which preview frames are sent.
+ */
+ virtual status_t setPreviewWindow(preview_stream_ops* window) = 0;
+
+ /**
+ * Start preview mode.
+ */
+ virtual status_t startPreview() = 0;
+
+ /**
+ * Stop a previously started preview.
+ */
+ virtual void stopPreview() = 0;
+
+ /**
+ * Returns true if preview is enabled.
+ */
+ virtual bool previewEnabled() = 0;
+
+ /**
+ * Request the camera hal to store meta data or real YUV data in
+ * the video buffers send out via CAMERA_MSG_VIDEO_FRRAME for a
+ * recording session. If it is not called, the default camera
+ * hal behavior is to store real YUV data in the video buffers.
+ *
+ * This method should be called before startRecording() in order
+ * to be effective.
+ *
+ * If meta data is stored in the video buffers, it is up to the
+ * receiver of the video buffers to interpret the contents and
+ * to find the actual frame data with the help of the meta data
+ * in the buffer. How this is done is outside of the scope of
+ * this method.
+ *
+ * Some camera hal may not support storing meta data in the video
+ * buffers, but all camera hal should support storing real YUV data
+ * in the video buffers. If the camera hal does not support storing
+ * the meta data in the video buffers when it is requested to do
+ * do, INVALID_OPERATION must be returned. It is very useful for
+ * the camera hal to pass meta data rather than the actual frame
+ * data directly to the video encoder, since the amount of the
+ * uncompressed frame data can be very large if video size is large.
+ *
+ * @param enable if true to instruct the camera hal to store
+ * meta data in the video buffers; false to instruct
+ * the camera hal to store real YUV data in the video
+ * buffers.
+ *
+ * @return OK on success.
+ */
+ virtual status_t storeMetaDataInBuffers(bool enable) = 0;
+
+ /**
+ * Start record mode. When a record image is available a CAMERA_MSG_VIDEO_FRAME
+ * message is sent with the corresponding frame. Every record frame must be released
+ * by a cameral hal client via releaseRecordingFrame() before the client calls
+ * disableMsgType(CAMERA_MSG_VIDEO_FRAME). After the client calls
+ * disableMsgType(CAMERA_MSG_VIDEO_FRAME), it is camera hal's responsibility
+ * to manage the life-cycle of the video recording frames, and the client must
+ * not modify/access any video recording frames.
+ */
+ virtual status_t startRecording() = 0;
+
+ /**
+ * Stop a previously started recording.
+ */
+ virtual void stopRecording() = 0;
+
+ /**
+ * Returns true if recording is enabled.
+ */
+ virtual bool recordingEnabled() = 0;
+
+ /**
+ * Release a record frame previously returned by CAMERA_MSG_VIDEO_FRAME.
+ *
+ * It is camera hal client's responsibility to release video recording
+ * frames sent out by the camera hal before the camera hal receives
+ * a call to disableMsgType(CAMERA_MSG_VIDEO_FRAME). After it receives
+ * the call to disableMsgType(CAMERA_MSG_VIDEO_FRAME), it is camera hal's
+ * responsibility of managing the life-cycle of the video recording
+ * frames.
+ */
+ virtual void releaseRecordingFrame(const void *opaque) = 0;
+
+ /**
+ * Start auto focus, the notification callback routine is called
+ * with CAMERA_MSG_FOCUS once when focusing is complete. autoFocus()
+ * will be called again if another auto focus is needed.
+ */
+ virtual status_t autoFocus() = 0;
+
+ /**
+ * Cancels auto-focus function. If the auto-focus is still in progress,
+ * this function will cancel it. Whether the auto-focus is in progress
+ * or not, this function will return the focus position to the default.
+ * If the camera does not support auto-focus, this is a no-op.
+ */
+ virtual status_t cancelAutoFocus() = 0;
+
+ /**
+ * Take a picture.
+ */
+ virtual status_t takePicture() = 0;
+
+ /**
+ * Cancel a picture that was started with takePicture. Calling this
+ * method when no picture is being taken is a no-op.
+ */
+ virtual status_t cancelPicture() = 0;
+
+ /**
+ * Set the camera parameters. This returns BAD_VALUE if any parameter is
+ * invalid or not supported.
+ */
+ virtual status_t setParameters(const char* params) = 0;
+
+ /**
+ * Return the camera parameters.
+ */
+ virtual char* getParameters() = 0;
+
+ /**
+ * Put the camera parameters.
+ */
+ virtual void putParameters(char *params) = 0;
+
+ /**
+ * Send command to camera driver.
+ */
+ virtual status_t sendCommand(int32_t cmd, int32_t arg1, int32_t arg2) = 0;
+
+ /**
+ * Dump state of the camera hardware
+ */
+ virtual status_t dump(int fd) = 0;
+ /*
+ * Add CamClient to listen for the camera image buffer
+ */
+ virtual status_t addCamClient(android::sp<ICamClient> const& client, const char* name) = 0;
+
+ /*
+ * Remove CamClient for the camera image buffer
+ */
+ virtual status_t removeCamClient(android::sp<ICamClient> const& client) = 0;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// ICamDevice Interfaces.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: ////
+
+ virtual hw_device_t const* get_hw_device() const { return &mDevice.common; }
+
+ virtual void set_hw_module(hw_module_t const* module)
+ {
+ mDevice.common.module = const_cast<hw_module_t*>(module);
+ }
+
+ virtual void set_module_callbacks(camera_module_callbacks_t const* callbacks)
+ {
+ mpModuleCallbacks = callbacks;
+ }
+};
+}; //namespace NSCam
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+extern "C"
+NSCam::Cam1Device*
+createCam1Device(
+ android::String8 const s8ClientAppMode,
+ int32_t const i4OpenId
+);
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_DEVICE_CAM1DEVICE_H_
+
diff --git a/include/hardware/include/mtkcam/device/Cam1DeviceBase.h b/include/hardware/include/mtkcam/device/Cam1DeviceBase.h
new file mode 100644
index 0000000..7370212
--- /dev/null
+++ b/include/hardware/include/mtkcam/device/Cam1DeviceBase.h
@@ -0,0 +1,238 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein
+ * is confidential and proprietary to MediaTek Inc. and/or its licensors.
+ * Without the prior written permission of MediaTek inc. and/or its licensors,
+ * any reproduction, modification, use or disclosure of MediaTek Software,
+ * and information contained herein, in whole or in part, shall be strictly prohibited.
+ */
+/* MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON
+ * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+ * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+ * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+ * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
+ * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
+ * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
+ * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
+ * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
+ * CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+ * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+ * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
+ * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek Software")
+ * have been modified by MediaTek Inc. All revisions are subject to any receiver's
+ * applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_DEVICE_CAM1DEVICEBASE_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_DEVICE_CAM1DEVICEBASE_H_
+//
+#include <mtkcam/v1/common.h>
+using namespace android::MtkCamUtils;
+//
+#include <mtkcam/v1/IParamsManager.h>
+#include <mtkcam/v1/ICamAdapter.h>
+#include <mtkcam/v1/ICamClient.h>
+#include <mtkcam/v1/IDisplayClient.h>
+//
+#include "Cam1Device.h"
+//
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace android {
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+class Cam1DeviceBase : public NSCam::Cam1Device, protected ICam1DeviceCallback
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Data Members.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected: //// Device Info.
+ //
+ NSCam::ICamDeviceManager* mpDeviceManager; // device manager.
+ String8 const mDevName; // device name.
+ int32_t const mi4OpenId; // device open ID.
+ sp<CamMsgCbInfo> mpCamMsgCbInfo;
+ //
+protected: ////
+ //
+ sp<IParamsManager> mpParamsMgr;
+ sp<ICamAdapter> mpCamAdapter;
+ sp<ICamClient> mpCamClient;
+ sp<IDisplayClient> mpDisplayClient;
+ Vector<sp<ICamClient> > vmpCamClient;
+ //
+ bool mIsPreviewEnabled;
+ bool mIsRaw16CBEnabled;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Command Info.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected: ////
+ struct CommandInfo
+ {
+ int32_t cmd;
+ int32_t arg1;
+ int32_t arg2;
+ CommandInfo(
+ int32_t _cmd = 0,
+ int32_t _arg1 = 0,
+ int32_t _arg2 = 0
+ )
+ : cmd(_cmd)
+ , arg1(_arg1)
+ , arg2(_arg2)
+ {}
+ };
+ typedef KeyedVector<int32_t, CommandInfo> CommandInfoMap_t;
+ CommandInfoMap_t mTodoCmdMap;
+ Mutex mTodoCmdMapLock;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Operations.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Instantiation.
+
+ virtual ~Cam1DeviceBase();
+ Cam1DeviceBase(
+ String8 const& rDevName,
+ int32_t const i4OpenId
+ );
+
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+protected: //// Operations.
+
+ virtual int32_t queryDisplayBufCount() const { return 3; }
+
+ virtual bool queryPreviewSize(int32_t& ri4Width, int32_t& ri4Height);
+
+ virtual bool initCameraAdapter();
+
+ virtual status_t initDisplayClient(preview_stream_ops* window);
+ virtual status_t enableDisplayClient();
+ virtual void disableDisplayClient();
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// [Template method] Operations.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected: //// Operations.
+
+ /**
+ * [Template method] Called by initialize().
+ * Initialize the device resources owned by this object.
+ */
+ virtual bool onInit();
+
+ /**
+ * [Template method] Called by uninitialize().
+ * Uninitialize the device resources owned by this object. Note that this is
+ * *not* done in the destructor.
+ */
+ virtual bool onUninit();
+
+ /**
+ * [Template method] Called by startPreview().
+ */
+ virtual bool onStartPreview() { return true; }
+
+ /**
+ * [Template method] Called by stopPreview().
+ */
+ virtual void onStopPreview() {}
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Cam1Device Interfaces.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: ////
+
+ virtual status_t closeDevice();
+
+ virtual status_t initialize();
+ virtual void uninitialize();
+ //
+ virtual void setCallbacks(
+ camera_notify_callback notify_cb,
+ camera_data_callback data_cb,
+ camera_data_timestamp_callback data_cb_timestamp,
+ camera_request_memory get_memory,
+ void *user
+ );
+ virtual void setCallbacks(
+ mtk_camera_metadata_callback metadata_cb,
+ void *user
+ );
+ virtual void enableMsgType(int32_t msgType);
+ virtual void disableMsgType(int32_t msgType);
+ virtual bool msgTypeEnabled(int32_t msgType);
+ //
+ virtual status_t setPreviewWindow(preview_stream_ops* window);
+ //
+ virtual status_t startPreview();
+ virtual void stopPreview();
+ virtual bool previewEnabled();
+ //
+ virtual status_t storeMetaDataInBuffers(bool enable);
+ virtual status_t startRecording();
+ virtual void stopRecording();
+ virtual bool recordingEnabled();
+ virtual void releaseRecordingFrame(const void *opaque);
+ //
+ virtual status_t autoFocus();
+ virtual status_t cancelAutoFocus();
+ //
+ virtual status_t takePicture();
+ virtual status_t cancelPicture();
+ //
+ virtual status_t setParameters(const char* params);
+ virtual char* getParameters();
+ virtual void putParameters(char *params);
+ //
+ virtual status_t sendCommand(int32_t cmd, int32_t arg1, int32_t arg2);
+ virtual status_t dump(int fd);
+ //
+ virtual status_t addCamClient(sp<ICamClient> const& client, const char* name);
+ virtual status_t removeCamClient(sp<ICamClient> const& client);
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// ICam1DeviceCallback Interfaces.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Operations.
+
+ virtual void onCam1Device_NotifyCb(
+ int32_t const msgType,
+ intptr_t const ext1
+ );
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// ICamDevice Interfaces.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Operations.
+
+ virtual char const* getDevName() const { return mDevName.string(); }
+ virtual int32_t getOpenId() const { return mi4OpenId; }
+
+ virtual void setDeviceManager(NSCam::ICamDeviceManager* manager);
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace android
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_DEVICE_CAM1DEVICEBASE_H_
+
diff --git a/include/hardware/include/mtkcam/device/Cam3Device.h b/include/hardware/include/mtkcam/device/Cam3Device.h
new file mode 100644
index 0000000..9c18151
--- /dev/null
+++ b/include/hardware/include/mtkcam/device/Cam3Device.h
@@ -0,0 +1,191 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein
+ * is confidential and proprietary to MediaTek Inc. and/or its licensors.
+ * Without the prior written permission of MediaTek inc. and/or its licensors,
+ * any reproduction, modification, use or disclosure of MediaTek Software,
+ * and information contained herein, in whole or in part, shall be strictly prohibited.
+ */
+/* MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON
+ * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+ * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+ * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+ * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
+ * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
+ * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
+ * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
+ * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
+ * CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+ * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+ * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
+ * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek Software")
+ * have been modified by MediaTek Inc. All revisions are subject to any receiver's
+ * applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_DEVICE_CAM3DEVICE_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_DEVICE_CAM3DEVICE_H_
+//
+#include <utils/String8.h>
+//
+#include <hardware/camera3.h>
+#include "ICamDevice.h"
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+class Cam3Device : public ICamDevice
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Definitions.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Definitions.
+ typedef android::status_t status_t;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Data Members.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected: //// Data Members.
+
+ camera_module_callbacks_t const*mpModuleCallbacks;
+ camera3_device mDevice;
+ camera3_device_ops mDeviceOps; // which is pointed to by mDevice.ops.
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Operations.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Attributes.
+ //
+ static inline Cam3Device* getDevice(camera3_device const* device)
+ {
+ return (NULL == device)
+ ? NULL
+ : (Cam3Device*)((device)->priv)
+ ;
+ }
+
+ static inline Cam3Device* getDevice(hw_device_t* device)
+ {
+ return getDevice((camera3_device const*)device);
+ }
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Operations.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected: //// Instantiation.
+ virtual ~Cam3Device() {}
+ Cam3Device();
+
+ virtual void onLastStrongRef(const void* id);
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Interfaces.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Initialization.
+
+ virtual status_t i_closeDevice() = 0;
+
+ /**
+ * One-time initialization to pass framework callback function pointers to
+ * the HAL. Will be called once after a successful open() call, before any
+ * other functions are called on the camera3_device_ops structure.
+ *
+ * Return values:
+ *
+ * 0: On successful initialization
+ *
+ * -ENODEV: If initialization fails. Only close() can be called successfully
+ * by the framework after this.
+ */
+ virtual status_t i_initialize(
+ camera3_callback_ops const* callback_ops
+ ) = 0;
+
+ /**
+ * Uninitialize the device resources owned by this object. Note that this
+ * is *not* done in the destructor.
+ *
+ * This may be called at any time, although the call may block until all
+ * in-flight captures have completed (all results returned, all buffers
+ * filled). After the call returns, no more callbacks are allowed.
+ */
+ virtual status_t i_uninitialize() = 0;
+
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+public: //// Stream management
+
+ virtual status_t i_configure_streams(
+ camera3_stream_configuration_t* stream_list
+ ) = 0;
+
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+public: //// Request creation and submission
+
+ virtual camera_metadata const* i_construct_default_request_settings(
+ int type
+ ) = 0;
+
+ virtual status_t i_process_capture_request(
+ camera3_capture_request_t* request
+ ) = 0;
+
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+public: //// Miscellaneous methods
+
+ virtual status_t i_flush() = 0;
+
+ virtual void i_dump(int fd) = 0;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// ICamDevice Interfaces.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: ////
+
+ virtual hw_device_t const* get_hw_device() const { return &mDevice.common; }
+
+ virtual void set_hw_module(hw_module_t const* module)
+ {
+ mDevice.common.module = const_cast<hw_module_t*>(module);
+ }
+
+ virtual void set_module_callbacks(camera_module_callbacks_t const* callbacks)
+ {
+ mpModuleCallbacks = callbacks;
+ }
+};
+}; //namespace NSCam
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+extern "C"
+NSCam::Cam3Device*
+createCam3Device(
+ android::String8 const s8ClientAppMode,
+ int32_t const i4OpenId
+);
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_DEVICE_CAM3DEVICE_H_
+
diff --git a/include/hardware/include/mtkcam/device/Cam3DeviceBase.h b/include/hardware/include/mtkcam/device/Cam3DeviceBase.h
new file mode 100644
index 0000000..a71a8af
--- /dev/null
+++ b/include/hardware/include/mtkcam/device/Cam3DeviceBase.h
@@ -0,0 +1,141 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein
+ * is confidential and proprietary to MediaTek Inc. and/or its licensors.
+ * Without the prior written permission of MediaTek inc. and/or its licensors,
+ * any reproduction, modification, use or disclosure of MediaTek Software,
+ * and information contained herein, in whole or in part, shall be strictly prohibited.
+ */
+/* MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON
+ * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+ * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+ * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+ * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
+ * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
+ * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
+ * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
+ * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
+ * CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+ * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+ * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
+ * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek Software")
+ * have been modified by MediaTek Inc. All revisions are subject to any receiver's
+ * applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_DEVICE_CAM3DEVICEBASE_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_DEVICE_CAM3DEVICEBASE_H_
+//
+#include <utils/Mutex.h>
+#include <utils/String8.h>
+#include <utils/List.h>
+//
+#include "Cam3Device.h"
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+class Cam3DeviceBase : public Cam3Device
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Definitions.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Definitions.
+ typedef android::String8 String8;
+ typedef android::Mutex Mutex;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Data Members.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected: //// Data Members.
+ MINT32 mLogLevel; // log level.
+ android::Mutex mDevOpsLock; // device operations mutex.
+
+protected: //// Device Info.
+ NSCam::ICamDeviceManager* mpDeviceManager; // device manager.
+ String8 const mDevName; // device name.
+ int32_t const mi4OpenId; // device open ID.
+ camera3_callback_ops const* mpCallbackOps;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Operations.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Instantiation.
+ virtual ~Cam3DeviceBase();
+ Cam3DeviceBase(
+ String8 const& rDevName,
+ int32_t const i4OpenId
+ );
+
+ virtual MINT32 getLogLevel() const;
+
+protected: //// Operations.
+ virtual status_t onInitializeLocked() = 0;
+ virtual status_t onUninitializeLocked() = 0;
+ virtual status_t onConfigureStreamsLocked(
+ camera3_stream_configuration_t* stream_list
+ ) = 0;
+ virtual status_t onFlushLocked() = 0;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Cam3Device Interfaces.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Initialization.
+
+ virtual status_t i_closeDevice();
+
+ virtual status_t i_initialize(
+ camera3_callback_ops const* callback_ops
+ );
+
+ virtual status_t i_uninitialize();
+
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+public: //// Stream management
+
+ virtual status_t i_configure_streams(
+ camera3_stream_configuration_t* stream_list
+ );
+
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+public: //// Miscellaneous methods
+
+ virtual status_t i_flush();
+
+ virtual void i_dump(int fd);
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// ICamDevice Interfaces.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: ////
+
+ virtual char const* getDevName() const { return mDevName.string(); }
+ virtual int32_t getOpenId() const { return mi4OpenId; }
+
+ virtual void setDeviceManager(ICamDeviceManager* manager);
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_DEVICE_CAM3DEVICEBASE_H_
+
diff --git a/include/hardware/include/mtkcam/device/CamDeviceManagerBase.h b/include/hardware/include/mtkcam/device/CamDeviceManagerBase.h
new file mode 100644
index 0000000..497e2b2
--- /dev/null
+++ b/include/hardware/include/mtkcam/device/CamDeviceManagerBase.h
@@ -0,0 +1,184 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_DEVICE_CAMDEVICEMANAGERBASE_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_DEVICE_CAMDEVICEMANAGERBASE_H_
+//
+#include <utils/RWLock.h>
+#include <utils/RefBase.h>
+#include <utils/String8.h>
+#include <utils/KeyedVector.h>
+#include <utils/StrongPointer.h>
+//
+#include "ICamDeviceManager.h"
+#include "ICamDevice.h"
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+class IPlatform;
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+class CamDeviceManagerBase : public ICamDeviceManager
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Definitions.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected: //// Enum Info.
+ class EnumInfo : public android::RefBase
+ {
+ public: //// fields.
+ uint32_t uDeviceVersion; // Device Version (CAMERA_DEVICE_API_VERSION_X_X)
+ camera_metadata const* pMetadata; // Device Metadata.
+ int32_t iFacing; // Device Facing Direction.
+ int32_t iWantedOrientation; // Device Wanted Orientation.
+ int32_t iSetupOrientation; // Device Setup Orientation.
+ public: //// operations.
+ ~EnumInfo();
+ EnumInfo();
+ };
+
+ typedef android::DefaultKeyedVector<int32_t, android::sp<EnumInfo> > EnumInfoMap_t;
+
+protected: //// Open Info.
+ class OpenInfo : public android::RefBase
+ {
+ public: //// fields.
+ android::sp<ICamDevice> pDevice;
+ uint32_t uDeviceVersion;
+ int64_t i8OpenTimestamp;
+ public: //// operations.
+ ~OpenInfo();
+ OpenInfo();
+ };
+
+ typedef android::DefaultKeyedVector<int32_t, android::sp<OpenInfo> > OpenInfoMap_t;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Implementations.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected: //// Data Members.
+ android::RWLock mRWLock;
+ void* mpLibPlatform;
+ camera_module_callbacks_t const* mpModuleCallbacks;
+ int32_t mi4DeviceNum;
+ EnumInfoMap_t mEnumMap;
+ OpenInfoMap_t mOpenMap;
+ vendor_tag_ops_t mVendorTagOps;
+
+public: //// Instantiation.
+ virtual ~CamDeviceManagerBase();
+ CamDeviceManagerBase();
+
+protected: //// Operations.
+ IPlatform* getPlatform();
+
+protected: //// Operations.
+
+ virtual android::status_t attachDeviceLocked(android::sp<ICamDevice> pDevice, uint32_t device_version);
+ virtual android::status_t detachDeviceLocked(android::sp<ICamDevice> pDevice);
+
+ virtual android::status_t closeDeviceLocked(android::sp<ICamDevice> pDevice);
+ virtual android::status_t openDeviceLocked(
+ hw_device_t** device,
+ hw_module_t const* module,
+ int32_t const i4OpenId,
+ uint32_t device_version
+ );
+
+ virtual android::status_t validateOpenLocked(
+ int32_t /*i4OpenId*/
+ ) const
+ {
+ return OK;
+ }
+
+ virtual android::status_t validateOpenLocked(
+ int32_t i4OpenId,
+ uint32_t device_version
+ ) const;
+
+ virtual int32_t enumDeviceLocked() = 0;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// ICamDeviceManager Interfaces.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: ////
+
+ virtual android::status_t open(
+ hw_device_t** device,
+ hw_module_t const* module,
+ char const* name,
+ uint32_t device_version
+ );
+
+ virtual android::status_t close(ICamDevice* pDevice);
+
+ virtual int32_t getNumberOfDevices();
+
+ virtual android::status_t getDeviceInfo(
+ int const deviceId,
+ camera_info& rInfo
+ );
+
+ virtual android::status_t setCallbacks(
+ camera_module_callbacks_t const* callbacks
+ );
+
+ virtual void getVendorTagOps(
+ vendor_tag_ops_t* ops
+ );
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_DEVICE_CAMDEVICEMANAGERBASE_H_
+
diff --git a/include/hardware/include/mtkcam/device/ICamDevice.h b/include/hardware/include/mtkcam/device/ICamDevice.h
new file mode 100644
index 0000000..b5bc2b2
--- /dev/null
+++ b/include/hardware/include/mtkcam/device/ICamDevice.h
@@ -0,0 +1,101 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_DEVICE_ICAMDEVICE_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_DEVICE_ICAMDEVICE_H_
+//
+#include <utils/Errors.h>
+#include <utils/RefBase.h>
+#include <hardware/camera_common.h>
+#include <mtkcam/common.h>
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+class ICamDeviceManager;
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+class ICamDevice : public virtual android::RefBase
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Instantiation.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected: //// Destructor.
+
+ // Disallowed to directly delete a raw pointer.
+ virtual ~ICamDevice() {}
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Interfaces.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: ////
+
+ virtual char const* getDevName() const = 0;
+
+ virtual int32_t getOpenId() const = 0;
+
+ virtual hw_device_t const* get_hw_device() const = 0;
+
+ virtual void set_hw_module(hw_module_t const* module)= 0;
+
+ virtual void set_module_callbacks(
+ camera_module_callbacks_t const* callbacks
+ ) = 0;
+
+ virtual void setDeviceManager(
+ ICamDeviceManager* manager
+ ) = 0;
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_DEVICE_ICAMDEVICE_H_
+
diff --git a/include/hardware/include/mtkcam/device/ICamDeviceManager.h b/include/hardware/include/mtkcam/device/ICamDeviceManager.h
new file mode 100644
index 0000000..4e19416
--- /dev/null
+++ b/include/hardware/include/mtkcam/device/ICamDeviceManager.h
@@ -0,0 +1,173 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_DEVICE_ICAMDEVICEMANAGER_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_DEVICE_ICAMDEVICEMANAGER_H_
+//
+#include <utils/Errors.h>
+#include <utils/StrongPointer.h>
+//
+#include <hardware/camera_common.h>
+#include <mtkcam/common.h>
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+class ICamDevice;
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+class ICamDeviceManager
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Instantiation.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected: //// Destructor.
+
+ // Disallowed to directly delete a raw pointer.
+ virtual ~ICamDeviceManager() {}
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Interfaces.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: ////
+
+ virtual android::status_t open(
+ hw_device_t** device,
+ hw_module_t const* module,
+ char const* name,
+ uint32_t device_version = 0
+ ) = 0;
+
+ virtual android::status_t close(ICamDevice* pDevice) = 0;
+
+ /**
+ * getNumberOfDevices:
+ *
+ * Returns the number of camera devices accessible through the camera
+ * module. The camera devices are numbered 0 through N-1, where N is the
+ * value returned by this call. The name of the camera device for open() is
+ * simply the number converted to a string. That is, "0" for camera ID 0,
+ * "1" for camera ID 1.
+ *
+ * The value here must be static, and cannot change after the first call to
+ * this method
+ */
+ virtual int32_t getNumberOfDevices() = 0;
+
+ /**
+ * getDeviceInfo:
+ *
+ * Return the static information for a given camera device. This information
+ * may not change for a camera device.
+ *
+ */
+ virtual android::status_t getDeviceInfo(
+ int const deviceId,
+ camera_info& rInfo
+ ) = 0;
+
+ /**
+ * set_callbacks:
+ *
+ * Provide callback function pointers to the HAL module to inform framework
+ * of asynchronous camera module events. The framework will call this
+ * function once after initial camera HAL module load, after the
+ * get_number_of_cameras() method is called for the first time, and before
+ * any other calls to the module.
+ *
+ * Version information (based on camera_module_t.common.module_api_version):
+ *
+ * CAMERA_MODULE_API_VERSION_1_0, CAMERA_MODULE_API_VERSION_2_0:
+ *
+ * Not provided by HAL module. Framework may not call this function.
+ *
+ * CAMERA_MODULE_API_VERSION_2_1:
+ *
+ * Valid to be called by the framework.
+ *
+ */
+ virtual android::status_t setCallbacks(
+ camera_module_callbacks_t const* callbacks
+ ) = 0;
+
+ /**
+ * get_vendor_tag_ops:
+ *
+ * Get methods to query for vendor extension metadata tag information. The
+ * HAL should fill in all the vendor tag operation methods, or leave ops
+ * unchanged if no vendor tags are defined.
+ *
+ * The vendor_tag_ops structure used here is defined in:
+ * system/media/camera/include/system/vendor_tags.h
+ *
+ * Version information (based on camera_module_t.common.module_api_version):
+ *
+ * CAMERA_MODULE_API_VERSION_1_x/2_0/2_1:
+ * Not provided by HAL module. Framework may not call this function.
+ *
+ * CAMERA_MODULE_API_VERSION_2_2:
+ * Valid to be called by the framework.
+ */
+ virtual void getVendorTagOps(
+ vendor_tag_ops_t* ops
+ ) = 0;
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+ICamDeviceManager* getCamDeviceManager();
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_DEVICE_ICAMDEVICEMANAGER_H_
+
diff --git a/include/hardware/include/mtkcam/device/device1.h b/include/hardware/include/mtkcam/device/device1.h
new file mode 100644
index 0000000..6f5e1cc
--- /dev/null
+++ b/include/hardware/include/mtkcam/device/device1.h
@@ -0,0 +1,69 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_DEVICE_OPS_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_DEVICE_OPS_H_
+//
+#include <hardware/camera.h>
+#include <system/camera_metadata.h>
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+typedef void (*mtk_camera_metadata_callback)(
+ int32_t msg_type,
+ camera_metadata_t *result,
+ camera_metadata_t *charateristic,
+ void *user);
+
+typedef struct mtk_camera_device_ops {
+ camera_device_ops ops;
+
+ /** Set the notification and data callbacks */
+ void (*mtk_set_callbacks)(
+ struct camera_device *,
+ mtk_camera_metadata_callback metadata_cb,
+ void *user);
+
+} mtk_camera_device_ops_t;
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_DEVICE_OPS_H_
+
diff --git a/include/hardware/include/mtkcam/device/module.h b/include/hardware/include/mtkcam/device/module.h
new file mode 100644
index 0000000..59ce0a2
--- /dev/null
+++ b/include/hardware/include/mtkcam/device/module.h
@@ -0,0 +1,93 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_DEVICE_MODULE_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_DEVICE_MODULE_H_
+//
+#include <hardware/camera_common.h>
+#include <utils/String8.h>
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+static
+char const*const
+mtk_camera_module_methods_symbols[] =
+{
+ "getProperty",
+ "setProperty",
+ NULL
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+struct mtk_camera_module_methods
+{
+ android::status_t (*getProperty)(
+ android::String8 const& key,
+ android::String8& value
+ );
+
+ android::status_t (*setProperty)(
+ android::String8 const& key,
+ android::String8 const& value
+ );
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+struct mtk_camera_module
+{
+ camera_module common;
+
+ char const*const* methods_symbols;
+
+ mtk_camera_module_methods* methods;
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_DEVICE_MODULE_H_
+
diff --git a/include/hardware/include/mtkcam/exif/CamExif.h b/include/hardware/include/mtkcam/exif/CamExif.h
new file mode 100644
index 0000000..b620177
--- /dev/null
+++ b/include/hardware/include/mtkcam/exif/CamExif.h
@@ -0,0 +1,341 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein
+ * is confidential and proprietary to MediaTek Inc. and/or its licensors.
+ * Without the prior written permission of MediaTek inc. and/or its licensors,
+ * any reproduction, modification, use or disclosure of MediaTek Software,
+ * and information contained herein, in whole or in part, shall be strictly prohibited.
+ */
+/* MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON
+ * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+ * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+ * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+ * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
+ * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
+ * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
+ * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
+ * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
+ * CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+ * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+ * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
+ * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek Software")
+ * have been modified by MediaTek Inc. All revisions are subject to any receiver's
+ * applicable license agreements with MediaTek Inc.
+ */
+
+/********************************************************************************************
+ * LEGAL DISCLAIMER
+ *
+ * (Header of MediaTek Software/Firmware Release or Documentation)
+ *
+ * BY OPENING OR USING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") RECEIVED
+ * FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON AN "AS-IS" BASIS
+ * ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR
+ * A PARTICULAR PURPOSE OR NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY
+ * WHATSOEVER WITH RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK
+ * ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+ * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S SPECIFICATION
+ * OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+ *
+ * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE LIABILITY WITH
+ * RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION,
+TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE
+ * FEES OR SERVICE CHARGE PAID BY BUYER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE WITH THE LAWS
+ * OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF LAWS PRINCIPLES.
+ ************************************************************************************************/
+#ifndef _MTK_CAMERA_INC_COMMON_CAMEXIF_CAMEXIF_H_
+#define _MTK_CAMERA_INC_COMMON_CAMEXIF_CAMEXIF_H_
+
+//
+#include <utils/Vector.h>
+#include <utils/KeyedVector.h>
+#include <utils/String8.h>
+//
+
+using namespace android;
+
+/*******************************************************************************
+*
+********************************************************************************/
+struct exifAPP1Info_s;
+struct DEBUG_CMN_INFO_S;
+//
+class IBaseExif;
+
+/*******************************************************************************
+*
+********************************************************************************/
+enum eDebugExifId {
+ //
+ ID_ERROR = 0x00000001,
+ //
+ ID_EIS = 0x00000002,
+ ID_AAA = 0x00000004,
+ ID_ISP = 0x00000008,
+ ID_CMN = 0x00000010,
+ ID_MF = 0x00000020,
+ ID_N3D = 0x00000040,
+ ID_SENSOR = 0x00000080,
+ ID_RESERVE1 = 0x00000100,
+ ID_RESERVE2 = 0x00000200,
+ ID_RESERVE3 = 0x00000400,
+ ID_SHAD_TABLE = 0x00001000
+ //
+};
+
+struct ExifIdMap
+{
+ typedef MUINT32 VAL_T;
+ typedef String8 STR_T;
+ //
+ ExifIdMap()
+ : m_vStr2Val()
+ , m_vVal2Str()
+ {
+ m_vStr2Val.clear();
+ m_vVal2Str.clear();
+#define _ADD_STRING_VALUE_MAP_(_str_, _val_) \
+ do {\
+ m_vStr2Val.add(String8(_str_), _val_); \
+ m_vVal2Str.add(_val_, String8(_str_)); \
+ } while (0)
+ _ADD_STRING_VALUE_MAP_("ERROR", ID_ERROR);
+ _ADD_STRING_VALUE_MAP_("AAA", ID_AAA);
+ _ADD_STRING_VALUE_MAP_("ISP", ID_ISP);
+ _ADD_STRING_VALUE_MAP_("COMMON", ID_CMN);
+ _ADD_STRING_VALUE_MAP_("MF", ID_MF);
+ _ADD_STRING_VALUE_MAP_("N3D", ID_N3D);
+ _ADD_STRING_VALUE_MAP_("SENSOR", ID_SENSOR);
+ _ADD_STRING_VALUE_MAP_("EIS", ID_EIS);
+ _ADD_STRING_VALUE_MAP_("SHAD/RESERVE1", ID_RESERVE1);
+ _ADD_STRING_VALUE_MAP_("RESERVE2", ID_RESERVE2);
+ _ADD_STRING_VALUE_MAP_("RESERVE3", ID_RESERVE3);
+ _ADD_STRING_VALUE_MAP_("SHAD_TABLE", ID_SHAD_TABLE);
+#undef _ADD_STRING_VALUE_MAP_
+ }
+ virtual ~ExifIdMap() {}
+ //
+ virtual VAL_T valueFor(STR_T const& str) const { return m_vStr2Val.valueFor(str); }
+ virtual STR_T stringFor(VAL_T const& val) const { return m_vVal2Str.valueFor(val); }
+ //
+private:
+ DefaultKeyedVector<STR_T, VAL_T> m_vStr2Val;
+ DefaultKeyedVector<VAL_T, STR_T> m_vVal2Str;
+};
+
+
+/*******************************************************************************
+*
+********************************************************************************/
+struct DbgInfo
+{
+ mutable MUINT8* puDbgBuf;
+ MUINT32 u4BufSize;
+
+ DbgInfo(MUINT8* _puDbgBuf = NULL, MUINT32 _u4BufSize = 0) :
+ puDbgBuf(_puDbgBuf), u4BufSize(_u4BufSize)
+ {
+ }
+};
+
+/*******************************************************************************
+*
+********************************************************************************/
+struct CamDbgParam
+{
+ MUINT32 u4ShotMode; // Shot mode
+ MUINT32 u4CamMode; // Camera mode: Normal, Engineer
+ MBOOL bStereoCam; // StereoCam feature.
+
+ CamDbgParam(
+ MUINT32 _u4ShotMode = 0,
+ MUINT32 _u4CamMode = 0,
+ MBOOL _bStereoCam = MFALSE
+ )
+ : u4ShotMode(_u4ShotMode)
+ , u4CamMode(_u4CamMode)
+ , bStereoCam(_bStereoCam)
+ {
+ }
+};
+
+/*******************************************************************************
+*
+********************************************************************************/
+struct CamExifParam {
+
+public: //// Data Members.
+
+ MUINT32 u4GpsIsOn;
+ MUINT32 u4GPSAltitude;
+ MUINT8 uGPSLatitude[32];
+ MUINT8 uGPSLongitude[32];
+ MUINT8 uGPSTimeStamp[32];
+ MUINT8 uGPSProcessingMethod[64]; //(values of "GPS", "CELLID", "WLAN" or "MANUAL" by the EXIF spec.)
+ //
+ MUINT32 u4Orientation;
+ MUINT32 u4ZoomRatio; // Digital zoom ratio (x100) For example, 100, 114, and 132 refer to 1.00, 1.14, and 1.32 respectively.
+ //
+ MUINT32 u4Facing;
+ //
+ MUINT32 u4ImgIndex; // The index of continuous shot image(1~n). '0' means single image.
+ MUINT32 u4GroupId; // The group ID for continuous shot.
+ MUINT32 u4FocusH; // Best shot: focus value H
+ MUINT32 u4FocusL; // Best shot: focus value L
+ MUINT32 u4RefocusPos; // Image Refocus: Main sensor position.
+ MUINT8 uJpsFileName[32]; // Image Refocus: JPS file name.
+
+public: //// Operations.
+ CamExifParam() { ::memset(this, 0, sizeof(CamExifParam)); }
+
+};
+
+/*******************************************************************************
+* (Basic) Camera Exif
+********************************************************************************/
+class CamExif : public IBaseCamExif
+{
+public: //// Constructor/Destructor
+ virtual ~CamExif();
+ CamExif();
+
+public: //// Interfaces.
+
+ virtual MBOOL init(CamExifParam const& rCamExifParam, CamDbgParam const& rCamDbgParam);
+ virtual MBOOL uninit();
+
+ virtual
+ MBOOL
+ makeExifApp1(
+ MUINT32 const u4ImgWidth, // [I] Image Width
+ MUINT32 const u4ImgHeight, // [I] Image Height
+ MUINT32 const u4ThumbSize, // [I] Thumb Size
+ MUINT8* const puApp1Buf, // [O] Pointer to APP1 Buffer
+ MUINT32*const pu4App1HeaderSize // [O] Pointer to APP1 Header Size
+ );
+
+ virtual
+ MBOOL
+ makeExifApp3(
+ MBOOL const bIsN3dEnable, // [I] Native3D(AC) Enable
+ MUINT8* const puApp3Buf, // [O] Pointer to APP3 Buffer
+ MUINT32*const pu4App3Size // [O] Pointer to APP3 Size
+ );
+
+ virtual
+ MBOOL
+ makeExifAppn(
+ MUINT32 const u4Appn, // [I] APPn
+ MUINT32 const u4Size, // [I] Buffer Size
+ MUINT8* const puBuf, // [I] Buffer
+ MUINT8* const puAppnBuf, // [O] Pointer to APPn Buffer
+ MUINT32*const pu4AppnSize // [O] Pointer to APPn Size
+ );
+
+ virtual
+ MBOOL
+ reserveExifAppn(
+ MUINT32 const u4ReserveAppn, // [I] APPn
+ MUINT32 const u4ReserveSize, // [I] Reserve size for APPn
+ MUINT8* const puAppnBuf, // [O] Pointer to APPn Buffer
+ MUINT32*const pu4AppnSize // [O] Pointer to APPn Size
+ );
+
+ virtual
+ MBOOL
+ queryExifApp1Info(exifAPP1Info_s*const pexifApp1Info);
+
+ virtual
+ MINT32
+ determineExifOrientation(
+ MUINT32 const u4DeviceOrientation,
+ MBOOL const bIsFacing,
+ MBOOL const bIsFacingFlip = MFALSE
+ );
+
+ virtual
+ MBOOL
+ set3AEXIFInfo(EXIF_INFO_T* p3AEXIFInfo);
+
+ virtual
+ MBOOL sendCommand(
+ MINT32 cmd,
+ MINT32 arg1 = 0,
+ MUINTPTR arg2 = 0,
+ MINT32 arg3 = 0);
+
+ virtual
+ MBOOL
+ appendDebugExif(
+ MUINT8* const puAppnBuf, // [O] Pointer to APPn Buffer
+ MUINT32* const pu4AppnSize, // [O] Pointer to APPn Size
+ MUINT32 const u4SensorIdx = 0 // [I] Sensor index. default value is 0. (0 means 1st cam, 1 means 2nd cam)
+ );
+
+private:
+ MUINT32
+ mapCapTypeIdx(MUINT32 const u4CapType);
+
+ MUINT32
+ mapExpProgramIdx(MUINT32 const u4SceneMode);
+
+ MUINT32
+ mapLightSourceIdx(MUINT32 const u4AwbMode);
+
+ MUINT32
+ mapMeteringModeIdx(MUINT32 const u4AeMeterMode);
+
+ void
+ getCommonDebugInfo(DEBUG_CMN_INFO_S &a_rDebugCommonInfo);
+
+ MBOOL
+ getCamDebugInfo(MUINT8* const pDbgInfo, MUINT32 const rDbgSize, MINT32 const dbgModuleID);
+
+ MBOOL appendDebugInfo(
+ MINT32 const dbgModuleID, // [I] debug module ID
+ MINT32 const dbgAppn, // [I] APPn
+ MUINT8** const ppuAppnBuf, // [O] Pointer to APPn Buffer
+ MUINT32* const pu4AppnSize // [O] Pointer to APPn Size
+ );
+
+ MBOOL appendCamDebugInfo(
+ MUINT32 const dbgAppn, // [I] APPn for CAM module
+ MUINT8** const puAppnBuf, // [O] Pointer to APPn Buffer
+ MUINT32*const pu4AppnSize // [O] Pointer to APPn Size
+ );
+
+protected: //// Data Members.
+ CamExifParam mCamExifParam;
+
+private:
+ EXIF_INFO_T* mp3AEXIFInfo;
+
+private:
+ CamDbgParam mCamDbgParam;
+ Vector<DbgInfo> mDbgInfo;
+ KeyedVector<MUINT32, MUINT32> mMapModuleID;
+ MINT32 mi4DbgModuleType;
+
+private:
+ IBaseExif* mpBaseExif;
+ ExifIdMap* mpDebugIdMap;
+};
+
+
+#endif // _MTK_CAMERA_INC_COMMON_CAMEXIF_CAMEXIF_H_
+
diff --git a/include/hardware/include/mtkcam/exif/IBaseCamExif.h b/include/hardware/include/mtkcam/exif/IBaseCamExif.h
new file mode 100644
index 0000000..c30d2ea
--- /dev/null
+++ b/include/hardware/include/mtkcam/exif/IBaseCamExif.h
@@ -0,0 +1,218 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein
+ * is confidential and proprietary to MediaTek Inc. and/or its licensors.
+ * Without the prior written permission of MediaTek inc. and/or its licensors,
+ * any reproduction, modification, use or disclosure of MediaTek Software,
+ * and information contained herein, in whole or in part, shall be strictly prohibited.
+ */
+/* MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON
+ * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+ * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+ * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+ * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
+ * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
+ * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
+ * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
+ * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
+ * CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+ * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+ * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
+ * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek Software")
+ * have been modified by MediaTek Inc. All revisions are subject to any receiver's
+ * applicable license agreements with MediaTek Inc.
+ */
+
+/********************************************************************************************
+ * LEGAL DISCLAIMER
+ *
+ * (Header of MediaTek Software/Firmware Release or Documentation)
+ *
+ * BY OPENING OR USING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") RECEIVED
+ * FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON AN "AS-IS" BASIS
+ * ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR
+ * A PARTICULAR PURPOSE OR NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY
+ * WHATSOEVER WITH RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK
+ * ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+ * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S SPECIFICATION
+ * OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+ *
+ * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE LIABILITY WITH
+ * RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION,
+TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE
+ * FEES OR SERVICE CHARGE PAID BY BUYER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE WITH THE LAWS
+ * OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF LAWS PRINCIPLES.
+ ************************************************************************************************/
+#ifndef _MTK_CAMERA_INC_COMMON_CAMEXIF_IBASECAMEXIF_H_
+#define _MTK_CAMERA_INC_COMMON_CAMEXIF_IBASECAMEXIF_H_
+
+#include "mtkcam/BuiltinTypes.h"
+
+/*******************************************************************************
+*
+********************************************************************************/
+#define DBG_EXIF_SIZE (0xFFFF * 4)
+#define REFOCUS_EXIF_SIZE (0xFFFF * 5) // for Image Refocus jpeg
+#define STEREO_EXIF_SIZE (0xFFFF * 8) // for JPS
+
+/*******************************************************************************
+* Camera EXIF Command
+********************************************************************************/
+typedef enum DEBUG_EXIF_CMD_S {
+
+ CMD_REGISTER = 0x1001,
+ CMD_SET_DBG_EXIF
+
+} DEBUG_EXIF_CMD_E;
+
+
+/*******************************************************************************
+* V1: 3A EXIF Information
+********************************************************************************/
+struct EXIF_INFO_T
+{
+public: //// Data member.
+ MUINT32 u4FNumber; // Format: F2.8 = 28
+ MUINT32 u4FocalLength; // Format: FL 3.5 = 350
+ MUINT32 u4SceneMode; // Scene mode (SCENE_MODE_XXX)
+ MUINT32 u4AWBMode; // White balance mode (AWB_NODE_XXX)
+ MUINT32 u4FlashLightTimeus; // Strobe on/off
+ MUINT32 u4AEMeterMode; // Exposure metering mode (AE_METERING_MODE_XXX)
+ MINT32 i4AEExpBias; // Exposure index*10
+ MUINT32 u4CapExposureTime; //
+ MUINT32 u4AEISOSpeed; //
+ MUINT32 u4RealISOValue; //
+
+public: //// Operations.
+ EXIF_INFO_T() { ::memset(this, 0, sizeof(EXIF_INFO_T)); }
+
+};
+
+
+/*******************************************************************************
+* V3: standard exif information
+********************************************************************************/
+struct ExifParams {
+ MUINT32 u4ImageWidth; // Image width
+ MUINT32 u4ImageHeight; // Image height
+ //
+ MUINT32 u4FNumber; // Format: F2.8 = 28
+ MUINT32 u4FocalLength; // Format: FL 3.5 = 350
+ MUINT32 u4AWBMode; // White balance mode
+ MUINT32 u4LightSource; // Light Source mode
+ MUINT32 u4ExpProgram; // Exposure Program
+ MUINT32 u4SceneCapType; // Scene Capture Type
+ MUINT32 u4FlashLightTimeus; // Strobe on/off
+ MUINT32 u4AEMeterMode; // Exposure metering mode
+ MINT32 i4AEExpBias; // Exposure index*10
+ MUINT32 u4CapExposureTime; //
+ MUINT32 u4AEISOSpeed; // AE ISO value
+ //
+ MUINT32 u4GpsIsOn;
+ MUINT32 u4GPSAltitude;
+ MUINT8 uGPSLatitude[32];
+ MUINT8 uGPSLongitude[32];
+ MUINT8 uGPSTimeStamp[32];
+ MUINT8 uGPSProcessingMethod[64]; //(values of "GPS", "CELLID", "WLAN" or "MANUAL" by the EXIF spec.)
+ //
+ MUINT32 u4Orientation; // 0, 90, 180, 270
+ MUINT32 u4ZoomRatio; // Digital zoom ratio (x100) For example, 100, 114, and 132 refer to 1.00, 1.14, and 1.32 respectively.
+ //
+ MUINT32 u4Facing; // 1: front camera, 0: not front
+ //
+public: //// Operations.
+ ExifParams() { ::memset(this, 0, sizeof(ExifParams)); }
+
+};
+
+
+/*******************************************************************************
+*
+********************************************************************************/
+
+enum ECapTypeId
+{
+ eCapTypeId_Standard = 0,
+ eCapTypeId_Landscape = 1,
+ eCapTypeId_Portrait = 2,
+ eCapTypeId_Night = 3
+};
+
+enum EExpProgramId
+{
+ eExpProgramId_NotDefined = 0,
+ eExpProgramId_Manual = 1,
+ eExpProgramId_Normal = 2,
+ eExpProgramId_Portrait = 7,
+ eExpProgramId_Landscape = 8
+};
+
+enum ELightSourceId
+{
+ eLightSourceId_Daylight = 1,
+ eLightSourceId_Fluorescent = 2,
+ eLightSourceId_Tungsten = 3,
+ eLightSourceId_Cloudy = 10,
+ eLightSourceId_Shade = 11,
+ eLightSourceId_Other = 255
+};
+
+enum EMeteringModeId
+{
+ eMeteringMode_Average = 1,
+ eMeteringMode_Center = 2,
+ eMeteringMode_Spot = 3,
+ eMeteringMode_Other = 255
+};
+
+/*******************************************************************************
+* (Basic) Camera Exif
+********************************************************************************/
+class IBaseCamExif
+{
+public: //// Interfaces.
+
+ IBaseCamExif() {};
+ virtual ~IBaseCamExif() {};
+
+//=============================================================
+// Interfaces.
+//=============================================================
+
+ /*******************************************************************************
+ * set 3A-related EXIF values for CamExif
+ *******************************************************************************/
+ virtual
+ MBOOL
+ set3AEXIFInfo(EXIF_INFO_T* p3AEXIFInfo) = 0;
+
+ /*******************************************************************************
+ * sendCommand
+ *******************************************************************************/
+ virtual
+ MBOOL sendCommand(
+ MINT32 cmd,
+ MINT32 arg1 = 0,
+ MUINTPTR arg2 = 0,
+ MINT32 arg3 = 0) = 0;
+
+
+};
+
+
+#endif // _MTK_CAMERA_INC_COMMON_CAMEXIF_IBASECAMEXIF_H_
diff --git a/include/hardware/include/mtkcam/exif/IDbgInfoContainer.h b/include/hardware/include/mtkcam/exif/IDbgInfoContainer.h
new file mode 100644
index 0000000..37700df
--- /dev/null
+++ b/include/hardware/include/mtkcam/exif/IDbgInfoContainer.h
@@ -0,0 +1,103 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein
+ * is confidential and proprietary to MediaTek Inc. and/or its licensors.
+ * Without the prior written permission of MediaTek inc. and/or its licensors,
+ * any reproduction, modification, use or disclosure of MediaTek Software,
+ * and information contained herein, in whole or in part, shall be strictly prohibited.
+ */
+/* MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON
+ * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+ * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+ * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+ * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
+ * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
+ * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
+ * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
+ * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
+ * CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+ * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+ * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
+ * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek Software")
+ * have been modified by MediaTek Inc. All revisions are subject to any receiver's
+ * applicable license agreements with MediaTek Inc.
+ */
+
+/********************************************************************************************
+ * LEGAL DISCLAIMER
+ *
+ * (Header of MediaTek Software/Firmware Release or Documentation)
+ *
+ * BY OPENING OR USING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") RECEIVED
+ * FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON AN "AS-IS" BASIS
+ * ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR
+ * A PARTICULAR PURPOSE OR NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY
+ * WHATSOEVER WITH RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK
+ * ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+ * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S SPECIFICATION
+ * OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+ *
+ * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE LIABILITY WITH
+ * RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION,
+TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE
+ * FEES OR SERVICE CHARGE PAID BY BUYER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE WITH THE LAWS
+ * OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF LAWS PRINCIPLES.
+ ************************************************************************************************/
+
+#ifndef _MTK_CAMERA_INCLUDE_COMMON_IDEBUGINFOCONTAINER_H_
+#define _MTK_CAMERA_INCLUDE_COMMON_IDEBUGINFOCONTAINER_H_
+
+/*******************************************************************************
+*
+********************************************************************************/
+class IBaseCamExif;
+/*******************************************************************************
+*
+********************************************************************************/
+class IDbgInfoContainer
+{
+ public:
+
+ static IDbgInfoContainer* createInstance();
+ MVOID destroyInstance();
+
+ protected:
+
+ IDbgInfoContainer();
+ virtual ~IDbgInfoContainer();
+
+ public: //operations
+
+ /* for user to query memory for a block */
+ virtual MVOID* queryMemory(MUINT32 const key, size_t const size, MBOOL clean = MTRUE) = 0;
+
+ /* copy all blocks to the exif */
+ virtual MBOOL setToExif(IBaseCamExif* pExif) const = 0;
+
+ /* copy all blocks to another container */
+ virtual MBOOL copyTo(IDbgInfoContainer* pDbg) const = 0;
+ private:
+
+};
+
+
+/*******************************************************************************
+*
+********************************************************************************/
+
+#endif //_MTK_CAMERA_INCLUDE_COMMON_IDEBUGINFOCONTAINER_H_
diff --git a/include/hardware/include/mtkcam/exif/StdExif.h b/include/hardware/include/mtkcam/exif/StdExif.h
new file mode 100644
index 0000000..478232f
--- /dev/null
+++ b/include/hardware/include/mtkcam/exif/StdExif.h
@@ -0,0 +1,255 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein
+ * is confidential and proprietary to MediaTek Inc. and/or its licensors.
+ * Without the prior written permission of MediaTek inc. and/or its licensors,
+ * any reproduction, modification, use or disclosure of MediaTek Software,
+ * and information contained herein, in whole or in part, shall be strictly prohibited.
+ */
+/* MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON
+ * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+ * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+ * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+ * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
+ * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
+ * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
+ * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
+ * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
+ * CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+ * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+ * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
+ * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek Software")
+ * have been modified by MediaTek Inc. All revisions are subject to any receiver's
+ * applicable license agreements with MediaTek Inc.
+ */
+
+/********************************************************************************************
+ * LEGAL DISCLAIMER
+ *
+ * (Header of MediaTek Software/Firmware Release or Documentation)
+ *
+ * BY OPENING OR USING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") RECEIVED
+ * FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON AN "AS-IS" BASIS
+ * ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR
+ * A PARTICULAR PURPOSE OR NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY
+ * WHATSOEVER WITH RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK
+ * ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+ * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S SPECIFICATION
+ * OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+ *
+ * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE LIABILITY WITH
+ * RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION,
+TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE
+ * FEES OR SERVICE CHARGE PAID BY BUYER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE WITH THE LAWS
+ * OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF LAWS PRINCIPLES.
+ ************************************************************************************************/
+#ifndef _STDEXIF_H_
+#define _STDEXIF_H_
+//
+
+#include <mtkcam/common.h>
+#include <utils/Vector.h>
+#include <utils/KeyedVector.h>
+#include <utils/String8.h>
+
+using namespace android;
+//
+class IBaseExif;
+struct exifAPP1Info_s;
+struct DEBUG_CMN_INFO_S;
+//
+/*******************************************************************************
+* Camera EXIF Command
+********************************************************************************/
+enum eDebugExifId {
+ //
+ ID_ERROR = 0x00000001,
+ //
+ ID_EIS = 0x00000002,
+ ID_AAA = 0x00000004,
+ ID_ISP = 0x00000008,
+ ID_CMN = 0x00000010,
+ ID_MF = 0x00000020,
+ ID_N3D = 0x00000040,
+ ID_SENSOR = 0x00000080,
+ ID_RESERVE1 = 0x00000100,
+ ID_RESERVE2 = 0x00000200,
+ ID_RESERVE3 = 0x00000400,
+ ID_SHAD_TABLE = 0x00001000
+ //
+};
+
+struct ExifIdMap
+{
+ typedef MUINT32 VAL_T;
+ typedef String8 STR_T;
+ //
+ ExifIdMap()
+ : m_vStr2Val()
+ , m_vVal2Str()
+ {
+ m_vStr2Val.clear();
+ m_vVal2Str.clear();
+#define _ADD_STRING_VALUE_MAP_(_str_, _val_) \
+ do {\
+ m_vStr2Val.add(String8(_str_), _val_); \
+ m_vVal2Str.add(_val_, String8(_str_)); \
+ } while (0)
+ _ADD_STRING_VALUE_MAP_("ERROR", ID_ERROR);
+ _ADD_STRING_VALUE_MAP_("AAA", ID_AAA);
+ _ADD_STRING_VALUE_MAP_("ISP", ID_ISP);
+ _ADD_STRING_VALUE_MAP_("COMMON", ID_CMN);
+ _ADD_STRING_VALUE_MAP_("MF", ID_MF);
+ _ADD_STRING_VALUE_MAP_("N3D", ID_N3D);
+ _ADD_STRING_VALUE_MAP_("SENSOR", ID_SENSOR);
+ _ADD_STRING_VALUE_MAP_("EIS", ID_EIS);
+ _ADD_STRING_VALUE_MAP_("SHAD/RESERVE1", ID_RESERVE1);
+ _ADD_STRING_VALUE_MAP_("RESERVE2", ID_RESERVE2);
+ _ADD_STRING_VALUE_MAP_("RESERVE3", ID_RESERVE3);
+ _ADD_STRING_VALUE_MAP_("SHAD_TABLE", ID_SHAD_TABLE);
+#undef _ADD_STRING_VALUE_MAP_
+ }
+ virtual ~ExifIdMap() {}
+ //
+ virtual VAL_T valueFor(STR_T const& str) const { return m_vStr2Val.valueFor(str); }
+ virtual STR_T stringFor(VAL_T const& val) const { return m_vVal2Str.valueFor(val); }
+ //
+private:
+ DefaultKeyedVector<STR_T, VAL_T> m_vStr2Val;
+ DefaultKeyedVector<VAL_T, STR_T> m_vVal2Str;
+};
+
+
+/*******************************************************************************
+*
+********************************************************************************/
+struct DbgInfo
+{
+ mutable MUINT8* puDbgBuf;
+ MUINT32 u4BufSize;
+
+ DbgInfo(MUINT8* _puDbgBuf = NULL, MUINT32 _u4BufSize = 0) :
+ puDbgBuf(_puDbgBuf), u4BufSize(_u4BufSize)
+{
+ }
+};
+
+/*******************************************************************************
+ *
+********************************************************************************/
+class StdExif : public IBaseCamExif
+{
+public: //// Constructor/Destructor
+ StdExif();
+ ~StdExif();
+
+public:
+ MBOOL init(
+ ExifParams const& rExifParams,
+ MBOOL const enableDbgExif = false
+ );
+ MBOOL uninit();
+ MBOOL reset(
+ ExifParams const& rExifParams,
+ MBOOL const enableDbgExif = false
+ );
+
+ /* V1 API */
+ virtual MBOOL set3AEXIFInfo(EXIF_INFO_T* p3AEXIFInfo) { return true; }
+ // -----
+
+ virtual MBOOL sendCommand(
+ MINT32 cmd,
+ MINT32 arg1 = 0,
+ MUINTPTR arg2 = 0,
+ MINT32 arg3 = 0
+ );
+
+ //get the size of standard exif (with out thumbnail)
+ size_t getStdExifSize() const { return mApp1Size; }
+
+ //get the size of debug exif
+ size_t getDbgExifSize() const { return mDbgAppnSize; }
+
+ // get the size of jpeg header
+ size_t getHeaderSize() const;
+
+ void setMaxThumbnail(size_t const thumbnailSize);
+
+ void setOutputBuffer(
+ MINT8 * const outputExifBuf,
+ size_t const outputExifBufCapacity
+ );
+
+ // make standard and debug exif
+ status_t make(
+ size_t& rOutputExifSize
+ );
+
+private:
+ size_t getThumbnailSize() const { return mMaxThumbSize; }
+
+ MBOOL isEnableDbgExif() const { return mbEnableDbgExif; }
+
+ void updateStdExif(exifAPP1Info_s* exifApp1Info);
+
+ void updateDbgExif();
+
+ void getCommonDebugInfo(DEBUG_CMN_INFO_S &a_rDebugCommonInfo);
+
+ MBOOL getCamDebugInfo(MUINT8* const pDbgInfo, MUINT32 const rDbgSize, MINT32 const dbgModuleID);
+
+ MBOOL appendDebugInfo(
+ MINT32 const dbgModuleID, // [I] debug module ID
+ MINT32 const dbgAppn, // [I] APPn
+ MUINT8** const ppuAppnBuf // [O] Pointer to APPn Buffer
+ );
+
+ MBOOL appendCamDebugInfo(
+ MUINT32 const dbgAppn, // [I] APPn for CAM module
+ MUINT8** const puAppnBuf // [O] Pointer to APPn Buffer
+ );
+
+ MINT32 determineExifOrientation(
+ MUINT32 const u4DeviceOrientation,
+ MBOOL const bIsFacing,
+ MBOOL const bIsFacingFlip = MFALSE
+ );
+
+private:
+ ////
+ ExifParams mExifParam;
+ IBaseExif* mpBaseExif;
+ //
+ MBOOL mbEnableDbgExif;
+ size_t mApp1Size;
+ size_t mDbgAppnSize;
+ size_t mMaxThumbSize;
+ MUINTPTR mpOutputExifBuf;
+ size_t mOutputExifBufSize;
+ //
+ Vector<DbgInfo> mDbgInfo;
+ KeyedVector<MUINT32, MUINT32> mMapModuleID;
+ MINT32 mi4DbgModuleType;
+ ExifIdMap* mpDebugIdMap;
+
+};
+
+
+#endif // _STDEXIF_H_
+
diff --git a/include/hardware/include/mtkcam/hal/IHalMemory.h b/include/hardware/include/mtkcam/hal/IHalMemory.h
new file mode 100644
index 0000000..3662b2e
--- /dev/null
+++ b/include/hardware/include/mtkcam/hal/IHalMemory.h
@@ -0,0 +1,130 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_HAL_IHALMEMORY_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_HAL_IHALMEMORY_H_
+//
+#include <mtkcam/BuiltinTypes.h>
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+
+enum IHALMEM_CACHECTRL_ENUM
+{
+ IHALMEM_CACHECTRL_ENUM_FLUSH = 0,
+ IHALMEM_CACHECTRL_ENUM_INVALID = 1
+};
+
+/******************************************************************************
+ * Hal Memory Interface.
+ ******************************************************************************/
+class IHalMemory
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Definitions.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Memory Info.
+ struct Info
+ {
+ MINTPTR pa; // physicall address; in/out
+ MINTPTR va; // virtual address;
+ MINT32 ionFd;
+ size_t size;
+ MINT32 security;
+ MINT32 coherence;
+ //
+ Info(
+ MINTPTR _pa = 0,
+ MINTPTR _va = 0,
+ MINT32 _ionFd = -1,
+ size_t _size = 0,
+ MINT32 _security = 0,
+ MINT32 _coherence = 0
+ )
+ : pa(_pa)
+ , va(_va)
+ , ionFd(_ionFd)
+ , size(_size)
+ , security(_security)
+ , coherence(_coherence)
+ {
+ }
+ };
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Instantiation.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected: //// Destructor.
+
+ // Disallowed to directly delete a raw pointer.
+ virtual ~IHalMemory() {}
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Interfaces.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: ////
+
+ static IHalMemory* createInstance(char const* szCallerName);
+ virtual MVOID destroyInstance(char const* szCallerName) = 0;
+
+ virtual MBOOL mapPA(
+ char const* szCallerName,
+ Info* pInfo
+ ) = 0;
+ virtual MBOOL unmapPA(
+ char const* szCallerName,
+ Info const* pInfo
+ ) = 0;
+
+ virtual MBOOL syncCache(
+ IHALMEM_CACHECTRL_ENUM const ctrl,
+ Info const* pInfo,
+ MUINT const num
+ ) = 0;
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_HAL_IHALMEMORY_H_
+
diff --git a/include/hardware/include/mtkcam/hal/IHalSensor.h b/include/hardware/include/mtkcam/hal/IHalSensor.h
new file mode 100644
index 0000000..9bfe684
--- /dev/null
+++ b/include/hardware/include/mtkcam/hal/IHalSensor.h
@@ -0,0 +1,594 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_HAL_IHALSENSOR_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_HAL_IHALSENSOR_H_
+//
+#include <mtkcam/common.h>
+#include <mtkcam/metadata/IMetadata.h>
+
+class IBaseCamExif;
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+
+
+/******************************************************************************
+ * Sensor Scenario ID
+ ******************************************************************************/
+enum
+{
+ SENSOR_SCENARIO_ID_NORMAL_PREVIEW,
+ SENSOR_SCENARIO_ID_NORMAL_CAPTURE,
+ SENSOR_SCENARIO_ID_NORMAL_VIDEO,
+ SENSOR_SCENARIO_ID_SLIM_VIDEO1,
+ SENSOR_SCENARIO_ID_SLIM_VIDEO2,
+ SENSOR_SCENARIO_ID_CUSTOM1,
+ SENSOR_SCENARIO_ID_CUSTOM2,
+ SENSOR_SCENARIO_ID_CUSTOM3,
+ SENSOR_SCENARIO_ID_CUSTOM4,
+ SENSOR_SCENARIO_ID_CUSTOM5,
+ /**************************************************************************
+ * All unnamed scenario id for a specific sensor must be started with
+ * values >= SENSOR_SCENARIO_ID_UNNAMED_START.
+ **************************************************************************/
+ SENSOR_SCENARIO_ID_UNNAMED_START = 0x100,
+};
+
+enum
+{
+ SENSOR_DEV_NONE = 0x00,
+ SENSOR_DEV_MAIN = 0x01,
+ SENSOR_DEV_SUB = 0x02,
+ SENSOR_DEV_PIP = 0x03,
+ SENSOR_DEV_MAIN_2 = 0x04,
+ SENSOR_DEV_MAIN_3D = 0x05,
+};
+
+enum
+{
+ CAM_TG_NONE = 0x0,
+ CAM_TG_1 = 0x1,
+ CAM_TG_2 = 0x2,
+ CAM_SV_1 = 0x4,
+ CAM_SV_2 = 0x8,
+ CAM_TG_ERR = 0xFF
+};
+
+enum
+{
+ ONE_PIXEL_MODE = 0x0,
+ TWO_PIXEL_MODE = 0x1,
+};
+
+enum
+{
+ SENSOR_TYPE_UNKNOWN = 0x0,
+ SENSOR_TYPE_RAW,
+ SENSOR_TYPE_YUV,
+ SENSOR_TYPE_RGB,
+ SENSOR_TYPE_JPEG,
+};
+
+enum
+{
+ RAW_SENSOR_8BIT = 0x0,
+ RAW_SENSOR_10BIT,
+ RAW_SENSOR_12BIT,
+ RAW_SENSOR_14BIT,
+ RAW_SENSOR_ERROR = 0xFF,
+};
+
+enum
+{
+ SENSOR_FORMAT_ORDER_RAW_B = 0x0,
+ SENSOR_FORMAT_ORDER_RAW_Gb,
+ SENSOR_FORMAT_ORDER_RAW_Gr,
+ SENSOR_FORMAT_ORDER_RAW_R,
+ SENSOR_FORMAT_ORDER_UYVY,
+ SENSOR_FORMAT_ORDER_VYUY,
+ SENSOR_FORMAT_ORDER_YUYV,
+ SENSOR_FORMAT_ORDER_YVYU,
+ SENSOR_FORMAT_ORDER_NONE = 0xFF,
+};
+
+enum
+{
+ SENSOR_PREVIEW_DELAY = 0, /*!<Request delay frame for sensor set to preview mode be valid */
+ SENSOR_VIDEO_DELAY, /*!<Request delay frame for sensor set to video mode be valid */
+ SENSOR_CAPTURE_DELAY, /*!<Request delay frame for sensor set to capture mode be valid */
+ SENSOR_YUV_AWB_SETTING_DELAY, /*!<Request delay frame for YUV sensor set WB setting be valid*/
+ SENSOR_YUV_EFFECT_SETTING_DELAY, /*!<Request delay frame for YUV sensor set color effect be valid */
+ SENSOR_AE_SHUTTER_DELAY, /*!<Request delay frame for sensor set AE shutter be valid */
+ SENSOR_AE_GAIN_DELAY, /*!<Request delay frame for sensor set AE gain be valid */
+ SENSOR_AE_ISP_DELAY,
+};
+
+enum
+{
+ SENSOR_VHDR_MODE_NONE = 0x0,
+ SENSOR_VHDR_MODE_IVHDR = 0x01,
+ SENSOR_VHDR_MODE_MVHDR = 0x02
+};
+
+ enum {
+ SENSOR_CMD_SET_SENSOR_EXP_TIME = 0x1000, /*!<Command to set sensor exposure time in unit us. arg1:[input]exp time, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_SET_SENSOR_EXP_LINE, /*!<Command to set sensor exposure line. arg1:[input]exp line, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_SET_SENSOR_GAIN, /*!<Command to set sensor gain. arg1:[input]gain, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_SET_FLICKER_FRAME_RATE, /*!<Command to set sensor gain. arg1:[input]gain, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_SET_VIDEO_FRAME_RATE, /*!<Command to set video scenario sensor frame rate. arg1:[input]video frame rate, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_SET_AE_EXPOSURE_GAIN_SYNC, /*!<Command to set AE sync write shutter and gain. arg1:[input]raw gain R, Gr raw gain Gb, B exposure time, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_SET_CCT_FEATURE_CONTROL, /*!<Command to set CCT feature. arg1:[input]ACDK_SENSOR_FEATURE_ENUM, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_SET_SENSOR_CALIBRATION_DATA, /*!<Command to set sensor calibration data. arg1:[input]SET_SENSOR_CALIBRATION_DATA_STRUCT, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_SET_MAX_FRAME_RATE_BY_SCENARIO, /*!<Command to set sensor max output frame rate by scenario. arg1:[input] ACDK_SCENARIO_ID_ENUM, arg2:[input] frame rate (10base), arg3:N/A*/
+ SENSOR_CMD_SET_TEST_PATTERN_OUTPUT, /*!<Command to set sensor test pattern output enable control. arg1:[input] on/off, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_SET_SENSOR_ESHUTTER_GAIN, /*!<Command to set sensor sensor shutter and sensor gain. arg1:[input] pointer of shutter and gain, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_SET_OB_LOCK, /*!<Command to set sensor OB lock enable/disable control. arg1:[input] on/off, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_SET_SENSOR_HDR_SHUTTER_GAIN, /*!<Command to set sensor exposure time in unit us & Gain. arg1:[input]long exp time, arg2:short exp time, arg3:Gain*/
+ SENSOR_CMD_SET_SENSOR_HDR_SHUTTER, /*!<Command to set sensor exposure time in unit us & Gain. arg1:[input]long exp time, arg2:short exp time*/
+ SENSOR_CMD_SET_SENSOR_HDR_AWB_GAIN, /*!<Command to set sensor exposure time in unit us & Gain. arg1:[input]long exp time, arg2:short exp time, arg3:Gain*/
+ SENSOR_CMD_SET_SENSOR_AWB_GAIN, /*!<Command to set sensor exposure time in unit us & Gain. arg1:[input]long exp time, arg2:short exp time, arg3:Gain*/
+ SENSOR_CMD_SET_SENSOR_ISO, /*!<Command to set sensor ISO*/
+ SENSOR_CMD_SET_SENSOR_OTP_AWB_CMD, /*!<Command to set sensor AWB update/disable from OTP control. arg1:[input] on/off, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_SET_SENSOR_OTP_LSC_CMD, /*!<Command to set sensor LSC update/disable from OTP control. arg1:[input] on/off, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_SET_MIN_MAX_FPS, /*!<Command to set sensor frame rate. arg1:[input]Max FPS, arg2:MIN Fps,*/
+ SENSOR_CMD_SET_N3D_CONFIG = 0x1100, /*!<Command to set native 3D mode configuration. arg1: [input]halSensorN3dConfig_t, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_SET_N3D_I2C_POS, /*!<Command to set count in SMI clock rate for I2C1&2 delay arg1:[input]position count, arg2:N/A, arg3:N/A */
+ SENSOR_CMD_SET_N3D_I2C_TRIGGER, /*!<Command to set hardware trigger mode arg1:[input]trigger mode, arg2:N/A, arg3:N/A */
+ SENSOR_CMD_SET_N3D_I2C_STREAM_REGDATA, /*!<Command to set I2C command to N3D I2C buffer used to control stream arg1:N/A, arg2:N/A, arg3:N/A */
+ SENSOR_CMD_SET_N3D_START_STREAMING, /*!<Command to set sensor driver to start straming out arg1:N/A, arg2:N/A, arg3:N/A */
+ SENSOR_CMD_SET_N3D_STOP_STREAMING, /*!<Command to set sensor driver to stop straming out arg1:N/A, arg2:N/A, arg3:N/A */
+ SENSOR_CMD_GET_UNSTABLE_DELAY_FRAME_CNT = 0x2000, /*!<Command to get sensor operation unstable frame number. arg1:[output] delay frame count, arg2:[input] operation mode, arg3:N/A*/
+ SENSOR_CMD_GET_PIXEL_CLOCK_FREQ, /*!<Command to get sensor operating pixel clock. arg1:[output] pixel clock frequency, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_FRAME_SYNC_PIXEL_LINE_NUM, /*!<Command to get sensor operating frame line length and line pxel value. arg1:[output] line pixels & frame line number, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_SENSOR_FEATURE_INFO, /*!<Command to get sensor feature information. arg1:[output] feature info, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_DEFAULT_FRAME_RATE_BY_SCENARIO, /*!<Command to get sensor default output frame rate by scenario. arg1:[input] ACDK_SCENARIO_ID_ENUM, arg2:[output] frame rate (10 base), arg3:N/A*/
+ SENSOR_CMD_GET_TEST_PATTERN_CHECKSUM_VALUE, /*!<Command to get sensor test pattern output check sum value. arg1:[output] test pattern check sum value, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_TEMPERATURE_VALUE, /*!<Command to get sensor temperature value (unit: degree). arg1:[output] temperature, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_SENSOR_CROP_WIN_INFO, /*!<Command to get sensor Crop window size */
+ SENSOR_CMD_GET_SENSOR_PIXELMODE, /*!<Command to get sensor pixel mode by scenario */
+ SENSOR_CMD_GET_SENSOR_PDAF_INFO, /*!<Command to get sensor PDAF postion informatoin */
+ SENSOR_CMD_GET_SENSOR_N3D_DIFFERENCE_COUNT = 0x2100,/*!<Command to get native 3D module difference count value arg1:[output] halSensorN3dDiffCnt_t, arg2:N/A, arg3:N/A */
+ SENSOR_CMD_GET_SENSOR_N3D_STREAM_TO_VSYNC_TIME, /*!<Command to get time between stream out command to vsync occur. arg1:[output] time(us), arg2:N/A, arg3:N/A */
+ SENSOR_CMD_SET_YUV_FEATURE_CMD = 0x3000, /*!<Command to set YUV sensor feature. arg1:[input] feature id, arg2:[input] feature value, arg3:N/A*/
+ SENSOR_CMD_SET_YUV_SINGLE_FOCUS_MODE, /*!<Command to set YUV sensor single focus. arg1:N/A, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_SET_YUV_CANCEL_AF, /*!<Command to cancel YUV sensor AF. arg1:N/A, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_SET_YUV_CONSTANT_AF, /*!<Command to set YUV sensor constant focus. arg1:N/A, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_SET_YUV_INFINITY_AF, /*!<Command to set YUV sensor infinite focus. arg1:N/A, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_SET_YUV_AF_WINDOW, /*!<Command to set YUV sensor AF window. arg1:[input]AF window, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_SET_YUV_AE_WINDOW, /*!<Command to set YUV sensor AE window. arg1:[input]AE window, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_SET_YUV_AUTOTEST, /*!<Command to set YUV sensor autotest. arg1:[input]YUV_AUTOTEST_T cmd, arg2:[input] param, arg3:N/A*/
+ SENSOR_CMD_SET_YUV_3A_CMD, /*!<Command to set YUV sensor 3A cmd. arg1:[input]ACDK_SENSOR_3A_LOCK_ENUM cmd, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_SET_YUV_GAIN_AND_EXP_LINE, /*!<Command to set YUV sensor gain & exposure line cmd. arg1:[input]gain, arg2:[input]exp line, arg3:N/A*/
+ SENSOR_CMD_GET_SENSOR_VC_INFO,
+ SENSOR_CMD_GET_YUV_AF_STATUS = 0x4000, /*!<Command to get YUV sensor AF status. arg1:[output] af status, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_YUV_AE_STATUS, /*!<Command to get YUV sensor current AE and AWB status. arg1:[output] AE status, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_YUV_AWB_STATUS, /*!<Command to get YUV sensor current AE and AWB status. arg1:[output] AE status, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_YUV_EV_INFO_AWB_REF_GAIN, /*!<Command to get YUV sensor AE shutter/gain for EV5 & 13 and AWB gain value. arg1:[output] pSensorAEAWBRefStruct, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_YUV_CURRENT_SHUTTER_GAIN_AWB_GAIN, /*!<Command to get YUV sensor current AE shutter/gain and AWB gain value. arg1:[output] pSensorAEAWBCurStruct, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_YUV_AF_MAX_NUM_FOCUS_AREAS, /*!<Command to get YUV sensor AF window number. arg1:[output] window number, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_YUV_AE_MAX_NUM_METERING_AREAS, /*!<Command to get YUV sensor AE window number. arg1:[output] window number, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_YUV_EXIF_INFO, /*!<Command to get YUV sensor EXIF info. arg1:[output] SENSOR_EXIF_INFO_STRUCT, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_YUV_DELAY_INFO, /*!<Command to get YUV sensor delay info. arg1:[output] SENSOR_DELAY_INFO_STRUCT, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_YUV_AE_AWB_LOCK, /*!<Command to get YUV sensor AE/AWB lock capability. arg1:[output] AE lock support, arg2: AWB lock support, arg3:N/A*/
+ SENSOR_CMD_GET_YUV_STROBE_INFO, /*!<Command to get YUV sensor current strobe info. arg1:[output] SENSOR_FLASHLIGHT_AE_INFO_STRUCT, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_YUV_TRIGGER_FLASHLIGHT_INFO, /*!<Command to get YUV sensor current flashlight auto fire necessity. arg1:[output] fire or not, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_PDAF_DATA, /*!<Command to get PDAF data from sensor OTP. arg1:[input] offset, arg2:[input]pointer of buffer, arg3:[input]size*/
+ SENSOR_CMD_GET_SENSOR_PDAF_CAPACITY, /*!<Command to get PDAF capacity by scenario ID. arg1:[input] scenario, arg2:support PDAF or not*/
+ SENSOR_CMD_GET_SENSOR_ROLLING_SHUTTER, /*!<Command to get PDAF data from sensor OTP. arg1:[input] offset, arg2:[input]pointer of buffer, arg3:[input]size*/
+ SENSOR_CMD_MAX = 0xFFFF
+} ;
+
+
+ struct SensorStaticInfo{
+ MUINT sensorDevID; //0x5642,....
+ MUINT sensorType; //SENSOR_TYPE_RAW, ....
+ MUINT sensorFormatOrder; //SENSOR_FORMAT_ORDER_RAW_B,...
+ MUINT rawSensorBit; //RAW_SENSOR_8BIT,....
+ MBOOL iHDRSupport;
+ MUINT PDAF_Support;
+ MUINT previewWidth;
+ MUINT previewHeight;
+ MUINT captureWidth;
+ MUINT captureHeight;
+ MUINT videoWidth;
+ MUINT videoHeight;
+ MUINT video1Width;
+ MUINT video1Height;
+ MUINT video2Width;
+ MUINT video2Height;
+ MUINT SensorCustom1Width; // new for custom
+ MUINT SensorCustom1Height;
+ MUINT SensorCustom2Width;
+ MUINT SensorCustom2Height;
+ MUINT SensorCustom3Width;
+ MUINT SensorCustom3Height;
+ MUINT SensorCustom4Width;
+ MUINT SensorCustom4Height;
+ MUINT SensorCustom5Width;
+ MUINT SensorCustom5Height;
+ MUINT previewDelayFrame;
+ MUINT captureDelayFrame;
+ MUINT videoDelayFrame;
+ MUINT video1DelayFrame;
+ MUINT video2DelayFrame;
+ MUINT aeShutDelayFrame;
+ MUINT aeSensorGainDelayFrame;
+ MUINT aeISPGainDelayFrame;
+ MUINT Custom1DelayFrame;
+ MUINT Custom2DelayFrame;
+ MUINT Custom3DelayFrame;
+ MUINT Custom4DelayFrame;
+ MUINT Custom5DelayFrame;
+ MUINT orientationAngle;
+ MUINT facingDirection;
+ MUINT previewFrameRate;//10 base
+ MUINT captureFrameRate;//10 base
+ MUINT videoFrameRate;//10 base
+ MUINT video1FrameRate;//10 base
+ MUINT video2FrameRate;//10 base
+ MBOOL fakeOrientation;
+ MUINT horizontalViewAngle;
+ MUINT verticalViewAngle;
+ MUINT previewActiveWidth;//3d use onlyl?
+ MUINT previewActiveHeight;//3d use onlyl?
+ MUINT captureActiveWidth;//3d use onlyl?
+ MUINT captureActiveHeight;//3d use onlyl?
+ MUINT videoActiveWidth;//3d use onlyl?
+ MUINT videowActiveHeight;//3d use onlyl?
+ MUINT previewHoizontalOutputOffset;//3d use onlyl?
+ MUINT previewVerticalOutputOffset; //3d use onlyl?
+ MUINT captureHoizontalOutputOffset;//3d use onlyl?
+ MUINT captureVerticalOutputOffset; //3d use onlyl?
+ MUINT videoHoizontalOutputOffset;//3d use onlyl?
+ MUINT videoVerticalOutputOffset; //3d use onlyl?
+ MUINT8 iHDR_First_IS_LE;
+ MUINT8 SensorModeNum;
+ MBOOL virtualChannelSupport;
+ MUINT8 PerFrameCTL_Support;
+};
+
+
+struct SensorDynamicInfo{
+ MUINT TgInfo; //TG_NONE,TG_1,...
+ MUINT pixelMode; //ONE_PIXEL_MODE, TWO_PIXEL_MODE
+ MUINT TgVR1Info; // CAM_SV1 , CAM_SV2
+ MUINT TgVR2Info;
+};
+
+ //N3D config
+ /**
+ *@struct<SENSOR_N3D_CONFIG_STRUCT>
+ *@brief:structure used in sensor hal provided sendCommand() api with ID SENSOR_CMD_SET_N3D_CONFIG to set native 3D control configuration
+ */
+ struct SensorN3dConfig{
+ MUINT32 u4N3dEn; /*!<N3D module enable control*/
+ MUINT32 u4I2C1En; /*!<N3D 1st I2C control enable control*/
+ MUINT32 u4I2C2En; /*!<N3D 2nd I2C control enable control*/
+ MUINT32 u4N3dMode; /*!<N3D I2C control mode*/
+ MUINT32 u4DiffCntEn; /*!<N3D sensor vsync difference count enable control */
+ MUINT32 u4DiffCntThr; /*!<N3D sensor vsync difference threshold */
+ } ;
+
+ //N3D different count
+ /**
+ *@struct<SENSOR_N3D_DIFFERENCE_COUNT_STRUCT>
+ *@brief:structure used in sensor hal provided sendCommand() api with ID SENSOR_CMD_GET_SENSOR_N3D_DIFFERENCE_COUNT to get native 3D vsync difference information
+ */
+ struct SensorN3dDiffCnt{
+ MUINT32 u4DiffCnt; /*!<vsync difference count between vysnc1 & vsync2*/
+ MUINT32 u4Vsync1Cnt; /*!<*vsync1 valid count*/
+ MUINT32 u4Vsync2Cnt; /*!<vsync2 valid count*/
+ MUINT32 u4DebugPort; /*!<vsync2 count number sample at vysnc1*/
+ MUINT32 u4Data[10]; /*!<reserve*/
+} ;
+
+struct SensorCropWinInfo{
+ MUINT16 full_w;
+ MUINT16 full_h;
+ MUINT16 x0_offset;
+ MUINT16 y0_offset;
+ MUINT16 w0_size;
+ MUINT16 h0_size;
+ MUINT16 scale_w;
+ MUINT16 scale_h;
+ MUINT16 x1_offset;
+ MUINT16 y1_offset;
+ MUINT16 w1_size;
+ MUINT16 h1_size;
+ MUINT16 x2_tg_offset;
+ MUINT16 y2_tg_offset;
+ MUINT16 w2_tg_size;
+ MUINT16 h2_tg_size;
+} ;
+
+
+struct SensorVCInfo{
+ MUINT16 VC_Num;
+ MUINT16 VC_PixelNum;
+ MUINT16 ModeSelect; /* 0: auto mode, 1:direct mode */
+ MUINT16 EXPO_Ratio; /* 1/1, 1/2, 1/4, 1/8 */
+ MUINT16 ODValue; /* OD Vaule */
+ MUINT16 RG_STATSMODE; /* STATS divistion mdoe 0: 16x16, 1:8x8, 2:4x4, 3:1x1*/
+ MUINT16 VC0_ID;
+ MUINT16 VC0_DataType;
+ MUINT16 VC0_SIZEH;
+ MUINT16 VC0_SIZEV;
+ MUINT16 VC1_ID;
+ MUINT16 VC1_DataType;
+ MUINT16 VC1_SIZEH;
+ MUINT16 VC1_SIZEV;
+ MUINT16 VC2_ID;
+ MUINT16 VC2_DataType;
+ MUINT16 VC2_SIZEH;
+ MUINT16 VC2_SIZEV;
+ MUINT16 VC3_ID;
+ MUINT16 VC3_DataType;
+ MUINT16 VC3_SIZEH;
+ MUINT16 VC3_SIZEV;
+} ;
+struct SENSOR_AWB_GAIN
+{
+ MUINT32 ABS_GAIN_GR;
+ MUINT32 ABS_GAIN_R;
+ MUINT32 ABS_GAIN_B;
+ MUINT32 ABS_GAIN_GB;
+};
+
+struct SensorPDAFInfo{
+ MUINT32 i4OffsetX; /* start offset of first PD block */
+ MUINT32 i4OffsetY;
+ MUINT32 i4PitchX; /* PD block pitch */
+ MUINT32 i4PitchY;
+ MUINT32 i4PairNum; /* PD pair num in one block */
+ MUINT32 i4SubBlkW; /* sub block width (one PD pair in one sub block) */
+ MUINT32 i4SubBlkH; /* sub block height */
+ MUINT32 i4PosL[16][2]; /* left pd pixel position in one block*/
+ MUINT32 i4PosR[16][2]; /* right pd pixel position in one block*/
+};
+
+/******************************************************************************
+ * Hal Sensor Interface.
+ ******************************************************************************/
+class IHalSensor
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Definitions.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: ////
+ /**
+ * @brief Used in configure.
+ */
+ struct ConfigParam
+ {
+ MUINT index; // sensor index
+ MSize crop; // TG crop size in pixels.
+ MUINT scenarioId; // sensor scenario ID.
+ MBOOL isBypassScenario;
+ MBOOL isContinuous;
+ MUINT HDRMode; //iHDR mode : 0: no HDR, 1: IHDR, 2:MHDR
+ MUINT framerate; // Unit : FPS, 10based, 0: will run sensor mode default setting
+ MUINT twopixelOn; //Force ture on two pixel mode by user
+ MUINT debugMode; // 1: Enable test model (TM) , 2:Enable sensor test pattern(Patern gen)
+ };
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Interfaces.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected: //// Destructor.
+
+ /**
+ * Disallowed to directly delete a raw pointer.
+ */
+ virtual ~IHalSensor() {}
+
+public: //// Instantiation.
+
+ /**
+ * Destroy this instance created from IHalSensorList::createSensor.
+ */
+ virtual MVOID destroyInstance(
+ char const* szCallerName = ""
+ ) = 0;
+
+public: //// Operations.
+
+ /**
+ * Turn on/off the power of sensor(s).
+ */
+ virtual MBOOL powerOn(
+ char const* szCallerName,
+ MUINT const uCountOfIndex,
+ MUINT const*pArrayOfIndex
+ ) = 0;
+ virtual MBOOL powerOff(
+ char const* szCallerName,
+ MUINT const uCountOfIndex,
+ MUINT const*pArrayOfIndex
+ ) = 0;
+
+
+ /**
+ * Configure the sensor(s).
+ */
+ virtual MBOOL configure(
+ MUINT const uCountOfParam,
+ ConfigParam const* pArrayOfParam
+ ) = 0;
+
+ /**
+ * Common interface to access sensor for specified command index and sensorDevIdx .It must be used after powerOn
+ */
+ virtual MINT sendCommand(
+ MUINT sensorDevIdx,
+ MUINTPTR cmd,
+ MUINTPTR arg1,
+ MUINTPTR arg2,
+ MUINTPTR arg3
+ ) = 0;
+ /**
+ * Query sensor dynamic information by sensorDevIdx..
+ */
+ virtual MBOOL querySensorDynamicInfo(
+ MUINT32 sensorIdx,
+ SensorDynamicInfo *pSensorDynamicInfo
+ ) = 0;
+ /**
+ * Sensor set exif debug information.
+ */
+
+ virtual MINT32 setDebugInfo(IBaseCamExif *pIBaseCamExif) = 0;
+
+ /**
+ * release I2C HW sync trigger lock.
+ */
+
+ virtual MINT32 releaseI2CTrigLock() = 0;
+
+};
+
+
+/******************************************************************************
+ * Hal Sensor List Interface.
+ ******************************************************************************/
+class IHalSensorList
+{
+public: //// Instantiation.
+ static IHalSensorList* get();
+
+protected: //// Destructor.
+
+ /**
+ * Disallowed to directly delete a raw pointer.
+ */
+ virtual ~IHalSensorList() {}
+
+public: //// Attributes.
+
+ /**
+ * Query the number of image sensors.
+ * This call is legal only after searchSensors().
+ */
+ virtual MUINT queryNumberOfSensors() const = 0;
+
+ /**
+ * Query static information for a specific sensor index.
+ * This call is legal only after searchSensors().
+ */
+ virtual IMetadata const& queryStaticInfo(MUINT const index) const = 0;
+
+ /**
+ * Query the driver name for a specific sensor index.
+ * This call is legal only after searchSensors().
+ */
+ virtual char const* queryDriverName(MUINT const index) const = 0;
+
+ /**
+ * Query the sensor type of NSSensorType::Type for a specific sensor index.
+ * This call is legal only after searchSensors().
+ */
+ virtual MUINT queryType(MUINT const index) const = 0;
+
+ /**
+ * Query the sensor facing direction for a specific sensor index.
+ * This call is legal only after searchSensors().
+ */
+ virtual MUINT queryFacingDirection(
+ MUINT const index
+ ) const = 0;
+
+ /**
+ * Query SensorDev Index by sensor list index.
+ * This call is legal only after searchSensors().
+ * Return SENSOR_DEV_MAIN, SENSOR_DEV_SUB,...
+ */
+ virtual MUINT querySensorDevIdx(MUINT const index) const = 0;
+
+ /**
+ * Query static SensorStaticInfo for a specific sensor index.
+ * This call is legal only after searchSensors().
+ */
+ virtual SensorStaticInfo const* querySensorStaticInfo(
+ MUINT const index
+ ) const = 0;
+
+ /**
+ * Query Sensor Information.
+ * This call is legal only after searchSensors().
+ */
+ virtual MVOID querySensorStaticInfo(
+ MUINT sensorDevIdx,
+ SensorStaticInfo *pSensorStaticInfo
+ ) const = 0;
+
+public: //// Operations.
+
+ /**
+ * Search sensors and return the number of image sensors.
+ */
+ virtual MUINT searchSensors() = 0;
+
+ /**
+ * Create an instance of IHalSensor for a single specific sensor index.
+ * This call is legal only after searchSensors().
+ */
+ virtual IHalSensor* createSensor(
+ char const* szCallerName,
+ MUINT const index
+ ) = 0;
+
+ /**
+ * Create an instance of IHalSensor for multiple specific sensor indexes.
+ * This call is legal only after searchSensors().
+ */
+ virtual IHalSensor* createSensor(
+ char const* szCallerName,
+ MUINT const uCountOfIndex,
+ MUINT const*pArrayOfIndex
+ ) = 0;
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_HAL_IHALSENSOR_H_
+
diff --git a/include/hardware/include/mtkcam/hal/IResManager.h b/include/hardware/include/mtkcam/hal/IResManager.h
new file mode 100644
index 0000000..e5d6d3c
--- /dev/null
+++ b/include/hardware/include/mtkcam/hal/IResManager.h
@@ -0,0 +1,64 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_CAMERA_INC_DRV_IRESMANAGER_H_
+#define _MTK_CAMERA_INC_DRV_IRESMANAGER_H_
+//
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+class IResManager
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Interfaces.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Instantiation.
+
+ static IResManager* getInstance();
+ virtual ~IResManager() {}
+
+public: //// Operations.
+
+ virtual MBOOL open(char const* szCallerName) = 0;
+ virtual MBOOL close(char const* szCallerName) = 0;
+};
+
+
+#endif //_MTK_CAMERA_INC_DRV_IRESMANAGER_H_
+
diff --git a/include/hardware/include/mtkcam/hal/aaa_hal_base.h b/include/hardware/include/mtkcam/hal/aaa_hal_base.h
new file mode 100644
index 0000000..8e4a1a7
--- /dev/null
+++ b/include/hardware/include/mtkcam/hal/aaa_hal_base.h
@@ -0,0 +1,756 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein
+ * is confidential and proprietary to MediaTek Inc. and/or its licensors.
+ * Without the prior written permission of MediaTek inc. and/or its licensors,
+ * any reproduction, modification, use or disclosure of MediaTek Software,
+ * and information contained herein, in whole or in part, shall be strictly prohibited.
+ */
+/* MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON
+ * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+ * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+ * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+ * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
+ * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
+ * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
+ * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
+ * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
+ * CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+ * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+ * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
+ * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek Software")
+ * have been modified by MediaTek Inc. All revisions are subject to any receiver's
+ * applicable license agreements with MediaTek Inc.
+ */
+
+/********************************************************************************************
+ * LEGAL DISCLAIMER
+ *
+ * (Header of MediaTek Software/Firmware Release or Documentation)
+ *
+ * BY OPENING OR USING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") RECEIVED
+ * FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON AN "AS-IS" BASIS
+ * ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR
+ * A PARTICULAR PURPOSE OR NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY
+ * WHATSOEVER WITH RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK
+ * ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+ * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S SPECIFICATION
+ * OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+ *
+ * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE LIABILITY WITH
+ * RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION,
+TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE
+ * FEES OR SERVICE CHARGE PAID BY BUYER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE WITH THE LAWS
+ * OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF LAWS PRINCIPLES.
+ ************************************************************************************************/
+/**
+* @file aaa_hal_base.h
+* @brief Declarations of 3A Hal Base Class and Top Data Structures
+*/
+#include <stdint.h>
+
+#ifndef _AAA_HAL_BASE_H_
+#define _AAA_HAL_BASE_H_
+
+typedef intptr_t MINTPTR;
+typedef uintptr_t MUINTPTR;
+
+class IBaseCamExif;
+
+namespace NS3A
+{
+
+enum E3ACtrl_T
+{
+ E3ACtrl_Begin = 0,
+ //shading
+ E3ACtrl_SetShadingOnOff = 0x0001,
+ E3ACtrl_SetShadingStrength = 0x0002,
+ E3ACtrl_SetShadingSdblkCfg = 0x0003,
+ E3ACtrl_SetShadingTSFOnOff = 0x0004,
+ E3ACtrl_SetShadingDynamic = 0x0005,
+ E3ACtrl_SetShadingColorTemp = 0x0006,
+ E3ACtrl_SetShadingByp123 = 0x0007,
+ E3ACtrl_SetShadingTSFCapByp = 0x0008,
+ //AWB
+ E3ACtrl_SetAwbBypCalibration = 0x0100,
+ //AE
+ E3ACtrl_SetExposureParam = 0x0200,
+ E3ACtrl_GetExposureParam = 0x0201,
+ E3ACtrl_GetAEPLineTable = 0x0202,
+ E3ACtrl_EnableDisableAE = 0x0203,
+ E3ACtrl_SetIsAEMultiCapture = 0x0204,
+ E3ACtrl_GetAECapDelay = 0x0205,
+ E3ACtrl_GetSensorDelayFrame = 0x0206,
+ E3ACtrl_SetSensorDirectly = 0x0207,
+ E3ACtrl_SetAEContinueShot = 0x0208,
+ E3ACtrl_GetEvCapture = 0x0209,
+ //ISP
+ E3ACtrl_GetIspGamma = 0x0300,
+ //AF
+ E3ACtrl_PostPDAFtask = 0x0400,
+ E3ACtrl_QueryAFStatus = 0x0401,
+ //Flow control set
+ E3ACtrl_Enable3ASetParams = 0x1000,
+ E3ACtrl_SetOperMode = 0x1001,
+ //Flow control get
+ E3ACtrl_GetOperMode = 0x2001,
+ //Stereo
+ E3ACtrl_GetStereo3DWarning = 0x8000,
+ E3ACtrl_GetDAFTBL = 0x8001,
+ // For engineer collect module info file
+ ECmd_Set3ACollectInfoFile = 0x9000,
+ //
+ E3ACtrl_Num
+};
+
+typedef enum
+{
+ ESensorDevId_Main = 0x01,
+ ESensorDevId_Sub = 0x02,
+ ESensorDevId_MainSecond = 0x04,
+ ESensorDevId_Main3D = 0x05,
+ ESensorDevId_Atv = 0x08,
+} ESensorDevId_T;
+
+enum ESensorType_T {
+ ESensorType_RAW = 0,
+ ESensorType_YUV = 1
+};
+/**
+ * @brief 3A commands
+ */
+enum ECmd_T {
+ ECmd_CameraPreviewStart,
+ ECmd_CameraPreviewEnd,
+ ECmd_CamcorderPreviewStart,
+ ECmd_CamcorderPreviewEnd,
+ ECmd_PrecaptureStart,
+ ECmd_PrecaptureEnd,
+ ECmd_CaptureStart,
+ ECmd_CaptureEnd,
+ ECmd_RecordingStart,
+ ECmd_RecordingEnd,
+ ECmd_Update,
+ // internal command
+ ECmd_Init,
+ ECmd_Uninit,
+ ECmd_AFUpdate, // sync with AF done
+ ECmd_AFStart,
+ ECmd_AFEnd
+
+};
+
+enum EQueryType_T{
+ EQueryType_Init,
+ EQueryType_Effect,
+ EQueryType_AWB,
+ EQueryType_AF,
+ EQueryType_Ev,
+ EQueryType_Sat,
+ EQueryType_Bright,
+ EQueryType_Contrast
+};
+/**
+ * @brief ISP tuning profile
+ */
+enum EIspProfile_T
+{
+ // NORMAL
+ EIspProfile_NormalPreview = 0,
+ EIspProfile_ZsdPreview_CC,
+ EIspProfile_ZsdPreview_NCC,
+ EIspProfile_NormalCapture,
+ EIspProfile_VideoPreview,
+ EIspProfile_VideoCapture,
+ EIspProfile_NormalCapture_CC,
+ EIspProfile_NormalCapture_16M,
+ // MF
+ EIspProfile_MFCapPass1,
+ EIspProfile_MFCapPass2,
+ EIspProfile_NUM
+};
+
+enum E3ACaptureMode_T
+{
+ ECapMode_P2_Cal = (1<<0),
+ ECapMode_P2_Set = (1<<1)
+};
+
+enum E3APreviewMode_T
+{
+ EPv_Normal = 0,
+ EPv_Video
+};
+
+enum ECaptureType_T
+{
+ ECapType_SingleCapture = 0,
+ ECapType_MultiCapture
+};
+
+struct FrameOutputParam_T
+{
+ MUINT32 u4FRameRate_x10; // 10 base frame rate
+ MINT32 i4BrightValue_x10; // 10 base brightness value
+ MINT32 i4ExposureValue_x10; // 10 base exposure value
+ MINT32 i4LightValue_x10; // 10 base lumince value
+ MUINT32 u4AEIndex;
+
+ MUINT32 u4ShutterSpeed_us; // micro second
+ MUINT32 u4SensorGain_x1024; // 1024 base
+ MUINT32 u4ISPGain_x1024; // 1024 base
+
+ MUINT32 u4PreviewShutterSpeed_us; // micro secondMUINT32 u4ShutterSpeed_us; // micro second
+ MUINT32 u4PreviewSensorGain_x1024; // 1024 base
+ MUINT32 u4PreviewISPGain_x1024; // 1024 base
+ MUINT32 u4RealISOValue;
+ MUINT32 u4CapShutterSpeed_us; // micro second
+ MUINT32 u4CapSensorGain_x1024; // 1024 base
+ MUINT32 u4CapISPGain_x1024; // 1024 base
+ MINT16 i2FlareOffset; // 12 bit domain
+ MINT16 i2FlareGain; // 9 base gain
+};
+
+
+struct Hal3A_HDROutputParam_T
+{
+ MUINT32 u4OutputFrameNum; // Output frame number (2 or 3)
+ MUINT32 u4FinalGainDiff[2]; // 1x=1024; [0]: Between short exposure and 0EV; [1]: Between 0EV and long exposure
+ MUINT32 u4TargetTone; //Decide the curve to decide target tone
+};
+/**
+ * @brief 3A parameters for capture
+ */
+struct CaptureParam_T
+{
+ MUINT32 u4ExposureMode; //0: exp. time, 1: exp. line
+ MUINT32 u4Eposuretime; //!<: Exposure time in us
+ MUINT32 u4AfeGain; //!<: sensor gain
+ MUINT32 u4IspGain; //!<: raw gain
+ MUINT32 u4RealISO; //!<: Real ISO speed
+ MUINT32 u4FlareOffset;
+ MUINT32 u4FlareGain; // 512 is 1x
+ MINT32 i4LightValue_x10; // 10 base LV value
+ MUINT32 u4YuvShading; //0: off, 1,on
+ MUINT32 u4YuvGamma; //0: off, 1,on
+ MUINT32 u4YuvAE; //0: off, 1,on
+ MUINT32 u4YuvShutter;
+ MUINT32 u4YuvGain;
+ MUINT32 u4YuvShutterRange;
+};
+
+struct FeatureParam_T {
+ MBOOL bExposureLockSupported;
+ MBOOL bAutoWhiteBalanceLockSupported;
+ MUINT32 u4MaxFocusAreaNum;
+ MINT32 i4MaxLensPos;
+ MINT32 i4MinLensPos;
+ MINT32 i4AFBestPos;
+ MINT64 i8BSSVlu;
+ MUINT32 u4MaxMeterAreaNum;
+ MUINT32 u4FocusLength_100x;
+};
+
+struct CameraArea_T {
+ MINT32 i4Left;
+ MINT32 i4Top;
+ MINT32 i4Right;
+ MINT32 i4Bottom;
+ MINT32 i4Weight;
+};
+
+struct ExpSettingParam_T {
+ MINT32 u4AOEMode;
+ MUINT32 u4MaxSensorAnalogGain; // 1x=1024
+ MUINT32 u4MaxAEExpTimeInUS; // unit: us
+ MUINT32 u4MinAEExpTimeInUS; // unit: us
+ MUINT32 u4ShutterLineTime; // unit: 1/1000 us
+ MUINT32 u4MaxAESensorGain; // 1x=1024
+ MUINT32 u4MinAESensorGain; // 1x=1024
+ MUINT32 u4ExpTimeInUS0EV; // unit: us
+ MUINT32 u4SensorGain0EV; // 1x=1024
+ MUINT8 u1FlareOffset0EV;
+ MINT32 i4GainBase0EV; // AOE application for LE calculation
+ MINT32 i4LE_LowAvg; // AOE application for LE calculation, def: 0 ~ 39 avg
+ MINT32 i4SEDeltaEVx100; // AOE application for SE calculation
+ MUINT32 u4Histogram[128];
+};
+
+#define MAX_FOCUS_AREAS 9
+
+struct CameraFocusArea_T {
+ CameraArea_T rAreas[MAX_FOCUS_AREAS];
+ MUINT32 u4Count;
+};
+
+#define MAX_METERING_AREAS 9
+
+struct CameraMeteringArea_T {
+ CameraArea_T rAreas[MAX_METERING_AREAS];
+ MUINT32 u4Count;
+};
+
+// 3A ASD info
+struct ASDInfo_T {
+ MINT32 i4AELv_x10; // AE Lv
+ MBOOL bAEBacklit; // AE backlit condition
+ MBOOL bAEStable; // AE stable
+ MINT16 i2AEFaceDiffIndex; // Face AE difference index with central weighting
+ MINT32 i4AWBRgain_X128; // AWB Rgain
+ MINT32 i4AWBBgain_X128; // AWB Bgain
+ MINT32 i4AWBRgain_D65_X128; // AWB Rgain (D65; golden sample)
+ MINT32 i4AWBBgain_D65_X128; // AWB Bgain (D65; golden sample)
+ MINT32 i4AWBRgain_CWF_X128; // AWB Rgain (CWF; golden sample)
+ MINT32 i4AWBBgain_CWF_X128; // AWB Bgain (CWF; golden sample)
+ MBOOL bAWBStable; // AWB stable
+ MINT32 i4AFPos; // AF position
+ MVOID *pAFTable; // Pointer to AF table
+ MINT32 i4AFTableOffset; // AF table offset
+ MINT32 i4AFTableMacroIdx; // AF table macro index
+ MINT32 i4AFTableIdxNum; // AF table total index number
+ MBOOL bAFStable; // AF stable
+};
+
+// LCE Info
+struct LCEInfo_T {
+ MINT32 i4NormalAEidx; // gain >= 4x AE Pline table index at 30fps
+ MINT32 i4LowlightAEidx; // gain max AE Pline table index at 30fps
+ MINT32 i4AEidxCur; // AE current frame Pline table index
+ MINT32 i4AEidxNext; // AE next frame Pline table index
+};
+
+typedef enum
+{
+ E_AE_PRECAPTURE_IDLE,
+ E_AE_PRECAPTURE_START
+} EAePreCapture_T;
+/**
+ * @brief 3A parameters
+ */
+// 3A parameters
+struct Param_T {
+
+ // DEFAULT DEFINITION CATEGORY ( ordered by SDK )
+ MINT32 i4MinFps;
+ MINT32 i4MaxFps;
+ MUINT32 u4AfMode;
+ MUINT32 u4AeMode;
+ MUINT32 u4AwbMode;
+ MUINT32 u4EffectMode;
+ MUINT32 u4AntiBandingMode;
+ MUINT32 u4SceneMode;
+ MUINT32 u4StrobeMode;
+ MINT32 i4ExpIndex;
+ MFLOAT fExpCompStep;
+ MBOOL bIsAELock;
+ MBOOL bIsAWBLock;
+
+ MINT32 i4FullScanStep;
+ MINT32 i4MFPos;
+ CameraFocusArea_T rFocusAreas;
+ CameraMeteringArea_T rMeteringAreas;
+
+ // MTK DEFINITION CATEGORY
+
+ MUINT32 u4IsoSpeedMode;
+ MUINT32 u4AfLampMode;
+ //
+ MUINT32 u4BrightnessMode;
+ MUINT32 u4HueMode;
+ MUINT32 u4SaturationMode;
+ MUINT32 u4EdgeMode;
+ MUINT32 u4ContrastMode;
+ MINT32 i4RotateDegree;
+ MUINT32 u4AeMeterMode;
+
+ // NEWLY-ADDED CATEGORY
+ MUINT32 u4CamMode; //Photo, Video, ZSD, ENG mode
+ MUINT32 u4ShotMode;
+
+ //flash for engineer mode
+ MINT32 i4PreFlashDuty;
+ MINT32 i4PreFlashStep;
+ MINT32 i4MainFlashDuty;
+ MINT32 i4MainFlashStep;
+
+ MBOOL bIsSupportAndroidService;
+ MBOOL bVideoStabilization;
+
+ Param_T()
+ : i4MinFps(5000)
+ , i4MaxFps(30000)
+ , u4AfMode(0)
+ , u4AwbMode(1)
+ , u4EffectMode(0)
+ , u4AntiBandingMode(0)
+ , u4SceneMode(0)
+ , u4StrobeMode(0)
+ , i4ExpIndex(0)
+ , fExpCompStep(0)
+ , bIsAELock(MFALSE)
+ , bIsAWBLock(MFALSE)
+ , i4FullScanStep(1)
+ , i4MFPos(0)
+ , rFocusAreas()
+ , rMeteringAreas()
+ , u4AeMode(0)
+ , u4IsoSpeedMode(0)
+ , u4AfLampMode(0)
+ , u4BrightnessMode(0)
+ , u4HueMode(0)
+ , u4SaturationMode(0)
+ , u4EdgeMode(0)
+ , u4ContrastMode(0)
+ , i4RotateDegree(0)
+ , u4AeMeterMode (0)
+ , u4CamMode(0)
+ , u4ShotMode(0)
+ , i4PreFlashDuty(-1)
+ , i4PreFlashStep(-1)
+ , i4MainFlashDuty(-1)
+ , i4MainFlashStep(-1)
+ , bIsSupportAndroidService(MTRUE)
+ , bVideoStabilization(0)
+ {}
+};
+
+
+/*
+#if 0
+typedef enum
+{
+ E_AF_INACTIVE,
+ E_AF_PASSIVE_SCAN,
+ E_AF_PASSIVE_FOCUSED,
+ E_AF_ACTIVE_SCAN,
+ E_AF_FOCUSED_LOCKED,
+ E_AF_NOT_FOCUSED_LOCKED,
+ E_AF_PASSIVE_UNFOCUSED,
+} EAfState_T;
+
+typedef enum
+{
+ E_AE_INACTIVE,
+ E_AE_SEARCHING,
+ E_AE_CONVERGED,
+ E_AE_LOCKED,
+ E_AE_FLASH_REQUIRED,
+ E_AE_PRECAPTURE
+} EAeState_T;
+
+typedef enum
+{
+ E_AWB_INACTIVE,
+ E_AWB_SEARCHING,
+ E_AWB_CONVERGED,
+ E_AWB_LOCKED
+} EAwbState_T;
+#endif
+// max frames to queue DAF information
+#define DAF_TBL_QLEN 32
+#define DIST_TBL_QLEN 16
+typedef struct
+{
+ MUINT32 frm_mun;
+ MUINT8 is_learning;
+ MUINT8 is_querying;
+ MUINT8 af_valid;
+ MUINT16 af_dac_index;
+ MUINT16 af_confidence;
+ MUINT16 af_win_start_x;
+ MUINT16 af_win_start_y;
+ MUINT16 af_win_end_x;
+ MUINT16 af_win_end_y;
+ MUINT16 daf_dac_index;
+ MUINT16 daf_confidence;
+ MUINT16 daf_distance;
+} DAF_VEC_STRUCT;
+
+typedef struct
+{
+ MUINT8 is_daf_run;
+ MUINT32 is_query_happen;
+ MUINT32 curr_p1_frm_num;
+ MUINT32 curr_p2_frm_num;
+ MUINT16 af_dac_min;
+ MUINT16 af_dac_max;
+ MUINT16 af_dac_start;
+ MUINT32 dac[DIST_TBL_QLEN];
+ MUINT32 dist[DIST_TBL_QLEN];
+
+ DAF_VEC_STRUCT daf_vec[DAF_TBL_QLEN];
+}DAF_TBL_STRUCT;
+*/
+struct Result_T
+{
+ MINT32 i4FrmId;
+ MINT32 i4PrecaptureId; // android.control.aePrecaptureId
+ //EAfState_T eAfState;
+ //EAeState_T eAeState;
+ //EAwbState_T eAwbState;
+};
+
+
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+//
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+class I3ACallBack {
+
+public:
+
+ virtual ~I3ACallBack() {}
+
+public:
+
+ virtual void doNotifyCb (
+ int32_t _msgType,
+ int32_t _ext1,
+ int32_t _ext2,
+ int32_t _ext3
+ ) = 0;
+
+ virtual void doDataCb (
+ int32_t _msgType,
+ void* _data,
+ uint32_t _size
+ ) = 0;
+public:
+
+enum ECallBack_T
+{
+ eID_NOTIFY_AF_FOCUSED,
+ eID_NOTIFY_AF_MOVING,
+ eID_DATA_AF_FOCUSED,
+};
+
+};
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+//
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+/**
+ * @brief 3A Hal Base Class
+ */
+class Hal3ABase {
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+//
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected: // Ctor/Dtor.
+ Hal3ABase() {}
+ virtual ~Hal3ABase() {}
+
+private: // disable copy constructor and copy assignment operator
+ Hal3ABase(const Hal3ABase&);
+ Hal3ABase& operator=(const Hal3ABase&);
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Interfaces.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public:
+ //
+ /**
+ * @brief Create instance of Hal3ABase
+ * @param [in] i4SensorDevId sensor device; please refer to halSensorDev_e in sensor_hal.h
+ */
+ static Hal3ABase* createInstance(MINT32 const i4SensorDevId);
+ /**
+ * @brief destroy instance of Hal3ABase
+ */
+ virtual MVOID destroyInstance() {}
+ /**
+ * @brief send commands to 3A hal
+ * @param [in] eCmd 3A commands; please refer to ECmd_T
+ */
+ virtual MBOOL sendCommand(ECmd_T const eCmd, MINTPTR const i4Arg = 0) {return MTRUE;}
+ /**
+ * @brief get 3A error code
+ */
+ virtual MINT32 getErrorCode() const {return 0;}
+ /**
+ * @brief get 3A parameters
+ * @param [out] rParam 3A parameter struct; please refer to Param_T
+ */
+ virtual MBOOL getParams(Param_T &rParam) const {return MTRUE;}
+ /**
+ * @brief set 3A parameters
+ * @param [in] rNewParam 3A parameter struct; please refer to Param_T
+ */
+ virtual MBOOL setParams(Param_T const &rNewParam) {return MTRUE;}
+ /**
+ * @brief get 3A feature parameters
+ * @param [out] rFeatureParam feature parameter struct; please refer to FeatureParam_T
+ */
+ virtual MBOOL getSupportedParams(FeatureParam_T &rFeatureParam) {return MTRUE;}
+ /**
+ * @brief to return whether ready to capture or not
+ */
+ virtual MBOOL isReadyToCapture() const {return MTRUE;}
+ /**
+ * @brief execute auto focus process
+ */
+ virtual MBOOL autoFocus() {return MTRUE;}
+ /**
+ * @brief cancel auto focus process
+ */
+ virtual MBOOL cancelAutoFocus() {return MTRUE;}
+ /**
+ * @brief set zoom parameters of auto focus
+ */
+ virtual MBOOL setZoom(MUINT32 u4ZoomRatio_x100, MUINT32 u4XOffset, MUINT32 u4YOffset, MUINT32 u4Width, MUINT32 u4Height) {return MTRUE;}
+ /**
+ * @brief set 3A photo EXIF information
+ * @param [in] pIBaseCamExif pointer of Exif base object; please refer to IBaseCamExif in IBaseCamExif.h
+ */
+ virtual MBOOL set3AEXIFInfo(IBaseCamExif *pIBaseCamExif) const {return MTRUE;}
+ /**
+ * @brief set debug information of MTK photo debug parsor
+ * @param [in] pIBaseCamExif pointer of Exif base object; please refer to IBaseCamExif in IBaseCamExif.h
+ */
+ virtual MBOOL setDebugInfo(IBaseCamExif *pIBaseCamExif) const {return MTRUE;}
+ /**
+ * @brief provide number of delay frames required by 3A mechanism
+ * @param [in] eQueryType query type; please refer to EQueryType_T
+ */
+ virtual MINT32 getDelayFrame(EQueryType_T const eQueryType) const {return 0;}
+ /**
+ * @brief set callbacks of AF Manager
+ */
+ virtual MBOOL setCallbacks(I3ACallBack* cb) {return MTRUE;}
+ /**
+ * @brief set ISP tuning profile
+ * @param [in] IspProfile ISP profile; please refer to EIspProfile
+ */
+ virtual MBOOL setIspProfile(EIspProfile_T IspProfile) {return MTRUE;}
+ /**
+ * @brief get capture AE parameters information
+ * @param [in] index capture index information, the value is 0~2
+ * @param [in] i4EVidx increase or decrease capture AE parameters information
+ * @param [out] a_rCaptureInfo AE information structure; please refer to Ae_param.h
+ */
+ virtual MINT32 getCaptureParams(MINT8 index, MINT32 i4EVidx, CaptureParam_T &a_rCaptureInfo) {return 0;}
+ /**
+ * @brief update capture AE parameters
+ * @param [in] a_rCaptureInfo capture AE parameters information
+ */
+ virtual MINT32 updateCaptureParams(CaptureParam_T &a_rCaptureInfo) {return 0;}
+
+ virtual MINT32 getExposureInfo(ExpSettingParam_T &strHDRInputSetting) {return 0;}
+ /**
+ * @brief get High dynamic range capture information
+ * @param [out] a_strHDROutputInfo capture information;
+ */
+ virtual MINT32 getHDRCapInfo(Hal3A_HDROutputParam_T &a_strHDROutputInfo) {return 0;}
+ /**
+ * @brief set AE face detection area and weight information
+ * @param [in] a_sFaces face detection information; please refer to Faces.h
+ */
+ virtual MVOID setFDEnable(MBOOL bEnable) {}
+ virtual MBOOL setFDInfo(MVOID* a_sFaces) {return MTRUE;}
+ virtual MBOOL setOTInfo(MVOID* a_sOT) {return MTRUE;}
+ /**
+ * @brief get real time AE parameters information
+ * @param [out] a_strFrameOutputInfo previiew AE information;
+ */
+ virtual MINT32 getRTParams(FrameOutputParam_T &a_strFrameOutputInfo) {return 0;}
+ /**
+ * @brief to return whether need to fire flash
+ */
+ virtual MINT32 isNeedFiringFlash() {return 0;}
+ /**
+ * @brief get ASD info
+ * @param [out] a_rASDInfo ASD info;
+ */
+ virtual MBOOL getASDInfo(ASDInfo_T &a_rASDInfo) {return MTRUE;}
+ /**
+ * @brief get LCE info from AE
+ * @param [out] a_rLCEInfo LCE info;
+ */
+ virtual MBOOL getLCEInfo(LCEInfo_T &a_rLCEInfo) {return MTRUE;}
+ /**
+ * @brief End continuous shot, EX: turn off flash device
+ */
+ virtual MVOID endContinuousShotJobs() {}
+ /**
+ * @brief enable AE limiter control
+ */
+ virtual MINT32 enableAELimiterControl(MBOOL bIsAELimiter) {return 0;}
+ virtual MINT32 getFlashFrameNumBeforeCapFrame() {return 1;}
+ virtual MVOID onFireCapFlashIfNeeded() {}
+ virtual MVOID setSensorMode(MINT32 i4SensorMode) {}
+ virtual MINT32 send3ACtrl(E3ACtrl_T e3ACtrl, MINTPTR iArg1, MINTPTR iArg2) {return 0;}
+ virtual MBOOL setAELock(MBOOL bIsAELock){return MTRUE;};
+ virtual MBOOL setAWBLock(MBOOL bIsAELock){return MTRUE;};
+#if 0
+ virtual MBOOL getFocusData (vector<T.B.D> &rData) const = 0;
+ // FD
+ // EXIF (T.B.D)
+
+#endif
+};
+
+#include <sys/time.h>
+#include <cutils/xlog.h>
+class aaaTimer {
+public:
+ inline MINT32 getUsTime()
+ {
+ struct timeval tv;
+ gettimeofday(&tv, NULL);
+
+ return tv.tv_sec * 1000000 + tv.tv_usec;
+ }
+
+ aaaTimer(const char* info, MINT32 sensorDevId, MBOOL enable)
+ : mInfo(info), mIdx(sensorDevId), mEnable(enable)
+ {
+ if (mEnable) mStartTime = getUsTime();
+ }
+
+ MVOID start(const char* info, MINT32 sensorDevId, MBOOL enable) //used by global/static variables
+ {
+ mInfo = info;
+ mIdx = sensorDevId;
+ mEnable = enable;
+ if (mEnable) mStartTime = getUsTime();
+ }
+
+ MVOID printTime()
+ {
+ if (!mEnable) return;
+ MINT32 endTime = getUsTime();
+ XLOGD("[Function: %s, SensorDevId: %d] =====> time(ms): %f\n", mInfo, mIdx, ((double)(endTime - mStartTime)) / 1000);
+ }
+
+ ~aaaTimer()
+ {
+ }
+
+protected:
+ const char* mInfo;
+ MINT32 mStartTime;
+ MINT32 mIdx;
+ MBOOL mEnable;
+};
+
+
+}; // namespace NS3A
+
+#endif
+
diff --git a/include/hardware/include/mtkcam/hal/sensor_hal.h b/include/hardware/include/mtkcam/hal/sensor_hal.h
new file mode 100644
index 0000000..d73d6b9
--- /dev/null
+++ b/include/hardware/include/mtkcam/hal/sensor_hal.h
@@ -0,0 +1,501 @@
+/********************************************************************************************
+ * LEGAL DISCLAIMER
+ *
+ * (Header of MediaTek Software/Firmware Release or Documentation)
+ *
+ * BY OPENING OR USING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") RECEIVED
+ * FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON AN "AS-IS" BASIS
+ * ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR
+ * A PARTICULAR PURPOSE OR NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY
+ * WHATSOEVER WITH RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK
+ * ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+ * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S SPECIFICATION
+ * OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+ *
+ * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE LIABILITY WITH
+ * RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION,
+TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE
+ * FEES OR SERVICE CHARGE PAID BY BUYER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE WITH THE LAWS
+ * OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF LAWS PRINCIPLES.
+ ************************************************************************************************/
+#ifndef _SENSOR_HAL_H_
+#define _SENSOR_HAL_H_
+class IBaseCamExif;
+/**
+* @file< Sensor_hal.h>
+* @brief:This file is user space camera sensor driver provided interface definition
+*
+*/
+
+
+/**
+*@enum<ACDK_SCENARIO_ID_ENUM>
+*@brief:Sensor operation scenario enum
+*/
+typedef enum
+{
+ ACDK_SCENARIO_ID_CAMERA_PREVIEW=0, /*!<camera preview scenario*/
+ ACDK_SCENARIO_ID_CAMERA_CAPTURE_JPEG, /*!<camera capture scenario*/
+ ACDK_SCENARIO_ID_VIDEO_PREVIEW, /*!<video preview or record scenario*/
+ ACDK_SCENARIO_ID_HIGH_SPEED_VIDEO, /*!<high speed video or record scenario (30fps above)*/
+ ACDK_SCENARIO_ID_CAMERA_ZSD, /*!<zero shtter delay preview or capture scenario*/
+ ACDK_SCENARIO_ID_CAMERA_3D_PREVIEW, /*!<3D camera preview scenario*/
+ ACDK_SCENARIO_ID_CAMERA_3D_CAPTURE, /*!<3D camera capture scenario*/
+ ACDK_SCENARIO_ID_CAMERA_3D_VIDEO, /*!<3D video preview or record scenario*/
+ ACDK_SCENARIO_ID_TV_OUT, /*!<TV out scenario*/
+ ACDK_SCENARIO_ID_HIGH_SPEED_VIDEO1, /*!<high speed video or record scenario (30fps above)*/
+ ACDK_SCENARIO_ID_MAX, /*!<Max enum value*/
+} ACDK_SCENARIO_ID_ENUM;
+
+/*******************************************************************************
+*
+********************************************************************************/
+typedef unsigned int MUINT32;
+typedef int MINT32;
+typedef unsigned short MUINT16;
+/*******************************************************************************
+*
+********************************************************************************/
+
+/**
+*@struct<halSensorIFParam_t>
+*@brief:structure used in sensor hal provided setConf() api to control sensor setting
+*/
+typedef struct halSensorIFParam_s {
+ MUINT32 u4SrcW; /*!<sensor input source width*/
+ MUINT32 u4SrcH; /*!<sensor input source height*/
+ MUINT32 u4CropW; /*!<TG crop width for ISP input*/
+ MUINT32 u4CropH; /*!<TG crop height for ISP input*/
+ MUINT32 u4IsContinous; /*!<TG output to ISP coninuous frame or single frame*/
+ MUINT32 u4IsBypassSensorScenario; /*!<parameter to set bypass sensor operation scenario*/
+ MUINT32 u4IsBypassSensorDelay; /*!<parameter to set bypass sensor switch operation sceario delay frame*/
+ ACDK_SCENARIO_ID_ENUM scenarioId; /*!<operation scenario*/
+} halSensorIFParam_t;
+//
+
+/**
+*@struct<halSensorRawImageInfo_t>
+*@brief:structure used in sensor hal provided sendCommand() api with ID SENSOR_CMD_GET_RAW_INFO to get information from sensor
+*/
+typedef struct halSensorRawImageInfo_s {
+ MUINT32 u4Width; /*!<sensor output source width*/
+ MUINT32 u4Height; /*!<sensor output source height*/
+ MUINT32 u4BitDepth; /*!<sensor output pixel data bit depth*/
+ MUINT32 u4IsPacked; /*!<memory out raw data is packed or not*/
+ MUINT32 u4Size; /*!<sensor output frame data size in bytes*/
+ MUINT32 u1Order; /*!<sensor output data format , please reference ACDK_SENSOR_OUTPUT_DATA_FORMAT_ENUM*/
+} halSensorRawImageInfo_t;
+//
+
+/**
+*@struct<SENSOR_CROP_INFO>
+*@brief:structure used in sensor hal provided sendCommand() api with ID SENSOR_CMD_GET_SENSOR_CROPINFO to get information from sensor
+*/
+typedef struct {
+ MUINT32 u4GrabX; /*!<TG crop window start x*/
+ MUINT32 u4GrabY; /*!<TG crop window start y*/
+ MUINT32 u4SrcW; /*!<sensor output source width*/
+ MUINT32 u4SrcH; /*!<sensor output source height*/
+ MUINT32 u4CropW; /*!<TG crop window width*/
+ MUINT32 u4CropH; /*!<TG crop window height*/
+ MUINT32 u4SubSpW; /*!<sensor Subsampling width*/
+ MUINT32 u4SubSpH; /*!<sensor Subsampling height*/
+ MUINT32 DataFmt; /*!<sensor output data format*/
+} SENSOR_CROP_INFO;
+
+
+/**
+*@struct<SENSOR_GRAB_INFO_STRUCT>
+*@brief:structure used in sensor hal provided sendCommand() api with ID SENSOR_CMD_GET_SENSOR_GRAB_INFO to get information from sensor
+*/
+typedef struct
+{
+ MUINT16 u4SensorGrabStartX; /*!<sensor output data start X from its active window*/
+ MUINT16 u4SensorGrabStartY; /*!<sensor output data start Y from its active window*/
+ MUINT16 u2SensorSubSpW; /*!<sensor output subsampling data in X dir*/
+ MUINT16 u2SensorSubSpH; /*!<sensor output subsampling data in Y dir */
+} SENSOR_GRAB_INFO_STRUCT;
+
+//N3D config
+/**
+*@struct<SENSOR_N3D_CONFIG_STRUCT>
+*@brief:structure used in sensor hal provided sendCommand() api with ID SENSOR_CMD_SET_N3D_CONFIG to set native 3D control configuration
+*/
+typedef struct halSensorN3dConfig_s {
+ MUINT32 u4N3dEn; /*!<N3D module enable control*/
+ MUINT32 u4I2C1En; /*!<N3D 1st I2C control enable control*/
+ MUINT32 u4I2C2En; /*!<N3D 2nd I2C control enable control*/
+ MUINT32 u4N3dMode; /*!<N3D I2C control mode*/
+ MUINT32 u4DiffCntEn; /*!<N3D sensor vsync difference count enable control */
+ MUINT32 u4DiffCntThr; /*!<N3D sensor vsync difference threshold */
+} halSensorN3dConfig_t;
+
+//N3D different count
+/**
+*@struct<SENSOR_N3D_DIFFERENCE_COUNT_STRUCT>
+*@brief:structure used in sensor hal provided sendCommand() api with ID SENSOR_CMD_GET_SENSOR_N3D_DIFFERENCE_COUNT to get native 3D vsync difference information
+*/
+typedef struct halSensorN3dDiffCnt_s {
+ MUINT32 u4DiffCnt; /*!<vsync difference count between vysnc1 & vsync2*/
+ MUINT32 u4Vsync1Cnt; /*!<*vsync1 valid count*/
+ MUINT32 u4Vsync2Cnt; /*!<vsync2 valid count*/
+ MUINT32 u4DebugPort; /*!<vsync2 count number sample at vysnc1*/
+ MUINT32 u4Data[10]; /*!<reserve*/
+} halSensorN3dDiffCnt_t;
+
+/**
+*@enum<halSensorCmd_e>
+*@brief:Sensor hal provide sendCommand() defined command id enum definition
+*/
+typedef enum halSensorCmd_s {
+ SENSOR_CMD_SET_SENSOR_DEV = 0x1000, /*!<Command to set camera operation device. arg1:N/A, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_SET_SENSOR_EXP_TIME, /*!<Command to set sensor exposure time in unit us. arg1:[input]exp time, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_SET_SENSOR_EXP_LINE, /*!<Command to set sensor exposure line. arg1:[input]exp line, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_SET_SENSOR_GAIN, /*!<Command to set sensor gain. arg1:[input]gain, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_SET_FLICKER_FRAME_RATE, /*!<Command to set sensor gain. arg1:[input]gain, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_SET_VIDEO_FRAME_RATE, /*!<Command to set video scenario sensor frame rate. arg1:[input]video frame rate, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_SET_AE_EXPOSURE_GAIN_SYNC, /*!<Command to set AE sync write shutter and gain. arg1:[input]raw gain R, Gr raw gain Gb, B exposure time, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_SET_CCT_FEATURE_CONTROL, /*!<Command to set CCT feature. arg1:[input]ACDK_SENSOR_FEATURE_ENUM, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_SET_SENSOR_CALIBRATION_DATA, /*!<Command to set sensor calibration data. arg1:[input]SET_SENSOR_CALIBRATION_DATA_STRUCT, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_SET_MAX_FRAME_RATE_BY_SCENARIO, /*!<Command to set sensor max output frame rate by scenario. arg1:[input] ACDK_SCENARIO_ID_ENUM, arg2:[input] frame rate (10base), arg3:N/A*/
+ SENSOR_CMD_SET_TEST_PATTERN_OUTPUT, /*!<Command to set sensor test pattern output enable control. arg1:[input] on/off, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_SET_SENSOR_ESHUTTER_GAIN, /*!<Command to set sensor sensor shutter and sensor gain. arg1:[input] pointer of shutter and gain, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_SET_N3D_CONFIG, /*!<Command to set native 3D mode configuration. arg1: [input]halSensorN3dConfig_t, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_SET_N3D_I2C_POS, /*!<Command to set count in SMI clock rate for I2C1&2 delay arg1:[input]position count, arg2:N/A, arg3:N/A */
+ SENSOR_CMD_SET_N3D_I2C_TRIGGER, /*!<Command to set hardware trigger mode arg1:[input]trigger mode, arg2:N/A, arg3:N/A */
+ SENSOR_CMD_SET_N3D_I2C_STREAM_REGDATA, /*!<Command to set I2C command to N3D I2C buffer used to control stream arg1:N/A, arg2:N/A, arg3:N/A */
+ SENSOR_CMD_SET_N3D_START_STREAMING, /*!<Command to set sensor driver to start straming out arg1:N/A, arg2:N/A, arg3:N/A */
+ SENSOR_CMD_SET_N3D_STOP_STREAMING, /*!<Command to set sensor driver to stop straming out arg1:N/A, arg2:N/A, arg3:N/A */
+ SENSOR_CMD_GET_SENSOR_DEV = 0x2000, /*!<Command to get camera operation device. arg1:[output]current sensor dev, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_SENSOR_PRV_RANGE, /*!<Command to get sensor preview scenario output size. arg1:[output]preview width, arg2:[output]preview height, arg3:N/A*/
+ SENSOR_CMD_GET_SENSOR_FULL_RANGE, /*!<Command to get sensor capture scenario output size. arg1:[output]full width, arg2:[output]full height, arg3:N/A*/
+ SENSOR_CMD_GET_SENSOR_VIDEO_RANGE, /*!<Command to get sensor video preview or record scenario output size. arg1:[output]video width, arg2:[output]video height, arg3:N/A*/
+ SENSOR_CMD_GET_SENSOR_HIGH_SPEED_VIDEO_RANGE, /*!<Command to get sensor high speed video preview or record scenario output size. arg1:[output]video width, arg2:[output]video height, arg3:N/A*/
+ SENSOR_CMD_GET_SENSOR_3D_PRV_RANGE, /*!<Command to get sensor 3D preview scenario output size. arg1:[output]preview width, arg2:[output]preview height, arg3:N/A*/
+ SENSOR_CMD_GET_SENSOR_3D_FULL_RANGE, /*!<Command to get sensor 3D capture scenario output size. arg1:[output]full width, arg2:[output]full height, arg3:N/A*/
+ SENSOR_CMD_GET_SENSOR_3D_VIDEO_RANGE, /*!<Command to get sensor 3D video preview or record scenario output size. arg1:[output]video width, arg2:[output]video height, arg3:N/A*/
+ SENSOR_CMD_GET_SENSOR_ID, /*!<Command to get sensor device ID . arg1:[output]Sensor Id, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_RAW_PADDING_RANGE, /*!<Command to get isp padding size. arg1:[output]isp padding width, arg2:[output]isp padding height, arg3:N/A*/
+ SENSOR_CMD_GET_SENSOR_NUM, /*!<Command invalid. arg1:N/A, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_SENSOR_TYPE, /*!<Command to get sensor output format type. arg1:[output] sensor type, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_RAW_INFO, /*!<Command to get sensor information. arg1:[output] halSensorRawImageInfo_t, arg2:[input] mode, arg3:N/A*/
+ SENSOR_CMD_GET_UNSTABLE_DELAY_FRAME_CNT, /*!<Command to get sensor operation unstable frame number. arg1:[output] delay frame count, arg2:[input] operation mode, arg3:N/A*/
+ SENSOR_CMD_GET_INPUT_BIT_ORDER, /*!<Command to get sensor pin connection bit order. arg1:[output] senosr bit order, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_PAD_PCLK_INV, /*!<Command to get sensor pclk inverse setting. arg1:[output] pad pclk inverter, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_SENSOR_ORIENTATION_ANGLE, /*!<Command to get sensor module orientation angle. arg1:[output] sensor orientation, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_SENSOR_FACING_DIRECTION, /*!<Command to get sensor facing direction(0:back/1:front). arg1:[output] sensor facing direction, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_PIXEL_CLOCK_FREQ, /*!<Command to get sensor operating pixel clock. arg1:[output] pixel clock frequency, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_FRAME_SYNC_PIXEL_LINE_NUM, /*!<Command to get sensor operating frame line length and line pxel value. arg1:[output] line pixels & frame line number, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_SENSOR_FEATURE_INFO, /*!<Command to get sensor feature information. arg1:[output] feature info, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_ATV_DISP_DELAY_FRAME, /*!<Command to get ATV required delay frame for display. arg1:[output] delay frame count, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_SENSOR_SCENARIO, /*!<Command to get sensor current operating scenario. arg1:[output] ACDK_SCENARIO_ID_ENUM, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_SENSOR_CROPINFO, /*!<Command to get TG cropping information. arg1:[output] SENSOR_CROP_INFO, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_SENSOR_GRAB_INFO, /*!<Command to get sensor output grab information. arg1:[output] SENSOR_GRAB_INFO_STRUCT, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_SENSOR_SUBSAMPLING_INFO, /*!<Command to get sensor sumsampling information. arg1:[output] subsample width, subsample height, arg3:N/A*/
+ SENSOR_CMD_GET_DEFAULT_FRAME_RATE_BY_SCENARIO, /*!<Command to get sensor default output frame rate by scenario. arg1:[input] ACDK_SCENARIO_ID_ENUM, arg2:[output] frame rate (10 base), arg3:N/A*/
+ SENSOR_CMD_GET_FAKE_ORIENTATION, /*!<Command to get sensor module orientation is fake and need resizer to rotate information. arg1:[output] FAKE orientation, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_SENSOR_VIEWANGLE, /*!<Command to get sensor module viewangle. arg1:[output] horizontal view angle, arg2:[output] vertical view angle, arg3:N/A*/
+ SENSOR_CMD_GET_TEST_PATTERN_CHECKSUM_VALUE, /*!<Command to get sensor test pattern output check sum value. arg1:[output] test pattern check sum value, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_SENSOR_CURRENT_TEMPERATURE, /*!<Command to get sensor current temerature. arg1:[output]sensor temperature, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_SENSOR_EFFECTIVE_PRV_RANGE, /*!<Command to get sensor maxumum preview active output size. arg1:[output] sensor effective preview width, arg2:[output] sensor effective preview height, arg3:N/A*/
+ SENSOR_CMD_GET_SENSOR_EFFECTIVE_FULL_RANGE, /*!<Command to get sensor maxumum capture active output size. arg1:[output] sensor effective full width, arg2:[output] sensor effective full height, arg3:N/A*/
+ SENSOR_CMD_GET_SENSOR_EFFECTIVE_VIDEO_RANGE, /*!<Command to get sensor maxumum video active output size. arg1:[output] sensor video full width, arg2:[output] sensor video full height, arg3:N/A*/
+ SENSOR_CMD_GET_SENSOR_EFFECTIVE_HIGH_SPEED_VIDEO_RANGE,/*!<Command to get sensor maxumum high speed video active output size. arg1:[output] sensor effective video width, arg2:[output] sensor effective video height, arg3:N/A*/
+ SENSOR_CMD_GET_SENSOR_EFFECTIVE_3D_PRV_RANGE, /*!<Command to get sensor maxumum 3D preview active output size. arg1:[output] sensor effective preview width, arg2:[output] sensor effective preview height, arg3:N/A*/
+ SENSOR_CMD_GET_SENSOR_EFFECTIVE_3D_FULL_RANGE, /*!<Command to get sensor maxumum 3D capture active output size. arg1:[output] sensor effective full width, arg2:[output] sensor effective full height, arg3:N/A*/
+ SENSOR_CMD_GET_SENSOR_EFFECTIVE_3D_VIDEO_RANGE, /*!<Command to get sensor maxumum 3D video active output size. arg1:[output] sensor effective video width, arg2:[output] sensor effective video height, arg3:N/A*/
+ SENSOR_CMD_GET_SENSOR_PRV_RANGE_OFFSET, /*!<Command to get sensor preview output offset from maximum active output size. arg1:[output] sensor preview output horizontal offset, arg2:[output] sensor preview output vertical offset, arg3:N/A*/
+ SENSOR_CMD_GET_SENSOR_FULL_RANGE_OFFSET, /*!<Command to get sensor capture output offset from maximum active output size. arg1:[output] sensor full output horizontal offset, arg2:[output] sensor full output vertical offset, arg3:N/A*/
+ SENSOR_CMD_GET_SENSOR_VIDEO_RANGE_OFFSET, /*!<Command to get sensor video output offset from maximum active output size. arg1:[output] sensor video output horizontal offset, arg2:[output] sensor video output vertical offset, arg3:N/A*/
+ SENSOR_CMD_GET_SENSOR_HIGH_SPEED_VIDEO_RANGE_OFFSET,/*!<Command to get sensor high speed video output offset from maximum active output size. arg1:[output] sensor video output horizontal offset, arg2:[output] sensor video output vertical offset, arg3:N/A*/
+ SENSOR_CMD_GET_SENSOR_3D_PRV_RANGE_OFFSET, /*!<Command to get sensor 3D preview output offset from maximum active output size. arg1:[output] sensor preview output horizontal offset, arg2:[output] sensor preview output vertical offset, arg3:N/A*/
+ SENSOR_CMD_GET_SENSOR_3D_FULL_RANGE_OFFSET, /*!<Command to get sensor 3Dcapture output offset from maximum active output size. arg1:[output] sensor full output horizontal offset, arg2:[output] sensor full output vertical offset, arg3:N/A*/
+ SENSOR_CMD_GET_SENSOR_3D_VIDEO_RANGE_OFFSET, /*!<Command to get sensor 3D video output offset from maximum active output size. arg1:[output] sensor video output horizontal offset, arg2:[output] sensor video output vertical offset, arg3:N/A*/
+ SENSOR_CMD_GET_SENSOR_N3D_DIFFERENCE_COUNT, /*!<Command to get native 3D module difference count value arg1:[output] halSensorN3dDiffCnt_t, arg2:N/A, arg3:N/A */
+ SENSOR_CMD_GET_SENSOR_N3D_STREAM_TO_VSYNC_TIME, /*!<Command to get time between stream out command to vsync occur. arg1:[output] time(us), arg2:N/A, arg3:N/A */
+ SENSOR_CMD_SET_YUV_FEATURE_CMD = 0x3000, /*!<Command to set YUV sensor feature. arg1:[input] feature id, arg2:[input] feature value, arg3:N/A*/
+ SENSOR_CMD_SET_YUV_SINGLE_FOCUS_MODE, /*!<Command to set YUV sensor single focus. arg1:N/A, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_SET_YUV_CANCEL_AF, /*!<Command to cancel YUV sensor AF. arg1:N/A, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_SET_YUV_CONSTANT_AF, /*!<Command to set YUV sensor constant focus. arg1:N/A, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_SET_YUV_AF_WINDOW, /*!<Command to set YUV sensor AF window. arg1:[input]AF window, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_SET_YUV_AE_WINDOW, /*!<Command to set YUV sensor AE window. arg1:[input]AE window, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_SET_YUV_AUTOTEST, /*!<Command to set YUV sensor autotest. arg1:[input]YUV_AUTOTEST_T cmd, arg2:[input] param, arg3:N/A*/
+ SENSOR_CMD_SET_YUV_3A_CMD, /*!<Command to set YUV sensor 3A cmd. arg1:[input]ACDK_SENSOR_3A_LOCK_ENUM cmd, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_SENSOR_VC_INFO,
+ SENSOR_CMD_GET_YUV_AF_STATUS = 0x4000, /*!<Command to get YUV sensor AF status. arg1:[output] af status, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_YUV_EV_INFO_AWB_REF_GAIN, /*!<Command to get YUV sensor AE shutter/gain for EV5 & 13 and AWB gain value. arg1:[output] pSensorAEAWBRefStruct, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_YUV_CURRENT_SHUTTER_GAIN_AWB_GAIN, /*!<Command to get YUV sensor current AE shutter/gain and AWB gain value. arg1:[output] pSensorAEAWBCurStruct, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_YUV_AF_MAX_NUM_FOCUS_AREAS, /*!<Command to get YUV sensor AF window number. arg1:[output] window number, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_YUV_AE_MAX_NUM_METERING_AREAS, /*!<Command to get YUV sensor AE window number. arg1:[output] window number, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_YUV_EXIF_INFO, /*!<Command to get YUV sensor EXIF info. arg1:[output] SENSOR_EXIF_INFO_STRUCT, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_YUV_DELAY_INFO, /*!<Command to get YUV sensor delay info. arg1:[output] SENSOR_DELAY_INFO_STRUCT, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_YUV_AE_AWB_LOCK, /*!<Command to get YUV sensor AE/AWB lock capability. arg1:[output] AE lock support, arg2: AWB lock support, arg3:N/A*/
+ SENSOR_CMD_GET_YUV_STROBE_INFO, /*!<Command to get YUV sensor current strobe info. arg1:[output] SENSOR_FLASHLIGHT_AE_INFO_STRUCT, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_YUV_TRIGGER_FLASHLIGHT_INFO, /*!<Command to get YUV sensor current flashlight auto fire necessity. arg1:[output] fire or not, arg2:N/A, arg3:N/A*/
+ SENSOR_CMD_GET_YUV_SENSOR_CAPTURE_OUTPUT_JPEG, //TRUE:JPEG,FALSE:original raw/yuv data
+ SENSOR_CMD_SET_YUV_JPEG_PARA, //Set JPEG-Sensor parameters
+ SENSOR_CMD_GET_YUV_JPEG_INFO, //Set JPEG-Sensor parameters
+ SENSOR_CMD_SET_YUV_MSHOT_ENABLE, //notify sensor-hal, mShot is enable
+ SENSOR_CMD_GET_YUV_SENSOR_FIXED_JPEG_ORIENTATION, //
+SENSOR_CMD_MAX = 0xFFFF
+} halSensorCmd_e;
+//
+/**
+*@enum<halSensorDev_e>
+*@brief:camera operating device enum
+*/
+typedef enum halSensorDev_s {
+ SENSOR_DEV_NONE = 0x00, /*!<No camera device*/
+ SENSOR_DEV_MAIN = 0x01, /*!<Main camera device or Rear camera device*/
+ SENSOR_DEV_SUB = 0x02, /*!<Sub camera device or Front camera device*/
+ SENSOR_DEV_ATV = 0x04, /*!<Analog TV device */
+ SENSOR_DEV_MAIN_2 = 0x08, /*!<Main2 camera device (used in 3D scenario) */
+ SENSOR_DEV_MAIN_3D = 0x09, /*!<3D camera device (Main+Main2)*/
+} halSensorDev_e;
+
+/**
+*@enum<halSensorType_e>
+*@brief:Sensor output data format type
+*/
+typedef enum halSensorType_s {
+ SENSOR_TYPE_RAW = 0, /*!<RAW data format type*/
+ SENSOR_TYPE_YUV = 1, /*!<YUV data format type*/
+ SENSOR_TYPE_YCBCR = 2, /*!<YCBCR data format type */
+ SENSOR_TYPE_RGB565 = 3, /*!<RGB565 data format type*/
+ SENSOR_TYPE_RGB888 = 4, /*!<RGB888 data format type*/
+ SENSOR_TYPE_JPEG = 5, /*!<JPEG data format type*/
+ SENSOR_TYPE_UNKNOWN = 0xFF,
+} halSensorType_e;
+
+/**
+*@enum<halSensorDelayFrame_e>
+*@brief:Sensor operation valid required delay frame
+*/
+typedef enum halSensorDelayFrame_s {
+ SENSOR_PREVIEW_DELAY = 0, /*!<Request delay frame for sensor set to preview mode be valid */
+ SENSOR_VIDEO_DELAY, /*!<Request delay frame for sensor set to video mode be valid */
+ SENSOR_CAPTURE_DELAY, /*!<Request delay frame for sensor set to capture mode be valid */
+ SENSOR_YUV_AWB_SETTING_DELAY, /*!<Request delay frame for YUV sensor set WB setting be valid*/
+ SENSOR_YUV_EFFECT_SETTING_DELAY, /*!<Request delay frame for YUV sensor set color effect be valid */
+ SENSOR_AE_SHUTTER_DELAY, /*!<Request delay frame for sensor set AE shutter be valid */
+ SENSOR_AE_GAIN_DELAY, /*!<Request delay frame for sensor set AE gain be valid */
+ SENSOR_AE_ISP_DELAY, /*!<Request delay frame for sensor set AE ISP gain be valid */
+}halSensorDelayFrame_e;
+/**
+*@enum<halSensorWaitEvent_e>
+*@brief:Waiting event type for sensor operation
+*/
+
+typedef enum halSensorWaitEvent_s{
+ SENSOR_WAIT_SET_SHUTTER_GAIN_DONE = 0x0, /*waiting for sensor driver set shutter and gain done*/
+ SENSOR_WAIT_EVENT_MAX = 0xFFFF
+}halSensorWaitEvent_e;
+
+// for JPEG Sensor
+typedef struct {
+ MUINT32 u4FileSize; // For input sensor width
+ MUINT32 u4SrcW; // For input sensor width
+ MUINT32 u4SrcH; // For input sensor height
+} halSensorJpegInfo_t;
+
+
+typedef struct
+{
+ MUINT32 tgtWidth;
+ MUINT32 tgtHeight;
+ MUINT32 quality;
+
+}halSensorJpegConfigPara_t;
+
+/*******************************************************************************
+*
+********************************************************************************/
+/**
+*@ user space sensor driver class used to define sensor hal provide interface for sensor driver user
+*
+*/
+
+class SensorHal {
+
+public:
+ //
+ /**
+ * @brief:create sensor hal instance when first time to connect sensor hal
+ *
+ *
+ * @note:it must use in pair with destroyInstance()
+
+ *
+ * @return None
+ */
+ static SensorHal* createInstance();
+ /**
+ * @brief:destroy sensor hal instance when not use sensor hal anymore
+ *
+ *
+ * @note:it must use in pair with createInstance()
+
+ *
+ * @return None
+ */
+
+
+ virtual void destroyInstance() = 0;
+
+protected:
+ virtual ~SensorHal() {};
+
+public:
+ /**
+ * @brief:used to detect connected camera sensor device.
+ *
+ * @note None
+ *
+ * @return
+ * - return value means connected camera sensor device represented in halSensorDev_e enum value.
+ */
+ virtual MINT32 searchSensor() = 0;
+ //
+ /**
+ * @brief:initial sensor driver and related settings and then open assigned camera sensor device
+ *
+ * @details
+ *
+ * @note:This API only need to be called once for the first user to open camera sensor device. The late coming user call will be redudant and useless. This must use in pair with uninit()
+ *
+ * @return
+ * - MTRUE indicates success.
+ * - MFALSE indicates failure.
+ */
+ virtual MINT32 init() = 0;
+ //
+ /**
+ * @brief:uninitial sensor driver and restore default sensor driver settings and then close assigned camera sensor device
+ *
+ * @details
+ *
+ * @note:must used in pair with init()
+ *
+ * @return
+ * - MTRUE indicates success.
+ * - MFALSE indicates failure.
+ */
+ virtual MINT32 uninit() = 0;
+ //
+ /**
+ * @brief:set mclk for ATV
+ *
+ * @return
+ * - MTRUE indicates success.
+ * - MFALSE indicates failure.
+ */
+ virtual MINT32 setATVStart() = 0;
+ //
+ /**
+ * @brief:used to set sensor driver config setting for operating scenario
+ *
+ * @details:set sensor input size, TG crop size, TG single or continous output frame data, if bypass set sensor scenario, if bypass delay frame for swtich scenario and scenario information
+ *
+ * @note
+ *
+ * @param [in] halSensorIFParam_t, please see halSensorIFParam_t structure description
+ *
+ * @return
+ * - MTRUE indicates success.
+ * - MFALSE indicates failure.
+ */
+ virtual MINT32 setConf(halSensorIFParam_t halSensorIFParam[2]) = 0;
+ //
+ /**
+ * @brief:A genernal interface to access sensor driver by constructed command id
+ *
+ * @details
+ *
+ * @note: Please check halSensorWaitEvent_e enum description to fill correct defined arguments
+ *
+ * @param [in] EventType: waiting event enum defined in halSensorWaitEvent_e
+ * @param [in] Timeout: waiting time for timeout. unit is us
+ *
+ * @return
+ * - MTRUE indicates success.
+ * - MFALSE indicates failure after timeout .
+ */
+
+ virtual MINT32 waitSensorEventDone(MUINT32 EventType, MUINT32 Timeout) = 0;
+
+ //
+ /**
+ * @brief:A general waiting sensor event type
+ *
+ * @details
+ *
+ * @note :Please check halSensorCmd_e enum description to fill correct defined arguments
+ *
+ * @param [in] sensorDevId: assigned camera sensor device for access
+ * @param [in] cmd: the command id for the sensor driver access
+ * @param [in] arg1: parameter needed by the assigned cmd, please reference halSensorCmd_e enum description for detail description
+ * @param [in] arg2: parameter needed by the assigned cmd, please reference halSensorCmd_e enum description for detail description
+ * @param [in] arg3: parameter needed by the assigned cmd, please reference halSensorCmd_e enum description for detail description
+ *
+ * @return
+ * - MTRUE indicates success.
+ * - MFALSE indicates failure .
+ */
+
+ virtual MINT32 sendCommand(
+ halSensorDev_e sensorDevId,
+ int cmd,
+ int arg1 = 0,
+ int arg2 = 0,
+ int arg3 = 0) = 0;
+ //
+ /**
+ * @brief:used to dump sensor interface module registers
+ *
+ * @details
+ *
+ * @note
+ *
+ * @return
+ * - MTRUE indicates success.
+ * - MFALSE indicates failure.
+ */
+ virtual MINT32 dumpReg() = 0;
+ //
+ /**
+ * @brief:store exif information
+ *
+ * @details:store sensor driver debug and specific information into exif tag
+ *
+ *
+ * @param [in] pIBaseCamExif: structure pointer of IBaseCamExif.
+ *
+ * @return
+ * - MTRUE indicates success.
+ * - MFALSE indicates failure.
+ */
+ virtual MINT32 setDebugInfo(IBaseCamExif *pIBaseCamExif) = 0;
+ //
+ /**
+ * @brief:soft reset sensor device driver to output image data
+ *
+ * @return
+ * - MTRUE indicates success.
+ * - MFALSE indicates failure.
+ */
+ virtual MINT32 reset() = 0;
+ //
+};
+
+/*******************************************************************************
+*
+********************************************************************************/
+
+
+#endif // _ISP_DRV_H_
+
diff --git a/include/hardware/include/mtkcam/metadata/IMetadata.h b/include/hardware/include/mtkcam/metadata/IMetadata.h
new file mode 100644
index 0000000..83a5365
--- /dev/null
+++ b/include/hardware/include/mtkcam/metadata/IMetadata.h
@@ -0,0 +1,247 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_IMETADATA_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_IMETADATA_H_
+//
+#include <mtkcam/common.h>
+#include <mtkcam/utils/common.h>
+#include <utils/RefBase.h>
+#include <utils/Vector.h>
+
+//
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+
+/******************************************************************************
+ * Camera Metadata Interface
+ ******************************************************************************/
+class IMetadata
+{
+
+public:
+ class Memory : public android::Vector<MUINT8>
+ {
+ };
+
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Definitions.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public:
+ typedef MUINT32 Tag_t;
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Entry Interfaces.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: ////
+ class IEntry
+ {
+ public: //// Definitions.
+ enum { BAD_TAG = -1U };
+
+ public: //// Instantiation.
+ virtual ~IEntry();
+ IEntry(Tag_t tag = BAD_TAG);
+
+ /**
+ * Copy constructor and copy assignment.
+ */
+ IEntry(IEntry const& other);
+ IEntry& operator=(IEntry const& other);
+
+ public: //// Accessors.
+
+ /**
+ * Return the tag.
+ */
+ virtual MUINT32 tag() const;
+
+ /**
+ * Check to see whether it is empty (no items) or not.
+ */
+ virtual MBOOL isEmpty() const;
+
+ /**
+ * Return the number of items.
+ */
+ virtual MUINT count() const;
+
+ /**
+ * Return how many items can be stored without reallocating the backing store.
+ */
+ virtual MUINT capacity() const;
+
+ /**
+ * Set the capacity.
+ */
+ virtual MBOOL setCapacity(MUINT size);
+
+
+ public: //// Operations.
+
+ /**
+ * Clear all items.
+ * Note: Copy-on write.
+ */
+ virtual MVOID clear();
+
+ /**
+ * Delete an item at a given index.
+ * Note: Copy-on write.
+ */
+ virtual MERROR removeAt(MUINT index);
+
+#define IMETADATA_IENTRY_OPS_DECLARATION(_T) \
+ virtual MVOID push_back(_T const& item, Type2Type<_T>); \
+ virtual _T& editItemAt(MUINT index, Type2Type<_T>); \
+ virtual _T const& itemAt(MUINT index, Type2Type<_T>) const;
+
+ IMETADATA_IENTRY_OPS_DECLARATION(MUINT8)
+ IMETADATA_IENTRY_OPS_DECLARATION(MINT32)
+ IMETADATA_IENTRY_OPS_DECLARATION(MFLOAT)
+ IMETADATA_IENTRY_OPS_DECLARATION(MINT64)
+ IMETADATA_IENTRY_OPS_DECLARATION(MDOUBLE)
+ IMETADATA_IENTRY_OPS_DECLARATION(MRational)
+ IMETADATA_IENTRY_OPS_DECLARATION(MPoint)
+ IMETADATA_IENTRY_OPS_DECLARATION(MSize)
+ IMETADATA_IENTRY_OPS_DECLARATION(MRect)
+ IMETADATA_IENTRY_OPS_DECLARATION(IMetadata)
+ IMETADATA_IENTRY_OPS_DECLARATION(Memory)
+#undef IMETADATA_IENTRY_OPS_DECLARATION
+
+ protected: //// Implementor.
+ class Implementor;
+ Implementor* mpImp;
+ };
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Interfaces.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Instantiation.
+ virtual ~IMetadata();
+ IMetadata();
+
+ /**
+ * Copy constructor and copy assignment.
+ */
+ IMetadata(IMetadata const& other);
+ IMetadata& operator=(IMetadata const& other);
+
+ /**
+ * operators
+ */
+ IMetadata& operator+=(IMetadata const& other);
+ IMetadata const operator+(IMetadata const& other);
+
+public: //// Accessors.
+
+ /**
+ * Check to see whether it is empty (no entries) or not.
+ */
+ virtual MBOOL isEmpty() const;
+
+ /**
+ * Return the number of entries.
+ */
+ virtual MUINT count() const;
+
+public: //// Operations.
+
+ /**
+ * Clear all entries.
+ * Note: Copy-on write.
+ */
+ virtual MVOID clear();
+
+ /**
+ * Delete an entry by tag.
+ * Note: Copy-on write.
+ */
+ virtual MERROR remove(Tag_t tag);
+
+ /**
+ * Sort all entries for faster find.
+ * Note: Copy-on write.
+ */
+ virtual MERROR sort();
+
+ /**
+ * Update metadata entry. An entry will be created if it doesn't exist already.
+ * Note: Copy-on write.
+ */
+ virtual MERROR update(Tag_t tag, IEntry const& entry);
+
+ /**
+ * Get metadata entry by tag for editing.
+ * Note: Copy-on write.
+ */
+ virtual IEntry& editEntryFor(Tag_t tag);
+
+ /**
+ * Get metadata entry by tag, with no editing.
+ */
+ virtual IEntry const& entryFor(Tag_t tag) const;
+
+ /**
+ * Get metadata entry by index for editing.
+ * Note: Copy-on write.
+ */
+ virtual IEntry& editEntryAt(MUINT index);
+
+ /**
+ * Get metadata entry by index, with no editing.
+ */
+ virtual IEntry const& entryAt(MUINT index) const;
+
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Bridge.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected: //// Implementor.
+ class Implementor;
+ Implementor* mpImp;
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_IMETADATA_H_
+
diff --git a/include/hardware/include/mtkcam/metadata/IMetadataConverter.h b/include/hardware/include/mtkcam/metadata/IMetadataConverter.h
new file mode 100644
index 0000000..fde7d14
--- /dev/null
+++ b/include/hardware/include/mtkcam/metadata/IMetadataConverter.h
@@ -0,0 +1,83 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_METADATA_IMETADATACONVERTER_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_METADATA_IMETADATACONVERTER_H_
+//
+#include <utils/RefBase.h>
+#include <mtkcam/metadata/IMetadata.h>
+#include <mtkcam/common.h>
+#include <mtkcam/metadata/IMetadataTagSet.h>
+
+struct camera_metadata;
+
+namespace NSCam {
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+class IMetadataConverter : public virtual android::RefBase
+{
+
+public:
+ static android::sp<IMetadataConverter> createInstance(IMetadataTagSet const &pTagInfo);
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// MTKMetadata
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+ virtual MBOOL convert(const camera_metadata* src, IMetadata& dst) const = 0;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// AndroidMetadata
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+ virtual MBOOL convert(const IMetadata& src, camera_metadata*& dst) const = 0;
+ virtual MBOOL convertWithoutAllocate(const IMetadata& src, camera_metadata*& dst) const = 0;
+ virtual android::status_t get_data_count(IMetadata const &src, size_t &entryCount, size_t &dataCount) const = 0;
+
+ virtual MVOID dump(const IMetadata &rMetadata, int frameNo = -1) const = 0;
+ virtual MVOID dumpAll(const IMetadata &rMetadata, int frameNo = -1) const = 0;
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; // NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_METADATA_IMETADATACONVERTER_H_
+
diff --git a/include/hardware/include/mtkcam/metadata/IMetadataProvider.h b/include/hardware/include/mtkcam/metadata/IMetadataProvider.h
new file mode 100644
index 0000000..a95a6ba
--- /dev/null
+++ b/include/hardware/include/mtkcam/metadata/IMetadataProvider.h
@@ -0,0 +1,105 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_V3_IMETADATAPROVIDER_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_V3_IMETADATAPROVIDER_H_
+//
+#include <utils/RefBase.h>
+#include "IMetadata.h"
+
+struct camera_metadata;
+
+namespace NSCam {
+/******************************************************************************
+ *
+ ******************************************************************************/
+
+
+/******************************************************************************
+ * Metadata Provider Interface
+ ******************************************************************************/
+class IMetadataProvider : public android::RefBase
+{
+
+public: //// Creation.
+ static IMetadataProvider* create(
+ int32_t const i4OpenId
+ );
+
+public: //// Instantiation.
+ virtual ~IMetadataProvider() {}
+
+public: //// Interface.
+
+ virtual camera_metadata const* getStaticCharacteristics() const = 0;
+
+ virtual IMetadata const& geMtktStaticCharacteristics() const = 0;
+
+ virtual uint32_t getDeviceVersion() const = 0;
+
+ virtual int getDeviceFacing() const = 0;
+
+ virtual int getDeviceWantedOrientation() const = 0;
+
+ virtual int getDeviceSetupOrientation() const = 0;
+
+
+};
+
+
+/******************************************************************************
+ * MetadataProvider Manager
+ ******************************************************************************/
+namespace NSMetadataProviderManager
+{
+ void clear();
+ ssize_t add(int32_t deviceId, IMetadataProvider* pProvider);
+
+ IMetadataProvider* valueFor(int32_t deviceId);
+ IMetadataProvider* valueAt(size_t index);
+ int32_t keyAt(size_t index);
+ ssize_t indexOfKey(int32_t deviceId);
+
+}; // NSMetadataProviderManager
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; // NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_V3_IMETADATAPROVIDER_H_
+
diff --git a/include/hardware/include/mtkcam/metadata/IMetadataTagSet.h b/include/hardware/include/mtkcam/metadata/IMetadataTagSet.h
new file mode 100644
index 0000000..d7a61d8
--- /dev/null
+++ b/include/hardware/include/mtkcam/metadata/IMetadataTagSet.h
@@ -0,0 +1,99 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_METADATA_IMETADATATAGSET_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_METADATA_IMETADATATAGSET_H_
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+//
+#include <mtkcam/common.h>
+//
+namespace NSCam {
+//
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+class IMetadataTagSet
+{
+
+public:
+ IMetadataTagSet();
+ virtual ~IMetadataTagSet();
+
+ IMetadataTagSet(IMetadataTagSet const& other);
+ IMetadataTagSet& operator=(IMetadataTagSet const& other);
+
+ virtual MINT32 getType(MUINT32 tag) const;
+
+ virtual char const* getName(unsigned int tag) const;
+
+ virtual MVOID addTag(MUINT32 tag, char const* name, MINT32 typeEnum);
+
+ virtual MVOID addTagMap(MUINT32 androidTag, MUINT32 MtkTag);
+
+ virtual MUINT32 getMtkTag(MUINT32 tag) const;
+
+ virtual MUINT32 getAndroidTag(MUINT32 tag) const;
+
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Bridge.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected: //// Implementor.
+ class Implementor;
+ Implementor* mpImp;
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+class IDefaultMetadataTagSet
+{
+public:
+ static IDefaultMetadataTagSet* singleton();
+ virtual ~IDefaultMetadataTagSet() {}
+ virtual IMetadataTagSet const& getTagSet() const = 0;
+};
+
+
+};// NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_METADATA_IMETADATATAGSET_H_
+
diff --git a/include/hardware/include/mtkcam/metadata/ITemplateRequest.h b/include/hardware/include/mtkcam/metadata/ITemplateRequest.h
new file mode 100644
index 0000000..61b8a0b
--- /dev/null
+++ b/include/hardware/include/mtkcam/metadata/ITemplateRequest.h
@@ -0,0 +1,82 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_V3_ITEMPLATEREQUEST_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_V3_ITEMPLATEREQUEST_H_
+//
+#include <utils/RefBase.h>
+struct camera_metadata;
+//
+namespace NSCam {
+/******************************************************************************
+ *
+ ******************************************************************************/
+class ITemplateRequest : public android::RefBase
+{
+public: //// Interface.
+
+ static ITemplateRequest* getInstance(int iOpenId);
+
+ virtual ~ITemplateRequest() {}
+
+ virtual camera_metadata const* getData(int requestType) = 0;
+
+ virtual IMetadata const& getMtkData(int requestType) = 0;
+};
+
+
+/******************************************************************************
+ * MetadataProvider Manager
+ ******************************************************************************/
+namespace NSTemplateRequestManager
+{
+ void clear();
+ ssize_t add(int32_t deviceId, ITemplateRequest* pRequest);
+
+ ITemplateRequest* valueFor(int32_t deviceId);
+ ITemplateRequest* valueAt(size_t index);
+ int32_t keyAt(size_t index);
+ ssize_t indexOfKey(int32_t deviceId);
+
+}; // NSTemplateRequestManager
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; // NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_V3_ITEMPLATEREQUEST_H_
+
diff --git a/include/hardware/include/mtkcam/metadata/client/TagMap.h b/include/hardware/include/mtkcam/metadata/client/TagMap.h
new file mode 100644
index 0000000..32f28d3
--- /dev/null
+++ b/include/hardware/include/mtkcam/metadata/client/TagMap.h
@@ -0,0 +1,251 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _TAGMAP_H_
+#define _TAGMAP_H_
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+#include <mtkcam/metadata/client/mtk_metadata_tag.h>
+#include <system/camera_metadata.h>
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+
+
+ #define ADD_ALL_MEMBERS \
+ _IMP_TAGCONVERT_( ANDROID_COLOR_CORRECTION_MODE , MTK_COLOR_CORRECTION_MODE )\
+ _IMP_TAGCONVERT_( ANDROID_COLOR_CORRECTION_TRANSFORM, MTK_COLOR_CORRECTION_TRANSFORM)\
+ _IMP_TAGCONVERT_( ANDROID_COLOR_CORRECTION_GAINS , MTK_COLOR_CORRECTION_GAINS )\
+ _IMP_TAGCONVERT_( ANDROID_COLOR_CORRECTION_ABERRATION_MODE, MTK_COLOR_CORRECTION_ABERRATION_MODE)\
+ _IMP_TAGCONVERT_( ANDROID_COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES, MTK_COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES)\
+ _IMP_TAGCONVERT_( ANDROID_CONTROL_AE_ANTIBANDING_MODE , MTK_CONTROL_AE_ANTIBANDING_MODE )\
+ _IMP_TAGCONVERT_( ANDROID_CONTROL_AE_EXPOSURE_COMPENSATION, MTK_CONTROL_AE_EXPOSURE_COMPENSATION)\
+ _IMP_TAGCONVERT_( ANDROID_CONTROL_AE_LOCK, MTK_CONTROL_AE_LOCK)\
+ _IMP_TAGCONVERT_( ANDROID_CONTROL_AE_MODE, MTK_CONTROL_AE_MODE)\
+ _IMP_TAGCONVERT_( ANDROID_CONTROL_AE_REGIONS, MTK_CONTROL_AE_REGIONS)\
+ _IMP_TAGCONVERT_( ANDROID_CONTROL_AE_TARGET_FPS_RANGE, MTK_CONTROL_AE_TARGET_FPS_RANGE)\
+ _IMP_TAGCONVERT_( ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER, MTK_CONTROL_AE_PRECAPTURE_TRIGGER)\
+ _IMP_TAGCONVERT_( ANDROID_CONTROL_AF_MODE, MTK_CONTROL_AF_MODE)\
+ _IMP_TAGCONVERT_( ANDROID_CONTROL_AF_REGIONS, MTK_CONTROL_AF_REGIONS)\
+ _IMP_TAGCONVERT_( ANDROID_CONTROL_AF_TRIGGER, MTK_CONTROL_AF_TRIGGER)\
+ _IMP_TAGCONVERT_( ANDROID_CONTROL_AWB_LOCK, MTK_CONTROL_AWB_LOCK)\
+ _IMP_TAGCONVERT_( ANDROID_CONTROL_AWB_MODE, MTK_CONTROL_AWB_MODE)\
+ _IMP_TAGCONVERT_( ANDROID_CONTROL_AWB_REGIONS, MTK_CONTROL_AWB_REGIONS)\
+ _IMP_TAGCONVERT_( ANDROID_CONTROL_CAPTURE_INTENT, MTK_CONTROL_CAPTURE_INTENT)\
+ _IMP_TAGCONVERT_( ANDROID_CONTROL_EFFECT_MODE, MTK_CONTROL_EFFECT_MODE)\
+ _IMP_TAGCONVERT_( ANDROID_CONTROL_MODE, MTK_CONTROL_MODE)\
+ _IMP_TAGCONVERT_( ANDROID_CONTROL_SCENE_MODE, MTK_CONTROL_SCENE_MODE)\
+ _IMP_TAGCONVERT_( ANDROID_CONTROL_VIDEO_STABILIZATION_MODE, MTK_CONTROL_VIDEO_STABILIZATION_MODE)\
+ _IMP_TAGCONVERT_( ANDROID_CONTROL_AE_AVAILABLE_ANTIBANDING_MODES, MTK_CONTROL_AE_AVAILABLE_ANTIBANDING_MODES)\
+ _IMP_TAGCONVERT_( ANDROID_CONTROL_AE_AVAILABLE_MODES, MTK_CONTROL_AE_AVAILABLE_MODES)\
+ _IMP_TAGCONVERT_( ANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES, MTK_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES)\
+ _IMP_TAGCONVERT_( ANDROID_CONTROL_AE_COMPENSATION_RANGE, MTK_CONTROL_AE_COMPENSATION_RANGE)\
+ _IMP_TAGCONVERT_( ANDROID_CONTROL_AE_COMPENSATION_STEP, MTK_CONTROL_AE_COMPENSATION_STEP)\
+ _IMP_TAGCONVERT_( ANDROID_CONTROL_AF_AVAILABLE_MODES, MTK_CONTROL_AF_AVAILABLE_MODES)\
+ _IMP_TAGCONVERT_( ANDROID_CONTROL_AVAILABLE_EFFECTS, MTK_CONTROL_AVAILABLE_EFFECTS)\
+ _IMP_TAGCONVERT_( ANDROID_CONTROL_AVAILABLE_SCENE_MODES, MTK_CONTROL_AVAILABLE_SCENE_MODES)\
+ _IMP_TAGCONVERT_( ANDROID_CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES, MTK_CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES)\
+ _IMP_TAGCONVERT_( ANDROID_CONTROL_AWB_AVAILABLE_MODES, MTK_CONTROL_AWB_AVAILABLE_MODES)\
+ _IMP_TAGCONVERT_( ANDROID_CONTROL_MAX_REGIONS, MTK_CONTROL_MAX_REGIONS)\
+ _IMP_TAGCONVERT_( ANDROID_CONTROL_SCENE_MODE_OVERRIDES, MTK_CONTROL_SCENE_MODE_OVERRIDES)\
+ _IMP_TAGCONVERT_( ANDROID_CONTROL_AE_PRECAPTURE_ID, MTK_CONTROL_AE_PRECAPTURE_ID)\
+ _IMP_TAGCONVERT_( ANDROID_CONTROL_AE_STATE, MTK_CONTROL_AE_STATE)\
+ _IMP_TAGCONVERT_( ANDROID_CONTROL_AF_STATE, MTK_CONTROL_AF_STATE)\
+ _IMP_TAGCONVERT_( ANDROID_CONTROL_AF_TRIGGER_ID, MTK_CONTROL_AF_TRIGGER_ID)\
+ _IMP_TAGCONVERT_( ANDROID_CONTROL_AWB_STATE, MTK_CONTROL_AWB_STATE)\
+ _IMP_TAGCONVERT_( ANDROID_CONTROL_AVAILABLE_HIGH_SPEED_VIDEO_CONFIGURATIONS, MTK_CONTROL_AVAILABLE_HIGH_SPEED_VIDEO_CONFIGURATIONS)\
+ _IMP_TAGCONVERT_( ANDROID_DEMOSAIC_MODE , MTK_DEMOSAIC_MODE )\
+ _IMP_TAGCONVERT_( ANDROID_EDGE_MODE , MTK_EDGE_MODE )\
+ _IMP_TAGCONVERT_( ANDROID_EDGE_STRENGTH, MTK_EDGE_STRENGTH)\
+ _IMP_TAGCONVERT_( ANDROID_EDGE_AVAILABLE_EDGE_MODES, MTK_EDGE_AVAILABLE_EDGE_MODES)\
+ _IMP_TAGCONVERT_( ANDROID_FLASH_FIRING_POWER , MTK_FLASH_FIRING_POWER )\
+ _IMP_TAGCONVERT_( ANDROID_FLASH_FIRING_TIME, MTK_FLASH_FIRING_TIME)\
+ _IMP_TAGCONVERT_( ANDROID_FLASH_MODE, MTK_FLASH_MODE)\
+ _IMP_TAGCONVERT_( ANDROID_FLASH_COLOR_TEMPERATURE, MTK_FLASH_COLOR_TEMPERATURE)\
+ _IMP_TAGCONVERT_( ANDROID_FLASH_MAX_ENERGY, MTK_FLASH_MAX_ENERGY)\
+ _IMP_TAGCONVERT_( ANDROID_FLASH_STATE, MTK_FLASH_STATE)\
+ _IMP_TAGCONVERT_( ANDROID_FLASH_INFO_AVAILABLE , MTK_FLASH_INFO_AVAILABLE )\
+ _IMP_TAGCONVERT_( ANDROID_FLASH_INFO_CHARGE_DURATION, MTK_FLASH_INFO_CHARGE_DURATION)\
+ _IMP_TAGCONVERT_( ANDROID_HOT_PIXEL_MODE , MTK_HOT_PIXEL_MODE )\
+ _IMP_TAGCONVERT_( ANDROID_HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES, MTK_HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES)\
+ _IMP_TAGCONVERT_( ANDROID_JPEG_GPS_COORDINATES , MTK_JPEG_GPS_COORDINATES )\
+ _IMP_TAGCONVERT_( ANDROID_JPEG_GPS_PROCESSING_METHOD, MTK_JPEG_GPS_PROCESSING_METHOD)\
+ _IMP_TAGCONVERT_( ANDROID_JPEG_GPS_TIMESTAMP, MTK_JPEG_GPS_TIMESTAMP)\
+ _IMP_TAGCONVERT_( ANDROID_JPEG_ORIENTATION, MTK_JPEG_ORIENTATION)\
+ _IMP_TAGCONVERT_( ANDROID_JPEG_QUALITY, MTK_JPEG_QUALITY)\
+ _IMP_TAGCONVERT_( ANDROID_JPEG_THUMBNAIL_QUALITY, MTK_JPEG_THUMBNAIL_QUALITY)\
+ _IMP_TAGCONVERT_( ANDROID_JPEG_THUMBNAIL_SIZE, MTK_JPEG_THUMBNAIL_SIZE)\
+ _IMP_TAGCONVERT_( ANDROID_JPEG_AVAILABLE_THUMBNAIL_SIZES, MTK_JPEG_AVAILABLE_THUMBNAIL_SIZES)\
+ _IMP_TAGCONVERT_( ANDROID_JPEG_MAX_SIZE, MTK_JPEG_MAX_SIZE)\
+ _IMP_TAGCONVERT_( ANDROID_JPEG_SIZE, MTK_JPEG_SIZE)\
+ _IMP_TAGCONVERT_( ANDROID_LENS_APERTURE , MTK_LENS_APERTURE )\
+ _IMP_TAGCONVERT_( ANDROID_LENS_FILTER_DENSITY, MTK_LENS_FILTER_DENSITY)\
+ _IMP_TAGCONVERT_( ANDROID_LENS_FOCAL_LENGTH, MTK_LENS_FOCAL_LENGTH)\
+ _IMP_TAGCONVERT_( ANDROID_LENS_FOCUS_DISTANCE, MTK_LENS_FOCUS_DISTANCE)\
+ _IMP_TAGCONVERT_( ANDROID_LENS_OPTICAL_STABILIZATION_MODE, MTK_LENS_OPTICAL_STABILIZATION_MODE)\
+ _IMP_TAGCONVERT_( ANDROID_LENS_FACING, MTK_SENSOR_INFO_FACING)\
+ _IMP_TAGCONVERT_( ANDROID_LENS_OPTICAL_AXIS_ANGLE, MTK_LENS_OPTICAL_AXIS_ANGLE)\
+ _IMP_TAGCONVERT_( ANDROID_LENS_POSITION, MTK_LENS_POSITION)\
+ _IMP_TAGCONVERT_( ANDROID_LENS_FOCUS_RANGE, MTK_LENS_FOCUS_RANGE)\
+ _IMP_TAGCONVERT_( ANDROID_LENS_STATE, MTK_LENS_STATE)\
+ _IMP_TAGCONVERT_( ANDROID_LENS_INFO_AVAILABLE_APERTURES, MTK_LENS_INFO_AVAILABLE_APERTURES)\
+ _IMP_TAGCONVERT_( ANDROID_LENS_INFO_AVAILABLE_FILTER_DENSITIES, MTK_LENS_INFO_AVAILABLE_FILTER_DENSITIES)\
+ _IMP_TAGCONVERT_( ANDROID_LENS_INFO_AVAILABLE_FOCAL_LENGTHS, MTK_LENS_INFO_AVAILABLE_FOCAL_LENGTHS)\
+ _IMP_TAGCONVERT_( ANDROID_LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION, MTK_LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION)\
+ _IMP_TAGCONVERT_( ANDROID_LENS_INFO_HYPERFOCAL_DISTANCE, MTK_LENS_INFO_HYPERFOCAL_DISTANCE)\
+ _IMP_TAGCONVERT_( ANDROID_LENS_INFO_MINIMUM_FOCUS_DISTANCE, MTK_LENS_INFO_MINIMUM_FOCUS_DISTANCE)\
+ _IMP_TAGCONVERT_( ANDROID_LENS_INFO_SHADING_MAP_SIZE, MTK_LENS_INFO_SHADING_MAP_SIZE)\
+ _IMP_TAGCONVERT_( ANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION, MTK_LENS_INFO_FOCUS_DISTANCE_CALIBRATION)\
+ _IMP_TAGCONVERT_( ANDROID_NOISE_REDUCTION_MODE , MTK_NOISE_REDUCTION_MODE )\
+ _IMP_TAGCONVERT_( ANDROID_NOISE_REDUCTION_STRENGTH, MTK_NOISE_REDUCTION_STRENGTH)\
+ _IMP_TAGCONVERT_( ANDROID_NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES, MTK_NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES)\
+ _IMP_TAGCONVERT_( ANDROID_QUIRKS_METERING_CROP_REGION, MTK_QUIRKS_METERING_CROP_REGION)\
+ _IMP_TAGCONVERT_( ANDROID_QUIRKS_TRIGGER_AF_WITH_AUTO, MTK_QUIRKS_TRIGGER_AF_WITH_AUTO)\
+ _IMP_TAGCONVERT_( ANDROID_QUIRKS_USE_ZSL_FORMAT, MTK_QUIRKS_USE_ZSL_FORMAT)\
+ _IMP_TAGCONVERT_( ANDROID_QUIRKS_USE_PARTIAL_RESULT, MTK_QUIRKS_USE_PARTIAL_RESULT)\
+ _IMP_TAGCONVERT_( ANDROID_QUIRKS_PARTIAL_RESULT, MTK_QUIRKS_PARTIAL_RESULT)\
+ _IMP_TAGCONVERT_( ANDROID_REQUEST_FRAME_COUNT , MTK_REQUEST_FRAME_COUNT )\
+ _IMP_TAGCONVERT_( ANDROID_REQUEST_ID, MTK_REQUEST_ID)\
+ _IMP_TAGCONVERT_( ANDROID_REQUEST_INPUT_STREAMS, MTK_REQUEST_INPUT_STREAMS)\
+ _IMP_TAGCONVERT_( ANDROID_REQUEST_METADATA_MODE, MTK_REQUEST_METADATA_MODE)\
+ _IMP_TAGCONVERT_( ANDROID_REQUEST_OUTPUT_STREAMS, MTK_REQUEST_OUTPUT_STREAMS)\
+ _IMP_TAGCONVERT_( ANDROID_REQUEST_TYPE, MTK_REQUEST_TYPE)\
+ _IMP_TAGCONVERT_( ANDROID_REQUEST_MAX_NUM_OUTPUT_STREAMS, MTK_REQUEST_MAX_NUM_OUTPUT_STREAMS)\
+ _IMP_TAGCONVERT_( ANDROID_REQUEST_MAX_NUM_REPROCESS_STREAMS, MTK_REQUEST_MAX_NUM_REPROCESS_STREAMS)\
+ _IMP_TAGCONVERT_( ANDROID_REQUEST_MAX_NUM_INPUT_STREAMS, MTK_REQUEST_MAX_NUM_INPUT_STREAMS)\
+ _IMP_TAGCONVERT_( ANDROID_REQUEST_PIPELINE_DEPTH, MTK_REQUEST_PIPELINE_DEPTH)\
+ _IMP_TAGCONVERT_( ANDROID_REQUEST_PIPELINE_MAX_DEPTH, MTK_REQUEST_PIPELINE_MAX_DEPTH)\
+ _IMP_TAGCONVERT_( ANDROID_REQUEST_PARTIAL_RESULT_COUNT, MTK_REQUEST_PARTIAL_RESULT_COUNT)\
+ _IMP_TAGCONVERT_( ANDROID_REQUEST_AVAILABLE_CAPABILITIES, MTK_REQUEST_AVAILABLE_CAPABILITIES)\
+ _IMP_TAGCONVERT_( ANDROID_REQUEST_AVAILABLE_REQUEST_KEYS, MTK_REQUEST_AVAILABLE_REQUEST_KEYS)\
+ _IMP_TAGCONVERT_( ANDROID_REQUEST_AVAILABLE_RESULT_KEYS, MTK_REQUEST_AVAILABLE_RESULT_KEYS)\
+ _IMP_TAGCONVERT_( ANDROID_REQUEST_AVAILABLE_CHARACTERISTICS_KEYS, MTK_REQUEST_AVAILABLE_CHARACTERISTICS_KEYS)\
+ _IMP_TAGCONVERT_( ANDROID_SCALER_CROP_REGION , MTK_SCALER_CROP_REGION )\
+ _IMP_TAGCONVERT_( ANDROID_SCALER_AVAILABLE_FORMATS, MTK_SCALER_AVAILABLE_FORMATS)\
+ _IMP_TAGCONVERT_( ANDROID_SCALER_AVAILABLE_JPEG_MIN_DURATIONS, MTK_SCALER_AVAILABLE_JPEG_MIN_DURATIONS)\
+ _IMP_TAGCONVERT_( ANDROID_SCALER_AVAILABLE_JPEG_SIZES, MTK_SCALER_AVAILABLE_JPEG_SIZES)\
+ _IMP_TAGCONVERT_( ANDROID_SCALER_AVAILABLE_MAX_DIGITAL_ZOOM, MTK_SCALER_AVAILABLE_MAX_DIGITAL_ZOOM)\
+ _IMP_TAGCONVERT_( ANDROID_SCALER_AVAILABLE_PROCESSED_MIN_DURATIONS, MTK_SCALER_AVAILABLE_PROCESSED_MIN_DURATIONS)\
+ _IMP_TAGCONVERT_( ANDROID_SCALER_AVAILABLE_PROCESSED_SIZES, MTK_SCALER_AVAILABLE_PROCESSED_SIZES)\
+ _IMP_TAGCONVERT_( ANDROID_SCALER_AVAILABLE_RAW_MIN_DURATIONS, MTK_SCALER_AVAILABLE_RAW_MIN_DURATIONS)\
+ _IMP_TAGCONVERT_( ANDROID_SCALER_AVAILABLE_RAW_SIZES, MTK_SCALER_AVAILABLE_RAW_SIZES)\
+ _IMP_TAGCONVERT_( ANDROID_SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP, MTK_SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP)\
+ _IMP_TAGCONVERT_( ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS, MTK_SCALER_AVAILABLE_STREAM_CONFIGURATIONS)\
+ _IMP_TAGCONVERT_( ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS, MTK_SCALER_AVAILABLE_MIN_FRAME_DURATIONS)\
+ _IMP_TAGCONVERT_( ANDROID_SCALER_AVAILABLE_STALL_DURATIONS, MTK_SCALER_AVAILABLE_STALL_DURATIONS)\
+ _IMP_TAGCONVERT_( ANDROID_SCALER_CROPPING_TYPE, MTK_SCALER_CROPPING_TYPE)\
+ _IMP_TAGCONVERT_( ANDROID_SENSOR_EXPOSURE_TIME , MTK_SENSOR_EXPOSURE_TIME )\
+ _IMP_TAGCONVERT_( ANDROID_SENSOR_FRAME_DURATION, MTK_SENSOR_FRAME_DURATION)\
+ _IMP_TAGCONVERT_( ANDROID_SENSOR_SENSITIVITY, MTK_SENSOR_SENSITIVITY)\
+ _IMP_TAGCONVERT_( ANDROID_SENSOR_REFERENCE_ILLUMINANT1, MTK_SENSOR_REFERENCE_ILLUMINANT1)\
+ _IMP_TAGCONVERT_( ANDROID_SENSOR_REFERENCE_ILLUMINANT2, MTK_SENSOR_REFERENCE_ILLUMINANT2)\
+ _IMP_TAGCONVERT_( ANDROID_SENSOR_CALIBRATION_TRANSFORM1, MTK_SENSOR_CALIBRATION_TRANSFORM1)\
+ _IMP_TAGCONVERT_( ANDROID_SENSOR_CALIBRATION_TRANSFORM2, MTK_SENSOR_CALIBRATION_TRANSFORM2)\
+ _IMP_TAGCONVERT_( ANDROID_SENSOR_COLOR_TRANSFORM1, MTK_SENSOR_COLOR_TRANSFORM1)\
+ _IMP_TAGCONVERT_( ANDROID_SENSOR_COLOR_TRANSFORM2, MTK_SENSOR_COLOR_TRANSFORM2)\
+ _IMP_TAGCONVERT_( ANDROID_SENSOR_FORWARD_MATRIX1, MTK_SENSOR_FORWARD_MATRIX1)\
+ _IMP_TAGCONVERT_( ANDROID_SENSOR_FORWARD_MATRIX2, MTK_SENSOR_FORWARD_MATRIX2)\
+ _IMP_TAGCONVERT_( ANDROID_SENSOR_BASE_GAIN_FACTOR, MTK_SENSOR_BASE_GAIN_FACTOR)\
+ _IMP_TAGCONVERT_( ANDROID_SENSOR_BLACK_LEVEL_PATTERN, MTK_SENSOR_BLACK_LEVEL_PATTERN)\
+ _IMP_TAGCONVERT_( ANDROID_SENSOR_MAX_ANALOG_SENSITIVITY, MTK_SENSOR_MAX_ANALOG_SENSITIVITY)\
+ _IMP_TAGCONVERT_( ANDROID_SENSOR_ORIENTATION, MTK_SENSOR_INFO_ORIENTATION)\
+ _IMP_TAGCONVERT_( ANDROID_SENSOR_PROFILE_HUE_SAT_MAP_DIMENSIONS, MTK_SENSOR_PROFILE_HUE_SAT_MAP_DIMENSIONS)\
+ _IMP_TAGCONVERT_( ANDROID_SENSOR_TIMESTAMP, MTK_SENSOR_TIMESTAMP)\
+ _IMP_TAGCONVERT_( ANDROID_SENSOR_TEMPERATURE , MTK_SENSOR_TEMPERATURE )\
+ _IMP_TAGCONVERT_( ANDROID_SENSOR_NEUTRAL_COLOR_POINT , MTK_SENSOR_NEUTRAL_COLOR_POINT )\
+ _IMP_TAGCONVERT_( ANDROID_SENSOR_NOISE_PROFILE , MTK_SENSOR_NOISE_PROFILE )\
+ _IMP_TAGCONVERT_( ANDROID_SENSOR_PROFILE_HUE_SAT_MAP , MTK_SENSOR_PROFILE_HUE_SAT_MAP )\
+ _IMP_TAGCONVERT_( ANDROID_SENSOR_PROFILE_TONE_CURVE, MTK_SENSOR_PROFILE_TONE_CURVE )\
+ _IMP_TAGCONVERT_( ANDROID_SENSOR_GREEN_SPLIT , MTK_SENSOR_GREEN_SPLIT)\
+ _IMP_TAGCONVERT_( ANDROID_SENSOR_TEST_PATTERN_DATA , MTK_SENSOR_TEST_PATTERN_DATA)\
+ _IMP_TAGCONVERT_( ANDROID_SENSOR_TEST_PATTERN_MODE , MTK_SENSOR_TEST_PATTERN_MODE)\
+ _IMP_TAGCONVERT_( ANDROID_SENSOR_AVAILABLE_TEST_PATTERN_MODES , MTK_SENSOR_AVAILABLE_TEST_PATTERN_MODES)\
+ _IMP_TAGCONVERT_( ANDROID_SENSOR_ROLLING_SHUTTER_SKEW , MTK_SENSOR_ROLLING_SHUTTER_SKEW)\
+ _IMP_TAGCONVERT_( ANDROID_SENSOR_INFO_ACTIVE_ARRAY_SIZE, MTK_SENSOR_INFO_ACTIVE_ARRAY_REGION)\
+ _IMP_TAGCONVERT_( ANDROID_SENSOR_INFO_SENSITIVITY_RANGE , MTK_SENSOR_INFO_SENSITIVITY_RANGE )\
+ _IMP_TAGCONVERT_( ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT, MTK_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT)\
+ _IMP_TAGCONVERT_( ANDROID_SENSOR_INFO_EXPOSURE_TIME_RANGE, MTK_SENSOR_INFO_EXPOSURE_TIME_RANGE)\
+ _IMP_TAGCONVERT_( ANDROID_SENSOR_INFO_MAX_FRAME_DURATION, MTK_SENSOR_INFO_MAX_FRAME_DURATION)\
+ _IMP_TAGCONVERT_( ANDROID_SENSOR_INFO_PHYSICAL_SIZE, MTK_SENSOR_INFO_PHYSICAL_SIZE)\
+ _IMP_TAGCONVERT_( ANDROID_SENSOR_INFO_PIXEL_ARRAY_SIZE, MTK_SENSOR_INFO_PIXEL_ARRAY_SIZE)\
+ _IMP_TAGCONVERT_( ANDROID_SENSOR_INFO_WHITE_LEVEL, MTK_SENSOR_INFO_WHITE_LEVEL)\
+ _IMP_TAGCONVERT_( ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE, MTK_SENSOR_INFO_TIMESTAMP_SOURCE)\
+ _IMP_TAGCONVERT_( ANDROID_SHADING_MODE , MTK_SHADING_MODE )\
+ _IMP_TAGCONVERT_( ANDROID_SHADING_STRENGTH, MTK_SHADING_STRENGTH)\
+ _IMP_TAGCONVERT_( ANDROID_STATISTICS_FACE_DETECT_MODE, MTK_STATISTICS_FACE_DETECT_MODE)\
+ _IMP_TAGCONVERT_( ANDROID_STATISTICS_HISTOGRAM_MODE, MTK_STATISTICS_HISTOGRAM_MODE)\
+ _IMP_TAGCONVERT_( ANDROID_STATISTICS_SHARPNESS_MAP_MODE, MTK_STATISTICS_SHARPNESS_MAP_MODE)\
+ _IMP_TAGCONVERT_( ANDROID_STATISTICS_HOT_PIXEL_MAP_MODE, MTK_STATISTICS_HOT_PIXEL_MAP_MODE)\
+ _IMP_TAGCONVERT_( ANDROID_STATISTICS_FACE_IDS, MTK_STATISTICS_FACE_IDS)\
+ _IMP_TAGCONVERT_( ANDROID_STATISTICS_FACE_LANDMARKS, MTK_STATISTICS_FACE_LANDMARKS)\
+ _IMP_TAGCONVERT_( ANDROID_STATISTICS_FACE_RECTANGLES, MTK_STATISTICS_FACE_RECTANGLES)\
+ _IMP_TAGCONVERT_( ANDROID_STATISTICS_FACE_SCORES, MTK_STATISTICS_FACE_SCORES)\
+ _IMP_TAGCONVERT_( ANDROID_STATISTICS_HISTOGRAM, MTK_STATISTICS_HISTOGRAM)\
+ _IMP_TAGCONVERT_( ANDROID_STATISTICS_SHARPNESS_MAP, MTK_STATISTICS_SHARPNESS_MAP)\
+ _IMP_TAGCONVERT_( ANDROID_STATISTICS_LENS_SHADING_CORRECTION_MAP, MTK_STATISTICS_LENS_SHADING_CORRECTION_MAP)\
+ _IMP_TAGCONVERT_( ANDROID_STATISTICS_LENS_SHADING_MAP , MTK_STATISTICS_LENS_SHADING_MAP )\
+ _IMP_TAGCONVERT_( ANDROID_STATISTICS_PREDICTED_COLOR_GAINS , MTK_STATISTICS_PREDICTED_COLOR_GAINS )\
+ _IMP_TAGCONVERT_( ANDROID_STATISTICS_PREDICTED_COLOR_TRANSFORM , MTK_STATISTICS_PREDICTED_COLOR_TRANSFORM )\
+ _IMP_TAGCONVERT_( ANDROID_STATISTICS_SCENE_FLICKER , MTK_STATISTICS_SCENE_FLICKER )\
+ _IMP_TAGCONVERT_( ANDROID_STATISTICS_HOT_PIXEL_MAP , MTK_STATISTICS_HOT_PIXEL_MAP )\
+ _IMP_TAGCONVERT_( ANDROID_STATISTICS_LENS_SHADING_MAP_MODE , MTK_STATISTICS_LENS_SHADING_MAP_MODE )\
+ _IMP_TAGCONVERT_( ANDROID_STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES, MTK_STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES)\
+ _IMP_TAGCONVERT_( ANDROID_STATISTICS_INFO_HISTOGRAM_BUCKET_COUNT, MTK_STATISTICS_INFO_HISTOGRAM_BUCKET_COUNT)\
+ _IMP_TAGCONVERT_( ANDROID_STATISTICS_INFO_MAX_FACE_COUNT, MTK_STATISTICS_INFO_MAX_FACE_COUNT)\
+ _IMP_TAGCONVERT_( ANDROID_STATISTICS_INFO_MAX_HISTOGRAM_COUNT, MTK_STATISTICS_INFO_MAX_HISTOGRAM_COUNT)\
+ _IMP_TAGCONVERT_( ANDROID_STATISTICS_INFO_MAX_SHARPNESS_MAP_VALUE, MTK_STATISTICS_INFO_MAX_SHARPNESS_MAP_VALUE)\
+ _IMP_TAGCONVERT_( ANDROID_STATISTICS_INFO_SHARPNESS_MAP_SIZE, MTK_STATISTICS_INFO_SHARPNESS_MAP_SIZE)\
+ _IMP_TAGCONVERT_( ANDROID_STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES , MTK_STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES )\
+ _IMP_TAGCONVERT_( ANDROID_TONEMAP_CURVE_BLUE , MTK_TONEMAP_CURVE_BLUE )\
+ _IMP_TAGCONVERT_( ANDROID_TONEMAP_CURVE_GREEN, MTK_TONEMAP_CURVE_GREEN)\
+ _IMP_TAGCONVERT_( ANDROID_TONEMAP_CURVE_RED, MTK_TONEMAP_CURVE_RED)\
+ _IMP_TAGCONVERT_( ANDROID_TONEMAP_MODE, MTK_TONEMAP_MODE)\
+ _IMP_TAGCONVERT_( ANDROID_TONEMAP_MAX_CURVE_POINTS, MTK_TONEMAP_MAX_CURVE_POINTS)\
+ _IMP_TAGCONVERT_( ANDROID_TONEMAP_AVAILABLE_TONE_MAP_MODES, MTK_TONEMAP_AVAILABLE_TONE_MAP_MODES)\
+ _IMP_TAGCONVERT_( ANDROID_LED_TRANSMIT , MTK_LED_TRANSMIT )\
+ _IMP_TAGCONVERT_( ANDROID_LED_AVAILABLE_LEDS, MTK_LED_AVAILABLE_LEDS)\
+ _IMP_TAGCONVERT_( ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL, MTK_INFO_SUPPORTED_HARDWARE_LEVEL)\
+ _IMP_TAGCONVERT_( ANDROID_BLACK_LEVEL_LOCK , MTK_BLACK_LEVEL_LOCK )\
+ _IMP_TAGCONVERT_( ANDROID_SYNC_FRAME_NUMBER, MTK_SYNC_FRAME_NUMBER )\
+ _IMP_TAGCONVERT_( ANDROID_SYNC_MAX_LATENCY, MTK_SYNC_MAX_LATENCY )\
+
+#endif //_TAGMAP_H_
+
+
diff --git a/include/hardware/include/mtkcam/metadata/client/mtk_metadata_tag.h b/include/hardware/include/mtkcam/metadata/client/mtk_metadata_tag.h
new file mode 100644
index 0000000..325a327
--- /dev/null
+++ b/include/hardware/include/mtkcam/metadata/client/mtk_metadata_tag.h
@@ -0,0 +1,943 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_METADATA_MTK_METADATA_TAG_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_METADATA_MTK_METADATA_TAG_H_
+
+#include <hardware/hardware.h>
+
+typedef enum mtk_camera_metadata_section {
+ MTK_COLOR_CORRECTION,
+ MTK_CONTROL,
+ MTK_DEMOSAIC,
+ MTK_EDGE,
+ MTK_FLASH,
+ MTK_FLASH_INFO,
+ MTK_HOT_PIXEL,
+ MTK_JPEG,
+ MTK_LENS,
+ MTK_LENS_INFO,
+ MTK_NOISE_REDUCTION,
+ MTK_QUIRKS,
+ MTK_REQUEST,
+ MTK_SCALER,
+ MTK_SENSOR,
+ MTK_SENSOR_INFO,
+ MTK_SHADING,
+ MTK_STATISTICS,
+ MTK_STATISTICS_INFO,
+ MTK_TONEMAP,
+ MTK_LED,
+ MTK_INFO,
+ MTK_BLACK_LEVEL,
+ MTK_SYNC,
+ MTK_HAL_INFO,
+ MTK_IOPIPE_INFO,
+ MTK_SECTION_COUNT,
+
+ //vendor tag
+ MTK_VENDOR_TAG_SECTION = 0x8000,
+ MTK_FACE_FEATURE = 0,
+ MTK_VENDOR_SECTION_COUNT,
+} mtk_camera_metadata_section_t;
+
+/**
+ * Hierarchy positions in enum space. All vendor extension tags must be
+ * defined with tag >= VENDOR_SECTION_START
+ */
+
+typedef enum mtk_camera_metadata_section_start {
+ MTK_COLOR_CORRECTION_START = MTK_COLOR_CORRECTION << 16,
+ MTK_CONTROL_START = MTK_CONTROL << 16,
+ MTK_DEMOSAIC_START = MTK_DEMOSAIC << 16,
+ MTK_EDGE_START = MTK_EDGE << 16,
+ MTK_FLASH_START = MTK_FLASH << 16,
+ MTK_FLASH_INFO_START = MTK_FLASH_INFO << 16,
+ MTK_HOT_PIXEL_START = MTK_HOT_PIXEL << 16,
+ MTK_JPEG_START = MTK_JPEG << 16,
+ MTK_LENS_START = MTK_LENS << 16,
+ MTK_LENS_INFO_START = MTK_LENS_INFO << 16,
+ MTK_NOISE_REDUCTION_START = MTK_NOISE_REDUCTION << 16,
+ MTK_QUIRKS_START = MTK_QUIRKS << 16,
+ MTK_REQUEST_START = MTK_REQUEST << 16,
+ MTK_SCALER_START = MTK_SCALER << 16,
+ MTK_SENSOR_START = MTK_SENSOR << 16,
+ MTK_SENSOR_INFO_START = MTK_SENSOR_INFO << 16,
+ MTK_SHADING_START = MTK_SHADING << 16,
+ MTK_STATISTICS_START = MTK_STATISTICS << 16,
+ MTK_STATISTICS_INFO_START = MTK_STATISTICS_INFO << 16,
+ MTK_TONEMAP_START = MTK_TONEMAP << 16,
+ MTK_LED_START = MTK_LED << 16,
+ MTK_INFO_START = MTK_INFO << 16,
+ MTK_BLACK_LEVEL_START = MTK_BLACK_LEVEL << 16,
+ MTK_SYNC_START = MTK_SYNC << 16,
+ MTK_HAL_INFO_START = MTK_HAL_INFO << 16,
+ MTK_IOPIPE_INFO_START = MTK_IOPIPE_INFO << 16,
+
+ MTK_VENDOR_TAG_SECTION_START = MTK_VENDOR_TAG_SECTION << 16,
+ MTK_FACE_FEATURE_START = (MTK_FACE_FEATURE + MTK_VENDOR_TAG_SECTION) << 16,
+} mtk_camera_metadata_section_start_t;
+
+
+
+/**
+ * Main enum for defining camera metadata tags. New entries must always go
+ * before the section _END tag to preserve existing enumeration values. In
+ * addition, the name and type of the tag needs to be added to
+ * ""
+ */
+typedef enum mtk_camera_metadata_tag {
+ MTK_COLOR_CORRECTION_MODE = MTK_COLOR_CORRECTION_START,
+ MTK_COLOR_CORRECTION_TRANSFORM,
+ MTK_COLOR_CORRECTION_GAINS,
+ MTK_COLOR_CORRECTION_ABERRATION_MODE,
+ MTK_COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES,
+ MTK_COLOR_CORRECTION_END,
+
+ MTK_CONTROL_AE_ANTIBANDING_MODE = MTK_CONTROL_START,
+ MTK_CONTROL_AE_EXPOSURE_COMPENSATION,
+ MTK_CONTROL_AE_LOCK,
+ MTK_CONTROL_AE_MODE,
+ MTK_CONTROL_AE_REGIONS,
+ MTK_CONTROL_AE_TARGET_FPS_RANGE,
+ MTK_CONTROL_AE_PRECAPTURE_TRIGGER,
+ MTK_CONTROL_AF_MODE,
+ MTK_CONTROL_AF_REGIONS,
+ MTK_CONTROL_AF_TRIGGER,
+ MTK_CONTROL_AWB_LOCK,
+ MTK_CONTROL_AWB_MODE,
+ MTK_CONTROL_AWB_REGIONS,
+ MTK_CONTROL_CAPTURE_INTENT,
+ MTK_CONTROL_EFFECT_MODE,
+ MTK_CONTROL_MODE,
+ MTK_CONTROL_SCENE_MODE,
+ MTK_CONTROL_VIDEO_STABILIZATION_MODE,
+ MTK_CONTROL_AE_AVAILABLE_ANTIBANDING_MODES,
+ MTK_CONTROL_AE_AVAILABLE_MODES,
+ MTK_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES,
+ MTK_CONTROL_AE_COMPENSATION_RANGE,
+ MTK_CONTROL_AE_COMPENSATION_STEP,
+ MTK_CONTROL_AF_AVAILABLE_MODES,
+ MTK_CONTROL_AVAILABLE_EFFECTS,
+ MTK_CONTROL_AVAILABLE_SCENE_MODES,
+ MTK_CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES,
+ MTK_CONTROL_AWB_AVAILABLE_MODES,
+ MTK_CONTROL_MAX_REGIONS,
+ MTK_CONTROL_SCENE_MODE_OVERRIDES,
+ MTK_CONTROL_AE_PRECAPTURE_ID,
+ MTK_CONTROL_AE_STATE,
+ MTK_CONTROL_AF_STATE,
+ MTK_CONTROL_AF_TRIGGER_ID,
+ MTK_CONTROL_AWB_STATE,
+ MTK_CONTROL_AVAILABLE_HIGH_SPEED_VIDEO_CONFIGURATIONS,
+ // Camera1
+ MTK_CONTROL_ISP_EDGE,
+ MTK_CONTROL_ISP_HUE,
+ MTK_CONTROL_ISP_SATURATION,
+ MTK_CONTROL_ISP_BRIGHTNESS,
+ MTK_CONTROL_ISP_CONTRAST,
+ MTK_CONTROL_END,
+
+ MTK_DEMOSAIC_MODE = MTK_DEMOSAIC_START,
+ MTK_DEMOSAIC_END,
+
+ MTK_EDGE_MODE = MTK_EDGE_START,
+ MTK_EDGE_STRENGTH,
+ MTK_EDGE_AVAILABLE_EDGE_MODES,
+ MTK_EDGE_END,
+
+ MTK_FLASH_FIRING_POWER = MTK_FLASH_START,
+ MTK_FLASH_FIRING_TIME,
+ MTK_FLASH_MODE,
+ MTK_FLASH_COLOR_TEMPERATURE,
+ MTK_FLASH_MAX_ENERGY,
+ MTK_FLASH_STATE,
+ MTK_FLASH_END,
+
+ MTK_FLASH_INFO_AVAILABLE = MTK_FLASH_INFO_START,
+ MTK_FLASH_INFO_CHARGE_DURATION,
+ MTK_FLASH_INFO_END,
+
+ MTK_HOT_PIXEL_MODE = MTK_HOT_PIXEL_START,
+ MTK_HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES,
+ MTK_HOT_PIXEL_END,
+
+ MTK_JPEG_GPS_COORDINATES = MTK_JPEG_START,
+ MTK_JPEG_GPS_PROCESSING_METHOD,
+ MTK_JPEG_GPS_TIMESTAMP,
+ MTK_JPEG_ORIENTATION,
+ MTK_JPEG_QUALITY,
+ MTK_JPEG_THUMBNAIL_QUALITY,
+ MTK_JPEG_THUMBNAIL_SIZE,
+ MTK_JPEG_AVAILABLE_THUMBNAIL_SIZES,
+ MTK_JPEG_MAX_SIZE,
+ MTK_JPEG_SIZE,
+ MTK_JPEG_END,
+
+ MTK_LENS_APERTURE = MTK_LENS_START,
+ MTK_LENS_FILTER_DENSITY,
+ MTK_LENS_FOCAL_LENGTH,
+ MTK_LENS_FOCUS_DISTANCE,
+ MTK_LENS_OPTICAL_STABILIZATION_MODE,
+ MTK_LENS_OPTICAL_AXIS_ANGLE,
+ MTK_LENS_POSITION,
+ MTK_LENS_FOCUS_RANGE,
+ MTK_LENS_STATE,
+ MTK_LENS_END,
+
+ MTK_LENS_INFO_AVAILABLE_APERTURES = MTK_LENS_INFO_START,
+ MTK_LENS_INFO_AVAILABLE_FILTER_DENSITIES,
+ MTK_LENS_INFO_AVAILABLE_FOCAL_LENGTHS,
+ MTK_LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION,
+ MTK_LENS_INFO_HYPERFOCAL_DISTANCE,
+ MTK_LENS_INFO_MINIMUM_FOCUS_DISTANCE,
+ MTK_LENS_INFO_SHADING_MAP_SIZE,
+ MTK_LENS_INFO_FOCUS_DISTANCE_CALIBRATION,
+ MTK_LENS_INFO_END,
+
+ MTK_NOISE_REDUCTION_MODE = MTK_NOISE_REDUCTION_START,
+ MTK_NOISE_REDUCTION_STRENGTH,
+ MTK_NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES,
+ MTK_NOISE_REDUCTION_END,
+
+ MTK_QUIRKS_METERING_CROP_REGION = MTK_QUIRKS_START,
+ MTK_QUIRKS_TRIGGER_AF_WITH_AUTO,
+ MTK_QUIRKS_USE_ZSL_FORMAT,
+ MTK_QUIRKS_USE_PARTIAL_RESULT,
+ MTK_QUIRKS_PARTIAL_RESULT,
+ MTK_QUIRKS_END,
+
+ MTK_REQUEST_FRAME_COUNT = MTK_REQUEST_START,
+ MTK_REQUEST_ID,
+ MTK_REQUEST_INPUT_STREAMS,
+ MTK_REQUEST_METADATA_MODE,
+ MTK_REQUEST_OUTPUT_STREAMS,
+ MTK_REQUEST_TYPE,
+ MTK_REQUEST_MAX_NUM_OUTPUT_STREAMS,
+ MTK_REQUEST_MAX_NUM_REPROCESS_STREAMS,
+ MTK_REQUEST_MAX_NUM_INPUT_STREAMS,
+ MTK_REQUEST_PIPELINE_DEPTH,
+ MTK_REQUEST_PIPELINE_MAX_DEPTH,
+ MTK_REQUEST_PARTIAL_RESULT_COUNT,
+ MTK_REQUEST_AVAILABLE_CAPABILITIES,
+ MTK_REQUEST_AVAILABLE_REQUEST_KEYS,
+ MTK_REQUEST_AVAILABLE_RESULT_KEYS,
+ MTK_REQUEST_AVAILABLE_CHARACTERISTICS_KEYS,
+ MTK_REQUEST_END,
+
+ MTK_SCALER_CROP_REGION = MTK_SCALER_START,
+ MTK_SCALER_AVAILABLE_FORMATS,
+ MTK_SCALER_AVAILABLE_JPEG_MIN_DURATIONS,
+ MTK_SCALER_AVAILABLE_JPEG_SIZES,
+ MTK_SCALER_AVAILABLE_MAX_DIGITAL_ZOOM,
+ MTK_SCALER_AVAILABLE_PROCESSED_MIN_DURATIONS,
+ MTK_SCALER_AVAILABLE_PROCESSED_SIZES,
+ MTK_SCALER_AVAILABLE_RAW_MIN_DURATIONS,
+ MTK_SCALER_AVAILABLE_RAW_SIZES,
+ MTK_SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP,
+ MTK_SCALER_AVAILABLE_STREAM_CONFIGURATIONS,
+ MTK_SCALER_AVAILABLE_MIN_FRAME_DURATIONS,
+ MTK_SCALER_AVAILABLE_STALL_DURATIONS,
+ MTK_SCALER_CROPPING_TYPE,
+ MTK_SCALER_END,
+
+ MTK_IOPIPE_INFO_AVAILABLE_IN_PORT_INFO
+ = MTK_IOPIPE_INFO_START,
+ MTK_IOPIPE_INFO_AVAILABLE_OUT_PORT_INFO,
+ MTK_IOPIPE_INFO_PORT_ID,
+ MTK_IOPIPE_INFO_TRANSFORM,
+ MTK_IOPIPE_INFO_CROP,
+ MTK_IOPIPE_INFO_SCALE_DOWN_RATIO,
+ MTK_IOPIPE_INFO_SCALE_UP_RATIO,
+ MTK_IOPIPE_INFO_LINEBUFFER,
+ MTK_IOPIPE_INFO_AVAILABLE_FORMATS,
+ MTK_IOPIPE_INFO_END,
+
+ MTK_SENSOR_EXPOSURE_TIME = MTK_SENSOR_START,
+ MTK_SENSOR_FRAME_DURATION,
+ MTK_SENSOR_SENSITIVITY,
+ MTK_SENSOR_REFERENCE_ILLUMINANT1,
+ MTK_SENSOR_REFERENCE_ILLUMINANT2,
+ MTK_SENSOR_CALIBRATION_TRANSFORM1,
+ MTK_SENSOR_CALIBRATION_TRANSFORM2,
+ MTK_SENSOR_COLOR_TRANSFORM1,
+ MTK_SENSOR_COLOR_TRANSFORM2,
+ MTK_SENSOR_FORWARD_MATRIX1,
+ MTK_SENSOR_FORWARD_MATRIX2,
+ MTK_SENSOR_BASE_GAIN_FACTOR,
+ MTK_SENSOR_BLACK_LEVEL_PATTERN,
+ MTK_SENSOR_MAX_ANALOG_SENSITIVITY,
+ MTK_SENSOR_ORIENTATION,
+ MTK_SENSOR_PROFILE_HUE_SAT_MAP_DIMENSIONS,
+ MTK_SENSOR_TIMESTAMP,
+ MTK_SENSOR_TEMPERATURE,
+ MTK_SENSOR_NEUTRAL_COLOR_POINT,
+ MTK_SENSOR_NOISE_PROFILE,
+ MTK_SENSOR_PROFILE_HUE_SAT_MAP,
+ MTK_SENSOR_PROFILE_TONE_CURVE,
+ MTK_SENSOR_GREEN_SPLIT,
+ MTK_SENSOR_TEST_PATTERN_DATA,
+ MTK_SENSOR_TEST_PATTERN_MODE,
+ MTK_SENSOR_AVAILABLE_TEST_PATTERN_MODES,
+ MTK_SENSOR_ROLLING_SHUTTER_SKEW,
+ MTK_SENSOR_END,
+
+ MTK_SENSOR_INFO_ACTIVE_ARRAY_REGION = MTK_SENSOR_INFO_START,
+ MTK_SENSOR_INFO_SENSITIVITY_RANGE,
+ MTK_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT,
+ MTK_SENSOR_INFO_EXPOSURE_TIME_RANGE,
+ MTK_SENSOR_INFO_MAX_FRAME_DURATION,
+ MTK_SENSOR_INFO_PHYSICAL_SIZE,
+ MTK_SENSOR_INFO_PIXEL_ARRAY_SIZE,
+ MTK_SENSOR_INFO_WHITE_LEVEL,
+ MTK_SENSOR_INFO_TIMESTAMP_SOURCE,
+ MTK_SENSOR_INFO_ORIENTATION,
+ MTK_SENSOR_INFO_FACING,
+ MTK_SENSOR_INFO_PACKAGE,
+ MTK_SENSOR_INFO_DEV,
+ MTK_SENSOR_INFO_SCENARIO_ID,
+ MTK_SENSOR_INFO_FRAME_RATE,
+ MTK_SENSOR_INFO_REAL_OUTPUT_SIZE,
+ MTK_SENSOR_INFO_OUTPUT_REGION_ON_ACTIVE_ARRAY,
+ MTK_SENSOR_INFO_WANTED_ORIENTATION,
+ MTK_SENSOR_INFO_END,
+
+ MTK_SHADING_MODE = MTK_SHADING_START,
+ MTK_SHADING_STRENGTH,
+ MTK_SHADING_END,
+
+ MTK_STATISTICS_FACE_DETECT_MODE = MTK_STATISTICS_START,
+ MTK_STATISTICS_HISTOGRAM_MODE,
+ MTK_STATISTICS_SHARPNESS_MAP_MODE,
+ MTK_STATISTICS_HOT_PIXEL_MAP_MODE,
+ MTK_STATISTICS_FACE_IDS,
+ MTK_STATISTICS_FACE_LANDMARKS,
+ MTK_STATISTICS_FACE_RECTANGLES,
+ MTK_STATISTICS_FACE_SCORES,
+ MTK_STATISTICS_HISTOGRAM,
+ MTK_STATISTICS_SHARPNESS_MAP,
+ MTK_STATISTICS_LENS_SHADING_CORRECTION_MAP,
+ MTK_STATISTICS_LENS_SHADING_MAP,
+ MTK_STATISTICS_PREDICTED_COLOR_GAINS,
+ MTK_STATISTICS_PREDICTED_COLOR_TRANSFORM,
+ MTK_STATISTICS_SCENE_FLICKER,
+ MTK_STATISTICS_HOT_PIXEL_MAP,
+ MTK_STATISTICS_LENS_SHADING_MAP_MODE,
+ MTK_STATISTICS_END,
+
+ MTK_STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES
+ = MTK_STATISTICS_INFO_START,
+ MTK_STATISTICS_INFO_HISTOGRAM_BUCKET_COUNT,
+ MTK_STATISTICS_INFO_MAX_FACE_COUNT,
+ MTK_STATISTICS_INFO_MAX_HISTOGRAM_COUNT,
+ MTK_STATISTICS_INFO_MAX_SHARPNESS_MAP_VALUE,
+ MTK_STATISTICS_INFO_SHARPNESS_MAP_SIZE,
+ MTK_STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES,
+ MTK_STATISTICS_INFO_END,
+
+ MTK_TONEMAP_CURVE_BLUE = MTK_TONEMAP_START,
+ MTK_TONEMAP_CURVE_GREEN,
+ MTK_TONEMAP_CURVE_RED,
+ MTK_TONEMAP_MODE,
+ MTK_TONEMAP_MAX_CURVE_POINTS,
+ MTK_TONEMAP_AVAILABLE_TONE_MAP_MODES,
+ MTK_TONEMAP_END,
+
+ MTK_LED_TRANSMIT = MTK_LED_START,
+ MTK_LED_AVAILABLE_LEDS,
+ MTK_LED_END,
+
+ MTK_INFO_SUPPORTED_HARDWARE_LEVEL = MTK_INFO_START,
+ MTK_INFO_END,
+
+ MTK_BLACK_LEVEL_LOCK = MTK_BLACK_LEVEL_START,
+ MTK_BLACK_LEVEL_END,
+
+ MTK_SYNC_FRAME_NUMBER = MTK_SYNC_START,
+ MTK_SYNC_MAX_LATENCY,
+ MTK_SYNC_END,
+
+ MTK_FACE_FEATURE_GESTURE_MODE = MTK_FACE_FEATURE_START,
+ MTK_FACE_FEATURE_GESTURE_RESULT,
+ MTK_FACE_FEATURE_SMILE_DETECT_MODE,
+ MTK_FACE_FEATURE_SMILE_DETECT_RESULT,
+ MTK_FACE_FEATURE_ASD_MODE,
+ MTK_FACE_FEATURE_ASD_RESULT,
+ MTK_FACE_FEATURE_AVAILABLE_GESTURE_MODES,
+ MTK_FACE_FEATURE_AVAILABLE_SMILE_DETECT_MODES,
+ MTK_FACE_FEATURE_AVAILABLE_ASD_MODES,
+ MTK_FACE_FEATURE_END,
+
+ MTK_HAL_VERSION = MTK_HAL_INFO_START,
+
+} mtk_camera_metadata_tag_t;
+
+/**
+ * Enumeration definitions for the various entries that need them
+ */
+
+// MTK_COLOR_CORRECTION_MODE
+typedef enum mtk_camera_metadata_enum_android_color_correction_mode {
+ MTK_COLOR_CORRECTION_MODE_TRANSFORM_MATRIX,
+ MTK_COLOR_CORRECTION_MODE_FAST,
+ MTK_COLOR_CORRECTION_MODE_HIGH_QUALITY,
+} mtk_camera_metadata_enum_android_color_correction_mode_t;
+
+// MTK_COLOR_CORRECTION_ABERRATION_MODE
+typedef enum mtk_camera_metadata_enum_android_color_correction_aberration_mode {
+ MTK_COLOR_CORRECTION_ABERRATION_MODE_OFF,
+ MTK_COLOR_CORRECTION_ABERRATION_MODE_FAST,
+ MTK_COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY,
+} mtk_camera_metadata_enum_android_color_correction_aberration_mode_t;
+
+// MTK_CONTROL_AE_ANTIBANDING_MODE
+typedef enum mtk_camera_metadata_enum_android_control_ae_antibanding_mode {
+ MTK_CONTROL_AE_ANTIBANDING_MODE_OFF,
+ MTK_CONTROL_AE_ANTIBANDING_MODE_50HZ,
+ MTK_CONTROL_AE_ANTIBANDING_MODE_60HZ,
+ MTK_CONTROL_AE_ANTIBANDING_MODE_AUTO,
+} mtk_camera_metadata_enum_android_control_ae_antibanding_mode_t;
+
+// MTK_CONTROL_AE_LOCK
+typedef enum mtk_camera_metadata_enum_android_control_ae_lock {
+ MTK_CONTROL_AE_LOCK_OFF,
+ MTK_CONTROL_AE_LOCK_ON,
+} mtk_camera_metadata_enum_android_control_ae_lock_t;
+
+// MTK_CONTROL_AE_MODE
+typedef enum mtk_camera_metadata_enum_android_control_ae_mode {
+ MTK_CONTROL_AE_MODE_OFF,
+ MTK_CONTROL_AE_MODE_ON,
+ MTK_CONTROL_AE_MODE_ON_AUTO_FLASH,
+ MTK_CONTROL_AE_MODE_ON_ALWAYS_FLASH,
+ MTK_CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE,
+} mtk_camera_metadata_enum_android_control_ae_mode_t;
+
+// MTK_CONTROL_AE_PRECAPTURE_TRIGGER
+typedef enum mtk_camera_metadata_enum_android_control_ae_precapture_trigger {
+ MTK_CONTROL_AE_PRECAPTURE_TRIGGER_IDLE,
+ MTK_CONTROL_AE_PRECAPTURE_TRIGGER_START,
+} mtk_camera_metadata_enum_android_control_ae_precapture_trigger_t;
+
+// MTK_CONTROL_AF_MODE
+typedef enum mtk_camera_metadata_enum_android_control_af_mode {
+ MTK_CONTROL_AF_MODE_OFF,
+ MTK_CONTROL_AF_MODE_AUTO,
+ MTK_CONTROL_AF_MODE_MACRO,
+ MTK_CONTROL_AF_MODE_CONTINUOUS_VIDEO,
+ MTK_CONTROL_AF_MODE_CONTINUOUS_PICTURE,
+ MTK_CONTROL_AF_MODE_EDOF,
+} mtk_camera_metadata_enum_android_control_af_mode_t;
+
+// MTK_CONTROL_AF_TRIGGER
+typedef enum mtk_camera_metadata_enum_android_control_af_trigger {
+ MTK_CONTROL_AF_TRIGGER_IDLE,
+ MTK_CONTROL_AF_TRIGGER_START,
+ MTK_CONTROL_AF_TRIGGER_CANCEL,
+} mtk_camera_metadata_enum_android_control_af_trigger_t;
+
+// MTK_CONTROL_AWB_LOCK
+typedef enum mtk_camera_metadata_enum_android_control_awb_lock {
+ MTK_CONTROL_AWB_LOCK_OFF,
+ MTK_CONTROL_AWB_LOCK_ON,
+} mtk_camera_metadata_enum_android_control_awb_lock_t;
+
+// MTK_CONTROL_AWB_MODE
+typedef enum mtk_camera_metadata_enum_android_control_awb_mode {
+ MTK_CONTROL_AWB_MODE_OFF,
+ MTK_CONTROL_AWB_MODE_AUTO,
+ MTK_CONTROL_AWB_MODE_INCANDESCENT,
+ MTK_CONTROL_AWB_MODE_FLUORESCENT,
+ MTK_CONTROL_AWB_MODE_WARM_FLUORESCENT,
+ MTK_CONTROL_AWB_MODE_DAYLIGHT,
+ MTK_CONTROL_AWB_MODE_CLOUDY_DAYLIGHT,
+ MTK_CONTROL_AWB_MODE_TWILIGHT,
+ MTK_CONTROL_AWB_MODE_SHADE,
+ MTK_CONTROL_AWB_MODE_GRAYWORLD, //deprecated
+} mtk_camera_metadata_enum_android_control_awb_mode_t;
+
+// MTK_CONTROL_CAPTURE_INTENT
+typedef enum mtk_camera_metadata_enum_android_control_capture_intent {
+ MTK_CONTROL_CAPTURE_INTENT_CUSTOM,
+ MTK_CONTROL_CAPTURE_INTENT_PREVIEW,
+ MTK_CONTROL_CAPTURE_INTENT_STILL_CAPTURE,
+ MTK_CONTROL_CAPTURE_INTENT_VIDEO_RECORD,
+ MTK_CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT,
+ MTK_CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG,
+ MTK_CONTROL_CAPTURE_INTENT_MANUAL,
+} mtk_camera_metadata_enum_android_control_capture_intent_t;
+
+// MTK_CONTROL_EFFECT_MODE
+typedef enum mtk_camera_metadata_enum_android_control_effect_mode {
+ MTK_CONTROL_EFFECT_MODE_OFF,
+ MTK_CONTROL_EFFECT_MODE_MONO,
+ MTK_CONTROL_EFFECT_MODE_NEGATIVE,
+ MTK_CONTROL_EFFECT_MODE_SOLARIZE,
+ MTK_CONTROL_EFFECT_MODE_SEPIA,
+ MTK_CONTROL_EFFECT_MODE_POSTERIZE,
+ MTK_CONTROL_EFFECT_MODE_WHITEBOARD,
+ MTK_CONTROL_EFFECT_MODE_BLACKBOARD,
+ MTK_CONTROL_EFFECT_MODE_AQUA, //,
+ MTK_CONTROL_EFFECT_MODE_SEPIAGREEN,
+ MTK_CONTROL_EFFECT_MODE_SEPIABLUE,
+ MTK_CONTROL_EFFECT_MODE_NASHVILLE , //LOMO
+ MTK_CONTROL_EFFECT_MODE_HEFE ,
+ MTK_CONTROL_EFFECT_MODE_VALENCIA ,
+ MTK_CONTROL_EFFECT_MODE_XPROII ,
+ MTK_CONTROL_EFFECT_MODE_LOFI ,
+ MTK_CONTROL_EFFECT_MODE_SIERRA ,
+ MTK_CONTROL_EFFECT_MODE_KELVIN ,
+ MTK_CONTROL_EFFECT_MODE_WALDEN,
+ MTK_CONTROL_EFFECT_MODE_F1977 , //LOMO
+ MTK_CONTROL_EFFECT_MODE_NUM
+} mtk_camera_metadata_enum_android_control_effect_mode_t;
+
+// MTK_CONTROL_MODE
+typedef enum mtk_camera_metadata_enum_android_control_mode {
+ MTK_CONTROL_MODE_OFF,
+ MTK_CONTROL_MODE_AUTO,
+ MTK_CONTROL_MODE_USE_SCENE_MODE,
+ MTK_CONTROL_MODE_OFF_KEEP_STATE,
+} mtk_camera_metadata_enum_android_control_mode_t;
+
+// MTK_CONTROL_SCENE_MODE
+typedef enum mtk_camera_metadata_enum_android_control_scene_mode {
+ MTK_CONTROL_SCENE_MODE_DISABLED = 0,
+ MTK_CONTROL_SCENE_MODE_UNSUPPORTED = MTK_CONTROL_SCENE_MODE_DISABLED,
+ MTK_CONTROL_SCENE_MODE_FACE_PRIORITY,
+ MTK_CONTROL_SCENE_MODE_ACTION,
+ MTK_CONTROL_SCENE_MODE_PORTRAIT,
+ MTK_CONTROL_SCENE_MODE_LANDSCAPE,
+ MTK_CONTROL_SCENE_MODE_NIGHT,
+ MTK_CONTROL_SCENE_MODE_NIGHT_PORTRAIT,
+ MTK_CONTROL_SCENE_MODE_THEATRE,
+ MTK_CONTROL_SCENE_MODE_BEACH,
+ MTK_CONTROL_SCENE_MODE_SNOW,
+ MTK_CONTROL_SCENE_MODE_SUNSET,
+ MTK_CONTROL_SCENE_MODE_STEADYPHOTO,
+ MTK_CONTROL_SCENE_MODE_FIREWORKS,
+ MTK_CONTROL_SCENE_MODE_SPORTS,
+ MTK_CONTROL_SCENE_MODE_PARTY,
+ MTK_CONTROL_SCENE_MODE_CANDLELIGHT,
+ MTK_CONTROL_SCENE_MODE_BARCODE,
+ MTK_CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO,
+ MTK_CONTROL_SCENE_MODE_HDR,
+ // Camera1
+ MTK_CONTROL_SCENE_MODE_NORMAL,
+ MTK_CONTROL_SCENE_MODE_NUM
+} mtk_camera_metadata_enum_android_control_scene_mode_t;
+
+// MTK_CONTROL_VIDEO_STABILIZATION_MODE
+typedef enum mtk_camera_metadata_enum_android_control_video_stabilization_mode {
+ MTK_CONTROL_VIDEO_STABILIZATION_MODE_OFF,
+ MTK_CONTROL_VIDEO_STABILIZATION_MODE_ON,
+} mtk_camera_metadata_enum_android_control_video_stabilization_mode_t;
+
+// MTK_CONTROL_AE_STATE
+typedef enum mtk_camera_metadata_enum_android_control_ae_state {
+ MTK_CONTROL_AE_STATE_INACTIVE,
+ MTK_CONTROL_AE_STATE_SEARCHING,
+ MTK_CONTROL_AE_STATE_CONVERGED,
+ MTK_CONTROL_AE_STATE_LOCKED,
+ MTK_CONTROL_AE_STATE_FLASH_REQUIRED,
+ MTK_CONTROL_AE_STATE_PRECAPTURE,
+} mtk_camera_metadata_enum_android_control_ae_state_t;
+
+// MTK_CONTROL_AF_STATE
+typedef enum mtk_camera_metadata_enum_android_control_af_state {
+ MTK_CONTROL_AF_STATE_INACTIVE,
+ MTK_CONTROL_AF_STATE_PASSIVE_SCAN,
+ MTK_CONTROL_AF_STATE_PASSIVE_FOCUSED,
+ MTK_CONTROL_AF_STATE_ACTIVE_SCAN,
+ MTK_CONTROL_AF_STATE_FOCUSED_LOCKED,
+ MTK_CONTROL_AF_STATE_NOT_FOCUSED_LOCKED,
+ MTK_CONTROL_AF_STATE_PASSIVE_UNFOCUSED,
+} mtk_camera_metadata_enum_android_control_af_state_t;
+
+// MTK_CONTROL_AWB_STATE
+typedef enum mtk_camera_metadata_enum_android_control_awb_state {
+ MTK_CONTROL_AWB_STATE_INACTIVE,
+ MTK_CONTROL_AWB_STATE_SEARCHING,
+ MTK_CONTROL_AWB_STATE_CONVERGED,
+ MTK_CONTROL_AWB_STATE_LOCKED,
+} mtk_camera_metadata_enum_android_control_awb_state_t;
+
+// MTK_CONTROL_ISP_EDGE
+typedef enum mtk_camera_metadata_enum_android_control_isp_edge {
+ MTK_CONTROL_ISP_EDGE_LOW,
+ MTK_CONTROL_ISP_EDGE_MIDDLE,
+ MTK_CONTROL_ISP_EDGE_HIGH
+} mtk_camera_metadata_enum_android_control_isp_edge_t;
+
+// MTK_CONTROL_ISP_HUE
+typedef enum mtk_camera_metadata_enum_android_control_isp_hue {
+ MTK_CONTROL_ISP_HUE_LOW,
+ MTK_CONTROL_ISP_HUE_MIDDLE,
+ MTK_CONTROL_ISP_HUE_HIGH
+} mtk_camera_metadata_enum_android_control_isp_hue_t;
+
+// MTK_CONTROL_ISP_SATURATION
+typedef enum mtk_camera_metadata_enum_android_control_isp_saturation {
+ MTK_CONTROL_ISP_SATURATION_LOW,
+ MTK_CONTROL_ISP_SATURATION_MIDDLE,
+ MTK_CONTROL_ISP_SATURATION_HIGH
+} mtk_camera_metadata_enum_android_control_isp_saturation_t;
+
+// MTK_CONTROL_ISP_BRIGHTNESS
+typedef enum mtk_camera_metadata_enum_android_control_isp_brightness {
+ MTK_CONTROL_ISP_BRIGHTNESS_LOW,
+ MTK_CONTROL_ISP_BRIGHTNESS_MIDDLE,
+ MTK_CONTROL_ISP_BRIGHTNESS_HIGH
+} mtk_camera_metadata_enum_android_control_isp_brightness_t;
+
+// MTK_CONTROL_ISP_CONTRAST
+typedef enum mtk_camera_metadata_enum_android_control_isp_contrast {
+ MTK_CONTROL_ISP_CONTRAST_LOW,
+ MTK_CONTROL_ISP_CONTRAST_MIDDLE,
+ MTK_CONTROL_ISP_CONTRAST_HIGH
+} mtk_camera_metadata_enum_android_control_isp_contrast_t;
+
+// MTK_DEMOSAIC_MODE
+typedef enum mtk_camera_metadata_enum_android_demosaic_mode {
+ MTK_DEMOSAIC_MODE_FAST,
+ MTK_DEMOSAIC_MODE_HIGH_QUALITY,
+} mtk_camera_metadata_enum_android_demosaic_mode_t;
+
+// MTK_EDGE_MODE
+typedef enum mtk_camera_metadata_enum_android_edge_mode {
+ MTK_EDGE_MODE_OFF,
+ MTK_EDGE_MODE_FAST,
+ MTK_EDGE_MODE_HIGH_QUALITY,
+} mtk_camera_metadata_enum_android_edge_mode_t;
+
+// MTK_FLASH_MODE
+typedef enum mtk_camera_metadata_enum_android_flash_mode {
+ MTK_FLASH_MODE_OFF,
+ MTK_FLASH_MODE_SINGLE,
+ MTK_FLASH_MODE_TORCH,
+} mtk_camera_metadata_enum_android_flash_mode_t;
+
+// MTK_FLASH_STATE
+typedef enum mtk_camera_metadata_enum_android_flash_state {
+ MTK_FLASH_STATE_UNAVAILABLE,
+ MTK_FLASH_STATE_CHARGING,
+ MTK_FLASH_STATE_READY,
+ MTK_FLASH_STATE_FIRED,
+ MTK_FLASH_STATE_PARTIAL,
+} mtk_camera_metadata_enum_android_flash_state_t;
+
+// MTK_FLASH_INFO_AVAILABLE
+typedef enum mtk_camera_metadata_enum_android_flash_info_available {
+ MTK_FLASH_INFO_AVAILABLE_FALSE,
+ MTK_FLASH_INFO_AVAILABLE_TRUE,
+} mtk_camera_metadata_enum_android_flash_info_available_t;
+
+// MTK_HOT_PIXEL_MODE
+typedef enum mtk_camera_metadata_enum_android_hot_pixel_mode {
+ MTK_HOT_PIXEL_MODE_OFF,
+ MTK_HOT_PIXEL_MODE_FAST,
+ MTK_HOT_PIXEL_MODE_HIGH_QUALITY,
+} mtk_camera_metadata_enum_android_hot_pixel_mode_t;
+
+// MTK_LENS_OPTICAL_STABILIZATION_MODE
+typedef enum mtk_camera_metadata_enum_android_lens_optical_stabilization_mode {
+ MTK_LENS_OPTICAL_STABILIZATION_MODE_OFF,
+ MTK_LENS_OPTICAL_STABILIZATION_MODE_ON,
+} mtk_camera_metadata_enum_android_lens_optical_stabilization_mode_t;
+
+// MTK_LENS_FACING
+typedef enum mtk_camera_metadata_enum_android_lens_facing {
+ MTK_LENS_FACING_FRONT,
+ MTK_LENS_FACING_BACK,
+} mtk_camera_metadata_enum_android_lens_facing_t;
+
+// MTK_LENS_STATE
+typedef enum mtk_camera_metadata_enum_android_lens_state {
+ MTK_LENS_STATE_STATIONARY,
+} mtk_camera_metadata_enum_android_lens_state_t;
+
+// MTK_LENS_INFO_FOCUS_DISTANCE_CALIBRATION
+typedef enum mtk_camera_metadata_enum_android_lens_info_focus_distance_calibration {
+ MTK_LENS_INFO_FOCUS_DISTANCE_CALIBRATION_UNCALIBRATED,
+ MTK_LENS_INFO_FOCUS_DISTANCE_CALIBRATION_APPROXIMATE,
+ MTK_LENS_INFO_FOCUS_DISTANCE_CALIBRATION_CALIBRATED,
+} mtk_camera_metadata_enum_android_lens_info_focus_distance_calibration_t;
+
+// MTK_NOISE_REDUCTION_MODE
+typedef enum mtk_camera_metadata_enum_android_noise_reduction_mode {
+ MTK_NOISE_REDUCTION_MODE_OFF,
+ MTK_NOISE_REDUCTION_MODE_FAST,
+ MTK_NOISE_REDUCTION_MODE_HIGH_QUALITY,
+} mtk_camera_metadata_enum_android_noise_reduction_mode_t;
+
+// MTK_QUIRKS_PARTIAL_RESULT
+typedef enum mtk_metadata_enum_android_quirks_partial_result {
+ MTK_QUIRKS_PARTIAL_RESULT_FINAL,
+ MTK_QUIRKS_PARTIAL_RESULT_PARTIAL,
+} mtk_metadata_enum_android_quirks_partial_result_t;
+
+// MTK_REQUEST_METADATA_MODE
+typedef enum mtk_camera_metadata_enum_android_request_metadata_mode {
+ MTK_REQUEST_METADATA_MODE_NONE,
+ MTK_REQUEST_METADATA_MODE_FULL,
+} mtk_camera_metadata_enum_android_request_metadata_mode_t;
+
+// MTK_REQUEST_TYPE
+typedef enum mtk_camera_metadata_enum_android_request_type {
+ MTK_REQUEST_TYPE_CAPTURE,
+ MTK_REQUEST_TYPE_REPROCESS,
+} mtk_camera_metadata_enum_android_request_type_t;
+
+// MTK_REQUEST_AVAILABLE_CAPABILITIES
+typedef enum mtk_camera_metadata_enum_android_request_available_capabilities {
+ MTK_REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE,
+ MTK_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR,
+ MTK_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING,
+ MTK_REQUEST_AVAILABLE_CAPABILITIES_RAW,
+ MTK_REQUEST_AVAILABLE_CAPABILITIES_ZSL,
+ MTK_REQUEST_AVAILABLE_CAPABILITIES_READ_SENSOR_SETTINGS,
+ MTK_REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE,
+} mtk_camera_metadata_enum_android_request_available_capabilities_t;
+
+// MTK_SCALER_AVAILABLE_FORMATS
+typedef enum mtk_camera_metadata_enum_android_scaler_available_formats {
+ MTK_SCALER_AVAILABLE_FORMATS_RAW16 = 0x20,
+ MTK_SCALER_AVAILABLE_FORMATS_RAW_OPAQUE = 0x24,
+ MTK_SCALER_AVAILABLE_FORMATS_YV12 = 0x32315659,
+ MTK_SCALER_AVAILABLE_FORMATS_YCrCb_420_SP = 0x11,
+ MTK_SCALER_AVAILABLE_FORMATS_IMPLEMENTATION_DEFINED = 0x22,
+ MTK_SCALER_AVAILABLE_FORMATS_YCbCr_420_888 = 0x23,
+ MTK_SCALER_AVAILABLE_FORMATS_BLOB = 0x21,
+} mtk_camera_metadata_enum_android_scaler_available_formats_t;
+
+// MTK_SCALER_AVAILABLE_STREAM_CONFIGURATIONS
+typedef enum mtk_camera_metadata_enum_android_scaler_available_stream_configurations {
+ MTK_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT,
+ MTK_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_INPUT,
+} mtk_camera_metadata_enum_android_scaler_available_stream_configurations_t;
+
+// MTK_SCALER_CROPPING_TYPE
+typedef enum mtk_camera_metadata_enum_android_scaler_cropping_type {
+ MTK_SCALER_CROPPING_TYPE_CENTER_ONLY,
+ MTK_SCALER_CROPPING_TYPE_FREEFORM,
+} mkt_camera_metadata_enum_android_scaler_cropping_type_t;
+
+// MTK_IOPIPE_INFO_CROP
+typedef enum mtk_camera_metadata_enum_android_iopipe_info_crop {
+ MTK_IOPIPE_INFO_CROP_NOT_SUPPORT,
+ MTK_IOPIPE_INFO_CROP_SYMMETRIC,
+ MTK_IOPIPE_INFO_CROP_ASYMMETRIC,
+} mtk_camera_metadata_enum_android_iopipe_info_crop_t;
+
+// MTK_SENSOR_REFERENCE_ILLUMINANT1
+typedef enum mtk_camera_metadata_enum_android_sensor_reference_illuminant1 {
+ MTK_SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT = 1,
+ MTK_SENSOR_REFERENCE_ILLUMINANT1_FLUORESCENT = 2,
+ MTK_SENSOR_REFERENCE_ILLUMINANT1_TUNGSTEN = 3,
+ MTK_SENSOR_REFERENCE_ILLUMINANT1_FLASH = 4,
+ MTK_SENSOR_REFERENCE_ILLUMINANT1_FINE_WEATHER = 9,
+ MTK_SENSOR_REFERENCE_ILLUMINANT1_CLOUDY_WEATHER = 10,
+ MTK_SENSOR_REFERENCE_ILLUMINANT1_SHADE = 11,
+ MTK_SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT_FLUORESCENT = 12,
+ MTK_SENSOR_REFERENCE_ILLUMINANT1_DAY_WHITE_FLUORESCENT = 13,
+ MTK_SENSOR_REFERENCE_ILLUMINANT1_COOL_WHITE_FLUORESCENT = 14,
+ MTK_SENSOR_REFERENCE_ILLUMINANT1_WHITE_FLUORESCENT = 15,
+ MTK_SENSOR_REFERENCE_ILLUMINANT1_STANDARD_A = 17,
+ MTK_SENSOR_REFERENCE_ILLUMINANT1_STANDARD_B = 18,
+ MTK_SENSOR_REFERENCE_ILLUMINANT1_STANDARD_C = 19,
+ MTK_SENSOR_REFERENCE_ILLUMINANT1_D55 = 20,
+ MTK_SENSOR_REFERENCE_ILLUMINANT1_D65 = 21,
+ MTK_SENSOR_REFERENCE_ILLUMINANT1_D75 = 22,
+ MTK_SENSOR_REFERENCE_ILLUMINANT1_D50 = 23,
+ MTK_SENSOR_REFERENCE_ILLUMINANT1_ISO_STUDIO_TUNGSTEN = 24,
+} mtk_camera_metadata_enum_android_sensor_reference_illuminant1_t;
+
+// MTK_SENSOR_TEST_PATTERN_MODE
+typedef enum mtk_camera_metadata_enum_android_sensor_test_pattern_mode {
+ MTK_SENSOR_TEST_PATTERN_MODE_OFF,
+ MTK_SENSOR_TEST_PATTERN_MODE_SOLID_COLOR,
+ MTK_SENSOR_TEST_PATTERN_MODE_COLOR_BARS,
+ MTK_SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY,
+ MTK_SENSOR_TEST_PATTERN_MODE_PN9,
+ MTK_SENSOR_TEST_PATTERN_MODE_CUSTOM1 = 256,
+} mkt_camera_metadata_enum_android_sensor_test_pattern_mode_t;
+
+// MTK_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
+typedef enum mtk_camera_metadata_enum_android_sensor_info_color_filter_arrangement {
+ MTK_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGGB,
+ MTK_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GRBG,
+ MTK_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GBRG,
+ MTK_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_BGGR,
+ MTK_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGB,
+} mtk_camera_metadata_enum_android_sensor_info_color_filter_arrangement_t;
+
+// MTK_SENSOR_INFO_TIMESTAMP_SOURCE
+typedef enum mtk_camera_metadata_enum_android_sensor_info_timestamp_source {
+ MTK_SENSOR_INFO_TIMESTAMP_SOURCE_UNKNOWN,
+ MTK_SENSOR_INFO_TIMESTAMP_SOURCE_REALTIME,
+} mtk_camera_metadata_enum_android_sensor_info_timestamp_source_t;
+
+// MTK_SENSOR_INFO_SCENARIO_ID
+typedef enum mtk_camera_metadata_enum_android_sensor_info_scenario_id {
+ MTK_SENSOR_INFO_SCENARIO_ID_ZSD,
+ MTK_SENSOR_INFO_SCENARIO_ID_NORMAL_PREVIEW,
+ MTK_SENSOR_INFO_SCENARIO_ID_NORMAL_CAPTURE,
+ MTK_SENSOR_INFO_SCENARIO_ID_NORMAL_VIDEO,
+ /**************************************************************************
+ * All unnamed scenario id for a specific sensor must be started with
+ * values >= MTK_SENSOR_INFO_SCENARIO_ID_UNNAMED_START.
+ **************************************************************************/
+ MTK_SENSOR_INFO_SCENARIO_ID_UNNAMED_START = 0x100,
+} mtk_camera_metadata_enum_android_sensor_info_scenario_id_t;
+
+// MTK_SHADING_MODE
+typedef enum mtk_camera_metadata_enum_android_shading_mode {
+ MTK_SHADING_MODE_OFF,
+ MTK_SHADING_MODE_FAST,
+ MTK_SHADING_MODE_HIGH_QUALITY,
+} mtk_camera_metadata_enum_android_shading_mode_t;
+
+// MTK_STATISTICS_FACE_DETECT_MODE
+typedef enum mtk_camera_metadata_enum_android_statistics_face_detect_mode {
+ MTK_STATISTICS_FACE_DETECT_MODE_OFF,
+ MTK_STATISTICS_FACE_DETECT_MODE_SIMPLE,
+ MTK_STATISTICS_FACE_DETECT_MODE_FULL,
+} mtk_camera_metadata_enum_android_statistics_face_detect_mode_t;
+
+// MTK_STATISTICS_HISTOGRAM_MODE
+typedef enum mtk_camera_metadata_enum_android_statistics_histogram_mode {
+ MTK_STATISTICS_HISTOGRAM_MODE_OFF,
+ MTK_STATISTICS_HISTOGRAM_MODE_ON,
+} mtk_camera_metadata_enum_android_statistics_histogram_mode_t;
+
+// MTK_STATISTICS_SHARPNESS_MAP_MODE
+typedef enum mtk_camera_metadata_enum_android_statistics_sharpness_map_mode {
+ MTK_STATISTICS_SHARPNESS_MAP_MODE_OFF,
+ MTK_STATISTICS_SHARPNESS_MAP_MODE_ON,
+} mtk_camera_metadata_enum_android_statistics_sharpness_map_mode_t;
+
+// MTK_STATISTICS_HOT_PIXEL_MAP_MODE
+typedef enum mtk_camera_metadata_enum_android_statistics_hot_pixel_map_mode {
+ MTK_STATISTICS_HOT_PIXEL_MAP_MODE_OFF,
+ MTK_STATISTICS_HOT_PIXEL_MAP_MODE_ON,
+} mtk_camera_metadata_enum_android_statistics_hot_pixel_map_mode_t;
+
+// ANDROID_STATISTICS_SCENE_FLICKER
+typedef enum mtk_camera_metadata_enum_android_statistics_scene_flicker {
+ MTK_STATISTICS_SCENE_FLICKER_NONE,
+ MTK_STATISTICS_SCENE_FLICKER_50HZ,
+ MTK_STATISTICS_SCENE_FLICKER_60HZ,
+} mtk_camera_metadata_enum_android_statistics_scene_flicker_t;
+
+// ANDROID_STATISTICS_LENS_SHADING_MAP_MODE
+typedef enum mtk_camera_metadata_enum_android_statistics_lens_shading_map_mode {
+ MTK_STATISTICS_LENS_SHADING_MAP_MODE_OFF,
+ MTK_STATISTICS_LENS_SHADING_MAP_MODE_ON,
+} mtk_camera_metadata_enum_android_statistics_lens_shading_map_mode_t;
+
+// MTK_TONEMAP_MODE
+typedef enum mtk_camera_metadata_enum_android_tonemap_mode {
+ MTK_TONEMAP_MODE_CONTRAST_CURVE,
+ MTK_TONEMAP_MODE_FAST,
+ MTK_TONEMAP_MODE_HIGH_QUALITY,
+} mtk_camera_metadata_enum_android_tonemap_mode_t;
+
+// MTK_LED_TRANSMIT
+typedef enum mtk_camera_metadata_enum_android_led_transmit {
+ MTK_LED_TRANSMIT_OFF,
+ MTK_LED_TRANSMIT_ON,
+} mtk_camera_metadata_enum_android_led_transmit_t;
+
+// MTK_LED_AVAILABLE_LEDS
+typedef enum mtk_camera_metadata_enum_android_led_available_leds {
+ MTK_LED_AVAILABLE_LEDS_TRANSMIT,
+} mtk_camera_metadata_enum_android_led_available_leds_t;
+
+// MTK_INFO_SUPPORTED_HARDWARE_LEVEL
+typedef enum mtk_camera_metadata_enum_android_info_supported_hardware_level {
+ MTK_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED,
+ MTK_INFO_SUPPORTED_HARDWARE_LEVEL_FULL,
+ MTK_INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY,
+} mtk_camera_metadata_enum_android_info_supported_hardware_level_t;
+
+// MTK_BLACK_LEVEL_LOCK
+typedef enum mtk_camera_metadata_enum_android_black_level_lock {
+ MTK_BLACK_LEVEL_LOCK_OFF,
+ MTK_BLACK_LEVEL_LOCK_ON,
+} mtk_camera_metadata_enum_android_black_level_lock_t;
+
+// MTK_SYNC_FRAME_NUMBER
+typedef enum mtk_camera_metadata_enum_android_sync_frame_number {
+ MTK_SYNC_FRAME_NUMBER_CONVERGING = -1,
+ MTK_SYNC_FRAME_NUMBER_UNKNOWN = -2,
+} mtk_camera_metadata_enum_android_sync_frame_number_t;
+
+// MTK_SYNC_MAX_LATENCY
+typedef enum mtk_camera_metadata_enum_android_sync_max_latency {
+ MTK_SYNC_MAX_LATENCY_PER_FRAME_CONTROL = 0,
+ MTK_SYNC_MAX_LATENCY_UNKNOWN = -1,
+} mtk_camera_metadata_enum_android_sync_max_latency_t;
+
+// MTK_HAL_VERSION
+typedef enum mtk_camera_metadata_num_hal_version {
+ MTK_HAL_VERSION_1_0 = HARDWARE_DEVICE_API_VERSION(1, 0),
+ MTK_HAL_VERSION_3_0 = HARDWARE_DEVICE_API_VERSION(3, 0),
+ MTK_HAL_VERSION_3_1 = HARDWARE_DEVICE_API_VERSION(3, 1),
+ MTK_HAL_VERSION_3_2 = HARDWARE_DEVICE_API_VERSION(3, 2),
+} mtk_camera_metadata_num_hal_version_t;
+
+// MTK GESTURE SHOT FEATURE
+typedef enum mtk_camera_metadata_enum_gesture_shot_mode {
+ MTK_FACE_FEATURE_GESTURE_MODE_OFF = 0,
+ MTK_FACE_FEATURE_GESTURE_MODE_SIMPLE,
+} mtk_camera_metadata_enum_gesture_shot_mode_t;
+
+// MTK SMILE SHOT FEATURE
+typedef enum mtk_camera_metadata_enum_smile_detect_mode {
+ MTK_FACE_FEATURE_SMILE_DETECT_MODE_OFF = 0,
+ MTK_FACE_FEATURE_SMILE_DETECT_MODE_SIMPLE,
+} mtk_camera_metadata_enum_smile_detect_mode_t;
+
+// MTK AUTO SCENE DETECTION FEATURE
+typedef enum mtk_camera_metadata_enum_asd_mode {
+ MTK_FACE_FEATURE_ASD_MODE_OFF = 0,
+ MTK_FACE_FEATURE_ASD_MODE_SIMPLE,
+ MTK_FACE_FEATURE_ASD_MODE_FULL,
+} mtk_camera_metadata_enum_asd_mode_t;
+
+#endif
diff --git a/include/hardware/include/mtkcam/metadata/client/mtk_metadata_tag_info.inl b/include/hardware/include/mtkcam/metadata/client/mtk_metadata_tag_info.inl
new file mode 100755
index 0000000..a2fdb72
--- /dev/null
+++ b/include/hardware/include/mtkcam/metadata/client/mtk_metadata_tag_info.inl
@@ -0,0 +1,591 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+//#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_METADATA_MTK_METADATA_TAG_INFO_INL_
+//#define _MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_METADATA_MTK_METADATA_TAG_INFO_INL_
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+#ifndef _IMP_SECTION_INFO_
+
+ template <mtk_camera_metadata_section section> struct MetadataSectionInfo {};
+
+ #define _IMP_SECTION_INFO_(_section_, _name_) \
+ template <> struct MetadataSectionInfo<_section_> { \
+ enum \
+ { \
+ SECTION_START = _section_##_START, \
+ SECTION_END = _section_##_END, \
+ }; \
+ };
+
+#endif
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+_IMP_SECTION_INFO_(MTK_COLOR_CORRECTION, "mtk.colorCorrection")
+_IMP_SECTION_INFO_(MTK_CONTROL, "mtk.control")
+_IMP_SECTION_INFO_(MTK_DEMOSAIC, "mtk.demosaic")
+_IMP_SECTION_INFO_(MTK_EDGE, "mtk.edge")
+_IMP_SECTION_INFO_(MTK_FLASH, "mtk.flash")
+_IMP_SECTION_INFO_(MTK_FLASH_INFO, "mtk.flash.info")
+_IMP_SECTION_INFO_(MTK_HOT_PIXEL, "mtk.hotPixel")
+_IMP_SECTION_INFO_(MTK_JPEG, "mtk.jpeg")
+_IMP_SECTION_INFO_(MTK_LENS, "mtk.lens")
+_IMP_SECTION_INFO_(MTK_LENS_INFO, "mtk.lens.info")
+_IMP_SECTION_INFO_(MTK_NOISE_REDUCTION, "mtk.noiseReduction")
+_IMP_SECTION_INFO_(MTK_QUIRKS, "mtk.quirks")
+_IMP_SECTION_INFO_(MTK_REQUEST, "mtk.request")
+_IMP_SECTION_INFO_(MTK_SCALER, "mtk.scaler")
+_IMP_SECTION_INFO_(MTK_SENSOR, "mtk.sensor")
+_IMP_SECTION_INFO_(MTK_SENSOR_INFO, "mtk.sensor.info")
+_IMP_SECTION_INFO_(MTK_SHADING, "mtk.shading")
+_IMP_SECTION_INFO_(MTK_STATISTICS, "mtk.statistics")
+_IMP_SECTION_INFO_(MTK_STATISTICS_INFO, "mtk.statistics.info")
+_IMP_SECTION_INFO_(MTK_TONEMAP, "mtk.tonemap")
+_IMP_SECTION_INFO_(MTK_LED, "mtk.led")
+_IMP_SECTION_INFO_(MTK_INFO, "mtk.info")
+_IMP_SECTION_INFO_(MTK_BLACK_LEVEL, "mtk.blacklevel")
+_IMP_SECTION_INFO_(MTK_SYNC, "mtk.sync")
+_IMP_SECTION_INFO_(MTK_IOPIPE_INFO, "mtk.iopipe.info")
+_IMP_SECTION_INFO_(MTK_HAL_INFO, "mtk.hal.info")
+#undef _IMP_SECTION_INFO_
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+_IMP_TAG_INFO_( MTK_COLOR_CORRECTION_MODE,
+ MUINT8, "mode")
+_IMP_TAG_INFO_( MTK_COLOR_CORRECTION_TRANSFORM,
+ MRational, "transform")
+_IMP_TAG_INFO_( MTK_COLOR_CORRECTION_GAINS ,
+ MFLOAT, "gains")
+_IMP_TAG_INFO_( MTK_COLOR_CORRECTION_ABERRATION_MODE,
+ MUINT8, "aberrationMode")
+_IMP_TAG_INFO_( MTK_COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES,
+ MUINT8, "availableAberrationModes")
+//
+_IMP_TAG_INFO_( MTK_CONTROL_AE_ANTIBANDING_MODE,
+ MUINT8, "aeAntibandingMode")
+_IMP_TAG_INFO_( MTK_CONTROL_AE_EXPOSURE_COMPENSATION,
+ MINT32, "aeExposureCompensation")
+_IMP_TAG_INFO_( MTK_CONTROL_AE_LOCK,
+ MUINT8, "aeLock")
+_IMP_TAG_INFO_( MTK_CONTROL_AE_MODE,
+ MUINT8, "aeMode")
+_IMP_TAG_INFO_( MTK_CONTROL_AE_REGIONS,
+ MINT32, "aeRegions")
+_IMP_TAG_INFO_( MTK_CONTROL_AE_TARGET_FPS_RANGE,
+ MINT32, "aeTargetFpsRange")
+_IMP_TAG_INFO_( MTK_CONTROL_AE_PRECAPTURE_TRIGGER,
+ MUINT8, "aePrecaptureTrigger")
+_IMP_TAG_INFO_( MTK_CONTROL_AF_MODE,
+ MUINT8, "afMode")
+_IMP_TAG_INFO_( MTK_CONTROL_AF_REGIONS,
+ MINT32, "afRegions")
+_IMP_TAG_INFO_( MTK_CONTROL_AF_TRIGGER,
+ MUINT8, "afTrigger")
+_IMP_TAG_INFO_( MTK_CONTROL_AWB_LOCK,
+ MUINT8, "awbLock")
+_IMP_TAG_INFO_( MTK_CONTROL_AWB_MODE,
+ MUINT8, "awbMode")
+_IMP_TAG_INFO_( MTK_CONTROL_AWB_REGIONS,
+ MINT32, "awbRegions")
+_IMP_TAG_INFO_( MTK_CONTROL_CAPTURE_INTENT,
+ MUINT8, "captureIntent")
+_IMP_TAG_INFO_( MTK_CONTROL_EFFECT_MODE,
+ MUINT8, "effectMode")
+_IMP_TAG_INFO_( MTK_CONTROL_MODE,
+ MUINT8, "mode")
+_IMP_TAG_INFO_( MTK_CONTROL_SCENE_MODE,
+ MUINT8, "sceneMode")
+_IMP_TAG_INFO_( MTK_CONTROL_VIDEO_STABILIZATION_MODE,
+ MUINT8, "videoStabilizationMode")
+_IMP_TAG_INFO_( MTK_CONTROL_AE_AVAILABLE_ANTIBANDING_MODES,
+ MUINT8, "aeAvailableAntibandingModes")
+_IMP_TAG_INFO_( MTK_CONTROL_AE_AVAILABLE_MODES,
+ MUINT8, "aeAvailableModes")
+_IMP_TAG_INFO_( MTK_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES,
+ MINT32, "aeAvailableTargetFpsRanges")
+_IMP_TAG_INFO_( MTK_CONTROL_AE_COMPENSATION_RANGE,
+ MINT32, "aeCompensationRange")
+_IMP_TAG_INFO_( MTK_CONTROL_AE_COMPENSATION_STEP,
+ MRational, "aeCompensationStep")
+_IMP_TAG_INFO_( MTK_CONTROL_AF_AVAILABLE_MODES,
+ MUINT8, "afAvailableModes")
+_IMP_TAG_INFO_( MTK_CONTROL_AVAILABLE_EFFECTS,
+ MUINT8, "availableEffects")
+_IMP_TAG_INFO_( MTK_CONTROL_AVAILABLE_SCENE_MODES,
+ MUINT8, "availableSceneModes")
+_IMP_TAG_INFO_( MTK_CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES,
+ MUINT8, "availableVideoStabilizationModes")
+_IMP_TAG_INFO_( MTK_CONTROL_AWB_AVAILABLE_MODES,
+ MUINT8, "awbAvailableModes")
+_IMP_TAG_INFO_( MTK_CONTROL_MAX_REGIONS,
+ MINT32, "maxRegions")
+_IMP_TAG_INFO_( MTK_CONTROL_SCENE_MODE_OVERRIDES,
+ MUINT8, "sceneModeOverrides")
+_IMP_TAG_INFO_( MTK_CONTROL_AE_PRECAPTURE_ID,
+ MINT32, "aePrecaptureId")
+_IMP_TAG_INFO_( MTK_CONTROL_AE_STATE,
+ MUINT8, "aeState")
+_IMP_TAG_INFO_( MTK_CONTROL_AF_STATE,
+ MUINT8, "afState")
+_IMP_TAG_INFO_( MTK_CONTROL_AF_TRIGGER_ID,
+ MINT32, "afTriggerId")
+_IMP_TAG_INFO_( MTK_CONTROL_AWB_STATE,
+ MUINT8, "awbState")
+_IMP_TAG_INFO_( MTK_CONTROL_AVAILABLE_HIGH_SPEED_VIDEO_CONFIGURATIONS,
+ MINT32, "vailableHighSpeedVideoConfigurations")
+//
+_IMP_TAG_INFO_( MTK_DEMOSAIC_MODE,
+ MUINT8, "mode")
+//
+_IMP_TAG_INFO_( MTK_EDGE_MODE,
+ MUINT8, "mode")
+_IMP_TAG_INFO_( MTK_EDGE_STRENGTH,
+ MUINT8, "strength")
+_IMP_TAG_INFO_( MTK_EDGE_AVAILABLE_EDGE_MODES,
+ MUINT8, "availableEdgeModes")
+
+//
+_IMP_TAG_INFO_( MTK_FLASH_FIRING_POWER,
+ MUINT8, "firingPower")
+_IMP_TAG_INFO_( MTK_FLASH_FIRING_TIME,
+ MINT64, "firingTime")
+_IMP_TAG_INFO_( MTK_FLASH_MODE,
+ MUINT8, "mode")
+_IMP_TAG_INFO_( MTK_FLASH_COLOR_TEMPERATURE,
+ MUINT8, "colorTemperature")
+_IMP_TAG_INFO_( MTK_FLASH_MAX_ENERGY,
+ MUINT8, "maxEnergy")
+_IMP_TAG_INFO_( MTK_FLASH_STATE,
+ MUINT8, "state")
+//
+_IMP_TAG_INFO_( MTK_FLASH_INFO_AVAILABLE,
+ MUINT8, "available")
+_IMP_TAG_INFO_( MTK_FLASH_INFO_CHARGE_DURATION,
+ MINT64, "chargeDuration")
+
+//
+_IMP_TAG_INFO_( MTK_HOT_PIXEL_MODE,
+ MUINT8, "mode")
+_IMP_TAG_INFO_( MTK_HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES,
+ MUINT8, "availableHotPixelModes")
+//
+
+//
+_IMP_TAG_INFO_( MTK_JPEG_GPS_COORDINATES,
+ MDOUBLE, "gpsCoordinates")
+_IMP_TAG_INFO_( MTK_JPEG_GPS_PROCESSING_METHOD,
+ MUINT8, "gpsProcessingMethod")
+_IMP_TAG_INFO_( MTK_JPEG_GPS_TIMESTAMP,
+ MINT64, "gpsTimestamp")
+_IMP_TAG_INFO_( MTK_JPEG_ORIENTATION,
+ MINT32, "orientation")
+_IMP_TAG_INFO_( MTK_JPEG_QUALITY,
+ MUINT8, "quality")
+_IMP_TAG_INFO_( MTK_JPEG_THUMBNAIL_QUALITY,
+ MUINT8, "thumbnailQuality")
+_IMP_TAG_INFO_( MTK_JPEG_THUMBNAIL_SIZE,
+ MSize, "thumbnailSize")
+_IMP_TAG_INFO_( MTK_JPEG_AVAILABLE_THUMBNAIL_SIZES,
+ MSize, "availableThumbnailSizes")
+_IMP_TAG_INFO_( MTK_JPEG_MAX_SIZE,
+ MINT32, "maxSize")
+_IMP_TAG_INFO_( MTK_JPEG_SIZE,
+ MSize, "size")
+//
+_IMP_TAG_INFO_( MTK_LENS_APERTURE,
+ MFLOAT, "aperture")
+_IMP_TAG_INFO_( MTK_LENS_FILTER_DENSITY,
+ MFLOAT, "filterDensity")
+_IMP_TAG_INFO_( MTK_LENS_FOCAL_LENGTH,
+ MFLOAT, "focalLength")
+_IMP_TAG_INFO_( MTK_LENS_FOCUS_DISTANCE,
+ MFLOAT, "focusDistance")
+_IMP_TAG_INFO_( MTK_LENS_OPTICAL_STABILIZATION_MODE,
+ MUINT8, "opticalStabilizationMode")
+_IMP_TAG_INFO_( MTK_LENS_OPTICAL_AXIS_ANGLE,
+ MFLOAT, "opticalAxisAngle")
+_IMP_TAG_INFO_( MTK_LENS_POSITION,
+ MFLOAT, "position")
+_IMP_TAG_INFO_( MTK_LENS_FOCUS_RANGE,
+ MFLOAT, "focusRange")
+_IMP_TAG_INFO_( MTK_LENS_STATE,
+ MUINT8, "state")
+//
+_IMP_TAG_INFO_( MTK_LENS_INFO_AVAILABLE_APERTURES,
+ MFLOAT, "availableApertures")
+_IMP_TAG_INFO_( MTK_LENS_INFO_AVAILABLE_FILTER_DENSITIES,
+ MFLOAT, "availableFilterDensities")
+_IMP_TAG_INFO_( MTK_LENS_INFO_AVAILABLE_FOCAL_LENGTHS,
+ MFLOAT, "availableFocalLengths")
+_IMP_TAG_INFO_( MTK_LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION,
+ MUINT8, "availableOpticalStabilization")
+_IMP_TAG_INFO_( MTK_LENS_INFO_HYPERFOCAL_DISTANCE,
+ MFLOAT, "hyperfocalDistance")
+_IMP_TAG_INFO_( MTK_LENS_INFO_MINIMUM_FOCUS_DISTANCE,
+ MFLOAT, "minimumFocusDistance")
+_IMP_TAG_INFO_( MTK_LENS_INFO_SHADING_MAP_SIZE,
+ MSize, "shadingMapSize")
+_IMP_TAG_INFO_( MTK_LENS_INFO_FOCUS_DISTANCE_CALIBRATION,
+ MUINT8, "focusDistanceCalibration")
+//
+_IMP_TAG_INFO_( MTK_NOISE_REDUCTION_MODE,
+ MUINT8, "mode")
+_IMP_TAG_INFO_( MTK_NOISE_REDUCTION_STRENGTH,
+ MUINT8, "strength")
+_IMP_TAG_INFO_( MTK_NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES,
+ MUINT8, "availableNoiseReductionModes")
+
+//
+_IMP_TAG_INFO_( MTK_QUIRKS_METERING_CROP_REGION,
+ MRect, "meteringCropRegion")
+_IMP_TAG_INFO_( MTK_QUIRKS_TRIGGER_AF_WITH_AUTO,
+ MUINT8, "triggerAfWithAuto")
+_IMP_TAG_INFO_( MTK_QUIRKS_USE_ZSL_FORMAT,
+ MUINT8, "useZslFormat")
+_IMP_TAG_INFO_( MTK_QUIRKS_USE_PARTIAL_RESULT,
+ MUINT8, "usePartialResult")
+_IMP_TAG_INFO_( MTK_QUIRKS_PARTIAL_RESULT,
+ MUINT8, "partialResult")
+//
+_IMP_TAG_INFO_( MTK_REQUEST_FRAME_COUNT,
+ MINT32, "frameCount")
+_IMP_TAG_INFO_( MTK_REQUEST_ID,
+ MINT32, "id")
+_IMP_TAG_INFO_( MTK_REQUEST_INPUT_STREAMS,
+ MINT32, "inputStreams")
+_IMP_TAG_INFO_( MTK_REQUEST_METADATA_MODE,
+ MUINT8, "metadataMode")
+_IMP_TAG_INFO_( MTK_REQUEST_OUTPUT_STREAMS,
+ MINT32, "outputStreams")
+_IMP_TAG_INFO_( MTK_REQUEST_TYPE,
+ MUINT8, "type")
+_IMP_TAG_INFO_( MTK_REQUEST_MAX_NUM_OUTPUT_STREAMS,
+ MINT32, "maxNumOutputStreams")
+_IMP_TAG_INFO_( MTK_REQUEST_MAX_NUM_REPROCESS_STREAMS,
+ MINT32, "maxNumReprocessStreams")
+_IMP_TAG_INFO_( MTK_REQUEST_MAX_NUM_INPUT_STREAMS,
+ MINT32, "maxNumInputStreams")
+_IMP_TAG_INFO_( MTK_REQUEST_PIPELINE_DEPTH,
+ MUINT8, "pipelineDepth")
+_IMP_TAG_INFO_( MTK_REQUEST_PIPELINE_MAX_DEPTH,
+ MUINT8, "pipelineMaxDepth")
+_IMP_TAG_INFO_( MTK_REQUEST_PARTIAL_RESULT_COUNT,
+ MINT32, "partialResultCount")
+_IMP_TAG_INFO_( MTK_REQUEST_AVAILABLE_CAPABILITIES,
+ MUINT8, "availableCapabilities")
+_IMP_TAG_INFO_( MTK_REQUEST_AVAILABLE_REQUEST_KEYS,
+ MINT32, "availableRequestKeys")
+_IMP_TAG_INFO_( MTK_REQUEST_AVAILABLE_RESULT_KEYS,
+ MINT32, "availableResultKeys")
+_IMP_TAG_INFO_( MTK_REQUEST_AVAILABLE_CHARACTERISTICS_KEYS,
+ MINT32, "availableCharacteristicsKeys")
+//
+_IMP_TAG_INFO_( MTK_SCALER_CROP_REGION,
+ MRect, "cropRegion")
+_IMP_TAG_INFO_( MTK_SCALER_AVAILABLE_FORMATS,
+ MINT32, "availableFormats")
+_IMP_TAG_INFO_( MTK_SCALER_AVAILABLE_JPEG_MIN_DURATIONS,
+ MINT64, "availableJpegMinDurations")
+_IMP_TAG_INFO_( MTK_SCALER_AVAILABLE_JPEG_SIZES,
+ MSize, "availableJpegSizes")
+_IMP_TAG_INFO_( MTK_SCALER_AVAILABLE_MAX_DIGITAL_ZOOM,
+ MFLOAT, "availableMaxDigitalZoom")
+_IMP_TAG_INFO_( MTK_SCALER_AVAILABLE_PROCESSED_MIN_DURATIONS,
+ MINT64, "availableProcessedMinDurations")
+_IMP_TAG_INFO_( MTK_SCALER_AVAILABLE_PROCESSED_SIZES,
+ MSize, "availableProcessedSizes")
+_IMP_TAG_INFO_( MTK_SCALER_AVAILABLE_RAW_MIN_DURATIONS,
+ MINT64, "availableRawMinDurations")
+_IMP_TAG_INFO_( MTK_SCALER_AVAILABLE_RAW_SIZES,
+ MSize, "availableRawSizes")
+_IMP_TAG_INFO_( MTK_SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP,
+ MINT32, "availableInputOutputFormatsMap")
+_IMP_TAG_INFO_( MTK_SCALER_AVAILABLE_STREAM_CONFIGURATIONS,
+ MINT32, "availableStreamConfigurations")
+_IMP_TAG_INFO_( MTK_SCALER_AVAILABLE_MIN_FRAME_DURATIONS,
+ MINT64, "availableMinFrameDurations")
+_IMP_TAG_INFO_( MTK_SCALER_AVAILABLE_STALL_DURATIONS,
+ MINT64, "availableStallDurations")
+_IMP_TAG_INFO_( MTK_SCALER_CROPPING_TYPE,
+ MUINT8, "croppingType")
+
+
+//
+_IMP_TAG_INFO_( MTK_IOPIPE_INFO_AVAILABLE_IN_PORT_INFO,
+ IMetadata, "availableInPortInfo")
+_IMP_TAG_INFO_( MTK_IOPIPE_INFO_AVAILABLE_OUT_PORT_INFO,
+ IMetadata, "availableOutPortInfo")
+_IMP_TAG_INFO_( MTK_IOPIPE_INFO_PORT_ID,
+ MINT32, "portId")
+_IMP_TAG_INFO_( MTK_IOPIPE_INFO_TRANSFORM,
+ MINT32, "transform")
+_IMP_TAG_INFO_( MTK_IOPIPE_INFO_CROP,
+ MINT32, "crop")
+_IMP_TAG_INFO_( MTK_IOPIPE_INFO_SCALE_DOWN_RATIO,
+ MFLOAT, "scale_down")
+_IMP_TAG_INFO_( MTK_IOPIPE_INFO_SCALE_UP_RATIO,
+ MFLOAT, "scale_up")
+_IMP_TAG_INFO_( MTK_IOPIPE_INFO_LINEBUFFER,
+ MINT32, "linebuffer")
+_IMP_TAG_INFO_( MTK_IOPIPE_INFO_AVAILABLE_FORMATS,
+ MINT32, "availableFormats")
+//
+_IMP_TAG_INFO_( MTK_SENSOR_EXPOSURE_TIME,
+ MINT64, "exposureTime")
+_IMP_TAG_INFO_( MTK_SENSOR_FRAME_DURATION,
+ MINT64, "frameDuration")
+_IMP_TAG_INFO_( MTK_SENSOR_SENSITIVITY,
+ MINT32, "sensitivity")
+_IMP_TAG_INFO_( MTK_SENSOR_REFERENCE_ILLUMINANT1,
+ MUINT8, "referenceIlluminant1")
+_IMP_TAG_INFO_( MTK_SENSOR_REFERENCE_ILLUMINANT2,
+ MUINT8, "referenceIlluminant2")
+_IMP_TAG_INFO_( MTK_SENSOR_CALIBRATION_TRANSFORM1,
+ MRational, "calibrationTransform1")
+_IMP_TAG_INFO_( MTK_SENSOR_CALIBRATION_TRANSFORM2,
+ MRational, "calibrationTransform2")
+_IMP_TAG_INFO_( MTK_SENSOR_COLOR_TRANSFORM1,
+ MRational, "colorTransform1")
+_IMP_TAG_INFO_( MTK_SENSOR_COLOR_TRANSFORM2,
+ MRational, "colorTransform2")
+_IMP_TAG_INFO_( MTK_SENSOR_FORWARD_MATRIX1,
+ MRational, "forwardMatrix1")
+_IMP_TAG_INFO_( MTK_SENSOR_FORWARD_MATRIX2,
+ MRational, "forwardMatrix2")
+_IMP_TAG_INFO_( MTK_SENSOR_BASE_GAIN_FACTOR,
+ MRational, "baseGainFactor")
+_IMP_TAG_INFO_( MTK_SENSOR_BLACK_LEVEL_PATTERN,
+ MINT32, "blackLevelPattern")
+_IMP_TAG_INFO_( MTK_SENSOR_MAX_ANALOG_SENSITIVITY,
+ MINT32, "maxAnalogSensitivity")
+_IMP_TAG_INFO_( MTK_SENSOR_ORIENTATION,
+ MINT32, "orientation")
+_IMP_TAG_INFO_( MTK_SENSOR_PROFILE_HUE_SAT_MAP_DIMENSIONS,
+ MINT32, "profileHueSatMapDimensions")
+_IMP_TAG_INFO_( MTK_SENSOR_TIMESTAMP,
+ MINT64, "timestamp")
+_IMP_TAG_INFO_( MTK_SENSOR_TEMPERATURE ,
+ MFLOAT, "temperature")
+
+_IMP_TAG_INFO_( MTK_SENSOR_NEUTRAL_COLOR_POINT,
+ MRational, "neutralColorPoint")
+_IMP_TAG_INFO_( MTK_SENSOR_NOISE_PROFILE,
+ MDOUBLE, "noiseProfile")
+_IMP_TAG_INFO_( MTK_SENSOR_PROFILE_HUE_SAT_MAP,
+ MFLOAT, "profileHueSatMap")
+_IMP_TAG_INFO_( MTK_SENSOR_PROFILE_TONE_CURVE,
+ MFLOAT, "profileToneCurve")
+_IMP_TAG_INFO_( MTK_SENSOR_GREEN_SPLIT,
+ MFLOAT, "greenSplit")
+_IMP_TAG_INFO_( MTK_SENSOR_TEST_PATTERN_DATA,
+ MINT32, "testPatternData")
+_IMP_TAG_INFO_( MTK_SENSOR_TEST_PATTERN_MODE,
+ MINT32, "testPatternMode")
+_IMP_TAG_INFO_( MTK_SENSOR_AVAILABLE_TEST_PATTERN_MODES,
+ MINT32, "availableTestPatternModes")
+_IMP_TAG_INFO_( MTK_SENSOR_ROLLING_SHUTTER_SKEW,
+ MINT64, "rollingShutterSkew")
+
+//
+_IMP_TAG_INFO_( MTK_SENSOR_INFO_ACTIVE_ARRAY_REGION,
+ MRect, "activeArrayRegion")
+_IMP_TAG_INFO_( MTK_SENSOR_INFO_SENSITIVITY_RANGE,
+ MINT32, "sensitivityRange")
+_IMP_TAG_INFO_( MTK_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT,
+ MUINT8, "colorFilterArrangement")
+_IMP_TAG_INFO_( MTK_SENSOR_INFO_EXPOSURE_TIME_RANGE,
+ MINT64, "exposureTimeRange")
+_IMP_TAG_INFO_( MTK_SENSOR_INFO_MAX_FRAME_DURATION,
+ MINT64, "maxFrameDuration")
+_IMP_TAG_INFO_( MTK_SENSOR_INFO_PHYSICAL_SIZE,
+ MFLOAT, "physicalSize")
+_IMP_TAG_INFO_( MTK_SENSOR_INFO_PIXEL_ARRAY_SIZE,
+ MSize, "pixelArraySize")
+_IMP_TAG_INFO_( MTK_SENSOR_INFO_WHITE_LEVEL,
+ MINT32, "whiteLevel")
+_IMP_TAG_INFO_( MTK_SENSOR_INFO_TIMESTAMP_SOURCE,
+ MUINT8, "timestampSource")
+_IMP_TAG_INFO_( MTK_SENSOR_INFO_ORIENTATION,
+ MINT32, "orientation")
+_IMP_TAG_INFO_( MTK_SENSOR_INFO_FACING,
+ MUINT8, "facing")
+_IMP_TAG_INFO_( MTK_SENSOR_INFO_PACKAGE,
+ IMetadata, "package")
+_IMP_TAG_INFO_( MTK_SENSOR_INFO_DEV,
+ MINT32, "sensorDev")
+_IMP_TAG_INFO_( MTK_SENSOR_INFO_SCENARIO_ID,
+ MINT32, "scenarioID")
+_IMP_TAG_INFO_( MTK_SENSOR_INFO_FRAME_RATE,
+ MINT32, "frameRate")
+_IMP_TAG_INFO_( MTK_SENSOR_INFO_REAL_OUTPUT_SIZE,
+ MSize, "realOutputSize")
+_IMP_TAG_INFO_( MTK_SENSOR_INFO_OUTPUT_REGION_ON_ACTIVE_ARRAY,
+ MRect, "outputRegionOnActiveArray")
+_IMP_TAG_INFO_( MTK_SENSOR_INFO_WANTED_ORIENTATION,
+ MINT32, "wantedOrientation")
+//
+_IMP_TAG_INFO_( MTK_SHADING_MODE,
+ MUINT8, "mode")
+_IMP_TAG_INFO_( MTK_SHADING_STRENGTH,
+ MUINT8, "strength")
+//
+_IMP_TAG_INFO_( MTK_STATISTICS_FACE_DETECT_MODE,
+ MUINT8, "faceDetectMode")
+_IMP_TAG_INFO_( MTK_STATISTICS_HISTOGRAM_MODE,
+ MUINT8, "histogramMode")
+_IMP_TAG_INFO_( MTK_STATISTICS_SHARPNESS_MAP_MODE,
+ MUINT8, "sharpnessMapMode")
+_IMP_TAG_INFO_( MTK_STATISTICS_HOT_PIXEL_MAP_MODE,
+ MUINT8, "hotPixelMapMode")
+_IMP_TAG_INFO_( MTK_STATISTICS_FACE_IDS,
+ MINT32, "faceIds")
+_IMP_TAG_INFO_( MTK_STATISTICS_FACE_LANDMARKS,
+ MINT32, "faceLandmarks")
+_IMP_TAG_INFO_( MTK_STATISTICS_FACE_RECTANGLES,
+ MRect, "faceRectangles")
+_IMP_TAG_INFO_( MTK_STATISTICS_FACE_SCORES,
+ MUINT8, "faceScores")
+_IMP_TAG_INFO_( MTK_STATISTICS_HISTOGRAM,
+ MINT32, "histogram")
+_IMP_TAG_INFO_( MTK_STATISTICS_SHARPNESS_MAP,
+ MINT32, "sharpnessMap")
+_IMP_TAG_INFO_( MTK_STATISTICS_LENS_SHADING_CORRECTION_MAP,
+ MUINT8, "lensShadingCorrectionMap")
+//
+_IMP_TAG_INFO_( MTK_STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES,
+ MUINT8, "availableFaceDetectModes")
+_IMP_TAG_INFO_( MTK_STATISTICS_INFO_HISTOGRAM_BUCKET_COUNT,
+ MINT32, "histogramBucketCount")
+_IMP_TAG_INFO_( MTK_STATISTICS_INFO_MAX_FACE_COUNT,
+ MINT32, "maxFaceCount")
+_IMP_TAG_INFO_( MTK_STATISTICS_INFO_MAX_HISTOGRAM_COUNT,
+ MINT32, "maxHistogramCount")
+_IMP_TAG_INFO_( MTK_STATISTICS_INFO_MAX_SHARPNESS_MAP_VALUE,
+ MINT32, "maxSharpnessMapValue")
+_IMP_TAG_INFO_( MTK_STATISTICS_INFO_SHARPNESS_MAP_SIZE,
+ MSize, "sharpnessMapSize")
+_IMP_TAG_INFO_( MTK_STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES,
+ MUINT8, "availableHotPixelMapModes")
+_IMP_TAG_INFO_( MTK_STATISTICS_LENS_SHADING_MAP,
+ MFLOAT, "lensShadingMap")
+_IMP_TAG_INFO_( MTK_STATISTICS_PREDICTED_COLOR_GAINS,
+ MFLOAT, "predictedColorGains")
+_IMP_TAG_INFO_( MTK_STATISTICS_PREDICTED_COLOR_TRANSFORM,
+ MRational, "predictedColorTransform")
+_IMP_TAG_INFO_( MTK_STATISTICS_SCENE_FLICKER,
+ MUINT8, "sceneFlicker")
+_IMP_TAG_INFO_( MTK_STATISTICS_HOT_PIXEL_MAP,
+ MINT32, "hotPixelMap")
+_IMP_TAG_INFO_( MTK_STATISTICS_LENS_SHADING_MAP_MODE,
+ MUINT8, "lensShadingMapMode")
+//
+_IMP_TAG_INFO_( MTK_TONEMAP_CURVE_BLUE,
+ MFLOAT, "curveBlue")
+_IMP_TAG_INFO_( MTK_TONEMAP_CURVE_GREEN,
+ MFLOAT, "curveGreen")
+_IMP_TAG_INFO_( MTK_TONEMAP_CURVE_RED,
+ MFLOAT, "curveRed")
+_IMP_TAG_INFO_( MTK_TONEMAP_MODE,
+ MUINT8, "mode")
+_IMP_TAG_INFO_( MTK_TONEMAP_MAX_CURVE_POINTS,
+ MINT32, "maxCurvePoints")
+_IMP_TAG_INFO_( MTK_TONEMAP_AVAILABLE_TONE_MAP_MODES,
+ MUINT8, "availableToneMapModes")
+//
+_IMP_TAG_INFO_( MTK_LED_TRANSMIT,
+ MUINT8, "transmit")
+_IMP_TAG_INFO_( MTK_LED_AVAILABLE_LEDS,
+ MUINT8, "availableLeds")
+//
+_IMP_TAG_INFO_( MTK_INFO_SUPPORTED_HARDWARE_LEVEL,
+ MUINT8, "supportedHardwareLevel")
+//
+_IMP_TAG_INFO_( MTK_BLACK_LEVEL_LOCK,
+ MUINT8, "lock")
+//
+_IMP_TAG_INFO_( MTK_SYNC_FRAME_NUMBER,
+ MINT64, "frameNumber")
+_IMP_TAG_INFO_( MTK_SYNC_MAX_LATENCY,
+ MINT32, "maxLatency")
+//
+_IMP_TAG_INFO_( MTK_HAL_VERSION,
+ MINT32, "version")
+
+// MTK vendor tag info
+_IMP_TAG_INFO_( MTK_FACE_FEATURE_GESTURE_MODE,
+ MINT32, "gesturemode")
+
+_IMP_TAG_INFO_( MTK_FACE_FEATURE_GESTURE_RESULT,
+ MINT32, "gestureresult")
+
+_IMP_TAG_INFO_( MTK_FACE_FEATURE_SMILE_DETECT_MODE,
+ MINT32, "smiledetectmode")
+
+_IMP_TAG_INFO_( MTK_FACE_FEATURE_SMILE_DETECT_RESULT,
+ MINT32, "smiledetectresult")
+
+_IMP_TAG_INFO_( MTK_FACE_FEATURE_ASD_MODE,
+ MINT32, "asdmode")
+
+_IMP_TAG_INFO_( MTK_FACE_FEATURE_ASD_RESULT,
+ MINT32, "asdresult")
+
+_IMP_TAG_INFO_( MTK_FACE_FEATURE_AVAILABLE_GESTURE_MODES,
+ MINT32, "availablegesturemodes")
+
+_IMP_TAG_INFO_( MTK_FACE_FEATURE_AVAILABLE_SMILE_DETECT_MODES,
+ MINT32, "availablesmiledetectmodes")
+
+_IMP_TAG_INFO_( MTK_FACE_FEATURE_AVAILABLE_ASD_MODES,
+ MINT32, "availableasdmodes")
+
+#undef _IMP_TAG_INFO_
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+//#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_METADATA_MTK_METADATA_TAG_INFO_INL_
diff --git a/include/hardware/include/mtkcam/metadata/mtk_metadata_types.h b/include/hardware/include/mtkcam/metadata/mtk_metadata_types.h
new file mode 100644
index 0000000..e4eb566
--- /dev/null
+++ b/include/hardware/include/mtkcam/metadata/mtk_metadata_types.h
@@ -0,0 +1,82 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+#include <mtkcam/common.h>
+#include <mtkcam/utils/common.h>
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+
+/******************************************************************************
+ * Type Info Utility
+ ******************************************************************************/
+enum MTK_TYPE_ENUM {
+ TYPE_UNKNOWN = -1,
+ TYPE_MUINT8, //= TYPE_BYTE, // Unsigned 8-bit integer (uint8_t)
+ TYPE_MINT32, //= TYPE_INT32, // Signed 32-bit integer (int32_t)
+ TYPE_MFLOAT,// = TYPE_FLOAT, // 32-bit float (float)
+ TYPE_MINT64,// = TYPE_INT64, // Signed 64-bit integer (int64_t)
+ TYPE_MDOUBLE,// = TYPE_DOUBLE, // 64-bit float (double)
+ TYPE_MRational, //= TYPE_RATIONAL,// A 64-bit fraction (camera_metadata_rational_t)
+ // -- MTK -- //
+ TYPE_MPoint,
+ TYPE_MSize,
+ TYPE_MRect,
+ TYPE_IMetadata,
+ TYPE_Memory,
+ NUM_MTYPES // Number of type fields
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+template <typename _T> struct Type2TypeEnum{};
+template <> struct Type2TypeEnum<MUINT8 >{ enum { typeEnum = TYPE_MUINT8 }; };
+template <> struct Type2TypeEnum<MINT32 >{ enum { typeEnum = TYPE_MINT32 }; };
+template <> struct Type2TypeEnum<MFLOAT >{ enum { typeEnum = TYPE_MFLOAT }; };
+template <> struct Type2TypeEnum<MINT64 >{ enum { typeEnum = TYPE_MINT64 }; };
+template <> struct Type2TypeEnum<MDOUBLE >{ enum { typeEnum = TYPE_MDOUBLE }; };
+template <> struct Type2TypeEnum<MRational>{ enum { typeEnum = TYPE_MRational };};
+template <> struct Type2TypeEnum<MPoint >{ enum { typeEnum = TYPE_MPoint }; };
+template <> struct Type2TypeEnum<MSize >{ enum { typeEnum = TYPE_MSize }; };
+template <> struct Type2TypeEnum<MRect >{ enum { typeEnum = TYPE_MRect }; };
+template <> struct Type2TypeEnum<IMetadata>{ enum { typeEnum = TYPE_IMetadata };};
+template <> struct Type2TypeEnum<IMetadata::Memory>{ enum { typeEnum = TYPE_Memory };};
+
+};
+
diff --git a/include/hardware/include/mtkcam/mmp/Profile.h b/include/hardware/include/mtkcam/mmp/Profile.h
new file mode 100644
index 0000000..ea11987
--- /dev/null
+++ b/include/hardware/include/mtkcam/mmp/Profile.h
@@ -0,0 +1,65 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_HWUTILS_PROFILE_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_HWUTILS_PROFILE_H_
+
+#include <mtkcam/mmp/mmp.h>
+
+#define EVENT_CAMERA_COMMON_COMMON (EVENT_CAMERA_COMMON | 0x00000000)
+#define EVENT_CAMERA_COMMON_V1 (EVENT_CAMERA_COMMON | 0x01000000)
+#define EVENT_CAMERA_COMMON_V3 (EVENT_CAMERA_COMMON | 0x03000000)
+
+//#include "Profile_common.h"
+//#include "Profile_v1.h"
+
+/******************************************************************************
+ * Camera Profiling Tool
+ ******************************************************************************/
+namespace CPTool
+{
+
+
+bool initCommonProfile();
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; // namespace CPTool
+#endif
+
diff --git a/include/hardware/include/mtkcam/mmp/mmp.h b/include/hardware/include/mtkcam/mmp/mmp.h
new file mode 100644
index 0000000..88f8f4a
--- /dev/null
+++ b/include/hardware/include/mtkcam/mmp/mmp.h
@@ -0,0 +1,259 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_MMP_MMP_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_MMP_MMP_H_
+
+
+////////////////////////////////////////////////////////////////////////////////
+/**
+ * @file MMP.h
+ * @brief This file is for the camera hal profile using mmp tool.
+ * @detail
+ */
+
+
+/******************************************************************************
+ * Camera Profiling Tool
+ ******************************************************************************/
+namespace CPTool
+{
+
+
+#define EVENT_CAMERA_ROOT 0x00000000
+#define EVENT_CAMERA_FRAMEWORK 0x10000000
+#define EVENT_CAMERA_COMMON 0x20000000
+#define EVENT_CAMERA_PLATFORM 0x30000000
+
+
+/**
+ * @brief Camera profile Event Info
+ */
+typedef struct
+{
+ unsigned int event; /// Log event
+ unsigned int parent; /// Log event's parent
+ const char* name; /// Log event's name
+}CPT_Event_Info;
+
+
+/**
+ * @brief Camera profile log type enum
+ */
+typedef enum
+{
+ CPTFlagStart = 0, /// Log Start
+ CPTFlagEnd, /// Log End
+ CPTFlagPulse, /// Log pulse
+ CPTFlagSeparator, /// Log Separator
+ CPTFlagMax /// Log Flag Max
+}CPT_LogType;
+
+
+/**
+ * @brief Automatically Profiling Logging
+ * @details
+ * The is used for automatically profiling logging.
+ *
+ */
+class AutoCPTLog
+{
+protected:
+ unsigned int mEvent; /// camera profile event
+ unsigned int mData1; /// data1
+ unsigned int mData2;
+
+public:
+ AutoCPTLog(unsigned int event, unsigned int data1 = 0, unsigned int data2 = 0);
+ virtual ~AutoCPTLog();
+};
+
+
+//#if defined(MTK_MMPROFILE_SUPPORT)
+#if 0
+
+ /**
+ * @brief register camera profile event in mmp profile tool
+ *
+ * @details
+ *
+ * @note
+ *
+ * @param[in] event: The camera profile event
+ *
+ * @param[in] enable: enable or disable
+ *
+ * @return
+ * - MTRUE indicates success.
+ * - MFALSE indicates failure
+ *
+ */
+ bool CPTRegisterEvents(const CPT_Event_Info *pCPTEventInfo, const unsigned int u4EventCnt);
+
+ /**
+ * @brief enable camera profile event in mmp profile tool
+ *
+ * @details
+ *
+ * @note
+ *
+ * @param[in] event: The camera profile event
+ *
+ * @param[in] enable: enable or disable
+ *
+ * @return
+ * - MTRUE indicates success.
+ * - MFALSE indicates failure
+ *
+ */
+ bool CPTEnableEvent(unsigned int event, bool enable);
+
+ /**
+ * @brief camera profile log
+ *
+ * @details
+ *
+ * @note
+ *
+ * @param[in] event: The camera profile event
+ *
+ * @param[in] type: The camera profile log type
+ *
+ * @return
+ * - MTRUE indicates success.
+ * - MFALSE indicates failure
+ *
+ */
+ bool CPTLog(unsigned int event, CPT_LogType type);
+
+ /**
+ * @brief camera profile log w/ extend parameter
+ *
+ * @details
+ *
+ * @note
+ *
+ * @param[in] event: The camera profile event
+ *
+ * @param[in] type: The camera profile log type
+ *
+ * @param[in] data1: The extend parameter 1
+ *
+ * @param[in] data2: The extend parameter 2
+ *
+ * @return
+ * - MTRUE indicates success.
+ * - MFALSE indicates failure
+ *
+ */
+ bool CPTLogEx(unsigned int event, CPT_LogType type, unsigned int data1, unsigned int data2);
+
+ /**
+ * @brief camera profile log w/ extend string parameter
+ *
+ * @details
+ *
+ * @note
+ *
+ * @param[in] event: The camera profile event
+ *
+ * @param[in] type: The camera profile log type
+ *
+ * @param[in] str: The extend string parameter
+ *
+ * @return
+ * - MTRUE indicates success.
+ * - MFALSE indicates failure
+ *
+ */
+ bool CPTLogStr(unsigned int event, CPT_LogType type, const char* str);
+
+ /**
+ * @brief camera profile log w/ extend parameter
+ *
+ * @details
+ *
+ * @note
+ *
+ * @param[in] event: The camera profile event
+ *
+ * @param[in] type: The camera profile log type
+ *
+ * @param[in] data1: The extend parameter 1
+ *
+ * @param[in] data2: The extend parameter 2
+ *
+ * @param[in] str: The extend string parameter
+ *
+ * @return
+ * - MTRUE indicates success.
+ * - MFALSE indicates failure
+ *
+ */
+ bool CPTLogStrEx(unsigned int event, CPT_LogType type, unsigned int data1, unsigned int data2, const char* str);
+
+#else //MTK_MMPROFILE_SUPPORT
+
+ inline AutoCPTLog::AutoCPTLog(unsigned int event, unsigned int data1, unsigned int data2) {}
+ inline AutoCPTLog::~AutoCPTLog() {}
+
+ inline bool CPTRegisterEvents(const CPT_Event_Info *pCPTEventInfo, const unsigned int u4EventCnt)
+ { return true; }
+
+ inline bool CPTEnableEvent(unsigned int event, bool enable)
+ { return true; }
+
+ inline bool CPTLog(unsigned int event, CPT_LogType type)
+ { return true; }
+
+ inline bool CPTLogEx(unsigned int event, CPT_LogType type, unsigned int data1, unsigned int data2)
+ { return true; }
+
+ inline bool CPTLogStr(unsigned int event, CPT_LogType type, const char* str)
+ { return true; }
+
+ inline bool CPTLogStrEx(unsigned int event, CPT_LogType type, unsigned int data1, unsigned int data2, const char* str)
+ { return true; }
+
+#endif //MTK_MMPROFILE_SUPPORT
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; // namespace CPTool
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_MMP_MMP_H_
+
diff --git a/include/hardware/include/mtkcam/utils/CpuCtrl.h b/include/hardware/include/mtkcam/utils/CpuCtrl.h
new file mode 100644
index 0000000..0ff5dd1
--- /dev/null
+++ b/include/hardware/include/mtkcam/utils/CpuCtrl.h
@@ -0,0 +1,28 @@
+#ifndef CPU_CTRL_H
+#define CPU_CTRL_H
+//-----------------------------------------------------------------------------
+class CpuCtrl
+{
+ protected:
+ virtual ~CpuCtrl() {};
+ //
+ public:
+ typedef struct
+ {
+ MINT bigCore;
+ MINT bigFreq;
+ MINT littleCore;
+ MINT littleFreq;
+ MINT timeout;
+ }CPU_CTRL_INFO;
+ //
+ static CpuCtrl* createInstance(void);
+ virtual MVOID destroyInstance(void) = 0;
+ virtual MBOOL init(void) = 0;
+ virtual MBOOL uninit(void) = 0;
+ virtual MBOOL enable(CPU_CTRL_INFO &cpuInfo) = 0;
+ virtual MBOOL disable(void) = 0;
+};
+//-----------------------------------------------------------------------------
+#endif
+
diff --git a/include/hardware/include/mtkcam/utils/Format.h b/include/hardware/include/mtkcam/utils/Format.h
new file mode 100644
index 0000000..6497a82
--- /dev/null
+++ b/include/hardware/include/mtkcam/utils/Format.h
@@ -0,0 +1,191 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_FORMAT_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_FORMAT_H_
+//
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+namespace Utils {
+namespace Format {
+
+bool
+checkValidFormat(
+ int const imageFormat
+);
+
+/*****************************************************************************
+ * @brief Query the plane count.
+ *
+ * @details Given a format of type EImageFormat, return its corresponding
+ * plane count.
+ *
+ * @note
+ *
+ * @param[in] imageFormat: A format of type EImageFormat.
+ *
+ * @return its corresponding plane count.
+ *
+ ******************************************************************************/
+size_t
+queryPlaneCount(
+ int const imageFormat
+);
+
+
+/*****************************************************************************
+ * @brief Query the width in pixels of a specific plane.
+ *
+ * @details Given a format of type EImageFormat, a plane index, and the width in
+ * in pixels of the 0-th plane, return the width in pixels of the given plane.
+ *
+ * @note
+ *
+ * @param[in] imageFormat: A format of type EImageFormat.
+ * @param[in] planeIndex: a specific plane index.
+ * @param[in] widthInPixels: the width in pixels of the 0-th plane.
+ *
+ * @return the width in pixels of the given plane.
+ *
+ ******************************************************************************/
+size_t
+queryPlaneWidthInPixels(
+ int const imageFormat,
+ size_t planeIndex,
+ size_t widthInPixels
+);
+
+
+/*****************************************************************************
+ * @brief Query the height in pixels of a specific plane.
+ *
+ * @details Given a format of type EImageFormat, a plane index, and the height
+ * in pixels of the 0-th plane, return the height in pixels of the given plane.
+ *
+ * @note
+ *
+ * @param[in] imageFormat: A format of type EImageFormat.
+ * @param[in] planeIndex: a specific plane index.
+ * @param[in] heightInPixels: the height in pixels of the 0-th plane.
+ *
+ * @return the height in pixels of the given plane.
+ *
+ ******************************************************************************/
+size_t
+queryPlaneHeightInPixels(
+ int const imageFormat,
+ size_t planeIndex,
+ size_t heightInPixels
+);
+
+
+/*****************************************************************************
+ * @brief Query the bits per pixel of a specific plane.
+ *
+ * @details Given a format of type EImageFormat and a plane index, return
+ * the bits per pixel of the given plane.
+ *
+ * @note
+ *
+ * @param[in] imageFormat: A format of type EImageFormat.
+ * @param[in] planeIndex: a specific plane index.
+ *
+ * @return the bits per pixel of the given plane.
+ *
+ ******************************************************************************/
+int
+queryPlaneBitsPerPixel(
+ int const imageFormat,
+ size_t planeIndex
+);
+
+
+/*****************************************************************************
+ * @brief Query the bits per pixel of a specific format.
+ *
+ * @details Given a format of type EImageFormat, return the bits per pixel.
+ *
+ * @note
+ *
+ * @param[in] imageFormat: A format of type EImageFormat.
+ *
+ * @return the bits per pixel.
+ *
+ ******************************************************************************/
+int
+queryImageBitsPerPixel(
+ int const imageFormat
+);
+
+
+/*****************************************************************************
+ * @brief Query the image format constant.
+ *
+ * @details Given a MtkCameraParameters::PIXEL_FORMAT_xxx, return its
+ * corresponding image format constant.
+ *
+ * @note
+ *
+ * @param[in] szPixelFormat: A null-terminated string for pixel format (i.e.
+ * MtkCameraParameters::PIXEL_FORMAT_xxx)
+ *
+ * @return its corresponding image format.
+ *
+ ******************************************************************************/
+int
+queryImageFormat(
+ char const* szPixelFormat
+);
+
+/*****************************************************************************
+ * @Dump the information of Image map.
+ ******************************************************************************/
+void
+dumpMapInformation();
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; // namespace Format
+}; // namespace Utils
+}; // namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_FORMAT_H_
+
diff --git a/include/hardware/include/mtkcam/utils/ImageBufferHeap.h b/include/hardware/include/mtkcam/utils/ImageBufferHeap.h
new file mode 100644
index 0000000..ad57491
--- /dev/null
+++ b/include/hardware/include/mtkcam/utils/ImageBufferHeap.h
@@ -0,0 +1,182 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_IMAGEBUFFERHEAP_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_IMAGEBUFFERHEAP_H_
+//
+#include "imagebuf/BaseImageBufferHeap.h"
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+
+struct PortBufInfo_v1
+{
+ MINT32 memID[3];
+ MUINTPTR virtAddr[3];
+ MINT32 nocache;
+ MINT32 security;
+ MINT32 coherence;
+ MBOOL continuos;
+ // for continuous memory
+ PortBufInfo_v1(
+ MINT32 const _memID,
+ MUINTPTR const _virtAddr,
+ MINT32 _nocache = 0,
+ MINT32 _security = 0,
+ MINT32 _coherence = 0
+ )
+ : nocache(_nocache)
+ , security(_security)
+ , coherence(_coherence)
+ , continuos(MTRUE)
+ {
+ memID[0] = _memID;
+ virtAddr[0] = _virtAddr;
+ }
+ // for non-continuous memory
+ PortBufInfo_v1(
+ MINT32 const _memID[],
+ MUINTPTR const _virtAddr[],
+ MUINT32 const _planeCount,
+ MINT32 _nocache = 0,
+ MINT32 _security = 0,
+ MINT32 _coherence = 0
+ )
+ : nocache(_nocache)
+ , security(_security)
+ , coherence(_coherence)
+ , continuos(MFALSE)
+ {
+ for (MUINT32 i = 0; i < _planeCount; ++i)
+ {
+ memID[i] = _memID[i];
+ virtAddr[i] = _virtAddr[i];
+ }
+ }
+};
+
+/******************************************************************************
+ * Image Buffer Heap (Camera1).
+ ******************************************************************************/
+class ImageBufferHeap : public NSImageBufferHeap::BaseImageBufferHeap
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Interface.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Params for v1 Buffer
+ typedef IImageBufferAllocator::ImgParam ImgParam_t;
+
+
+public: //// Creation.
+ static ImageBufferHeap* create(
+ char const* szCallerName,
+ ImgParam_t const& rImgParam,
+ PortBufInfo_v1 const& rPortBufInfo,
+ MBOOL const enableLog = MTRUE
+ );
+
+public: //// Attributes.
+ static char const* magicName() { return "Cam1Heap"; }
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// BaseImageBufferHeap Interface.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected: ////
+ virtual char const* impGetMagicName() const { return magicName(); }
+
+ virtual HeapInfoVect_t const& impGetHeapInfo() const { return mvHeapInfo; }
+
+ virtual MBOOL impInit(BufInfoVect_t const& rvBufInfo);
+ virtual MBOOL impUninit(BufInfoVect_t const& rvBufInfo);
+
+public: ////
+ virtual MBOOL impLockBuf(
+ char const* szCallerName,
+ MINT usage,
+ BufInfoVect_t const& rvBufInfo
+ );
+ virtual MBOOL impUnlockBuf(
+ char const* szCallerName,
+ MINT usage,
+ BufInfoVect_t const& rvBufInfo
+ );
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Implementations.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected: ////
+ virtual MBOOL doMapPhyAddr(char const* szCallerName, HeapInfo const& rHeapInfo, BufInfo& rBufInfo);
+ virtual MBOOL doUnmapPhyAddr(char const* szCallerName, HeapInfo const& rHeapInfo, BufInfo& rBufInfo);
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Instantiation.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected: //// Destructor/Constructors.
+
+ /**
+ * Disallowed to directly delete a raw pointer.
+ */
+ virtual ~ImageBufferHeap() {}
+ ImageBufferHeap(
+ char const* szCallerName,
+ ImgParam_t const& rImgParam,
+ PortBufInfo_v1 const& rPortBufInfo
+ );
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Data Members.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected: //// Info to Allocate.
+ size_t mBufStridesInBytesToAlloc[3]; // buffer strides in bytes.
+
+protected: //// Info of Allocated Result.
+ PortBufInfo_v1 mPortBufInfo; //
+ HeapInfoVect_t mvHeapInfo; //
+ BufInfoVect_t mvBufInfo; //
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; // namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_IONIMAGEBUFFERHEAP_H_
+
diff --git a/include/hardware/include/mtkcam/utils/Misc.h b/include/hardware/include/mtkcam/utils/Misc.h
new file mode 100644
index 0000000..5e9c77e
--- /dev/null
+++ b/include/hardware/include/mtkcam/utils/Misc.h
@@ -0,0 +1,169 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_MISC_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_MISC_H_
+//
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+namespace Utils {
+
+
+/******************************************************************************
+ * @brief dump call stack
+ ******************************************************************************/
+void
+dumpCallStack(char const* prefix = 0);
+
+
+/******************************************************************************
+ * @brief make all directories in path.
+ *
+ * @details
+ * @note
+ *
+ * @param[in] path: a specified path to create.
+ * @param[in] mode: the argument specifies the permissions to use, like 0777
+ * (the same to that in mkdir).
+ *
+ * @return
+ * - true indicates success
+ * - false indicates failure
+ *****************************************************************************/
+bool
+makePath(
+ char const*const path,
+ uint_t const mode
+);
+
+
+/******************************************************************************
+ * @brief save the buffer to the file
+ *
+ * @details
+ *
+ * @note
+ *
+ * @param[in] fname: The file name
+ * @param[in] buf: The buffer to save
+ * @param[in] size: The size in bytes to save
+ *
+ * @return
+ * - true indicates success
+ * - false indicates failure
+ ******************************************************************************/
+bool
+saveBufToFile(
+ char const*const fname,
+ unsigned char*const buf,
+ unsigned int const size
+);
+
+
+/******************************************************************************
+ * @brief load the file to the buffer
+ *
+ * @details
+ *
+ * @note
+ *
+ * @param[in] fname: The file name
+ * @param[out] buf: The output buffer
+ * @param[in] capacity: The buffer capacity in bytes
+ *
+ * @return
+ * - The loaded size in bytes.
+ ******************************************************************************/
+unsigned int
+loadFileToBuf(
+ char const*const fname,
+ unsigned char*const buf,
+ unsigned int const capacity
+);
+
+
+/******************************************************************************
+ * @brief set the thread policy & priority
+ *
+ * @details
+ *
+ * @note
+ *
+ * @param[in] policy: The policy of the thread
+ * @param[in] priority: The priority of the thread
+ *
+ * @return
+ * - true indicates success
+ * - false indicates failure
+ ******************************************************************************/
+bool
+setThreadPriority(
+ int policy,
+ int priority
+);
+
+
+/******************************************************************************
+ * @brief get the thread policy & priority
+ *
+ * @details
+ *
+ * @note
+ *
+ * @param[out] policy: The policy of the thread
+ * @param[out] priority: The priority of the thread
+ *
+ * @return
+ * - true indicates success
+ * - false indicates failure
+ ******************************************************************************/
+bool
+getThreadPriority(
+ int& policy,
+ int& priority
+);
+
+
+/******************************************************************************
+ *
+*******************************************************************************/
+}; // namespace Utils
+}; // namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_MISC_H_
+
diff --git a/include/hardware/include/mtkcam/utils/Profile.h b/include/hardware/include/mtkcam/utils/Profile.h
new file mode 100644
index 0000000..cf08c6f
--- /dev/null
+++ b/include/hardware/include/mtkcam/utils/Profile.h
@@ -0,0 +1,157 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_PROFILE_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_PROFILE_H_
+/******************************************************************************
+ *
+ ******************************************************************************/
+#include <utils/String8.h>
+#include <utils/Timers.h>
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+namespace Utils {
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+
+
+/******************************************************************************
+ * get the time in micro-seconds
+ ******************************************************************************/
+inline
+int64_t
+getTimeInUs()
+{
+ return ::ns2us(::systemTime());
+}
+
+
+/******************************************************************************
+ * get the time in milli-seconds
+ ******************************************************************************/
+inline
+int64_t
+getTimeInMs()
+{
+ return ::ns2ms(::systemTime());
+}
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+class DurationTool
+{
+public: //// Interfaces.
+ DurationTool(char const*const szSubjectName);
+ DurationTool(char const*const szSubjectName, nsecs_t nsInitTimestamp);
+ //
+ void reset();
+ void reset(nsecs_t nsInitTimestamp);
+ //
+ void update();
+ void update(nsecs_t nsTimestamp);
+ //
+ void showFps() const;
+ //
+ int32_t getCount() const { return mi4Count; }
+ nsecs_t getDuration() const { return mnsEnd - mnsStart; }
+ //
+protected: //// Data Members.
+ android::String8 ms8SubjectName;
+ //
+ int32_t mi4Count;
+ nsecs_t mnsStart;
+ nsecs_t mnsEnd;
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+class CamProfile
+{
+public: //// Interfaces.
+ CamProfile(
+ char const*const pszFuncName,
+ char const*const pszClassName = ""
+ );
+ //
+ inline
+ void
+ enable(bool fgEnable)
+ {
+ mfgIsProfile = fgEnable;
+ }
+ //
+ bool
+ print(
+ char const*const fmt = "",
+ ...
+ ) const;
+ //
+ bool
+ print_overtime(
+ int32_t const msTimeInterval,
+ char const*const fmt = "",
+ ...
+ ) const;
+
+protected: //// Data Members.
+ char const*const mpszClassName;
+ char const*const mpszFuncName;
+ mutable int32_t mIdx;
+ int32_t const mi4StartUs;
+ mutable int32_t mi4LastUs;
+ bool mfgIsProfile;
+};
+
+
+/******************************************************************************
+*
+*******************************************************************************/
+}; // namespace Utils
+}; // namespace NSCam
+#endif // _MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_PROFILE_H_
+
diff --git a/include/hardware/include/mtkcam/utils/Property.h b/include/hardware/include/mtkcam/utils/Property.h
new file mode 100644
index 0000000..123a118
--- /dev/null
+++ b/include/hardware/include/mtkcam/utils/Property.h
@@ -0,0 +1,111 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_PROPERTY_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_PROPERTY_H_
+//
+#include <utils/String8.h>
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+namespace Utils {
+namespace Property {
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+typedef android::String8 String8;
+
+
+/******************************************************************************
+ * Clears the all property map.
+ *
+ * return
+ * N/A
+ *
+ ******************************************************************************/
+void clear();
+
+
+/******************************************************************************
+ * Set a property.
+ * Replaces the property with the same key if it is already present.
+ *
+ * return
+ * N/A
+ *
+ ******************************************************************************/
+void set(String8 const& key, String8 const& value);
+
+
+/******************************************************************************
+ * Test if a specified key exists or not.
+ *
+ * return
+ * Returns true if the property map contains the specified key.
+ *
+ ******************************************************************************/
+bool hasKey(String8 const& key);
+
+
+/******************************************************************************
+ * Gets the value of a property and parses it.
+ *
+ * return
+ * Returns true and sets outValue if the key was found and its value was
+ * parsed successfully.
+ * Otherwise returns false and does not modify outValue.
+ *
+ ******************************************************************************/
+bool tryGet(const String8& key, String8& outValue);
+bool tryGet(const String8& key, bool& outValue);
+bool tryGet(const String8& key, int32_t& outValue);
+bool tryGet(const String8& key, float& outValue);
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; // namespace Property
+}; // namespace Utils
+}; // namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_PROPERTY_H_
+
diff --git a/include/hardware/include/mtkcam/utils/SensorListener.h b/include/hardware/include/mtkcam/utils/SensorListener.h
new file mode 100644
index 0000000..5707a9c
--- /dev/null
+++ b/include/hardware/include/mtkcam/utils/SensorListener.h
@@ -0,0 +1,31 @@
+#ifndef SENSOR_LISTENER_H
+#define SENSOR_LISTENER_H
+//-----------------------------------------------------------------------------
+class SensorListener
+{
+ protected:
+ virtual ~SensorListener() {};
+ //
+ public:
+ typedef enum
+ {
+ SensorType_Acc,
+ SensorType_Mag,
+ SensorType_Gyro,
+ SensorType_Light,
+ SensorType_Proxi
+ }SensorTypeEnum;
+ //
+ typedef void (*Listener) (ASensorEvent event);
+ //
+ static SensorListener* createInstance(void);
+ virtual MVOID destroyInstance(void) = 0;
+ virtual MBOOL setListener(Listener func) = 0;
+ virtual MBOOL enableSensor(
+ SensorTypeEnum sensorType,
+ MUINT32 periodInMs) = 0;
+ virtual MBOOL disableSensor(SensorTypeEnum sensorType) = 0;
+};
+//-----------------------------------------------------------------------------
+#endif
+
diff --git a/include/hardware/include/mtkcam/utils/Sync.h b/include/hardware/include/mtkcam/utils/Sync.h
new file mode 100644
index 0000000..e5343b2
--- /dev/null
+++ b/include/hardware/include/mtkcam/utils/Sync.h
@@ -0,0 +1,207 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_SYNC_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_SYNC_H_
+//
+#include <utils/RefBase.h>
+#include <utils/StrongPointer.h>
+#include <mtkcam/common.h>
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+namespace Utils {
+namespace Sync {
+
+
+/******************************************************************************
+ * Fence Interface
+ ******************************************************************************/
+class IFence : public virtual android::RefBase
+{
+public: //// Definitions.
+
+ static android::sp<IFence> const NO_FENCE;
+
+ enum { TIMEOUT_NEVER = -1 };
+
+public: //// Operations.
+
+ /**
+ * Create a new fence object to manage a given fence file descriptor.
+ * If a valid fence file descriptor is given, it will be closed when the
+ * newly createdly object is destructed.
+ */
+ static android::sp<IFence> create(MINT fenceFd);
+
+ /**
+ * Merge two fence objects, creating a new fence object that becomes
+ * signaled when both f1 and f2 are signaled (even if f1 or f2 is destroyed
+ * before it becomes signaled)
+ *
+ * @param[in] szFenceName: a name to associated with the new fence.
+ *
+ * @param[in] f1,f2: fence objects to merge.
+ *
+ * @return a newly createdly fence.
+ */
+ static android::sp<IFence> merge(
+ char const* szFenceName,
+ android::sp<IFence> const& f1,
+ android::sp<IFence> const& f2
+ );
+
+ /**
+ * Return a duplicate of the fence file descriptor.
+ * The caller is responsible for closing the returned file descriptor.
+ * On error, -1 will be returned and errno will indicate the problem.
+ */
+ virtual MINT dup() const = 0;
+
+ /**
+ * Wait with a given timeout for a fence to signal.
+ *
+ * @param[in] timeoutMs: a timeout in milliseconds.
+ * A timeout of TIMEOUT_NEVER may be used to indicate that the call
+ * should wait indefinitely for the fence to signal.
+ *
+ * @return
+ * OK if the fence is signaled.
+ * TIMED_OUT if the timeout expires before the fence signals.
+ */
+ virtual MERROR wait(MINT timeoutMs) = 0;
+
+ /**
+ * Wait forever for a fence to signal.
+ * Just like wait(TIMEOUT_NEVER), this is a convenience function for waiting
+ * forever but issuing an error to the system log and fence state to the
+ * kernel log if the wait lasts longer than a warning timeout.
+ *
+ * @param[in] logname: a timeout in milliseconds.
+ * The logname argument should be a string identifying the caller and
+ * will be included in the log message.
+ *
+ * @return
+ * OK if the fence is signaled.
+ * TIMED_OUT if the timeout expires before the fence signals.
+ */
+ virtual MERROR waitForever(char const* logname) = 0;
+
+public: //// Attributes.
+
+ /**
+ * Fence name.
+ */
+ virtual char const* name() const = 0;
+
+ /**
+ * Check to see whether this fence is valid or not.
+ */
+ virtual MBOOL isValid() const = 0;
+
+ /**
+ * Get fence fd.
+ */
+ virtual MINT getFd() const = 0;
+
+ /**
+ * Return the system monotonic clock time at which the fence transitioned to
+ * the signaled state.
+ *
+ * @return
+ * -1 if the fence is invalid or if an error occurs.
+ * INT64_MAX if the fence is not signaled.
+ * Otherwise, a timestamp in ns, at which the fence is signaled.
+ */
+ virtual MINT64 getSignalTime() const = 0;
+
+};
+
+
+/******************************************************************************
+ * Timeline Interface
+ ******************************************************************************/
+class ITimeline : public virtual android::RefBase
+{
+public: //// Operations.
+
+ /**
+ * Create a new sync timeline object.
+ *
+ * @param[in] name: a name to associated with the timeline.
+ */
+ static android::sp<ITimeline> create(char const* szTimelineName);
+
+ /**
+ * Increase timeline
+ *
+ * @param[in] count: timline increase count.
+ */
+ virtual MERROR inc(size_t count) = 0;
+
+ /**
+ * Create a new Fence
+ *
+ * @param[in] szFenceName: The name of Fence
+ * @param[in] value: Timeline FD
+ */
+ virtual MINT createFence(
+ char const* szFenceName,
+ size_t value
+ ) = 0;
+
+public: //// Attributes.
+
+ /**
+ * Timeline name.
+ */
+ virtual char const* name() const = 0;
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; // namespace Sync
+}; // namespace Utils
+}; // namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_SYNC_H_
+
diff --git a/include/hardware/include/mtkcam/utils/common.h b/include/hardware/include/mtkcam/utils/common.h
new file mode 100644
index 0000000..ce5c5d0
--- /dev/null
+++ b/include/hardware/include/mtkcam/utils/common.h
@@ -0,0 +1,55 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_COMMON_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_COMMON_H_
+/******************************************************************************
+ *
+ ******************************************************************************/
+//
+#include "Misc.h"
+#include "Format.h"
+#include "Property.h"
+#include "Profile.h"
+//
+#include "../metadata/IMetadata.h"
+//
+/******************************************************************************
+ *
+ ******************************************************************************/
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_COMMON_H_
+
diff --git a/include/hardware/include/mtkcam/utils/imagebuf/BaseImageBufferHeap.h b/include/hardware/include/mtkcam/utils/imagebuf/BaseImageBufferHeap.h
new file mode 100644
index 0000000..035feef
--- /dev/null
+++ b/include/hardware/include/mtkcam/utils/imagebuf/BaseImageBufferHeap.h
@@ -0,0 +1,346 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_BASEIMAGEBUFFERHEAP_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_BASEIMAGEBUFFERHEAP_H_
+//
+#include <utils/RefBase.h>
+#include <utils/Mutex.h>
+#include <utils/Vector.h>
+#include <utils/String8.h>
+#include <mtkcam/IImageBuffer.h>
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+class IHalMemory;
+namespace NSImageBufferHeap {
+using namespace android;
+
+
+/******************************************************************************
+ * Image Buffer Heap (Base).
+ ******************************************************************************/
+class BaseImageBufferHeap : public virtual IImageBufferHeap, protected virtual RefBase
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// IImageBufferHeap Interface.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Reference Counting.
+ virtual MVOID incStrong(MVOID const* id) const { RefBase::incStrong(id); }
+ virtual MVOID decStrong(MVOID const* id) const { RefBase::decStrong(id); }
+ virtual MINT32 getStrongCount() const { return RefBase::getStrongCount(); }
+
+public: //// Image Attributes.
+ virtual MINT getImgFormat() const { return mImgFormat; }
+ virtual MSize const& getImgSize() const { return mImgSize; }
+ virtual size_t getImgBitsPerPixel() const;
+ virtual size_t getPlaneBitsPerPixel(size_t index) const;
+ virtual size_t getPlaneCount() const { return mPlaneCount; }
+ virtual size_t getBitstreamSize() const { return mBitstreamSize; }
+ virtual MBOOL setBitstreamSize(size_t const bitstreamsize);
+
+public: //// Buffer Attributes.
+ virtual MBOOL getLogCond() const { return mEnableLog; }
+ virtual char const* getMagicName() const { return impGetMagicName(); }
+ virtual MINT32 getHeapID(size_t index) const;
+ virtual size_t getHeapIDCount() const;
+ virtual MINTPTR getBufPA(size_t index) const;
+ virtual MINTPTR getBufVA(size_t index) const;
+ virtual size_t getBufSizeInBytes(size_t index) const;
+ virtual size_t getBufStridesInBytes(size_t index) const;
+ virtual void* getGraphicBuffer() const { return NULL; };
+
+public: //// Buffer Operations.
+ virtual MBOOL lockBuf(
+ char const* szCallerName,
+ MINT usage
+ );
+ virtual MBOOL unlockBuf(
+ char const* szCallerName
+ );
+ virtual MBOOL syncCache(eCacheCtrl const ctrl);
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// IImageBuffer Operations.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: ////
+
+ /**
+ * Create an IImageBuffer instance with its ROI equal to the image full
+ * resolution of this heap.
+ */
+ virtual IImageBuffer* createImageBuffer();
+
+ /**
+ * This call is legal only if the heap format is blob.
+ *
+ * From the given blob heap, create an IImageBuffer instance with a specified
+ * offset and size, and its format equal to blob.
+ */
+ virtual IImageBuffer* createImageBuffer_FromBlobHeap(
+ size_t offsetInBytes,
+ size_t sizeInBytes
+ );
+
+ /**
+ * This call is legal only if the heap format is blob.
+ *
+ * From the given blob heap, create an IImageBuffer instance with a specified
+ * offset, image format, image size in pixels, and buffer strides in pixels.
+ */
+ virtual IImageBuffer* createImageBuffer_FromBlobHeap(
+ size_t offsetInBytes,
+ MINT32 imgFormat,
+ MSize const&imgSize,
+ size_t const bufStridesInBytes[3]
+ );
+
+ /**
+ * Create an IImageBuffer instance indicating the left-side or right-side
+ * buffer within a side-by-side image.
+ *
+ * Left side if isRightSide = 0; otherwise right side.
+ */
+ virtual IImageBuffer* createImageBuffer_SideBySide(
+ MBOOL isRightSide
+ );
+
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Definitions.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected: //// Heap Info.
+ struct HeapInfo : public LightRefBase<HeapInfo>
+ {
+ MINT32 heapID; // heap ID.
+ //
+ HeapInfo()
+ : heapID(-1)
+ {
+ }
+ };
+ typedef Vector<sp<HeapInfo> > HeapInfoVect_t;
+
+public: //// Buffer Info.
+ struct BufInfo : public LightRefBase<BufInfo>
+ {
+ MINTPTR pa; // (plane) physical address
+ MINTPTR va; // (plane) virtual address
+ size_t stridesInBytes; // (plane) strides in bytes
+ size_t sizeInBytes; // (plane) size in bytes
+ //
+ BufInfo(
+ MINTPTR _pa = 0,
+ MINTPTR _va = 0,
+ size_t _stridesInBytes = 0,
+ size_t _sizeInBytes = 0
+ )
+ : pa(_pa)
+ , va(_va)
+ , stridesInBytes(_stridesInBytes)
+ , sizeInBytes(_sizeInBytes)
+ {
+ }
+ };
+ typedef Vector<sp<BufInfo> > BufInfoVect_t;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Template-Method Pattern. Subclass must implement them.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected: ////
+ /**
+ * Return a pointer to a null-terminated string to indicate a magic name of
+ * buffer type.
+ */
+ virtual char const* impGetMagicName() const = 0;
+
+ /**
+ * This call is valid after calling impLockBuf();
+ * invalid after impUnlockBuf().
+ */
+ virtual HeapInfoVect_t const& impGetHeapInfo() const = 0;
+
+ /**
+ * onCreate() must be invoked by a subclass when its instance is created to
+ * inform this base class of a creating event.
+ * The call impInit(), implemented by a subclass, will be invoked by this
+ * base class during onCreate() for initialization.
+ * As to buffer information (i.e. BufInfoVect_t), buffer strides in pixels
+ * and buffer size in bytes of each plane as well as the vector size MUST be
+ * legal, at least, after impInit() return success.
+ *
+ * onLastStrongRef() will be invoked to indicate the last one reference to
+ * this instance before it is freed.
+ * The call impUninit(), implemented by a subclass, will be invoked by this
+ * base class during onLastStrongRef() for uninitialization.
+ */
+ virtual MBOOL impInit(BufInfoVect_t const& rvBufInfo) = 0;
+ virtual MBOOL impUninit(BufInfoVect_t const& rvBufInfo) = 0;
+
+public: ////
+ /**
+ * As to buffer information (i.e. BufInfoVect_t), buffer strides in bytes
+ * and buffer size in bytes of each plane as well as the vector size MUST be
+ * always legal.
+ *
+ * After calling impLockBuf() successfully, the heap information from
+ * impGetHeapInfo() must be legal; virtual address and physical address of
+ * each plane must be legal if any SW usage and any HW usage are specified,
+ * respectively.
+ */
+ virtual MBOOL impLockBuf(
+ char const* szCallerName,
+ MINT usage,
+ BufInfoVect_t const& rvBufInfo
+ ) = 0;
+ virtual MBOOL impUnlockBuf(
+ char const* szCallerName,
+ MINT usage,
+ BufInfoVect_t const& rvBufInfo
+ ) = 0;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Helper Functions.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected: //// Helper Params.
+ struct HelperParamMapPA
+ {
+ MINTPTR phyAddr; // physicall address; in/out
+ MINTPTR virAddr; // virtual address
+ MINT32 ionFd; // ION file descriptor
+ size_t size;
+ MINT32 security;
+ MINT32 coherence;
+ };
+
+ struct HelperParamFlushCache
+ {
+ MINTPTR phyAddr; // physical address
+ MINTPTR virAddr; // virtual address
+ MINT32 ionFd; // ION file descriptor
+ size_t size;
+ };
+
+protected: //// Helper Functions.
+ virtual MBOOL helpMapPhyAddr(
+ char const* szCallerName,
+ HelperParamMapPA& rParam
+ );
+
+ virtual MBOOL helpUnmapPhyAddr(
+ char const* szCallerName,
+ HelperParamMapPA const& rParam
+ );
+
+ virtual MBOOL helpFlushCache(
+ eCacheCtrl const ctrl,
+ HelperParamFlushCache const* paParam,
+ size_t const num
+ );
+
+ virtual MBOOL helpCheckBufStrides(
+ size_t const planeIndex,
+ size_t const planeBufStridesInBytes
+ ) const;
+
+ virtual size_t helpQueryBufSizeInBytes(
+ size_t const planeIndex,
+ size_t const planeStridesInBytes
+ ) const;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Implementations.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+private: //// Called inside lock.
+ virtual MBOOL initLocked();
+ virtual MBOOL uninitLocked();
+ virtual MBOOL lockBufLocked(char const* szCallerName, MINT usage);
+ virtual MBOOL unlockBufLocked(char const* szCallerName);
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Instantiation.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected: //// Destructor/Constructors.
+ /**
+ * Disallowed to directly delete a raw pointer.
+ */
+ virtual ~BaseImageBufferHeap();
+ BaseImageBufferHeap(char const* szCallerName);
+
+protected: //// Callback (LastStrongRef@RefBase)
+ virtual void onLastStrongRef(const void* id);
+
+protected: //// Callback (Create)
+ virtual MBOOL onCreate(
+ MSize const& imgSize,
+ MINT const imgFormat = eImgFmt_BLOB,
+ size_t const bitstreamSize = 0,
+ MBOOL const enableLog = MTRUE
+ );
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Data Members.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+private: //// Heap Info.
+ IHalMemory* mpHalMemory;
+ mutable Mutex mInitMtx;
+ mutable Mutex mLockMtx;
+ MINT32 volatile mLockCount;
+ MINT32 mLockUsage;
+ BufInfoVect_t mvBufInfo;
+
+private: //// Image Attributes.
+ String8 mCallerName;
+ MSize mImgSize;
+ MINT mImgFormat;
+ size_t mPlaneCount;
+ size_t mBitstreamSize; // in bytes
+ MBOOL mEnableLog;
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; // namespace NSImageBufferHeap
+}; // namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_BASEIMAGEBUFFERHEAP_H_
+
diff --git a/include/hardware/include/mtkcam/utils/imagebuf/IDummyImageBufferHeap.h b/include/hardware/include/mtkcam/utils/imagebuf/IDummyImageBufferHeap.h
new file mode 100644
index 0000000..22b2604
--- /dev/null
+++ b/include/hardware/include/mtkcam/utils/imagebuf/IDummyImageBufferHeap.h
@@ -0,0 +1,116 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_IDUMMYIMAGEBUFFERHEAP_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_IDUMMYIMAGEBUFFERHEAP_H_
+//
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+
+struct PortBufInfo_dummy
+{
+ MINT32 memID;
+ MUINTPTR virtAddr[3];
+ MUINTPTR phyAddr[3];
+ MINT32 nocache;
+ MINT32 security;
+ MINT32 coherence;
+
+ PortBufInfo_dummy(
+ MINT32 const _memID,
+ MUINTPTR const _virtAddr[],
+ MUINTPTR const _phyAddr[],
+ MUINT32 const _planeCount,
+ MINT32 _nocache = 0,
+ MINT32 _security = 0,
+ MINT32 _coherence = 0
+ )
+ : memID(_memID)
+ , nocache(_nocache)
+ , security(_security)
+ , coherence(_coherence)
+ {
+ for (MUINT32 i = 0; i < _planeCount; ++i)
+ {
+ virtAddr[i] = _virtAddr[i];
+ phyAddr[i] = _phyAddr[i];
+ }
+ }
+};
+
+/******************************************************************************
+ * Image Buffer Heap (Dummy).
+ ******************************************************************************/
+class IDummyImageBufferHeap : public virtual IImageBufferHeap
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Interface.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Params for Allocations.
+ typedef IImageBufferAllocator::ImgParam ImgParam_t;
+
+
+public: //// Creation.
+ static IDummyImageBufferHeap* create(
+ char const* szCallerName,
+ ImgParam_t const& rImgParam,
+ PortBufInfo_dummy const& rPortBufInfo,
+ MBOOL const enableLog = MTRUE
+ );
+
+protected: //// Destructor/Constructors.
+ /**
+ * Disallowed to directly delete a raw pointer.
+ */
+ virtual ~IDummyImageBufferHeap() {}
+
+public: //// Attributes.
+ static char const* magicName() { return "DummyHeap"; }
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; // namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_IDUMMYIMAGEBUFFERHEAP_H_
+
diff --git a/include/hardware/include/mtkcam/utils/imagebuf/IGrallocImageBufferHeap.h b/include/hardware/include/mtkcam/utils/imagebuf/IGrallocImageBufferHeap.h
new file mode 100644
index 0000000..3327e2e
--- /dev/null
+++ b/include/hardware/include/mtkcam/utils/imagebuf/IGrallocImageBufferHeap.h
@@ -0,0 +1,109 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_IMAGEBUF_IGRALLOCIMAGEBUFFERHEAP_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_IMAGEBUF_IGRALLOCIMAGEBUFFERHEAP_H_
+//
+#include <ui/GraphicBuffer.h>
+using namespace android;
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+
+
+/******************************************************************************
+ * Image Buffer Heap (Gralloc).
+ ******************************************************************************/
+class IGrallocImageBufferHeap : public virtual IImageBufferHeap
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Interface.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Params for Allocations.
+ typedef IImageBufferAllocator::ImgParam AllocImgParam_t;
+
+ struct AllocExtraParam
+ {
+ MINT32 usage;
+ MINT32 nocache;
+ MINT32 security;
+ MINT32 coherence;
+ //
+ AllocExtraParam(
+ MINT32 _usage,
+ MINT32 _nocache = 0,
+ MINT32 _security = 0,
+ MINT32 _coherence = 0
+ )
+ : usage(_usage)
+ , nocache(_nocache)
+ , security(_security)
+ , coherence(_coherence)
+ {
+ }
+ };
+
+public: //// Creation.
+ static IGrallocImageBufferHeap*create(
+ char const* szCallerName,
+ AllocImgParam_t const& rImgParam,
+ AllocExtraParam const& rExtraParam
+ );
+
+protected: //// Destructor/Constructors.
+ /**
+ * Disallowed to directly delete a raw pointer.
+ */
+ virtual ~IGrallocImageBufferHeap() {}
+
+public: //// Attributes.
+ static char const* magicName() { return "GrallocHeap"; }
+
+ virtual void* getGraphicBuffer() const = 0;
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; // namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_IMAGEBUF_IGRALLOCIMAGEBUFFERHEAP_H_
+
diff --git a/include/hardware/include/mtkcam/utils/imagebuf/IGraphicImageBufferHeap.h b/include/hardware/include/mtkcam/utils/imagebuf/IGraphicImageBufferHeap.h
new file mode 100644
index 0000000..98cc829
--- /dev/null
+++ b/include/hardware/include/mtkcam/utils/imagebuf/IGraphicImageBufferHeap.h
@@ -0,0 +1,98 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_IMAGEBUF_IGRAPHICIMAGEBUFFERHEAP_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_IMAGEBUF_IGRAPHICIMAGEBUFFERHEAP_H_
+//
+#include <ui/GraphicBuffer.h>
+//
+#include <hardware/camera3.h>
+#include <mtkcam/IImageBuffer.h>
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+
+
+/******************************************************************************
+ * Image Buffer Heap.
+ ******************************************************************************/
+class IGraphicImageBufferHeap : public virtual IImageBufferHeap
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Interface.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Creation.
+ static IGraphicImageBufferHeap*create(
+ char const* szCallerName,
+ android::GraphicBuffer* pGraphicBuffer,
+ MINT const acquire_fence = -1,
+ MINT const release_fence = -1
+ );
+
+ static IGraphicImageBufferHeap*create(
+ char const* szCallerName,
+ camera3_stream_buffer const* stream_buffer
+ );
+
+protected: //// Destructor/Constructors.
+ /**
+ * Disallowed to directly delete a raw pointer.
+ */
+ virtual ~IGraphicImageBufferHeap() {}
+
+public: //// Attributes.
+ static char const* magicName() { return "IGraphicImageBufferHeap"; }
+
+public: //// Accessors.
+ virtual buffer_handle_t* getBufferHandlePtr()const = 0;
+ virtual MINT getAcquireFence() const = 0;
+ virtual MVOID setAcquireFence(MINT fence) = 0;
+ virtual MINT getReleaseFence() const = 0;
+ virtual MVOID setReleaseFence(MINT fence) = 0;
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; // namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_IMAGEBUF_IGRAPHICIMAGEBUFFERHEAP_H_
+
diff --git a/include/hardware/include/mtkcam/utils/imagebuf/IIonImageBufferHeap.h b/include/hardware/include/mtkcam/utils/imagebuf/IIonImageBufferHeap.h
new file mode 100644
index 0000000..6b0ebba
--- /dev/null
+++ b/include/hardware/include/mtkcam/utils/imagebuf/IIonImageBufferHeap.h
@@ -0,0 +1,104 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_IMAGEBUF_IIONIMAGEBUFFERHEAP_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_IMAGEBUF_IIONIMAGEBUFFERHEAP_H_
+//
+#include <mtkcam/IImageBuffer.h>
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+
+
+/******************************************************************************
+ * Image Buffer Heap (ION).
+ ******************************************************************************/
+class IIonImageBufferHeap : public virtual IImageBufferHeap
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Interface.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Params for Allocations.
+ typedef IImageBufferAllocator::ImgParam AllocImgParam_t;
+
+ struct AllocExtraParam
+ {
+ MINT32 nocache;
+ MINT32 security;
+ MINT32 coherence;
+ //
+ AllocExtraParam(
+ MINT32 _nocache = 0,
+ MINT32 _security = 0,
+ MINT32 _coherence = 0
+ )
+ : nocache(_nocache)
+ , security(_security)
+ , coherence(_coherence)
+ {
+ }
+ };
+
+public: //// Creation.
+ static IIonImageBufferHeap* create(
+ char const* szCallerName,
+ AllocImgParam_t const& rImgParam,
+ AllocExtraParam const& rExtraParam = AllocExtraParam(),
+ MBOOL const enableLog = MTRUE
+ );
+
+protected: //// Destructor/Constructors.
+ /**
+ * Disallowed to directly delete a raw pointer.
+ */
+ virtual ~IIonImageBufferHeap() {}
+
+public: //// Attributes.
+ static char const* magicName() { return "IonHeap"; }
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; // namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_UTILS_IMAGEBUF_IIONIMAGEBUFFERHEAP_H_
+
diff --git a/include/hardware/include/mtkcam/v1/ExtImgProc/ExtImgProc.h b/include/hardware/include/mtkcam/v1/ExtImgProc/ExtImgProc.h
new file mode 100644
index 0000000..2f4e2c9
--- /dev/null
+++ b/include/hardware/include/mtkcam/v1/ExtImgProc/ExtImgProc.h
@@ -0,0 +1,28 @@
+#ifndef EXT_IMG_PROC_H
+#define EXT_IMG_PROC_H
+//-----------------------------------------------------------------------------
+class ExtImgProc : public IExtImgProc
+{
+ public:
+ typedef enum
+ {
+ BufType_Display = 0x00000001,
+ BufType_PreviewCB = 0x00000002,
+ BufType_Record = 0x00000004
+ }BufTypeEnum;
+ //
+ protected:
+ virtual ~ExtImgProc() {};
+ //
+ public:
+ static ExtImgProc* createInstance(void);
+ virtual void destroyInstance(void) = 0;
+ //
+ virtual MBOOL init(void) = 0;
+ virtual MBOOL uninit(void) = 0;
+ virtual MUINT32 getImgMask(void) = 0;
+ virtual MBOOL doImgProc(ImgInfo& img) = 0;
+};
+//-----------------------------------------------------------------------------
+#endif
+
diff --git a/include/hardware/include/mtkcam/v1/ExtImgProc/IExtImgProc.h b/include/hardware/include/mtkcam/v1/ExtImgProc/IExtImgProc.h
new file mode 100644
index 0000000..d870b8e
--- /dev/null
+++ b/include/hardware/include/mtkcam/v1/ExtImgProc/IExtImgProc.h
@@ -0,0 +1,49 @@
+#ifndef I_EXT_IMG_PROC_H
+#define I_EXT_IMG_PROC_H
+//-----------------------------------------------------------------------------
+#include <mtkcam/IImageBuffer.h>
+using namespace NSCam;
+//-----------------------------------------------------------------------------
+class IExtImgProc
+{
+ public:
+ #define PLANE_AMOUNT_MAX 3
+
+ struct ImgInfo
+ {
+ MUINT32 bufType;
+ const char* format;
+ MUINT32 width;
+ MUINT32 height;
+ MUINT32 stride[PLANE_AMOUNT_MAX];
+ MUINTPTR virtAddr;
+ MUINT32 bufSize;
+ //
+ ImgInfo()
+ : bufType(0)
+ , format(NULL)
+ , width(0)
+ , height(0)
+ , virtAddr(0)
+ , bufSize(0)
+ {
+ for(MUINT32 i=0; i<PLANE_AMOUNT_MAX; i++)
+ {
+ stride[i] = 0;
+ }
+ }
+ };
+ //
+ virtual ~IExtImgProc() {}
+ public:
+ virtual MBOOL init(void) = 0;
+ virtual MBOOL uninit(void) = 0;
+ virtual MUINT32 getImgMask(void) = 0;
+ virtual MBOOL doImgProc(ImgInfo& img) { return MTRUE; };
+ virtual MBOOL doImgProc(
+ MUINT32 bufType,
+ IImageBuffer* const pImgBuf) { return MTRUE; };
+};
+//-----------------------------------------------------------------------------
+#endif
+
diff --git a/include/hardware/include/mtkcam/v1/ICamAdapter.h b/include/hardware/include/mtkcam/v1/ICamAdapter.h
new file mode 100644
index 0000000..878a175
--- /dev/null
+++ b/include/hardware/include/mtkcam/v1/ICamAdapter.h
@@ -0,0 +1,206 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_CAMERA_INC_ICAMADAPTER_H_
+#define _MTK_CAMERA_INC_ICAMADAPTER_H_
+
+/*******************************************************************************
+*
+*******************************************************************************/
+class CamMsgCbInfo;
+
+
+namespace android {
+/*******************************************************************************
+*
+*******************************************************************************/
+class CameraParameters;
+class IParamsManager;
+
+
+/*******************************************************************************
+*
+*******************************************************************************/
+class ICamAdapter : public IImgBufProviderClient
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Interfaces.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: ////
+ //
+ static sp<ICamAdapter> createInstance(
+ String8 const& rName,
+ int32_t const i4OpenId,
+ sp<IParamsManager> pParamsMgr
+ );
+
+ static bool isValidInstance(sp<ICamAdapter>const& rpCamAdapter);
+
+ /**
+ * Initialize the device resources owned by this object.
+ */
+ virtual bool init() = 0;
+
+ /**
+ * Uninitialize the device resources owned by this object. Note that this is
+ * *not* done in the destructor.
+ */
+ virtual bool uninit() = 0;
+
+ virtual char const* getName() const = 0;
+ virtual int32_t getOpenId() const = 0;
+ virtual sp<IParamsManager>const getParamsManager() const = 0;
+
+ /**
+ * Set camera message-callback information.
+ */
+ virtual void setCallbacks(
+ sp<CamMsgCbInfo> const& rpCamMsgCbInfo
+ ) = 0;
+
+ /**
+ * Enable a message, or set of messages.
+ */
+ virtual void enableMsgType(int32_t msgType) = 0;
+
+ /**
+ * Disable a message, or a set of messages.
+ *
+ * Once received a call to disableMsgType(CAMERA_MSG_VIDEO_FRAME), camera hal
+ * should not rely on its client to call releaseRecordingFrame() to release
+ * video recording frames sent out by the cameral hal before and after the
+ * disableMsgType(CAMERA_MSG_VIDEO_FRAME) call. Camera hal clients must not
+ * modify/access any video recording frame after calling
+ * disableMsgType(CAMERA_MSG_VIDEO_FRAME).
+ */
+ virtual void disableMsgType(int32_t msgType) = 0;
+
+ /**
+ * Query whether a message, or a set of messages, is enabled.
+ * Note that this is operates as an AND, if any of the messages
+ * queried are off, this will return false.
+ */
+ virtual bool msgTypeEnabled(int32_t msgType) = 0;
+
+ /**
+ * Start preview mode.
+ */
+ virtual status_t startPreview() = 0;
+
+ /**
+ * Stop a previously started preview.
+ */
+ virtual void stopPreview() = 0;
+
+ /**
+ * Returns true if preview is enabled.
+ */
+ virtual bool previewEnabled() const = 0;
+
+ /**
+ * Start record mode. When a record image is available a CAMERA_MSG_VIDEO_FRAME
+ * message is sent with the corresponding frame. Every record frame must be released
+ * by a cameral hal client via releaseRecordingFrame() before the client calls
+ * disableMsgType(CAMERA_MSG_VIDEO_FRAME). After the client calls
+ * disableMsgType(CAMERA_MSG_VIDEO_FRAME), it is camera hal's responsibility
+ * to manage the life-cycle of the video recording frames, and the client must
+ * not modify/access any video recording frames.
+ */
+ virtual status_t startRecording() = 0;
+
+ /**
+ * Stop a previously started recording.
+ */
+ virtual void stopRecording() = 0;
+
+ /**
+ * Returns true if recording is enabled.
+ */
+ virtual bool recordingEnabled() const = 0;
+
+ /**
+ * Start auto focus, the notification callback routine is called
+ * with CAMERA_MSG_FOCUS once when focusing is complete. autoFocus()
+ * will be called again if another auto focus is needed.
+ */
+ virtual status_t autoFocus() = 0;
+
+ /**
+ * Cancels auto-focus function. If the auto-focus is still in progress,
+ * this function will cancel it. Whether the auto-focus is in progress
+ * or not, this function will return the focus position to the default.
+ * If the camera does not support auto-focus, this is a no-op.
+ */
+ virtual status_t cancelAutoFocus() = 0;
+
+ /**
+ * Returns true if capture is on-going.
+ */
+ virtual bool isTakingPicture() const = 0;
+
+ /**
+ * Take a picture.
+ */
+ virtual status_t takePicture() = 0;
+
+ /**
+ * Cancel a picture that was started with takePicture. Calling this
+ * method when no picture is being taken is a no-op.
+ */
+ virtual status_t cancelPicture() = 0;
+
+ /**
+ * Set the camera parameters. This returns BAD_VALUE if any parameter is
+ * invalid or not supported.
+ */
+ virtual status_t setParameters() = 0;
+
+ /**
+ * Send command to camera driver.
+ */
+ virtual status_t sendCommand(int32_t cmd, int32_t arg1, int32_t arg2) = 0;
+
+ /**
+ *
+ */
+ virtual status_t dump(int fd, Vector<String8>const& args)= 0;
+};
+
+
+}; // namespace android
+#endif //_MTK_CAMERA_INC_ICAMADAPTER_H_
+
diff --git a/include/hardware/include/mtkcam/v1/ICamClient.h b/include/hardware/include/mtkcam/v1/ICamClient.h
new file mode 100644
index 0000000..2df91fa
--- /dev/null
+++ b/include/hardware/include/mtkcam/v1/ICamClient.h
@@ -0,0 +1,177 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_V1_ICAMCLIENT_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_V1_ICAMCLIENT_H_
+//
+#include <mtkcam/v1/common.h>
+#include "IParamsManager.h"
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace android {
+
+
+/******************************************************************************
+ * Camera Client Callback Interface.
+ ******************************************************************************/
+class ICamClient : public virtual android::RefBase
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Interfaces.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: ////
+ static android::sp<ICamClient> createInstance(android::sp<android::IParamsManager> pParamsMgr);
+
+ virtual bool init() = 0;
+ virtual bool init(android::sp<IParamsManager> pParamsMgr) = 0;
+ virtual bool uninit() = 0;
+
+ /**
+ *
+ */
+ virtual bool setImgBufProviderClient(
+ android::sp<android::MtkCamUtils::IImgBufProviderClient>const& rpClient
+ ) = 0;
+
+ /**
+ * Set camera message-callback information.
+ */
+ virtual void setCallbacks(
+ android::sp<CamMsgCbInfo> const& rpCamMsgCbInfo
+ ) = 0;
+
+ virtual void enableMsgType(int32_t msgType) = 0;
+ virtual void disableMsgType(int32_t msgType) = 0;
+ virtual bool msgTypeEnabled(int32_t msgType) = 0;
+
+ /**
+ *
+ */
+ virtual bool startPreview() = 0;
+ virtual void stopPreview() = 0;
+ virtual bool previewEnabled() = 0;
+
+ /**
+ *
+ */
+ virtual void takePicture() = 0;
+
+
+ /**
+ * Request the camera hal to store meta data or real YUV data in
+ * the video buffers send out via CAMERA_MSG_VIDEO_FRRAME for a
+ * recording session. If it is not called, the default camera
+ * hal behavior is to store real YUV data in the video buffers.
+ *
+ * This method should be called before startRecording() in order
+ * to be effective.
+ *
+ * If meta data is stored in the video buffers, it is up to the
+ * receiver of the video buffers to interpret the contents and
+ * to find the actual frame data with the help of the meta data
+ * in the buffer. How this is done is outside of the scope of
+ * this method.
+ *
+ * Some camera hal may not support storing meta data in the video
+ * buffers, but all camera hal should support storing real YUV data
+ * in the video buffers. If the camera hal does not support storing
+ * the meta data in the video buffers when it is requested to do
+ * do, INVALID_OPERATION must be returned. It is very useful for
+ * the camera hal to pass meta data rather than the actual frame
+ * data directly to the video encoder, since the amount of the
+ * uncompressed frame data can be very large if video size is large.
+ *
+ * @param enable if true to instruct the camera hal to store
+ * meta data in the video buffers; false to instruct
+ * the camera hal to store real YUV data in the video
+ * buffers.
+ *
+ * @return OK on success.
+ */
+ virtual status_t storeMetaDataInBuffers(bool enable) { return INVALID_OPERATION; }
+
+ /**
+ * Start record mode. When a record image is available a CAMERA_MSG_VIDEO_FRAME
+ * message is sent with the corresponding frame. Every record frame must be released
+ * by a cameral hal client via releaseRecordingFrame() before the client calls
+ * disableMsgType(CAMERA_MSG_VIDEO_FRAME). After the client calls
+ * disableMsgType(CAMERA_MSG_VIDEO_FRAME), it is camera hal's responsibility
+ * to manage the life-cycle of the video recording frames, and the client must
+ * not modify/access any video recording frames.
+ */
+ virtual bool startRecording() = 0;
+
+ /**
+ * Stop a previously started recording.
+ */
+ virtual void stopRecording() = 0;
+
+ /**
+ * Release a record frame previously returned by CAMERA_MSG_VIDEO_FRAME.
+ *
+ * It is camera hal client's responsibility to release video recording
+ * frames sent out by the camera hal before the camera hal receives
+ * a call to disableMsgType(CAMERA_MSG_VIDEO_FRAME). After it receives
+ * the call to disableMsgType(CAMERA_MSG_VIDEO_FRAME), it is camera hal's
+ * responsibility of managing the life-cycle of the video recording
+ * frames.
+ */
+ virtual void releaseRecordingFrame(const void *opaque) = 0;
+
+ /**
+ * Send command to camera driver.
+ */
+ virtual status_t sendCommand(int32_t cmd, int32_t arg1, int32_t arg2) = 0;
+
+ /**
+ *
+ */
+ virtual status_t dump(int fd, android::Vector<android::String8>& args) = 0;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+//
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Instantiation.
+ //
+ virtual ~ICamClient() {}
+};
+}; //namespace android
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_V1_ICAMCLIENT_H_
+
diff --git a/include/hardware/include/mtkcam/v1/IDisplayClient.h b/include/hardware/include/mtkcam/v1/IDisplayClient.h
new file mode 100644
index 0000000..4753e90
--- /dev/null
+++ b/include/hardware/include/mtkcam/v1/IDisplayClient.h
@@ -0,0 +1,130 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_CAMERA_INC_IDISPLAYCLIENT_H_
+#define _MTK_CAMERA_INC_IDISPLAYCLIENT_H_
+//
+#include <utils/Errors.h>
+#include <utils/RefBase.h>
+#include <utils/String8.h>
+//
+#include <hardware/camera.h>
+#include <system/camera.h>
+//
+
+
+namespace android {
+/******************************************************************************
+*
+*******************************************************************************/
+
+
+/******************************************************************************
+*
+*******************************************************************************/
+class IDisplayClient : public virtual RefBase
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Interfaces.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Instantiation.
+
+ static IDisplayClient* createInstance();
+ virtual ~IDisplayClient() {}
+
+public: ////
+
+ /**
+ * Initialize the display adapter to create any resources required.
+ */
+ virtual bool init() = 0;
+ /**
+ * Uninitialize the display adapter.
+ */
+ virtual bool uninit() = 0;
+
+ /**
+ * Set the preview_stream_ops to which frames are sent.
+ *
+ * Notes:
+ * (1) When calling setWindow(), all preview parameters have been decided.
+ * [CameraService]
+ * mHardware->setParameters() -> mHardware->setPreviewWindow() -> mHardware->startPreview()
+ * --> enableDisplay during startPreview()
+ * mHardware->setParameters() -> mHardware->startPreview() -> mHardware->setPreviewWindow()
+ * --> enableDisplay during setPreviewWindow()
+ * (2) During inactive preview, window may be changed by setWindow().
+ */
+ virtual bool setWindow(
+ preview_stream_ops*const window,
+ int32_t const wndWidth,
+ int32_t const wndHeight,
+ int32_t const i4MaxImgBufCount
+ ) = 0;
+
+ /**
+ *
+ */
+ virtual bool setImgBufProviderClient(
+ sp<IImgBufProviderClient>const& rpClient
+ ) = 0;
+
+ /**
+ *
+ */
+ virtual bool disableDisplay() = 0;
+ virtual bool enableDisplay() = 0;
+ virtual bool enableDisplay(
+ int32_t const i4Width,
+ int32_t const i4Height,
+ int32_t const i4BufCount,
+ sp<IImgBufProviderClient>const& rpClient
+ ) = 0;
+#if 1
+ virtual status_t waitUntilDrained() = 0;
+#endif
+ /**
+ *
+ */
+ virtual status_t dump(int fd, Vector<String8>const& args) = 0;
+
+};
+
+
+}; // namespace android
+#endif //_MTK_CAMERA_INC_IDISPLAYCLIENT_H_
+
diff --git a/include/hardware/include/mtkcam/v1/IParamsManager.h b/include/hardware/include/mtkcam/v1/IParamsManager.h
new file mode 100644
index 0000000..06580c3
--- /dev/null
+++ b/include/hardware/include/mtkcam/v1/IParamsManager.h
@@ -0,0 +1,224 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_CAMERA_INC_COMMON_IPARAMSMANAGER_H_
+#define _MTK_CAMERA_INC_COMMON_IPARAMSMANAGER_H_
+//
+#include <camera/CameraParameters.h>
+#include <camera/MtkCameraParameters.h>
+//
+#include <utils/RefBase.h>
+#include <utils/List.h>
+
+
+namespace android {
+/*******************************************************************************
+ *
+ ******************************************************************************/
+
+
+/*******************************************************************************
+ *
+ ******************************************************************************/
+typedef struct camera_area
+{
+ /**
+ * Bounds of the area [left, top, right, bottom]. (-1000, -1000) represents
+ * the top-left of the camera field of view, and (1000, 1000) represents the
+ * bottom-right of the field of view. The width and height cannot be 0 or
+ * negative.
+ */
+ int32_t left;
+ int32_t top;
+ int32_t right;
+ int32_t bottom;
+ /**
+ * The weight must range from 1 to 1000, and represents a weight for
+ * every pixel in the area. This means that a large metering area with
+ * the same weight as a smaller area will have more effect in the
+ * metering result. Metering areas can partially overlap and the driver
+ * will add the weights in the overlap region
+ */
+ int32_t weight;
+} camera_area_t;
+
+
+/*******************************************************************************
+ *
+ ******************************************************************************/
+class IParamsManager : public RefBase
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Map Interfaces.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// IMap Enum
+ enum
+ {
+ eMapAppMode, // App Mode.
+ eMapLevel, // Level: low/middle/high
+ eMapScene,
+ eMapEffect,
+ eMapWhiteBalance,
+ eMapFocusMode,
+ eMapFocusLamp,
+ eMapExpMode,
+ eMapIso,
+ eMapAntiBanding,
+ eMapFlashMode,
+ eMapShotMode,
+ eMapMeterMode,
+ };
+
+public: //// IMap Interface
+ struct IMap
+ {
+ typedef uint32_t VAL_T;
+ typedef String8 STR_T;
+ //
+ virtual ~IMap() {}
+ virtual VAL_T valueFor(STR_T const& str) const = 0;
+ virtual STR_T stringFor(VAL_T const& val) const = 0;
+ };
+
+public: ////
+ /*
+ * IParamsManager::getMapInst(IParamsManager::int2type<IParamsManager::eMapXXX>()) returns a pointer to IMap const (i.e. IMap const*)
+ */
+ template<int value> struct int2type { enum {v=value}; };
+ template <int eMapXXX>
+ static IMap const* getMapInst(int2type<eMapXXX>);
+#define PARAMSMANAGER_MAP_INST(eMapXXX) IParamsManager::getMapInst(IParamsManager::int2type<IParamsManager::eMapXXX>())
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Interfaces.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Instantiation.
+
+ static IParamsManager* createInstance(
+ String8 const& rName,
+ int32_t const i4OpenId
+ );
+ virtual ~IParamsManager() {}
+ virtual bool init() = 0;
+ virtual bool uninit() = 0;
+
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+public: //// Attributes.
+ virtual char const* getName() const = 0;
+ virtual int32_t getOpenId() const = 0;
+
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+public: //// Operations.
+ virtual status_t setParameters(CameraParameters const& params) = 0;
+ virtual String8 getPreviewFormat() const = 0;
+ virtual void getPreviewSize(int *width, int *height) const = 0;
+ virtual void getVideoSize(int *width, int *height) const = 0;
+ virtual void getPictureSize(int *width, int *height) const = 0;
+ virtual uint32_t getZoomRatio() const = 0;
+ virtual uint32_t getZoomRatioByIndex(uint32_t index) const = 0;
+ virtual bool getRecordingHint() const = 0;
+ virtual bool getVideoStabilization() const = 0;
+ virtual bool getVideoSnapshotSupport() const = 0;
+ virtual uint32_t getMultFrameBlending() const = 0;
+ virtual uint32_t getVHdr() const = 0;
+ virtual String8 getShotModeStr() const = 0;
+ virtual uint32_t getShotMode() const = 0;
+ typedef struct FACE_BEAUTY_POS
+ {
+ int32_t x;
+ int32_t y;
+ }FACE_BEAUTY_POS_t;
+ virtual void getFaceBeautyTouchPosition(FACE_BEAUTY_POS& pos) const = 0;
+ virtual void getFaceBeautyBeautifiedPosition(Vector<FACE_BEAUTY_POS>& pos) const = 0;
+
+ virtual bool getPDAFSupported() const = 0;
+
+ /*
+ * @brief update brightness value.
+ *
+ * @details update (BV) brightness value.
+ *
+ * @note
+ *
+ * @param[in] iBV: brightness value (scaled by 10).
+ *
+ * @return
+ *
+ */
+ virtual void updateBrightnessValue(int const iBV) = 0;
+ virtual void updatePreviewFPS(int const fps) = 0;
+ virtual void updatePreviewFrameInterval(int const interval) = 0;
+ virtual void updatePreviewAEIndexShutterGain(int const index, int const shutter, int const isp_gain, int const sensor_gain) = 0;
+ virtual void updatePreviewAEIndexShutterGain(int const index, int const shutter, int const isp_gain, int const sensor_gain, int const iso) = 0;
+ virtual void updateCaptureShutterGain(int const shutter, int const isp_gain, int const sensor_gain) = 0;
+ virtual void updateEngMsg(char const* msg) = 0;
+
+ virtual bool setForceHalAppMode(String8 const& mode) = 0;
+ virtual bool evaluateHalAppMode(String8 &mode) const = 0;
+ virtual int32_t getHalAppMode() const = 0;
+ virtual bool updateHalAppMode() = 0;
+ virtual bool updateBestFocusStep() const = 0;
+
+public: //// Utility.
+ static void showParameters(String8 const& rs8Param);
+ virtual void showParameters() const = 0;
+ //
+ virtual String8 flatten() const = 0;
+ virtual void set(char const* key, char const* value) = 0;
+ virtual void set(char const* key, int value) = 0;
+ virtual String8 getStr(char const* key) const = 0;
+ virtual int getInt(char const* key) const = 0;
+ virtual float getFloat(char const* key) const = 0;
+ virtual bool isEnabled(char const* key) const = 0;
+ //
+ virtual status_t parseCamAreas(
+ char const* areaStr,
+ List<camera_area_t>& areas,
+ int const maxNumArea
+ ) const = 0;
+ //
+ virtual status_t dump(int fd, Vector<String8>const& args) = 0;
+
+};
+
+
+/*******************************************************************************
+ *
+ ******************************************************************************/
+}; // namespace android
+#endif //_MTK_CAMERA_INC_COMMON_IPARAMSMANAGER_H_
+
diff --git a/include/hardware/include/mtkcam/v1/PriorityDefs.h b/include/hardware/include/mtkcam/v1/PriorityDefs.h
new file mode 100644
index 0000000..9ff1a8d
--- /dev/null
+++ b/include/hardware/include/mtkcam/v1/PriorityDefs.h
@@ -0,0 +1,80 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_V1_PRIORITYDEFS_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_V1_PRIORITYDEFS_H_
+/******************************************************************************
+ * Priority Definitions.
+ ******************************************************************************/
+#include <linux/rtpm_prio.h>
+#include <utils/ThreadDefs.h> // for SCHED_OTHER
+
+
+/******************************************************************************
+ * Real-Time Priority (SCHED_RR, SCHED_FIFO)
+ ******************************************************************************/
+enum
+{
+ //
+ // Clients
+ PRIO_RT_CAMERA_RECORD_CLIENT = (RTPM_PRIO_CAMERA_TOPBASE - 1),
+ PRIO_RT_CAMERA_PREVIEW_CLIENT = (RTPM_PRIO_CAMERA_TOPBASE - 1),
+ PRIO_RT_CAMERA_DISPLAY_CLIENT = (RTPM_PRIO_CAMERA_TOPBASE - 0),
+ //
+ PRIO_RT_FD_THREAD = (RTPM_PRIO_CAMERA_TOPBASE - 3),
+};
+
+
+/******************************************************************************
+ * Nice value (SCHED_OTHER)
+ ******************************************************************************/
+enum
+{
+ //
+ // Clients
+ NICE_CAMERA_RECORD_CLIENT = ANDROID_PRIORITY_NORMAL,
+ NICE_CAMERA_PREVIEW_CLIENT = ANDROID_PRIORITY_NORMAL,
+ NICE_CAMERA_DISPLAY_CLIENT = ANDROID_PRIORITY_NORMAL,
+ //
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_V1_PRIORITYDEFS_H_
+
diff --git a/include/hardware/include/mtkcam/v1/camutils/CamFormat.h b/include/hardware/include/mtkcam/v1/camutils/CamFormat.h
new file mode 100644
index 0000000..2530961
--- /dev/null
+++ b/include/hardware/include/mtkcam/v1/camutils/CamFormat.h
@@ -0,0 +1,192 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_V1_CAMUTILS_CAMFORMAT_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_V1_CAMUTILS_CAMFORMAT_H_
+//
+
+
+namespace android {
+namespace MtkCamUtils {
+namespace FmtUtils {
+
+
+/*****************************************************************************
+ * @brief Query the imageio format.
+ *
+ * @details Given a CameraParameters::PIXEL_FORMAT_xxx, return its corresponding
+ * imageio format.
+ *
+ * @note
+ *
+ * @param[in] szPixelFormat: A null-terminated string for pixel format (i.e.
+ * CameraParameters::PIXEL_FORMAT_xxx)
+ *
+ * @return its corresponding imageio format (i.e. EImageFormat)
+ *
+ ******************************************************************************/
+uint_t
+queryImageioFormat(
+ char const* szPixelFormat
+);
+
+
+/*****************************************************************************
+ * @brief Query the bits per pixel.
+ *
+ * @details Given a CameraParameters::PIXEL_FORMAT_xxx, return its corresponding
+ * bits per pixel.
+ *
+ * @note
+ *
+ * @param[in] szPixelFormat: A null-terminated string for pixel format (i.e.
+ * CameraParameters::PIXEL_FORMAT_xxx)
+ *
+ * @return its corresponding bits per pixel.
+ *
+ ******************************************************************************/
+int
+queryBitsPerPixel(
+ char const* szPixelFormat
+);
+
+
+/*****************************************************************************
+ * @brief Query the plane count.
+ *
+ * @details Given a CameraParameters::PIXEL_FORMAT_xxx, return its corresponding
+ * plane count.
+ *
+ * @note
+ *
+ * @param[in] szPixelFormat: A null-terminated string for pixel format (i.e.
+ * CameraParameters::PIXEL_FORMAT_xxx)
+ *
+ * @return its corresponding plane count.
+ *
+ ******************************************************************************/
+size_t
+queryPlaneCount(
+ char const* szPixelFormat
+);
+
+
+/*****************************************************************************
+ * @brief Query a specific plane's width stride.
+ *
+ * @details Given a CameraParameters::PIXEL_FORMAT_xxx, image width and plane's
+ * index, return its corresponding plane's stride.
+ *
+ * @note
+ *
+ * @param[in] szPixelFormat: A null-terminated string for pixel format (i.e.
+ * CameraParameters::PIXEL_FORMAT_xxx)
+ *
+ * @param[in] imgWidth: image width, in pixel.
+ *
+ * @param[in] planeIndex: plane's index; 0, 1, and 2 refer to 1st-, 2nd-, and
+ * 3rd plane, respectively.
+ *
+ * @return its corresponding plane's stride, in pixel
+ *
+ ******************************************************************************/
+size_t
+queryImgWidthStride(
+ char const* szPixelFormat,
+ size_t imgWidth,
+ size_t planeIndex
+);
+
+
+/*****************************************************************************
+ * @brief Query a specific plane's height stride.
+ *
+ * @details Given a CameraParameters::PIXEL_FORMAT_xxx, image height and plane's
+ * index, return its corresponding plane's stride.
+ *
+ * @note
+ *
+ * @param[in] szPixelFormat: A null-terminated string for pixel format (i.e.
+ * CameraParameters::PIXEL_FORMAT_xxx)
+ *
+ * @param[in] imgHeight: image height, in pixel.
+ *
+ * @param[in] planeIndex: plane's index; 0, 1, and 2 refer to 1st-, 2nd-, and
+ * 3rd plane, respectively.
+ *
+ * @return its corresponding plane's stride, in pixel
+ *
+ ******************************************************************************/
+size_t
+queryImgHeightStride(
+ char const* szPixelFormat,
+ size_t imgHeight,
+ size_t planeIndex
+);
+
+
+/*****************************************************************************
+ * @brief Query a striding buffer size, in bytes.
+ *
+ * @details Given a CameraParameters::PIXEL_FORMAT_xxx, image width/height,
+ * return its corresponding striding buffer size, in bytes.
+ *
+ * @note
+ *
+ * @param[in] szPixelFormat: A null-terminated string for pixel format (i.e.
+ * CameraParameters::PIXEL_FORMAT_xxx)
+ *
+ * @param[in] imgWidth: image width, in pixel.
+ *
+ * @param[in] imgHeight: image height, in pixel.
+ *
+ * @return its corresponding striding buffer size, in bytes
+ *
+ ******************************************************************************/
+size_t
+queryImgBufferSize(
+ char const* szPixelFormat,
+ size_t imgWidth,
+ size_t imgHeight
+);
+
+
+}; // namespace FmtUtils
+}; // namespace MtkCamUtils
+}; // namespace android
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_V1_CAMUTILS_CAMFORMAT_H_
+
diff --git a/include/hardware/include/mtkcam/v1/camutils/CamFormatTransform.h b/include/hardware/include/mtkcam/v1/camutils/CamFormatTransform.h
new file mode 100644
index 0000000..586e1ed
--- /dev/null
+++ b/include/hardware/include/mtkcam/v1/camutils/CamFormatTransform.h
@@ -0,0 +1,99 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_CAMERA_INC_COMMON_CAMUTILS_CAMFORMAT_TRANSFORM_H_
+#define _MTK_CAMERA_INC_COMMON_CAMUTILS_CAMFORMAT_TRANSFORM_H_
+//
+/******************************************************************************
+*
+*******************************************************************************/
+#include <utils/String8.h>
+
+
+namespace android {
+namespace MtkCamUtils {
+namespace FmtUtils {
+
+
+class CamFormatTransform
+{
+private:
+
+ struct buffer
+ {
+ String8 fmt;
+ unsigned char* addr;
+ int size;
+ int width;
+ int height;
+ int stride1;
+ int stride2;
+ int stride3;
+ //
+ buffer()
+ : fmt("")
+ , addr(NULL)
+ , size(0)
+ , width(0)
+ , height(0)
+ , stride1(0)
+ , stride2(0)
+ , stride3(0)
+ {}
+ };
+
+ buffer src;
+ buffer dst;
+ //
+ bool check();
+
+public:
+ void setSrc(String8 fmt, unsigned char *addr, int size, int width, int height, int stride1 = 0, int stride2 = 0, int stride3 = 0);
+ void setDst(String8 fmt, unsigned char *addr, int size, int width, int height, int stride1 = 0, int stride2 = 0, int stride3 = 0);
+
+public:
+ bool convert();
+};
+
+
+
+
+}; // namespace FmtUtils
+}; // namespace MtkCamUtils
+}; // namespace android
+#endif //_MTK_CAMERA_INC_COMMON_CAMUTILS_CAMFORMAT_H_
+
diff --git a/include/hardware/include/mtkcam/v1/camutils/CamInfo.h b/include/hardware/include/mtkcam/v1/camutils/CamInfo.h
new file mode 100644
index 0000000..e5e5d3c
--- /dev/null
+++ b/include/hardware/include/mtkcam/v1/camutils/CamInfo.h
@@ -0,0 +1,275 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HAL_INC_COMMON_CAMUTILS_CAMINFO_H_
+#define _MTK_HAL_INC_COMMON_CAMUTILS_CAMINFO_H_
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+#include <utils/RefBase.h>
+#include <hardware/camera.h>
+#include <mtkcam/device/device1.h>
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+struct ICam1DeviceCallback : public virtual android::RefBase
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Interfaces.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Instantiation.
+ virtual ~ICam1DeviceCallback() {}
+
+public: //// Operations.
+
+ virtual void onCam1Device_NotifyCb(
+ int32_t const msgType,
+ intptr_t const ext1
+ ) = 0;
+
+};
+
+
+/******************************************************************************
+ * Message-Callback Info
+ ******************************************************************************/
+struct CamMsgCbInfo : public android::LightRefBase<CamMsgCbInfo>
+{
+ int32_t mMsgEnabled;
+ void* mCbCookie;
+ camera_notify_callback mNotifyCb;
+ camera_data_callback mDataCb;
+ camera_data_timestamp_callback mDataCbTimestamp;
+ camera_request_memory mRequestMemory;
+ //
+ mtk_camera_metadata_callback mMetadataCb;
+ android::wp<ICam1DeviceCallback>mCam1DeviceCb;
+
+ CamMsgCbInfo(
+ int32_t msgEnabled = 0,
+ void* cbCookie = 0,
+ camera_notify_callback notify_cb = 0,
+ camera_data_callback data_cb = 0,
+ camera_data_timestamp_callback data_cb_timestamp= 0,
+ camera_request_memory get_memory = 0,
+ android::wp<ICam1DeviceCallback> const& cam1device_cb = 0
+ )
+ : mMsgEnabled(msgEnabled)
+ , mCbCookie(cbCookie)
+ , mNotifyCb(notify_cb)
+ , mDataCb(data_cb)
+ , mDataCbTimestamp(data_cb_timestamp)
+ , mRequestMemory(get_memory)
+ , mMetadataCb(0)
+ , mCam1DeviceCb(cam1device_cb)
+ {
+ }
+
+ CamMsgCbInfo& operator=(CamMsgCbInfo const& rhs)
+ {
+ mMsgEnabled = rhs.mMsgEnabled;
+ mCbCookie = rhs.mCbCookie;
+ mNotifyCb = rhs.mNotifyCb;
+ mDataCb = rhs.mDataCb;
+ mDataCbTimestamp = rhs.mDataCbTimestamp;
+ mRequestMemory = rhs.mRequestMemory;
+ mCam1DeviceCb = rhs.mCam1DeviceCb;
+ //
+ mMetadataCb = rhs.mMetadataCb;
+ return (*this);
+ }
+};
+
+
+/*******************************************************************************
+* Device ID
+*******************************************************************************/
+enum EDeviceId
+{
+ eDevId_ImgSensor, // image sensor
+ eDevId_AtvSensor, // atv sensor
+ eDevId_Unknown = 0xFFFFFFFF
+};
+
+
+/******************************************************************************
+*
+*******************************************************************************/
+namespace android {
+namespace MtkCamUtils {
+namespace DevMetaInfo {
+
+
+/******************************************************************************
+ * Clears the database.
+ *
+ * return
+ * N/A
+ *
+ ******************************************************************************/
+void
+clear();
+
+
+/******************************************************************************
+ * add a device meta information.
+ *
+ * i4OpenId
+ * [i] Open id
+ * rCameraInfo
+ * [i] camera info
+ * i4DevSetupOrientation
+ * [i] Device setup orientation
+ * i4DevId
+ * [i] Device id (EDeviceId)
+ * i4HalSensorDev
+ * [i] Sensor hal device id (halSensorDev_e)
+ *
+ * return
+ * N/A
+ *
+ ******************************************************************************/
+void
+add(
+ int32_t const i4OpenId,
+ camera_info const& rCameraInfo,
+ int32_t const i4DevSetupOrientation,
+ int32_t const i4DevId,
+ int32_t const i4HalSensorDev
+);
+
+
+/******************************************************************************
+ * Query the number of device.
+ *
+ * return
+ * Returns the number of device.
+ *
+ ******************************************************************************/
+int32_t
+queryNumberOfDevice();
+
+
+/******************************************************************************
+ * Given an open id, query the camera_info
+ *
+ * i4OpenId
+ * [i] Open id
+ *
+ * return
+ * Returns a value of type camera_info if found.
+ * Otherwise returns invalid value.
+ *
+ ******************************************************************************/
+camera_info const&
+queryCameraInfo(int32_t const i4OpenId);
+
+
+/******************************************************************************
+ * Given an open id, query the device wanted orientation.
+ *
+ * i4OpenId
+ * [i] Open id
+ *
+ * return
+ * Returns a device wanted orientation if found.
+ * Otherwise returns invalid value.
+ *
+ ******************************************************************************/
+int32_t
+queryDeviceWantedOrientation(int32_t const i4OpenId);
+
+
+/******************************************************************************
+ * Given an open id, query the device setup orientation.
+ *
+ * i4OpenId
+ * [i] Open id
+ *
+ * return
+ * Returns a device setup orientation if found.
+ * Otherwise returns invalid value.
+ *
+ ******************************************************************************/
+int32_t
+queryDeviceSetupOrientation(int32_t const i4OpenId);
+
+
+/******************************************************************************
+ * Given an open id, query the device id
+ *
+ * i4OpenId
+ * [i] Open id
+ *
+ * return
+ * Returns a value of type EDeviceId if found.
+ * Otherwise returns invalid value.
+ *
+ ******************************************************************************/
+int32_t
+queryDeviceId(int32_t const i4OpenId);
+
+
+/******************************************************************************
+ * Given an open id, query the sensor hal device id defined in sensor hal
+ *
+ * i4OpenId
+ * [i] Open id
+ *
+ * return
+ * Returns a value of type halSensorCmd_e if found.
+ * Otherwise returns invalid value.
+ *
+ ******************************************************************************/
+int32_t
+queryHalSensorDev(int32_t const i4OpenId);
+
+
+}; // namespace DevMetaInfo
+}; // namespace MtkCamUtils
+}; // namespace android
+
+
+/******************************************************************************
+*
+********************************************************************************/
+#endif //_MTK_HAL_INC_COMMON_CAMUTILS_CAMINFO_H_
+
diff --git a/include/hardware/include/mtkcam/v1/camutils/CamMisc.h b/include/hardware/include/mtkcam/v1/camutils/CamMisc.h
new file mode 100644
index 0000000..19128bb
--- /dev/null
+++ b/include/hardware/include/mtkcam/v1/camutils/CamMisc.h
@@ -0,0 +1,182 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_CAMERA_INC_COMMON_CAMUTILS_CAMMISC_H_
+#define _MTK_CAMERA_INC_COMMON_CAMUTILS_CAMMISC_H_
+//
+
+
+/******************************************************************************
+*
+*******************************************************************************/
+
+
+namespace android {
+namespace MtkCamUtils {
+/******************************************************************************
+*
+*******************************************************************************/
+
+
+/******************************************************************************
+*
+*******************************************************************************/
+template<int value> struct int2type { enum {v=value}; };
+
+
+/******************************************************************************
+ * @brief make all directories in path.
+ *
+ * @details
+ * @note
+ *
+ * @param[in] path: a specified path to create.
+ * @param[in] mode: the argument specifies the permissions to use, like 0777
+ * (the same to that in mkdir).
+ *
+ * @return
+ * - true if successful; otherwise false.
+ *****************************************************************************/
+bool
+makePath(
+ char const*const path,
+ uint_t const mode
+);
+
+
+/**
+ * @brief save the buffer to the file
+ *
+ * @details
+ *
+ * @note
+ *
+ * @param[in] fname: The file name
+ * @param[in] buf: The buffer want to save
+ * @param[in] size: The size want to save
+ *
+ * @return
+ * - MTRUE indicates the operation is success
+ * - MFALSE indicates the operation is fail
+ */
+bool
+saveBufToFile(
+ char const*const fname,
+ uint8_t*const buf,
+ uint32_t const size
+);
+
+
+/**
+ * @brief read the file to the buffer
+ *
+ * @details
+ *
+ * @note
+ *
+ * @param[in] fname: The input file name
+ * @param[out] buf: The output buffer
+ * @param[in] size: The buf size be read
+ *
+ *
+ * @return
+ * - The read count
+ */
+uint32_t
+loadFileToBuf(
+ char const*const fname,
+ uint8_t*const buf,
+ uint32_t size
+);
+
+/**
+ * @brief set the thread policy & priority
+ *
+ * @details
+ *
+ * @note
+ *
+ * @param[in] policy: The policy of the thread
+ * @param[in] priority: The priority of the thread
+ *
+ * @return
+ * - MTRUE indicates the operation is success
+ * - MFALSE indicates the operation is fail
+ */
+bool
+setThreadPriority(
+ int policy,
+ int priority
+);
+
+
+/**
+ * @brief get the thread policy & priority
+ *
+ * @details
+ *
+ * @note
+ *
+ * @param[out] policy: The policy of the thread
+ * @param[out] priority: The priority of the thread
+ *
+ * @return
+ * - MTRUE indicates the operation is success
+ * - MFALSE indicates the operation is fail
+ */
+bool
+getThreadPriority(
+ int& policy,
+ int& priority
+);
+
+
+/**
+ * @dump android call stack
+ *
+ */
+void
+dumpCallStack(void);
+
+
+/******************************************************************************
+*
+*******************************************************************************/
+}; // namespace MtkCamUtils
+}; // namespace android
+#endif //_MTK_CAMERA_INC_COMMON_CAMUTILS_CAMMISC_H_
+
diff --git a/include/hardware/include/mtkcam/v1/camutils/CamProfile.h b/include/hardware/include/mtkcam/v1/camutils/CamProfile.h
new file mode 100644
index 0000000..b15764c
--- /dev/null
+++ b/include/hardware/include/mtkcam/v1/camutils/CamProfile.h
@@ -0,0 +1,152 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_CAMERA_INC_COMMON_CAMUTILS_CAMPROFILE_H_
+#define _MTK_CAMERA_INC_COMMON_CAMUTILS_CAMPROFILE_H_
+/******************************************************************************
+ *
+ ******************************************************************************/
+#include <utils/String8.h>
+#include <utils/Timers.h>
+
+
+namespace android {
+namespace MtkCamUtils {
+/******************************************************************************
+ *
+ ******************************************************************************/
+
+
+/******************************************************************************
+ * get the time in micro-seconds
+ ******************************************************************************/
+inline
+int64_t
+getTimeInUs()
+{
+ return ::ns2us(::systemTime());
+}
+
+
+/******************************************************************************
+ * get the time in milli-seconds
+ ******************************************************************************/
+inline
+int64_t
+getTimeInMs()
+{
+ return ::ns2ms(::systemTime());
+}
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+class DurationTool
+{
+public: //// Interfaces.
+ DurationTool(char const*const szSubjectName);
+ DurationTool(char const*const szSubjectName, nsecs_t nsInitTimestamp);
+ //
+ void reset();
+ void reset(nsecs_t nsInitTimestamp);
+ //
+ void update();
+ void update(nsecs_t nsTimestamp);
+ //
+ void showFps() const;
+ //
+ int32_t getCount() const { return mi4Count; }
+ nsecs_t getDuration() const { return mnsEnd - mnsStart; }
+ //
+protected: //// Data Members.
+ String8 ms8SubjectName;
+ //
+ int32_t mi4Count;
+ nsecs_t mnsStart;
+ nsecs_t mnsEnd;
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+class CamProfile
+{
+public: //// Interfaces.
+ CamProfile(
+ char const*const pszFuncName,
+ char const*const pszClassName = ""
+ );
+ //
+ inline
+ void
+ enable(bool fgEnable)
+ {
+ mfgIsProfile = fgEnable;
+ }
+ //
+ bool
+ print(
+ char const*const fmt = "",
+ ...
+ ) const;
+ //
+ bool
+ print_overtime(
+ int32_t const msTimeInterval,
+ char const*const fmt = "",
+ ...
+ ) const;
+
+protected: //// Data Members.
+ char const*const mpszClassName;
+ char const*const mpszFuncName;
+ mutable int32_t mIdx;
+ int32_t const mi4StartUs;
+ mutable int32_t mi4LastUs;
+ bool mfgIsProfile;
+};
+
+
+/******************************************************************************
+*
+*******************************************************************************/
+}; // namespace MtkCamUtils
+}; // namespace android
+#endif // _MTK_CAMERA_INC_COMMON_CAMUTILS_CAMPROFILE_H_
+
diff --git a/include/hardware/include/mtkcam/v1/camutils/CamProperty.h b/include/hardware/include/mtkcam/v1/camutils/CamProperty.h
new file mode 100644
index 0000000..da83950
--- /dev/null
+++ b/include/hardware/include/mtkcam/v1/camutils/CamProperty.h
@@ -0,0 +1,99 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_CAMERA_INC_COMMON_CAMUTILS_CAMPROPERTY_H_
+#define _MTK_CAMERA_INC_COMMON_CAMUTILS_CAMPROPERTY_H_
+//
+#include <utils/String8.h>
+
+
+namespace android {
+namespace MtkCamUtils {
+namespace Property {
+
+
+/******************************************************************************
+ * Clears the all property map.
+ *
+ * return
+ * N/A
+ *
+ ******************************************************************************/
+void clear();
+
+
+/******************************************************************************
+ * Set a property.
+ * Replaces the property with the same key if it is already present.
+ *
+ * return
+ * N/A
+ *
+ ******************************************************************************/
+void set(String8 const& key, String8 const& value);
+
+
+/******************************************************************************
+ * Test if a specified key exists or not.
+ *
+ * return
+ * Returns true if the property map contains the specified key.
+ *
+ ******************************************************************************/
+bool hasKey(String8 const& key);
+
+
+/******************************************************************************
+ * Gets the value of a property and parses it.
+ *
+ * return
+ * Returns true and sets outValue if the key was found and its value was
+ * parsed successfully.
+ * Otherwise returns false and does not modify outValue.
+ *
+ ******************************************************************************/
+bool tryGet(const String8& key, String8& outValue);
+bool tryGet(const String8& key, bool& outValue);
+bool tryGet(const String8& key, int32_t& outValue);
+bool tryGet(const String8& key, float& outValue);
+
+
+}; // namespace Property
+}; // namespace MtkCamUtils
+}; // namespace android
+#endif //_MTK_CAMERA_INC_COMMON_CAMUTILS_CAMPROPERTY_H_
+
diff --git a/include/hardware/include/mtkcam/v1/camutils/IBuffer.h b/include/hardware/include/mtkcam/v1/camutils/IBuffer.h
new file mode 100644
index 0000000..96fa45c
--- /dev/null
+++ b/include/hardware/include/mtkcam/v1/camutils/IBuffer.h
@@ -0,0 +1,127 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_CAMERA_INC_COMMON_CAMUTILS_IBUFFER_H_
+#define _MTK_CAMERA_INC_COMMON_CAMUTILS_IBUFFER_H_
+//
+#include <sys/types.h>
+//
+#include <utils/RefBase.h>
+#include <utils/String8.h>
+#if (PLATFORM_VERSION_MAJOR == 2)
+#include <utils/RefBase.h>
+#else
+#include <utils/StrongPointer.h>
+#endif
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+
+
+namespace android {
+namespace MtkCamUtils {
+/******************************************************************************
+ *
+ ******************************************************************************/
+
+
+/******************************************************************************
+ * Memory Buffer Interface.
+ ******************************************************************************/
+class IMemBuf : public virtual RefBase
+{
+public: //// Attributes.
+ //
+ virtual int64_t getTimestamp() const = 0;
+ virtual void setTimestamp(int64_t const timestamp) = 0;
+ //
+public: //// Attributes.
+ virtual const char* getBufName() const = 0;
+ virtual size_t getBufSize() const = 0;
+ //
+ virtual void* getVirAddr() const = 0;
+ virtual void* getPhyAddr() const = 0;
+ //
+ virtual int getIonFd() const { return -1; }
+ virtual int getBufSecu() const { return 0; }
+ virtual int getBufCohe() const { return 0; }
+ //
+public: ////
+ //
+ virtual ~IMemBuf() {};
+};
+
+
+/******************************************************************************
+ * Image Buffer Interface.
+ ******************************************************************************/
+class IImgBuf : public IMemBuf
+{
+public: //// Attributes.
+ virtual String8 const& getImgFormat() const = 0;
+ virtual uint32_t getImgWidth() const = 0;
+ virtual uint32_t getImgHeight() const = 0;
+
+ //
+ // planeIndex
+ // [I] plane's index; 0, 1, and 2 refer to 1st-, 2nd-, and 3rd planes,
+ // respectively.
+ //
+ // return
+ // return its corresponding plane's stride, in pixel
+ //
+ virtual uint32_t getImgWidthStride(
+ uint_t const uPlaneIndex = 0
+ ) const = 0;
+
+ virtual uint32_t getBitsPerPixel() const = 0;
+ //
+public: ////
+ //
+ virtual ~IImgBuf() {};
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; // namespace MtkCamUtils
+}; // namespace android
+#endif //_MTK_CAMERA_INC_COMMON_CAMUTILS_IBUFFER_H_
+
diff --git a/include/hardware/include/mtkcam/v1/camutils/ICameraBuffer.h b/include/hardware/include/mtkcam/v1/camutils/ICameraBuffer.h
new file mode 100644
index 0000000..2d4bbb4
--- /dev/null
+++ b/include/hardware/include/mtkcam/v1/camutils/ICameraBuffer.h
@@ -0,0 +1,106 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_CAMERA_INC_COMMON_CAMUTILS_ICAMERABUFFER_H_
+#define _MTK_CAMERA_INC_COMMON_CAMUTILS_ICAMERABUFFER_H_
+//
+#include <sys/types.h>
+//
+#include <utils/RefBase.h>
+#include <utils/String8.h>
+#if (PLATFORM_VERSION_MAJOR == 2)
+#include <utils/RefBase.h>
+#else
+#include <utils/StrongPointer.h>
+#endif
+//
+#include <hardware/camera.h>
+//
+
+
+/******************************************************************************
+*
+*******************************************************************************/
+
+
+namespace android {
+namespace MtkCamUtils {
+/******************************************************************************
+*
+*******************************************************************************/
+class IMemBuf;
+class IImgBuf;
+
+
+/******************************************************************************
+* Camera Buffer Interface.
+*******************************************************************************/
+class ICameraBuf : public virtual RefBase
+{
+public: //// Attributes.
+ virtual uint_t getBufIndex() const = 0;
+ virtual camera_memory_t* get_camera_memory() = 0;
+
+public: ////
+ //
+ virtual ~ICameraBuf() {};
+};
+
+
+/******************************************************************************
+* Camera Memory Buffer Interface.
+*******************************************************************************/
+class ICameraMemBuf : public IMemBuf, public ICameraBuf
+{
+};
+
+
+/******************************************************************************
+* Camera Image Buffer Interface.
+*******************************************************************************/
+class ICameraImgBuf : public IImgBuf, public ICameraBuf
+{
+};
+
+
+/******************************************************************************
+*
+*******************************************************************************/
+}; // namespace MtkCamUtils
+}; // namespace android
+#endif //_MTK_CAMERA_INC_COMMON_CAMUTILS_ICAMERABUFFER_H_
+
diff --git a/include/hardware/include/mtkcam/v1/camutils/IImgBufQueue.h b/include/hardware/include/mtkcam/v1/camutils/IImgBufQueue.h
new file mode 100644
index 0000000..7f31e57
--- /dev/null
+++ b/include/hardware/include/mtkcam/v1/camutils/IImgBufQueue.h
@@ -0,0 +1,243 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_CAMERA_INC_COMMON_CAMUTILS_IIMGBUFQUEUE_H_
+#define _MTK_CAMERA_INC_COMMON_CAMUTILS_IIMGBUFQUEUE_H_
+//
+#include <utils/Vector.h>
+
+
+/******************************************************************************
+*
+*******************************************************************************/
+
+
+namespace android {
+namespace MtkCamUtils {
+/******************************************************************************
+*
+*******************************************************************************/
+
+
+/*******************************************************************************
+*
+*******************************************************************************/
+struct ImgBufQueNode
+{
+public: //// Image Buffer Operations.
+ inline sp<IImgBuf>const& getImgBuf() const { return mpImgBuf; }
+
+public: //// Status Operations.
+ enum ESTATUS
+ {
+ eSTATUS_TODO, // buffer is ready to be processed.
+ eSTATUS_DONE, // buffer is processed done.
+ eSTATUS_CANCEL, // buffer is canceled & not processed.
+ };
+ //
+ inline bool isTODO() const { return mi4Status == eSTATUS_TODO; }
+ inline bool isDONE() const { return mi4Status == eSTATUS_DONE; }
+ inline bool isCANCEL() const { return mi4Status == eSTATUS_CANCEL; }
+ //
+ inline int32_t getStatus() const { return mi4Status; }
+ inline void setStatus(ESTATUS const eSTATUS) { mi4Status = eSTATUS; }
+
+public: //// Cookie Operations.
+ inline int32_t getCookieED() const { return mi4CookieED; }
+ inline int32_t getCookieDE() const { return mi4CookieDE; }
+ //
+ inline void setCookieED(int32_t const i4Cookie) { mi4CookieED = i4Cookie; }
+ inline void setCookieDE(int32_t const i4Cookie) { mi4CookieDE = i4Cookie; }
+
+public: ////
+ inline void setRotation(uint32_t const u4Rotate){ mu4Rotate = u4Rotate; }
+ inline uint32_t getRotation() const { return mu4Rotate; }
+
+
+public: //// Operators.
+ bool operator!() const { return mpImgBuf==0; }
+ sp<IImgBuf>const& operator->()const { return mpImgBuf; }
+ ImgBufQueNode& operator=(ImgBufQueNode const& rhs)
+ {
+ mpImgBuf = rhs.mpImgBuf;
+ mi4Status = rhs.mi4Status;
+ mi4CookieED = rhs.mi4CookieED;
+ mi4CookieDE = rhs.mi4CookieDE;
+ mu4Rotate = rhs.mu4Rotate;
+ return (*this);
+ }
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+public: //// Instantiation.
+ ImgBufQueNode(
+ sp<IImgBuf>const& pImgBuf = 0,
+ int32_t const i4Status = 0,
+ int32_t const i4CookieED = 0,
+ int32_t const i4CookieDE = 0,
+ uint32_t const u4Rotate = 0
+ )
+ : mpImgBuf(pImgBuf)
+ , mi4Status(i4Status)
+ , mi4CookieED(i4CookieED)
+ , mi4CookieDE(i4CookieDE)
+ , mu4Rotate(u4Rotate)
+ {
+ }
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+protected: //// Data Members.
+ sp<IImgBuf> mpImgBuf;
+ int32_t mi4Status; // TODO, DONE, CANCEL
+ int32_t mi4CookieED; // enqueuer (read/write) -> dequeuer (read only )
+ int32_t mi4CookieDE; // dequeuer (read only ) -> enqueuer (read/write)
+ uint32_t mu4Rotate; // rotation indicator
+ //
+};
+
+
+/******************************************************************************
+* Image Buffer Provider Interface
+*******************************************************************************/
+class IImgBufProvider : public virtual RefBase
+{
+public: //// Owner ID.
+ enum
+ {
+ eID_GENERIC, // Generic Users
+ eID_DISPLAY, // Display Client
+ eID_REC_CB, // Record Callback
+ eID_PRV_CB, // Preview Callback
+ eID_FD, // FD Client
+ eID_OT, // OT Client
+ eID_AP_CLIENT, // AP Client
+ eID_TOTAL_NUM, // Total Num
+ eID_UNKNOWN = 0x80000000,
+ };
+
+public: //// Interface.
+ virtual ~IImgBufProvider() {}
+ //
+ virtual int32_t getProviderId() const = 0;
+ virtual char const* getProviderName() const = 0;
+
+ /*
+ * REPEAT:[ dequeProvider() -> enqueProvider() ]
+ * dequeProvider() returns false immediately if empty.
+ */
+ virtual bool dequeProvider(ImgBufQueNode& rNode) = 0;
+ virtual bool enqueProvider(ImgBufQueNode const& rNode) = 0;
+
+ /*
+ * Arguments:
+ * rNode
+ * [I] If this function returns true, rNode is a copy of the first
+ * node in th queue. Unlike dequeProvider(), the first node is not
+ * removed from th equeue.
+ * Return:
+ * false if the queue is empty.
+ * true if the queue is not empty.
+ */
+ virtual bool queryProvider(ImgBufQueNode& rNode) = 0;
+ //
+ virtual bool queryFormat(String8& rFormat) = 0;
+
+};
+
+
+/******************************************************************************
+* Image Buffer Provider Client Interface
+*******************************************************************************/
+class IImgBufProviderClient : public virtual RefBase
+{
+public: //// Interface.
+ virtual ~IImgBufProviderClient() {}
+ //
+ /**
+ * Notify when IImgBufProvider is created.
+ */
+ virtual bool onImgBufProviderCreated(sp<IImgBufProvider>const& rpProvider) = 0;
+ /**
+ * Notify when IImgBufProvider is destroyed.
+ */
+ virtual void onImgBufProviderDestroyed(int32_t const i4ProviderId) = 0;
+};
+
+
+/******************************************************************************
+* Image Buffer Processor Interface
+*******************************************************************************/
+class IImgBufProcessor : public virtual RefBase
+{
+public: //// Interface.
+ virtual ~IImgBufProcessor() {}
+ //
+ /*
+ * Usage:
+ * enqueProcessor() <============> if needed
+ * -> startProcessor()
+ * -> REPEAT:[ enqueProcessor() -> dequeProcessor() ]
+ * -> pauseProcessor() -> flushProcessor() <============> if needed
+ * -> stopProcessor()
+ *
+ * dequeProcessor() will block until:
+ * (1) queue is not empty, (2) pauseProcessor(), or (3) stopProcessor().
+ */
+ virtual bool enqueProcessor(ImgBufQueNode const& rNode) = 0;
+ virtual bool dequeProcessor(Vector<ImgBufQueNode>& rvNode) = 0;
+ //
+ virtual bool startProcessor() = 0;
+ virtual bool pauseProcessor() = 0;
+ virtual bool flushProcessor() = 0;
+ virtual bool stopProcessor() = 0;
+ // add to examine if the processor is paused.
+ virtual bool isProcessorRunning() = 0;
+};
+
+
+/******************************************************************************
+* Image Buffer Queue Interface
+*******************************************************************************/
+class IImgBufQueue : public IImgBufProvider, public IImgBufProcessor
+{
+};
+
+
+/******************************************************************************
+*
+*******************************************************************************/
+}; // namespace MtkCamUtils
+}; // namespace android
+#endif //_MTK_CAMERA_INC_COMMON_CAMUTILS_IIMGBUFQUEUE_H_
+
diff --git a/include/hardware/include/mtkcam/v1/camutils/ImgBufQueue.h b/include/hardware/include/mtkcam/v1/camutils/ImgBufQueue.h
new file mode 100644
index 0000000..8241ed3
--- /dev/null
+++ b/include/hardware/include/mtkcam/v1/camutils/ImgBufQueue.h
@@ -0,0 +1,170 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_CAMERA_INC_COMMON_CAMUTILS_IMGBUFQUEUE_H_
+#define _MTK_CAMERA_INC_COMMON_CAMUTILS_IMGBUFQUEUE_H_
+//
+#include <utils/threads.h>
+#include <utils/List.h>
+#include <utils/Vector.h>
+
+
+/******************************************************************************
+*
+*******************************************************************************/
+
+
+namespace android {
+namespace MtkCamUtils {
+/******************************************************************************
+*
+*******************************************************************************/
+
+
+/******************************************************************************
+* Image Buffer Queue
+*
+* enqueProcessor --> [ ToDo Queue ] --> dequeProvider
+* --> -->
+* [Provider] [Processor]
+* <-- <--
+* dequeProcessor <-- [ Done Queue ] <-- enqueProvider
+*
+*******************************************************************************/
+class ImgBufQueue : public IImgBufQueue
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Implementation.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Instantiation.
+ ImgBufQueue(
+ int32_t const i4QueueId,
+ char const*const pszQueueName
+ );
+
+protected: //// Data Members.
+ int32_t const mi4QueueId;
+ char const*const mpszQueueName;
+ char const* getQueName() const { return mpszQueueName; }
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// TODO Queue
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected: ////
+ List<ImgBufQueNode> mTodoImgBufQue;
+ mutable Mutex mTodoImgBufQueMtx;
+ String8 mTodoImgBufQueFmt;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// DONE Queue
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected: ////
+ Vector<ImgBufQueNode> mDoneImgBufQue;
+ mutable Mutex mDoneImgBufQueMtx;
+ Condition mDoneImgBufQueCond; // Condition to wait: [ mDoneImgBufQue.empty() && mbIsProcessorRunning ]
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// IImgBufProvider.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Interface.
+ virtual int32_t getProviderId() const { return mi4QueueId; }
+ virtual char const* getProviderName() const { return mpszQueueName; }
+
+ /*
+ * REPEAT:[ dequeProvider() -> enqueProvider() ]
+ * dequeProvider() returns false immediately if empty.
+ */
+ virtual bool dequeProvider(ImgBufQueNode& rNode);
+ virtual bool enqueProvider(ImgBufQueNode const& rNode);
+
+ /*
+ * Arguments:
+ * rNode
+ * [I] If this function returns true, rNode is a copy of the first
+ * node in th queue. Unlike dequeProvider(), the first node is not
+ * removed from th equeue.
+ * Return:
+ * false if the queue is empty.
+ * true if the queue is not empty.
+ */
+ virtual bool queryProvider(ImgBufQueNode& rNode);
+ //
+ virtual bool queryFormat(String8& rFormat);
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// IImgBufProcessor.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Interface.
+ /*
+ * Usage:
+ * enqueProcessor() <============> if needed
+ * -> startProcessor()
+ * -> REPEAT:[ enqueProcessor() -> dequeProcessor() ]
+ * -> pauseProcessor() -> flushProcessor() <============> if needed
+ * -> stopProcessor()
+ *
+ * dequeProcessor() will block until:
+ * (1) queue is not empty, (2) pauseProcessor(), or (3) stopProcessor().
+ */
+ virtual bool enqueProcessor(ImgBufQueNode const& rNode);
+ virtual bool dequeProcessor(Vector<ImgBufQueNode>& rvNode);
+ //
+ virtual bool startProcessor();
+ virtual bool pauseProcessor();
+ virtual bool stopProcessor();
+ /*
+ * Move all buffers from TODO queue to DONE queue.
+ * It returns false if Processor is Running; call pauseProcessor() firstly
+ * before flushProcessor().
+ */
+ virtual bool flushProcessor();
+ virtual bool isProcessorRunning();
+
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+protected: //// Data Members.
+ bool volatile mbIsProcessorRunning;
+
+};
+
+
+/******************************************************************************
+*
+*******************************************************************************/
+}; // namespace MtkCamUtils
+}; // namespace android
+#endif //_MTK_CAMERA_INC_COMMON_CAMUTILS_IMGBUFQUEUE_H_
+
diff --git a/include/hardware/include/mtkcam/v1/client/IFDClient.h b/include/hardware/include/mtkcam/v1/client/IFDClient.h
new file mode 100644
index 0000000..52e8d38
--- /dev/null
+++ b/include/hardware/include/mtkcam/v1/client/IFDClient.h
@@ -0,0 +1,106 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_V1_CLIENT_IFDCLIENT_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_V1_CLIENT_IFDCLIENT_H_
+//
+
+
+namespace android {
+/******************************************************************************
+ *
+ ******************************************************************************/
+class IParamsManager;
+
+
+namespace NSCamClient {
+
+
+/******************************************************************************
+* Face Detection Client Handler.
+*******************************************************************************/
+class IFDClient : public virtual RefBase
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+//
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Instantiation.
+ //
+ static sp<IFDClient> createInstance(sp<IParamsManager> pParamsMgr);
+ //
+ virtual ~IFDClient() {}
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Interfaces.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: ////
+
+ virtual bool init() = 0;
+ virtual bool uninit() = 0;
+
+ virtual bool setImgBufProviderClient(
+ sp<IImgBufProviderClient>const& rpClient
+ ) = 0;
+
+ /**
+ *
+ */
+ virtual void setCallbacks(
+ sp<CamMsgCbInfo> const& rpCamMsgCbInfo
+ ) = 0;
+
+ /**
+ *
+ */
+ virtual status_t sendCommand(int32_t cmd, int32_t arg1, int32_t arg2) = 0;
+ virtual bool stopPreview() = 0;
+ virtual bool takePicture() = 0;
+
+
+ /**
+ *
+ */
+ virtual void enableMsgType(int32_t msgType) = 0;
+ virtual void disableMsgType(int32_t msgType) = 0;
+
+};
+
+
+}; // namespace NSCamClient
+}; // namespace android
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_V1_CLIENT_IFDCLIENT_H_
+
diff --git a/include/hardware/include/mtkcam/v1/client/IOTClient.h b/include/hardware/include/mtkcam/v1/client/IOTClient.h
new file mode 100644
index 0000000..0356a71
--- /dev/null
+++ b/include/hardware/include/mtkcam/v1/client/IOTClient.h
@@ -0,0 +1,108 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HAL_CAMCLIENT_INC_IOTCLIENT_H_
+#define _MTK_HAL_CAMCLIENT_INC_IOTCLIENT_H_
+//
+
+
+namespace android {
+/******************************************************************************
+ *
+ ******************************************************************************/
+class IParamsManager;
+
+
+namespace NSCamClient {
+
+
+/******************************************************************************
+* Face Detection Client Handler.
+*******************************************************************************/
+class IOTClient : public virtual RefBase
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+//
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Instantiation.
+ //
+ static sp<IOTClient> createInstance(sp<IParamsManager> pParamsMgr);
+ //
+ virtual ~IOTClient() {}
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Interfaces.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: ////
+
+ virtual bool init() = 0;
+ virtual bool uninit() = 0;
+
+ virtual bool setImgBufProviderClient(
+ sp<IImgBufProviderClient>const& rpClient
+ ) = 0;
+
+ /**
+ *
+ */
+ virtual void setCallbacks(
+ sp<CamMsgCbInfo> const& rpCamMsgCbInfo
+ ) = 0;
+
+ /**
+ *
+ */
+ virtual status_t sendCommand(int32_t cmd, int32_t arg1, int32_t arg2) = 0;
+ virtual bool stopPreview() = 0;
+ virtual bool takePicture() = 0;
+ virtual bool startRecording() = 0;
+ virtual bool stopRecording() = 0;
+
+
+ /**
+ *
+ */
+ virtual void enableMsgType(int32_t msgType) = 0;
+ virtual void disableMsgType(int32_t msgType) = 0;
+
+};
+
+
+}; // namespace NSCamClient
+}; // namespace android
+#endif //_MTK_HAL_CAMCLIENT_INC_IFDCLIENT_H_
+
diff --git a/include/hardware/include/mtkcam/v1/client/IPreviewClient.h b/include/hardware/include/mtkcam/v1/client/IPreviewClient.h
new file mode 100644
index 0000000..d929a26
--- /dev/null
+++ b/include/hardware/include/mtkcam/v1/client/IPreviewClient.h
@@ -0,0 +1,117 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_V1_CLIENT_IPREVIEWCLIENT_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_V1_CLIENT_IPREVIEWCLIENT_H_
+//
+
+
+namespace android {
+/******************************************************************************
+ *
+ ******************************************************************************/
+class IParamsManager;
+
+
+namespace NSCamClient {
+
+
+/******************************************************************************
+* Preview Client Handler.
+*******************************************************************************/
+class IPreviewClient : public virtual RefBase
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+//
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Instantiation.
+ //
+ static sp<IPreviewClient> createInstance(sp<IParamsManager> pParamsMgr);
+ //
+ virtual ~IPreviewClient() {}
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Interfaces.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: ////
+
+ virtual bool init() = 0;
+ virtual bool uninit() = 0;
+
+ virtual bool setImgBufProviderClient(
+ sp<IImgBufProviderClient>const& rpClient
+ ) = 0;
+
+ /**
+ * Set camera message-callback information.
+ */
+ virtual void setCallbacks(
+ sp<CamMsgCbInfo> const& rpCamMsgCbInfo
+ ) = 0;
+ virtual void enableMsgType(int32_t msgType) = 0;
+ virtual void disableMsgType(int32_t msgType) = 0;
+ /**
+ *
+ */
+ virtual bool startPreview() = 0;
+ virtual bool stopPreview() = 0;
+
+ /**
+ *
+ */
+ virtual bool takePicture() = 0;
+
+ /**
+ * Send command to camera client.
+ */
+ virtual status_t sendCommand(
+ int32_t cmd,
+ int32_t arg1,
+ int32_t arg2
+ ) = 0;
+
+ /**
+ *
+ */
+ virtual status_t dump(int fd, Vector<String8>& args) = 0;
+};
+
+
+}; // namespace NSCamClient
+}; // namespace android
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_V1_CLIENT_IPREVIEWCLIENT_H_
+
diff --git a/include/hardware/include/mtkcam/v1/client/IPreviewFeatureClient.h b/include/hardware/include/mtkcam/v1/client/IPreviewFeatureClient.h
new file mode 100644
index 0000000..5b4a2d6
--- /dev/null
+++ b/include/hardware/include/mtkcam/v1/client/IPreviewFeatureClient.h
@@ -0,0 +1,107 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_V1_CLIENT_IPREFEATURECLINET_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_V1_CLIENT_IPREFEATURECLINET_H_
+//
+
+
+namespace android {
+/******************************************************************************
+ *
+ ******************************************************************************/
+class IParamsManager;
+
+
+namespace NSCamClient {
+
+
+/******************************************************************************
+* Face Detection Client Handler.
+*******************************************************************************/
+class IPREFEATUREClient : public virtual RefBase
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+//
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Instantiation.
+ //
+ static sp<IPREFEATUREClient> createInstance(sp<IParamsManager> pParamsMgr);
+ //
+ virtual ~IPREFEATUREClient() {}
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Interfaces.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: ////
+
+ virtual bool init() = 0;
+ virtual bool uninit() = 0;
+
+ virtual bool setImgBufProviderClient(
+ sp<IImgBufProviderClient>const& rpClient
+ ) = 0;
+
+ /**
+ *
+ */
+ virtual void setCallbacks(
+ sp<CamMsgCbInfo> const& rpCamMsgCbInfo
+ ) = 0;
+
+ /**
+ *
+ */
+ virtual status_t sendCommand(int32_t cmd, int32_t arg1, int32_t arg2) = 0;
+
+
+ virtual bool stopPreview() = 0;
+
+
+ /**
+ *
+ */
+ virtual void enableMsgType(int32_t msgType) = 0;
+ virtual void disableMsgType(int32_t msgType) = 0;
+
+};
+
+
+}; // namespace NSCamClient
+}; // namespace android
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_V1_CLIENT_IPREFEATURECLINET_H_
+
diff --git a/include/hardware/include/mtkcam/v1/client/IRecordClient.h b/include/hardware/include/mtkcam/v1/client/IRecordClient.h
new file mode 100644
index 0000000..762e201
--- /dev/null
+++ b/include/hardware/include/mtkcam/v1/client/IRecordClient.h
@@ -0,0 +1,117 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_V1_CLIENT_IRECORDCLIENT_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_V1_CLIENT_IRECORDCLIENT_H_
+//
+
+
+namespace android {
+/******************************************************************************
+ *
+ ******************************************************************************/
+class IParamsManager;
+
+
+namespace NSCamClient {
+
+
+/******************************************************************************
+* Preview Client Handler.
+*******************************************************************************/
+class IRecordClient : public virtual RefBase
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+//
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Instantiation.
+ //
+ static sp<IRecordClient> createInstance(sp<IParamsManager> pParamsMgr);
+ //
+ virtual ~IRecordClient() {}
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Interfaces.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: ////
+
+ virtual bool init() = 0;
+ virtual bool uninit() = 0;
+
+ virtual bool setImgBufProviderClient(
+ sp<IImgBufProviderClient>const& rpClient
+ ) = 0;
+
+ /**
+ * Set camera message-callback information.
+ */
+ virtual void setCallbacks(
+ sp<CamMsgCbInfo> const& rpCamMsgCbInfo
+ ) = 0;
+ virtual void enableMsgType(int32_t msgType) = 0;
+ virtual void disableMsgType(int32_t msgType) = 0;
+
+ /**
+ *
+ */
+ virtual status_t storeMetaDataInBuffers(bool enable) { return INVALID_OPERATION; }
+ virtual bool startPreview() = 0;
+ virtual bool stopPreview() = 0;
+ virtual bool startRecording() = 0;
+ virtual bool stopRecording() = 0;
+ virtual void releaseRecordingFrame(
+ const void *opaque) = 0;
+
+ /**
+ *
+ */
+ virtual status_t dump(int fd, Vector<String8>& args) = 0;
+
+ /**
+ *
+ */
+ virtual status_t sendCommand(
+ int32_t cmd,
+ int32_t arg1,
+ int32_t arg2) = 0;
+};
+
+
+}; // namespace NSCamClient
+}; // namespace android
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_V1_CLIENT_IRECORDCLIENT_H_
+
diff --git a/include/hardware/include/mtkcam/v1/common.h b/include/hardware/include/mtkcam/v1/common.h
new file mode 100644
index 0000000..dae81de
--- /dev/null
+++ b/include/hardware/include/mtkcam/v1/common.h
@@ -0,0 +1,54 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_V1_COMMON_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_V1_COMMON_H_
+/******************************************************************************
+ *
+ ******************************************************************************/
+//
+#include "camutils/CamInfo.h"
+#include "camutils/IBuffer.h"
+#include "camutils/ICameraBuffer.h"
+#include "camutils/IImgBufQueue.h"
+#include "camutils/ImgBufQueue.h"
+//
+/******************************************************************************
+ *
+ ******************************************************************************/
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_V1_COMMON_H_
+
diff --git a/include/hardware/include/mtkcam/v1/featureio/3DF_hal_base.h b/include/hardware/include/mtkcam/v1/featureio/3DF_hal_base.h
new file mode 100644
index 0000000..dd21ed4
--- /dev/null
+++ b/include/hardware/include/mtkcam/v1/featureio/3DF_hal_base.h
@@ -0,0 +1,198 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein
+ * is confidential and proprietary to MediaTek Inc. and/or its licensors.
+ * Without the prior written permission of MediaTek inc. and/or its licensors,
+ * any reproduction, modification, use or disclosure of MediaTek Software,
+ * and information contained herein, in whole or in part, shall be strictly prohibited.
+ */
+/* MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON
+ * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+ * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+ * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+ * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
+ * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
+ * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
+ * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
+ * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
+ * CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+ * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+ * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
+ * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek Software")
+ * have been modified by MediaTek Inc. All revisions are subject to any receiver's
+ * applicable license agreements with MediaTek Inc.
+ */
+
+/********************************************************************************************
+ * LEGAL DISCLAIMER
+ *
+ * (Header of MediaTek Software/Firmware Release or Documentation)
+ *
+ * BY OPENING OR USING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") RECEIVED
+ * FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON AN "AS-IS" BASIS
+ * ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR
+ * A PARTICULAR PURPOSE OR NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY
+ * WHATSOEVER WITH RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK
+ * ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+ * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S SPECIFICATION
+ * OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+ *
+ * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE LIABILITY WITH
+ * RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION,
+TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE
+ * FEES OR SERVICE CHARGE PAID BY BUYER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE WITH THE LAWS
+ * OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF LAWS PRINCIPLES.
+ ************************************************************************************************/
+
+#ifndef _3DF_HAL_BASE_H_
+#define _3DF_HAL_BASE_H_
+
+/*******************************************************************************
+*
+********************************************************************************/
+
+#define MAV_PIPE_MAX_IMAGE_NUM (25) // maximum image number
+#define Pipe_RANK (3)
+#define MOTION_MAX_IN_WIDTH (320) // max input image width
+#define MOTION_MAX_IN_HEIGHT (240) // max input image height
+#define OVERLAP_RATIO (32)
+#define PANO3DOVERLAP_RATIO (58)
+#define PIPEPANO3D_MAX_IMG_NUM (25)
+
+typedef enum Hal3DFObject_s {
+ HAL_3DF_OBJ_NONE = 0,
+ HAL_MAV_OBJ_NORMAL,
+ HAL_PANO3D_OBJ_NORMAL,
+ HAL_3DF_OBJ_UNKNOWN = 0xFF,
+} Hal3DFObject_e;
+
+typedef enum
+{
+ MTKMAV_DIR_RIGHT=0,
+ MTKMAV_DIR_LEFT,
+ MTKMAV_DIR_UP,
+ MTKMAV_DIR_DOWN,
+ MTKMAV_DIR_NO
+} MTKMAV_DIRECTION_ENUM;
+
+struct MAVMotionResultInfo
+{
+ /* motion tracking results */
+ MINT16 MV_X; // horizontal accumulated motion
+ MINT16 MV_Y; // vertical accumulated motion
+ MBOOL ReadyToShot; // ready to shot flag (0/1 = not ready/ready)
+ MINT32 RetCode; // returned code of state machine
+ MUINT8 ErrPattern; // returned error/warning bit pattern
+ // bit 0: low trust value (set if warning)
+ // bit 1: large motion vector (set if warning)
+ // bit 2: vertical shake (set if warning)
+ MTKMAV_DIRECTION_ENUM Direction; // panorama direction enum
+};
+
+struct MavPipeImageInfo
+{
+ uintptr_t ImgAddr;
+ MUINT16 Width; // input image width
+ MUINT16 Height; // input image height
+ MUINT32 AngleValueX;
+ MUINT32 AngleValueY;
+ MFLOAT AngleValueZ; // AngleValue
+ MINT32 ClipX; // Image Global Offset X
+ MINT32 ClipY; // Image Global Offset Y
+ MINT32 MotionValue[2];
+
+ // for 3D Panorama
+ MUINT16 GridX; // vertical offset in panorama space
+ MUINT16 MinX; // x_start in panorama space
+ MUINT16 MaxX; // x_end in panorama space
+ MBOOL ControlFlow; // rectify once or not
+};
+
+struct MavPipeResultInfo
+{
+ MINT32 RetCode; // return warning
+ MINT16 ClipWidth; // Image Result Width
+ MINT16 ClipHeight; // Image Result Height
+ MUINT16 ViewIdx; // Image Start View Index
+ MUINT8 ErrPattern; // Returned error/Warning bit pattern
+ // bit 0: lack of match points (set if error)
+ // bit 1: small clip region (set if error)
+ // bit 2: reverse order(set if warning) -> 0/1 = Left-To-Right/Right-To-Left
+ MavPipeImageInfo ImageInfo[MAV_PIPE_MAX_IMAGE_NUM];
+ MFLOAT ImageHmtx[MAV_PIPE_MAX_IMAGE_NUM][Pipe_RANK][Pipe_RANK]; // 3x3 rectification matrix
+};
+
+struct PipePano3DResultInfo
+{
+ MUINT16 PanoWidth;
+ MUINT16 PanoHeight;
+ MUINT32 LeftPanoImageAddr;
+ MUINT32 RightPanoImageAddr;
+ MUINT32 RetCode;
+ MUINT8 ErrPattern; // Returned error/Warning bit pattern
+ // bit 0: small overlap width (set if error)
+ // bit 1: large seam change (set if error)
+ MUINT32 ClipX; // horizontal offset of ROI
+ MUINT32 ClipY; // vertical offset of ROI
+ MUINT32 ClipWidth; // width of ROI
+ MUINT32 ClipHeight; // height of ROI
+
+ // Optimal Seam - debug purpose
+ MINT32 OptimalSeamLeft[PIPEPANO3D_MAX_IMG_NUM][600];
+};
+
+/*******************************************************************************
+*
+********************************************************************************/
+class hal3DFBase {
+public:
+ static hal3DFBase* createInstance(Hal3DFObject_e eobject);
+ virtual MVOID destroyInstance() = 0;
+ virtual ~hal3DFBase() {};
+protected:
+
+
+public:
+ virtual MINT32 mHal3dfInit(void* MavInitInData,void* MotionInitInData,void* WarpInitInData,void* Pano3DInitInData) {return 0;}
+ virtual MINT32 mHal3dfUninit() {return 0;}
+ virtual MINT32 mHal3dfMain(void) {return 0;}
+ virtual MINT32 mHal3dfAddImg(MavPipeImageInfo* pParaIn);
+ virtual MINT32 mHal3dfGetMavResult(void* pParaOut);
+ virtual MINT32 mHal3dfMerge(MUINT32 *MavResult);
+ virtual MINT32 mHal3dfDoMotion(void* InputData,MUINT32* MotionResult, MUINT32 u4SrcImgWidth = 0, MUINT32 u4SrcImgHeight = 0);
+ virtual MINT32 mHal3dfWarp(MavPipeImageInfo* pParaIn,MUINT32 *MavResult,MUINT8 ImgNum);
+ virtual MINT32 mHal3dfCrop(MUINT32 *MavResult,MUINT8 ImgNum);
+ virtual MINT32 mHal3dfGetResult(MUINT32& MavResult,MUINT32& ClipWidth, MUINT32& ClipHeight);
+ virtual MINT32 mHal3dfStitch(MUINT32 *MavResult,MUINT8 ImgNum);
+ virtual MINT32 mHal3dfGetStitchResult(void* Pano3dResult);
+ virtual MINT32 mHal3dfGetWokSize(int SrcWidth, int SrcHeight, MUINT32 &WorkingSize);
+ virtual MINT32 mHal3dfSetWokBuff(void* WorkingBuff);
+};
+
+class hal3DFTmp : public hal3DFBase {
+public:
+ //
+ static hal3DFBase* getInstance();
+ virtual void destroyInstance();
+ //
+ hal3DFTmp() {};
+ virtual ~hal3DFTmp() {};
+};
+
+#endif
+
diff --git a/include/hardware/include/mtkcam/v1/featureio/autorama_hal_base.h b/include/hardware/include/mtkcam/v1/featureio/autorama_hal_base.h
new file mode 100644
index 0000000..2b38c87
--- /dev/null
+++ b/include/hardware/include/mtkcam/v1/featureio/autorama_hal_base.h
@@ -0,0 +1,239 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein
+ * is confidential and proprietary to MediaTek Inc. and/or its licensors.
+ * Without the prior written permission of MediaTek inc. and/or its licensors,
+ * any reproduction, modification, use or disclosure of MediaTek Software,
+ * and information contained herein, in whole or in part, shall be strictly prohibited.
+ */
+/* MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON
+ * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+ * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+ * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+ * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
+ * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
+ * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
+ * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
+ * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
+ * CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+ * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+ * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
+ * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek Software")
+ * have been modified by MediaTek Inc. All revisions are subject to any receiver's
+ * applicable license agreements with MediaTek Inc.
+ */
+
+/********************************************************************************************
+ * LEGAL DISCLAIMER
+ *
+ * (Header of MediaTek Software/Firmware Release or Documentation)
+ *
+ * BY OPENING OR USING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") RECEIVED
+ * FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON AN "AS-IS" BASIS
+ * ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR
+ * A PARTICULAR PURPOSE OR NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY
+ * WHATSOEVER WITH RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK
+ * ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+ * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S SPECIFICATION
+ * OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+ *
+ * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE LIABILITY WITH
+ * RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION,
+TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE
+ * FEES OR SERVICE CHARGE PAID BY BUYER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE WITH THE LAWS
+ * OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF LAWS PRINCIPLES.
+ ************************************************************************************************/
+/*
+** $Log: fd_hal_base.h $
+ *
+*/
+
+#ifndef _AUTORAMA_HAL_BASE_H_
+#define _AUTORAMA_HAL_BASE_H_
+
+/*******************************************************************************
+*
+********************************************************************************/
+
+#define AUTORAMA_MAX_WIDTH (30720) // max output image width
+#define MOTION_MAX_IN_WIDTH (320) // max input image width
+#define MOTION_MAX_IN_HEIGHT (240) // max input image height
+#define MOTION_PIPE_WORKING_BUFFER_SIZE (MOTION_MAX_IN_WIDTH * MOTION_MAX_IN_HEIGHT * 3)
+#define OVERLAP_RATIO (32)
+
+typedef enum HalAUTORAMAObject_s {
+ HAL_AUTORAMA_OBJ_NONE = 0,
+ HAL_AUTORAMA_OBJ_AUTO,
+ HAL_AUTORAMA_OBJ_UNKNOWN = 0xFF,
+} HalAUTORAMAObject_e;
+//
+#define HAL_AUTORAMA_RESET_PARAM 0x00
+#define HAL_AUTORAMA_SET_DST_DIR 0x10 // Direction (direction)
+#define HAL_AUTORAMA_SET_DST_BUF 0x11 // Buffer (buffer address, size)
+#define HAL_AUTORAMA_SET_SRC_DIM 0x20 // Dimension (width, height)
+#define HAL_AUTORAMA_SET_SRC_BUF 0x21 // Buffer (index, buffer address)
+#define HAL_AUTORAMA_GET_RESULT 0x40 // result (buffer address, width, height)
+
+typedef enum
+{
+ MTKPIPEAUTORAMA_DIR_RIGHT=0, // panorama direction is right
+ MTKPIPEAUTORAMA_DIR_LEFT, // panorama direction is left
+ MTKPIPEAUTORAMA_DIR_UP, // panorama direction is up
+ MTKPIPEAUTORAMA_DIR_DOWN, // panorama direction is down
+ MTKPIPEAUTORAMA_DIR_NO // panorama direction is not decided
+} MTKPIPEAUTORAMA_DIRECTION_ENUM;
+
+typedef enum
+{
+ MTKPIPEAUTORAMA_IMAGE_YV12, // processing add image
+ MTKPIPEAUTORAMA_IMAGE_NV21, // processing stitch images
+ MTKPIPEAUTORAMA_IMAGE_MAX
+} MTKPIPEAUTORAMA_IMAGE_FORMAT_ENUM;
+
+struct MTKPipeAutoramaEnvInfo
+{
+ MUINT16 SrcImgWidth; // input image width
+ MUINT16 SrcImgHeight; // input image height
+ MUINT16 MaxPanoImgWidth; // final output image max width
+ MUINT8 MaxSnapshotNumber; // max capture image num
+ uintptr_t WorkingBufAddr; // working buffer
+ MUINT32 WorkingBufSize; // working buffer size
+ MBOOL FixAE; // fixAe or not, if false, system should provide the ev information
+ MUINT32 FocalLength; // lens focal length depends on lens, normally, this value can be set 750
+ MBOOL GPUWarp; // enable gpu cylindrical projection or not
+ MTKPIPEAUTORAMA_IMAGE_FORMAT_ENUM SrcImgFormat;// source image format
+};
+
+struct MTKPipeMotionTuningPara
+{
+ MINT32 MaxMV; // maximum motion vertor (default: 8)
+ MINT32 StepLB; // upper bound of frame step (default: 3)
+ MINT32 StepUB; // lower bound of frame step (default: 8)
+ MINT32 ToleranceX; // horizontal tolerance of motion vector deviation
+ MINT32 ToleranceY; // vertical tolerance of motion vector deviation
+ MINT32 OverlapRatio; // overlap ratio between captured images
+};
+
+struct MTKPipeMotionEnvInfo
+{
+ MUINT32 SrcImgWidth; // source image width
+ MUINT32 SrcImgHeight; // source image height
+ uintptr_t WorkingBuffAddr; // working buffer address
+ MUINT32 WorkingBuffSize; // working buffer size
+ MTKPipeMotionTuningPara *pTuningPara; // tuning parameters
+};
+
+struct MTKPipeAutoramaResultInfo
+{
+ uintptr_t ImgBufferAddr; // output image address, currently, only output YUV420
+ MUINT16 ImgWidth; // output image width
+ MUINT16 ImgHeight; // output image height
+};
+
+struct AutoramaMotionResult
+{
+ /* motion tracking results */
+ MINT16 MV_X; // horizontal accumulated motion
+ MINT16 MV_Y; // vertical accumulated motion
+ MBOOL ReadyToShot; // ready to shot flag (0/1 = not ready/ready)
+ MINT32 RetCode; // returned code of state machine
+ MUINT8 ErrPattern; // returned error/warning bit pattern
+ // bit 0: low trust value (set if warning)
+ // bit 1: large motion vector (set if warning)
+ // bit 2: vertical shake (set if warning)
+ MTKPIPEAUTORAMA_DIRECTION_ENUM Direction; // panorama direction enum
+};
+/*******************************************************************************
+*
+********************************************************************************/
+class halAUTORAMABase {
+public:
+ //
+ MINT32 gImgEV[9];
+ static halAUTORAMABase* createInstance(HalAUTORAMAObject_e eobject);
+ virtual void destroyInstance() = 0;
+ virtual ~halAUTORAMABase() {};
+ /////////////////////////////////////////////////////////////////////////
+ //
+ // mHalAutoramaInit () -
+ //! \brief init autorama
+ //
+ /////////////////////////////////////////////////////////////////////////
+ virtual MINT32 mHalAutoramaInit(MTKPipeAutoramaEnvInfo AutoramaInitInData, MTKPipeMotionEnvInfo MotionInitInfo) {return 0;}
+
+ /////////////////////////////////////////////////////////////////////////
+ //
+ // mHalAutoramaUninit () -
+ //! \brief Autorama uninit
+ //
+ /////////////////////////////////////////////////////////////////////////
+ virtual MINT32 mHalAutoramaUninit() {return 0;}
+
+ /////////////////////////////////////////////////////////////////////////
+ //
+ // mHalAutoramaGetParam () -
+ //! \brief draw fd face detection result rectangle
+ //
+ /////////////////////////////////////////////////////////////////////////
+ virtual MINT32 mHalAutoramaGetResult(MTKPipeAutoramaResultInfo* ResultInfo) {return 0;}
+
+ /////////////////////////////////////////////////////////////////////////
+ //
+ // mHalAutoramaCalcStitch () -
+ //! \brief get face detection result
+ //
+ /////////////////////////////////////////////////////////////////////////
+ virtual MINT32 mHalAutoramaCalcStitch(void* SrcImg,MINT32 gEv,MTKPIPEAUTORAMA_DIRECTION_ENUM DIRECTION) {return 0;}
+
+ /////////////////////////////////////////////////////////////////////////
+ //
+ // mHalAutoramaDoStitch () -
+ //! \brief get face detection result
+ //
+ /////////////////////////////////////////////////////////////////////////
+ virtual MINT32 mHalAutoramaDoStitch() {return 0;}
+
+ /////////////////////////////////////////////////////////////////////////
+ //
+ // mHalAutoramaDoMotion () -
+ //! \brief check motion and capture
+ //
+ /////////////////////////////////////////////////////////////////////////
+ virtual MINT32 mHalAutoramaDoMotion(MUINT32* ImgSrc,MUINT32* MotionResult) {return 0;}
+
+ /////////////////////////////////////////////////////////////////////////
+ //
+ // mHalAutoramaGetWokSize () -
+ //! \brief get working buffer size
+ //
+ /////////////////////////////////////////////////////////////////////////
+ virtual MINT32 mHalAutoramaGetWokSize(int SrcWidth, int SrcHeight, int ShotNum, int &WorkingSize) {return 0;}
+};
+
+class halAUTORAMATmp : public halAUTORAMABase {
+public:
+ //
+ static halAUTORAMABase* getInstance();
+ virtual void destroyInstance();
+ //
+ halAUTORAMATmp() {};
+ virtual ~halAUTORAMATmp() {};
+};
+
+#endif
+
diff --git a/include/hardware/include/mtkcam/v1/featureio/motiontrack_hal_base.h b/include/hardware/include/mtkcam/v1/featureio/motiontrack_hal_base.h
new file mode 100644
index 0000000..5d0dc09
--- /dev/null
+++ b/include/hardware/include/mtkcam/v1/featureio/motiontrack_hal_base.h
@@ -0,0 +1,210 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein
+ * is confidential and proprietary to MediaTek Inc. and/or its licensors.
+ * Without the prior written permission of MediaTek inc. and/or its licensors,
+ * any reproduction, modification, use or disclosure of MediaTek Software,
+ * and information contained herein, in whole or in part, shall be strictly prohibited.
+ */
+/* MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON
+ * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+ * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+ * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+ * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
+ * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
+ * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
+ * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
+ * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
+ * CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+ * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+ * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
+ * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek Software")
+ * have been modified by MediaTek Inc. All revisions are subject to any receiver's
+ * applicable license agreements with MediaTek Inc.
+ */
+
+/********************************************************************************************
+ * LEGAL DISCLAIMER
+ *
+ * (Header of MediaTek Software/Firmware Release or Documentation)
+ *
+ * BY OPENING OR USING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") RECEIVED
+ * FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON AN "AS-IS" BASIS
+ * ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR
+ * A PARTICULAR PURPOSE OR NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY
+ * WHATSOEVER WITH RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK
+ * ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+ * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S SPECIFICATION
+ * OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+ *
+ * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE LIABILITY WITH
+ * RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION,
+TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE
+ * FEES OR SERVICE CHARGE PAID BY BUYER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE WITH THE LAWS
+ * OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF LAWS PRINCIPLES.
+ ************************************************************************************************/
+/*
+** $Log: fd_hal_base.h $
+ *
+*/
+
+#ifndef _MOTIONTRACK_HAL_BASE_H_
+#define _MOTIONTRACK_HAL_BASE_H_
+
+/*******************************************************************************
+*
+********************************************************************************/
+
+//
+//
+#define MOTIONTRACK_MAX_NUM_OF_BLENDING_IMAGES 8
+struct MTKPipeMotionTrackEnvInfo
+{
+ MUINT16 SrcImgWidth; // input image width
+ MUINT16 SrcImgHeight; // input image height
+};
+struct MTKPipeMotionTrackWorkBufInfo
+{
+ MUINT8* WorkBufAddr;
+ MUINT32 WorkBufSize;
+};
+struct MTKPipeMotionTrackAddImageInfo
+{
+ MUINT8 ImageIndex;
+ MUINT8* ThumbImageAddr;
+ MUINT32 ThumbImageWidth;
+ MUINT32 ThumbImageHeight;
+ MUINT32 ThumbImageStrideY;
+ MUINT32 ThumbImageStrideUV;
+ MINT32 MvX;
+ MINT32 MvY;
+};
+struct MTKPipeMotionTrackIntermediateData
+{
+ MUINT32 DataSize;
+ void* DataAddr;
+};
+struct MTKPipeMotionTrackSelectImageInfo
+{
+ MUINT32 NumCandidateImages; //candidate number returned;
+ MUINT8 CandidateImageIndex[MOTIONTRACK_MAX_NUM_OF_BLENDING_IMAGES];
+};
+struct MTKPipeMotionTrackBlendImageInfo
+{
+ MUINT32 NumBlendImages;
+ MUINT8 BlendImageIndex[MOTIONTRACK_MAX_NUM_OF_BLENDING_IMAGES];
+ MUINT8* SrcImageAddr[MOTIONTRACK_MAX_NUM_OF_BLENDING_IMAGES];
+ MUINT8* ResultImageAddr[MOTIONTRACK_MAX_NUM_OF_BLENDING_IMAGES];
+};
+struct MTKPipeMotionTrackResultImageInfo
+{
+ MUINT16 OutputImgWidth;
+ MUINT16 OutputImgHeight;
+};
+/*******************************************************************************
+*
+********************************************************************************/
+class halMOTIONTRACKBase {
+public:
+ //
+ static halMOTIONTRACKBase* createInstance();
+ virtual void destroyInstance() = 0;
+ virtual ~halMOTIONTRACKBase() {};
+ /////////////////////////////////////////////////////////////////////////
+ //
+ // mHalMotionTrackInit () -
+ //! \brief init MotionTrack
+ //
+ /////////////////////////////////////////////////////////////////////////
+ virtual MINT32 mHalMotionTrackInit(MTKPipeMotionTrackEnvInfo MotionTrackEnvInfo) = 0;
+
+ /////////////////////////////////////////////////////////////////////////
+ //
+ // mHalMotionTrackUninit () -
+ //! \brief MotionTrack uninit
+ //
+ /////////////////////////////////////////////////////////////////////////
+ virtual MINT32 mHalMotionTrackUninit() = 0;
+
+ /////////////////////////////////////////////////////////////////////////
+ //
+ // mHalMotionTrackGetWorkSize () -
+ //! \brief get working buffer size
+ //
+ /////////////////////////////////////////////////////////////////////////
+ virtual MINT32 mHalMotionTrackGetWorkSize(MTKPipeMotionTrackWorkBufInfo *MotionTrackWorkBufInfo) = 0;
+
+ /////////////////////////////////////////////////////////////////////////
+ //
+ // mHalMotionTrackGetGMV () -
+ //! \brief Get EIS GMV
+ //
+ /////////////////////////////////////////////////////////////////////////
+ virtual MINT32 mHalMotionTrackGetGMV(MINT32 &MvX, MINT32 &MvY) = 0;
+
+ /////////////////////////////////////////////////////////////////////////
+ //
+ // mHalMotionTrackSetWorkBuf () -
+ //! \brief set working buffer
+ //
+ /////////////////////////////////////////////////////////////////////////
+ virtual MINT32 mHalMotionTrackSetWorkBuf(MTKPipeMotionTrackWorkBufInfo MotionTrackWorkBufInfo) = 0;
+
+ /////////////////////////////////////////////////////////////////////////
+ //
+ // mHalMotionTrackAddImage () -
+ //! \brief add image
+ //
+ /////////////////////////////////////////////////////////////////////////
+ virtual MINT32 mHalMotionTrackAddImage(MTKPipeMotionTrackAddImageInfo MotionTrackAddImageInfo) = 0;
+
+ /////////////////////////////////////////////////////////////////////////
+ //
+ // mHalMotionTrackGetIntermediateDataSize () -
+ //! \brief get size of intermediate data
+ //
+ /////////////////////////////////////////////////////////////////////////
+ virtual MINT32 mHalMotionTrackGetIntermediateDataSize(MTKPipeMotionTrackIntermediateData *MotionTrackIntermediateData) = 0;
+
+ /////////////////////////////////////////////////////////////////////////
+ //
+ // mHalMotionTrackSelectImage () -
+ //! \brief get intermediate data
+ //
+ /////////////////////////////////////////////////////////////////////////
+ virtual MINT32 mHalMotionTrackGetIntermediateData(MTKPipeMotionTrackIntermediateData MotionTrackIntermediateData) = 0;
+
+ /////////////////////////////////////////////////////////////////////////
+ //
+ // mHalMotionTrackSelectImage () -
+ //! \brief select candidate images
+ //
+ /////////////////////////////////////////////////////////////////////////
+ virtual MINT32 mHalMotionTrackSelectImage(MTKPipeMotionTrackSelectImageInfo *MotionTrackSelectImageInfo) = 0;
+
+ /////////////////////////////////////////////////////////////////////////
+ //
+ // mHalMotionTrackBlendImage () -
+ //! \brief blend images
+ //
+ /////////////////////////////////////////////////////////////////////////
+ virtual MINT32 mHalMotionTrackBlendImage(MTKPipeMotionTrackBlendImageInfo MotionTrackBlendImageInfo, MTKPipeMotionTrackResultImageInfo *MotionTrackResultImageInfo) = 0;
+};
+
+#endif
+
diff --git a/include/hardware/include/mtkcam/v1/featureio/utility_hal_base.h b/include/hardware/include/mtkcam/v1/featureio/utility_hal_base.h
new file mode 100644
index 0000000..fd071c8
--- /dev/null
+++ b/include/hardware/include/mtkcam/v1/featureio/utility_hal_base.h
@@ -0,0 +1,130 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein
+ * is confidential and proprietary to MediaTek Inc. and/or its licensors.
+ * Without the prior written permission of MediaTek inc. and/or its licensors,
+ * any reproduction, modification, use or disclosure of MediaTek Software,
+ * and information contained herein, in whole or in part, shall be strictly prohibited.
+ */
+/* MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON
+ * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+ * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+ * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+ * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
+ * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
+ * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
+ * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
+ * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
+ * CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+ * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+ * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
+ * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek Software")
+ * have been modified by MediaTek Inc. All revisions are subject to any receiver's
+ * applicable license agreements with MediaTek Inc.
+ */
+
+/********************************************************************************************
+ * LEGAL DISCLAIMER
+ *
+ * (Header of MediaTek Software/Firmware Release or Documentation)
+ *
+ * BY OPENING OR USING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") RECEIVED
+ * FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON AN "AS-IS" BASIS
+ * ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR
+ * A PARTICULAR PURPOSE OR NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY
+ * WHATSOEVER WITH RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK
+ * ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+ * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S SPECIFICATION
+ * OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+ *
+ * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE LIABILITY WITH
+ * RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION,
+TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE
+ * FEES OR SERVICE CHARGE PAID BY BUYER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE WITH THE LAWS
+ * OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF LAWS PRINCIPLES.
+ ************************************************************************************************/
+/*
+** $Log: utility_hal_base.h $
+ *
+*/
+
+#ifndef _UTILITY_HAL_BASE_H_
+#define _UTILITY_HAL_BASE_H_
+
+/*******************************************************************************
+*
+********************************************************************************/
+class halUTILITYBase {
+public:
+ //
+ static halUTILITYBase* createInstance();
+ virtual void destroyInstance() = 0;
+ virtual ~halUTILITYBase(){};
+ /////////////////////////////////////////////////////////////////////////
+ //
+ // mHalUtilityInit () -
+ //! \brief init UTILITY
+ //
+ /////////////////////////////////////////////////////////////////////////
+ virtual MINT32 mHalUtilityInit() {return 0;}
+
+ /////////////////////////////////////////////////////////////////////////
+ //
+ // mHalUtilityUninit () -
+ //! \brief Utility uninit
+ //
+ /////////////////////////////////////////////////////////////////////////
+ virtual MINT32 mHalUtilityUninit() {return 0;}
+
+ /////////////////////////////////////////////////////////////////////////
+ //
+ // createJpegImg () -
+ //! \brief create jpg image for panorama
+ //
+ /////////////////////////////////////////////////////////////////////////
+ virtual MBOOL createPanoJpegImg(MVOID* pMPImageInfo
+ , MVOID* Srcbuf
+ , int u4SrcWidth
+ , int u4SrcHeight
+ , MUINT32 Jpgbufsize
+ , MINT32 JpgbufmemID
+ , MUINT32 JpgbufvirtAddr
+ , MUINT32 JpgbufphyAddr
+ , MUINT32 &u4JpegSize
+ , MUINT32 quality)=0;
+
+ /////////////////////////////////////////////////////////////////////////
+ //
+ // makeExifHeader () -
+ //! \brief create exif file infor
+ //
+ /////////////////////////////////////////////////////////////////////////
+ virtual MBOOL makeExifHeader(MUINT32 const u4CamMode,
+ MUINT8* const puThumbBuf,
+ MUINT32 const u4ThumbSize,
+ MUINT8* puExifBuf,
+ MUINT32 &u4FinalExifSize,
+ MUINT32 const Width,
+ MUINT32 const Height,
+ MUINT32 u4ImgIndex,
+ MUINT32 u4GroupId,
+ MVOID* mpParamsMgr)=0;
+};
+
+#endif
+
diff --git a/include/hardware/include/mtkcam/v1/sdkClient/IGestureClient.h b/include/hardware/include/mtkcam/v1/sdkClient/IGestureClient.h
new file mode 100644
index 0000000..fd9b7e9
--- /dev/null
+++ b/include/hardware/include/mtkcam/v1/sdkClient/IGestureClient.h
@@ -0,0 +1,85 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_V1_SDKCLIENT_IGESTURECLIENT_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_V1_SDKCLIENT_IGESTURECLIENT_H_
+//
+
+#include <mmsdk/gesture_device.h>
+
+typedef bool (*GestureCallback_t)(hand_detection_result_t const &result, MVOID* user);
+
+
+
+namespace android {
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+class IParamsManager;
+class ICamClient;
+
+namespace NSSdkClient {
+
+
+/******************************************************************************
+* Preview Client Handler.
+*******************************************************************************/
+class IGestureClient : public ICamClient, public virtual RefBase
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+//
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Instantiation.
+ //
+ static sp<IGestureClient> createInstance();
+ //
+ virtual ~IGestureClient() {}
+
+ //
+ virtual bool start() = 0;
+ //
+ virtual bool stop() = 0;
+ //
+ virtual void setCallbacks(GestureCallback_t gesture_cb, MVOID* user) = 0;
+};
+
+
+}; // namespace NSSdkClient
+}; // namespace android
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_V1_SDKCLIENT_IGESTURECLIENT_H_
+
diff --git a/include/hardware/include/mtkcam/v3/app/AppStreamBuffers.h b/include/hardware/include/mtkcam/v3/app/AppStreamBuffers.h
new file mode 100644
index 0000000..bac6af6
--- /dev/null
+++ b/include/hardware/include/mtkcam/v3/app/AppStreamBuffers.h
@@ -0,0 +1,177 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_V3_APP_APPSTREAMBUFFERS_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_V3_APP_APPSTREAMBUFFERS_H_
+//
+#include <mtkcam/v3/utils/streambuf/StreamBuffers.h>
+#include <mtkcam/utils/imagebuf/IGraphicImageBufferHeap.h>
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+namespace v3 {
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+/**
+ * An implementation of app image stream buffer.
+ */
+class AppImageStreamBuffer
+ : public Utils::TStreamBuffer<AppImageStreamBuffer, IImageStreamBuffer>
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Definitions.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Definitions.
+
+ struct Allocator : public virtual android::RefBase
+ {
+ public: //// Data Members.
+ android::sp<IStreamInfoT> mpStreamInfo;
+
+ public: //// Operations.
+ Allocator(
+ IStreamInfoT* pStreamInfo
+ );
+
+ public: //// Operator.
+ virtual StreamBufferT* operator()(
+ IGraphicImageBufferHeap* pHeap,
+ IStreamInfoT* pStreamInfo = NULL
+ );
+ };
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Implementations.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected: //// Data Members.
+ android::sp<IGraphicImageBufferHeap> mImageBufferHeap;
+
+public: //// Operations.
+ AppImageStreamBuffer(
+ android::sp<IStreamInfoT> pStreamInfo,
+ android::sp<IGraphicImageBufferHeap> pImageBufferHeap,
+ IUsersManager* pUsersManager = 0
+ );
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Interfaces.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Accessors.
+ android::sp<IGraphicImageBufferHeap> getImageBufferHeap() const;
+ virtual MINT getAcquireFence() const;
+ virtual MVOID setAcquireFence(MINT fence);
+ virtual MINT getReleaseFence() const;
+ virtual MVOID setReleaseFence(MINT fence);
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// IUsersManager Interfaces.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Operations.
+ virtual ssize_t enqueUserGraph(
+ android::sp<IUserGraph> pUserGraph
+ );
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+/**
+ * An implementation of app metadata stream buffer.
+ */
+class AppMetaStreamBuffer
+ : public Utils::TStreamBuffer<AppMetaStreamBuffer, IMetaStreamBuffer>
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Definitions.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Definitions.
+
+ struct Allocator : public virtual android::RefBase
+ {
+ public: //// Data Members.
+ android::sp<IStreamInfoT> mpStreamInfo;
+
+ public: //// Operations.
+ Allocator(
+ IStreamInfoT* pStreamInfo
+ );
+
+ public: //// Operator.
+ virtual StreamBufferT* operator()();
+ virtual StreamBufferT* operator()(NSCam::IMetadata const& metadata);
+ };
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Implementations.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected: //// Data Members.
+ NSCam::IMetadata mMetadata; // IBufferT-derived object.
+ MBOOL mRepeating; // Non-zero indicates repeating meta settings.
+
+public: //// Operations.
+ AppMetaStreamBuffer(
+ android::sp<IStreamInfoT> pStreamInfo,
+ IUsersManager* pUsersManager = 0
+ );
+ AppMetaStreamBuffer(
+ android::sp<IStreamInfoT> pStreamInfo,
+ NSCam::IMetadata const& metadata,
+ IUsersManager* pUsersManager = 0
+ );
+
+public: //// Attributes.
+ virtual MVOID setRepeating(MBOOL const repeating);
+ virtual MBOOL isRepeating() const;
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace v3
+}; //namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_V3_APP_APPSTREAMBUFFERS_H_
+
diff --git a/include/hardware/include/mtkcam/v3/app/Cam3ImageStreamInfo.h b/include/hardware/include/mtkcam/v3/app/Cam3ImageStreamInfo.h
new file mode 100644
index 0000000..a426a25
--- /dev/null
+++ b/include/hardware/include/mtkcam/v3/app/Cam3ImageStreamInfo.h
@@ -0,0 +1,164 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_V3_APP_CAM3IMAGESTREAMINFO_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_V3_APP_CAM3IMAGESTREAMINFO_H_
+//
+#include <utils/String8.h>
+//
+#include <hardware/camera3.h>
+#include <mtkcam/v3/stream/IStreamInfo.h>
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+namespace v3 {
+
+
+/**
+ * camera3 image stream info.
+ */
+class Cam3ImageStreamInfo : public IImageStreamInfo
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Implementations.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Definitions.
+ typedef Cam3ImageStreamInfo ThisT;
+
+protected: //// Data Members.
+
+ camera3_stream* mpCamera3Stream; /**<
+ * camera3_stream::usage: usage for buffer allocator.
+ */
+ android::String8 mStreamName;
+ StreamId_T mStreamId;
+ MUINT32 mStreamType;
+
+ MUINT mUsageForConsumer; /**< usage for buffer consumer. */
+ MINT mImgFormat; /**< image format in reality. */
+ MINT mImgFormatToAlloc; /**< image format for buffer allocation.
+ * It must equal to camera3_stream::format.
+ */
+ MSize mImgSize; /**< image size, in pixels.
+ * It must equal to width and height in camera3_stream.
+ */
+ BufPlanes_t mvbufPlanes;
+
+ MUINT32 mTransform;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Interface.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Instantiation.
+
+ /**
+ * @param[in] pCamera3Stream: pointer to a camera3_stream, where
+ * all fields except priv are specified.
+ */
+ Cam3ImageStreamInfo(
+ camera3_stream* pCamera3Stream,
+ char const* streamName,
+ StreamId_T streamId,
+ MUINT usageForConsumer,
+ MUINT usageForAllocator,
+ MINT imgFormatToAlloc,
+ MINT imgFormatInFact,
+ BufPlanes_t const& bufPlanes,
+ size_t maxBufNum = 1,
+ MUINT32 transform = 0
+ );
+
+public: //// Attributes.
+
+ static ThisT* cast(camera3_stream* stream);
+ static ThisT const* cast(camera3_stream const* stream);
+
+ virtual camera3_stream* get_camera3_stream() const;
+
+ /*
+ * image format to alloc.
+ *
+ * @remark It must equal to camera3_stream::format.
+ */
+ virtual MINT getImgFormatToAlloc() const;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// IImageStreamInfo Interface.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Attributes.
+
+ /**
+ * Usage for buffer consumer.
+ */
+ virtual MUINT getUsageForConsumer() const;
+
+ /**
+ * Usage for buffer allocator.
+ *
+ * @remark It must equal to camera3_stream::usage.
+ */
+ virtual MUINT getUsageForAllocator() const;
+
+ virtual MINT getImgFormat() const;
+ virtual MSize getImgSize() const;
+ virtual BufPlanes_t const& getBufPlanes() const;
+ virtual MUINT32 getTransform() const;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// IStreamInfo Interface.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Attributes.
+ virtual char const* getStreamName() const;
+ virtual StreamId_T getStreamId() const;
+ virtual MUINT32 getStreamType() const;
+ virtual size_t getMaxBufNum() const;
+ virtual MVOID setMaxBufNum(size_t count);
+ virtual size_t getMinInitBufNum() const;
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace v3
+}; //namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_V3_APP_CAM3IMAGESTREAMINFO_H_
+
diff --git a/include/hardware/include/mtkcam/v3/app/IAppStreamManager.h b/include/hardware/include/mtkcam/v3/app/IAppStreamManager.h
new file mode 100644
index 0000000..ad8ae27
--- /dev/null
+++ b/include/hardware/include/mtkcam/v3/app/IAppStreamManager.h
@@ -0,0 +1,288 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_V3_APP_IAPPSTREAMMANAGER_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_V3_APP_IAPPSTREAMMANAGER_H_
+//
+#include <utils/RefBase.h>
+#include <utils/Vector.h>
+#include <utils/KeyedVector.h>
+#include <utils/StrongPointer.h>
+//
+#include <mtkcam/metadata/IMetadataProvider.h>
+#include <mtkcam/v3/utils/streambuf/StreamBuffers.h>
+#include <mtkcam/v3/utils/streaminfo/MetaStreamInfo.h>
+#include "Cam3ImageStreamInfo.h"
+#include "AppStreamBuffers.h"
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+namespace v3 {
+
+
+/**
+ * An interface of App stream manager.
+ */
+class IAppStreamManager
+ : public virtual android::RefBase
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Definitions.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Definitions.
+ typedef Cam3ImageStreamInfo AppImageStreamInfo;
+
+ typedef NSCam::v3::Utils::MetaStreamInfo
+ AppMetaStreamInfo;
+
+ typedef NSCam::v3::AppImageStreamBuffer
+ AppImageStreamBuffer;
+
+ typedef NSCam::v3::AppMetaStreamBuffer
+ AppMetaStreamBuffer;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Definitions.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Definitions.
+
+ struct Request
+ {
+ /*****
+ * Assigned by App Stream Manager (during createRequest).
+ */
+
+ /**
+ * @param frame number.
+ */
+ MUINT32 frameNo;
+
+ /**
+ * @param input image stream buffers.
+ */
+ android::KeyedVector<
+ StreamId_T,
+ android::sp<AppImageStreamBuffer>
+ > vInputImageBuffers;
+
+ /**
+ * @param output image stream buffers.
+ */
+ android::KeyedVector<
+ StreamId_T,
+ android::sp<AppImageStreamBuffer>
+ > vOutputImageBuffers;
+
+ /**
+ * @param input meta stream buffers.
+ */
+ android::KeyedVector<
+ StreamId_T,
+ android::sp<IMetaStreamBuffer>
+ > vInputMetaBuffers;
+
+ /*****
+ * Assigned out of App Stream Manager.
+ */
+
+ /**
+ * @param output meta stream buffers.
+ * Note that the number of output meta streams equals to the number of
+ * partial meta result callbacks.
+ */
+ android::KeyedVector<
+ StreamId_T,
+ android::sp<IMetaStreamBuffer>
+ > vOutputMetaBuffers;
+ };
+
+
+ struct ConfigAppStreams
+ {
+ /**
+ * @param image streams.
+ */
+ android::KeyedVector<
+ StreamId_T,
+ android::sp<IImageStreamInfo>
+ > vImageStreams;
+
+ /**
+ * @param stream min frame duration.
+ */
+ android::KeyedVector<
+ StreamId_T,
+ MINT64
+ > vMinFrameDuration;
+
+ /**
+ * @param stream stall frame duration.
+ */
+ android::KeyedVector<
+ StreamId_T,
+ MINT64
+ > vStallFrameDuration;
+
+ /**
+ * @param meta streams.
+ */
+ android::KeyedVector<
+ StreamId_T,
+ android::sp<IMetaStreamInfo>
+ > vMetaStreams;
+ };
+
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Interfaces.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Operations.
+
+ /**
+ * Create an instance.
+ */
+ static IAppStreamManager* create(
+ MINT32 openId,
+ camera3_callback_ops const* callback_ops,
+ IMetadataProvider const* pMetadataProvider
+ );
+
+ /**
+ * Destroy the instance.
+ */
+ virtual MVOID destroy() = 0;
+
+ /**
+ * Configure streams.
+ *
+ * @param[in] stream_list
+ *
+ * @return
+ * 0 indicates success; otherwise failure.
+ */
+ virtual MERROR configureStreams(
+ camera3_stream_configuration_t *stream_list
+ ) = 0;
+
+ /**
+ * Query configured streams.
+ * This call is valid only after streams are configured.
+ *
+ * @param[out] rStreams: contains all configured streams.
+ *
+ * @return
+ * 0 indicates success; otherwise failure.
+ */
+ virtual MERROR queryConfiguredStreams(
+ ConfigAppStreams& rStreams
+ ) const = 0;
+
+ /**
+ * Create a request based-on camera3_capture_request.
+ * This call is valid only after streams are configured.
+ *
+ * @param[in] request: a given camera3_capture_request.
+ *
+ * @param[out] rRequest: a newly-created request.
+ *
+ * @return
+ * 0 indicates success; otherwise failure.
+ */
+ virtual MERROR createRequest(
+ camera3_capture_request_t* request,
+ Request& rRequest
+ ) = 0;
+
+ /**
+ * Register a request, which is created from createRequest.
+ * This call is valid only after streams are configured.
+ *
+ * @param[in] rRequest: a request to register.
+ *
+ * @return
+ * 0 indicates success; otherwise failure.
+ */
+ virtual MERROR registerRequest(
+ Request const& rRequest
+ ) = 0;
+
+ /**
+ * Update a given result frame.
+ *
+ * @param[in] frameNo: the frame number to update.
+ */
+ virtual MVOID updateResult(
+ MUINT32 const frameNo,
+ MINTPTR const userId
+ ) = 0;
+
+ /**
+ * Update a given result frame.
+ *
+ * @param[in] frameNo: the frame number to update.
+ *
+ * @param[in] resultMeta: result partial metadata to update.
+ *
+ * @param[in] hasLastPartial: contain last partial metadata in result partial metadata vector.
+ */
+ virtual MVOID updateResult(
+ MUINT32 const frameNo,
+ MINTPTR const userId,
+ android::Vector< android::sp<IMetaStreamBuffer> > resultMeta,
+ bool hasLastPartial
+ ) = 0;
+
+ /**
+ * Wait until all the registered requests have finished returning.
+ *
+ * @param[in] timeout
+ */
+ virtual MERROR waitUntilDrained(nsecs_t const timeout) = 0;
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace v3
+}; //namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_V3_APP_IAPPSTREAMMANAGER_H_
+
diff --git a/include/hardware/include/mtkcam/v3/app/StreamId.h b/include/hardware/include/mtkcam/v3/app/StreamId.h
new file mode 100644
index 0000000..1c110fd
--- /dev/null
+++ b/include/hardware/include/mtkcam/v3/app/StreamId.h
@@ -0,0 +1,69 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_V3_APP_STREAMID_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_V3_APP_STREAMID_H_
+//
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+
+
+/******************************************************************************
+ * App Stream ID
+ ******************************************************************************/
+enum
+{
+ //==========================================================================
+ eSTREAMID_BEGIN_OF_APP = (0x00000000UL),
+ //==========================================================================
+
+ //==========================================================================
+ eSTREAMID_END_OF_APP = (0x3FFFFFFFUL),
+ //==========================================================================
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_V3_APP_STREAMID_H_
+
diff --git a/include/hardware/include/mtkcam/v3/device/default/Cam3DeviceCommon.h b/include/hardware/include/mtkcam/v3/device/default/Cam3DeviceCommon.h
new file mode 100644
index 0000000..42bf30c
--- /dev/null
+++ b/include/hardware/include/mtkcam/v3/device/default/Cam3DeviceCommon.h
@@ -0,0 +1,115 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_V3_DEVICE_CAM3DEVICECOMMON_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_V3_DEVICE_CAM3DEVICECOMMON_H_
+//
+#include <mtkcam/device/Cam3DeviceBase.h>
+#include <mtkcam/v3/app/IAppStreamManager.h>
+#include <mtkcam/v3/pipeline/IPipelineModel.h>
+#include <mtkcam/v3/pipeline/IPipelineBufferSetFrameControl.h>
+#include <mtkcam/v3/pipeline/IPipelineFrameNumberGenerator.h>
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+namespace v3 {
+
+/**
+ * An implementation of C.
+ */
+class Cam3DeviceCommon
+ : public IPipelineBufferSetFrameControl::IAppCallback
+ , public Cam3DeviceBase
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Data Members.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected:
+ android::sp<IPipelineFrameNumberGenerator>
+ mpPipelineFrameNumberGenerator;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Operations.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Instantiation.
+ virtual ~Cam3DeviceCommon();
+ Cam3DeviceCommon(
+ String8 const& rDevName,
+ int32_t const i4OpenId
+ );
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// IPipelineBufferSetFrameControl::IAppCallback Interfaces.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Operations.
+ virtual MVOID updateFrame(
+ MUINT32 const frameNo,
+ MINTPTR const userId,
+ ssize_t const nOutMetaLeft,
+ android::Vector<android::sp<IMetaStreamBuffer> > vOutMeta
+ );
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Interfaces.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Operations.
+ virtual android::sp<IAppStreamManager>
+ getAppStreamManager() const = 0;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Operations.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public:
+ virtual android::sp<IPipelineFrameNumberGenerator>
+ getPipelineFrameNumberGenerator() const
+ { return mpPipelineFrameNumberGenerator; };
+ virtual MERROR finishPipelineConfiguration(
+ android::sp<IPipelineModel> aPipeline
+ );
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace v3
+}; //namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_V3_DEVICE_CAM3DEVICECOMMON_H_
+
diff --git a/include/hardware/include/mtkcam/v3/pipeline/DefaultPipelineModel/DefaultPipelineModel.h b/include/hardware/include/mtkcam/v3/pipeline/DefaultPipelineModel/DefaultPipelineModel.h
new file mode 100644
index 0000000..33d90b4
--- /dev/null
+++ b/include/hardware/include/mtkcam/v3/pipeline/DefaultPipelineModel/DefaultPipelineModel.h
@@ -0,0 +1,334 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_V3_PIPELINE_DEFAULTPIPELINEMODEL_DEFAULTPIPELINEMODEL_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_V3_PIPELINE_DEFAULTPIPELINEMODEL_DEFAULTPIPELINEMODEL_H_
+//
+#include "../IPipelineModel.h"
+#include <mtkcam/v3/pipeline/DefaultPipelineModel/DefaultStrategy.h>
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+namespace v3 {
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+class DefaultPipelineModel
+ : public virtual IPipelineModel
+ , public IPipelineStreamBufferProvider
+ , protected Pipeline::DefaultStrategy::IEvaluator
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Definitions.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Definitions.
+ typedef Pipeline_NodeId_T NodeId_T;
+
+ typedef NSCam::v3::Utils:: IStreamInfoSetControl
+ IStreamInfoSetControl;
+
+ typedef NSCam::v3::Utils:: HalMetaStreamBuffer
+ HalMetaStreamBuffer;
+
+ typedef NSCam::v3::Utils:: HalImageStreamBuffer
+ HalImageStreamBuffer;
+
+ typedef HalMetaStreamBuffer:: Allocator
+ HalMetaStreamBufferAllocatorT;
+
+ typedef HalImageStreamBuffer:: Allocator
+ HalImageStreamBufferAllocatorT;
+
+ typedef HalMetaStreamBufferAllocatorT::StreamBufferPoolT
+ HalMetaStreamBufferPoolT;
+
+ typedef HalImageStreamBufferAllocatorT::StreamBufferPoolT
+ HalImageStreamBufferPoolT;
+
+ typedef android::DefaultKeyedVector <StreamId_T, android::sp<HalMetaStreamBufferPoolT> >
+ HalMetaStreamBufferPoolMapT;
+
+ typedef android::DefaultKeyedVector<StreamId_T, android::sp<HalImageStreamBufferPoolT> >
+ HalImageStreamBufferPoolMapT;
+
+ typedef NSCam::v3::Utils::IStreamBufferPool<IImageStreamBuffer>
+ IImageStreamBufferPoolT;
+
+public: //// Definitions.
+ typedef Pipeline::DefaultStrategy:: RequestAppStreamsInfo
+ RequestAppStreamsInfo;
+
+ typedef Pipeline::DefaultStrategy:: evaluate_request_pipeline
+ evaluate_request_pipeline;
+
+ typedef Pipeline::DefaultStrategy:: refine_meta_stream_buffer_params
+ refine_meta_stream_buffer_params;
+
+ typedef Pipeline::DefaultStrategy:: evaluate_node_io_streams_params
+ evaluate_node_io_streams_params;
+
+public: //// Definitions.
+ typedef IPipelineFrame::ImageInfoIOMap ImageInfoIOMap;
+ typedef IPipelineFrame::MetaInfoIOMap MetaInfoIOMap;
+ typedef IPipelineFrame::ImageInfoIOMapSet ImageInfoIOMapSet;
+ typedef IPipelineFrame::MetaInfoIOMapSet MetaInfoIOMapSet;
+ typedef IPipelineFrame::InfoIOMapSet InfoIOMapSet;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Definitions.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Definitions.
+
+ struct Context
+ {
+ android::sp<IStreamInfoSetControl> mpStreamInfoSet;
+ android::sp<IPipelineDAG> mpPipelineDAG;
+ android::sp<IPipelineNodeMapControl> mpPipelineNodeMap;
+ };
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Implementations.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected: //// Operations.
+
+ struct refine_request_app_params_based_on_face_detect_params
+ {
+ /**
+ * @param[in] input App metadata.
+ * The caller must promise its content.
+ * The callee should not modify it.
+ */
+ IMetadata const* pIAppMetaData;
+
+ /**
+ * @param[in,out] App stream info.
+ * The caller must promise its initial value.
+ * The callee has an authority to update it based on its initial value.
+ */
+ RequestAppStreamsInfo* pAppStreams;
+ };
+
+ virtual MERROR refineRequestAppParamsLocked(
+ refine_request_app_params_based_on_face_detect_params& rParams
+ ) const;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Implementations.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected: //// Operations.
+
+ struct evaluate_app_request_params
+ {
+ /**
+ * @param[in,out] A pointer to the App request.
+ * The caller must promise its initial value.
+ * The callee has an authority to update it based on its initial value.
+ */
+ AppRequest* pAppRequest;
+
+ /**
+ * @param[out] output App meta stream buffers.
+ * By default, this field is empty. The callee must be in charge of
+ * adding buffers and update each buffer's users.
+ * Note that the number of output meta streams equals to the number of
+ * partial meta result callbacks.
+ */
+ android::KeyedVector<
+ StreamId_T,
+ android::sp<IMetaStreamBuffer>
+ > vOMetaBuffers;
+
+ /**
+ * @param[out] A pointer to the pipeline frame.
+ * By default, this field is NULL. The callee is responsible for
+ * filling it.
+ */
+ android::sp<IPipelineFrame> pFrame;
+ };
+
+public: //// Operations.
+ virtual MERROR evaluateAppRequest(
+ evaluate_app_request_params& rParams
+ ) const;
+
+ virtual MERROR submitRequestFrame(
+ android::sp<IPipelineFrame> pFrame
+ );
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Implementations.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected: //// Data Members.
+ mutable android::RWLock mRWLock;
+ MINT32 const mOpenId;
+ android::String8 const mName;
+
+protected: //// Data Members.
+ Context mConfigContext;
+
+protected: //// Data Members.
+ HalImageStreamBufferPoolMapT mHalImageStreamBufferPoolMap;
+
+protected: //// Data Members.
+ mutable android::RWLock mflushLock;
+ MBOOL mInFlush;
+
+protected: //// Data Members.
+ mutable android::RWLock mFrameNumberGeneratorLock;
+ android::sp<IPipelineFrameNumberGenerator>
+ mpPipelineFrameNumberGenerator;
+
+private: //// Data Members.
+ MINT mLogLevel; // log level.
+ MINT mDebugFdMode;
+ mutable MINT mFdEnable;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Implementations.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected: //// Operations.
+ android::sp<HalImageStreamBufferPoolT>
+ addHalStreamBufferPoolLocked(
+ android::sp<IImageStreamInfo> pStreamInfo
+ );
+
+ android::sp<HalImageStreamBufferPoolT>
+ replaceHalStreamBufferPoolLocked(
+ android::sp<IImageStreamInfo> pStreamInfo,
+ android::sp<HalImageStreamBufferPoolT> pPool
+ );
+protected: //// Operations.
+
+ virtual MVOID onDestroyLocked();
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Implementations.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected: //// Attributes.
+ virtual android::sp<IMetaStreamInfo>
+ getMetaStreamInfoLocked_FaceDetectResult() const;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Interfaces.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Instantiation.
+ DefaultPipelineModel(
+ MINT32 const openId,
+ android::String8 const& name
+ );
+
+public: //// Attributes.
+ virtual Context const& getConfigContext() const;
+ virtual android::sp<IPipelineFrameNumberGenerator>
+ getPipelineFrameNumberGenerator() const;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Pipeline::DefaultStrategy::IEvaluator
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Attributes.
+ virtual IPipelineStreamBufferProvider const*
+ getStreamBufferProvider() const;
+ virtual IPipelineNodeMapControl*getConfigPipelineNodeMap() const;
+ virtual IPipelineDAG* getConfigPipelineDAG() const;
+
+public: //// Operations.
+ virtual MERROR refineRequestAppParams(
+ evaluate_request_pipeline::Params& rParams
+ ) const;
+
+ virtual MUINT queryMinimalUsage(
+ NodeId_T const nodeId,
+ IImageStreamInfo const*const pStreamInfo
+ ) const;
+
+ virtual MERROR evaluateNodeIOStreams(
+ NodeId_T const /*nodeId*/,
+ evaluate_node_io_streams_params& /*rParams*/
+ ) const { return OK;}
+
+ virtual MERROR refineRequestMetaStreamBuffers(
+ refine_meta_stream_buffer_params& /*rParams*/
+ ) const { return OK;}
+
+public: //// Attributes.
+ virtual MERROR acquireHalStreamBuffer(
+ android::sp<IImageStreamInfo> const pStreamInfo,
+ android::sp<HalImageStreamBuffer>& rpStreamBuffer
+ ) const;
+
+public: //// Operations.
+ virtual MVOID dump(android::Vector<android::String8>& rLogs, InfoIOMapSet const& rIOMapSet) const;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// IPipelineModel Interfaces.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Attributes.
+ virtual char const* getName() const { return mName.string(); }
+ virtual MINT32 getOpenId() const { return mOpenId; }
+
+public: //// Operations.
+ virtual MERROR submitRequest(AppRequest& request);
+
+ virtual MERROR setPipelineFrameNumberGenerator(
+ android::sp<IPipelineFrameNumberGenerator> aPipelineFrameNumberGenerator
+ );
+
+ virtual MERROR beginFlush();
+
+ virtual MVOID endFlush();
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// RefBase Interfaces.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected: //// Operations.
+ virtual void onLastStrongRef(const void* id);
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace v3
+}; //namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_V3_PIPELINE_DEFAULTPIPELINEMODEL_DEFAULTPIPELINEMODEL_H_
+
diff --git a/include/hardware/include/mtkcam/v3/pipeline/DefaultPipelineModel/DefaultStrategy.h b/include/hardware/include/mtkcam/v3/pipeline/DefaultPipelineModel/DefaultStrategy.h
new file mode 100644
index 0000000..d8cedd9
--- /dev/null
+++ b/include/hardware/include/mtkcam/v3/pipeline/DefaultPipelineModel/DefaultStrategy.h
@@ -0,0 +1,585 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_V3_PIPELINE_DEFAULTPIPELINEMODEL_DEFAULTSTRATEGY_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_V3_PIPELINE_DEFAULTPIPELINEMODEL_DEFAULTSTRATEGY_H_
+//
+#include <utils/String8.h>
+#include <mtkcam/v3/pipeline/IPipelineNodeMapControl.h>
+#include <mtkcam/v3/pipeline/IPipelineBufferSetFrameControl.h>
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+namespace v3 {
+namespace Pipeline {
+namespace DefaultStrategy {
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+struct IEvaluator;
+
+typedef Pipeline_NodeId_T NodeId_T;
+
+typedef NSCam::v3::Utils::IStreamInfoSetControl IStreamInfoSetControl;
+typedef NSCam::v3::Utils::HalMetaStreamBuffer HalMetaStreamBuffer;
+typedef NSCam::v3::Utils::HalImageStreamBuffer HalImageStreamBuffer;
+
+typedef HalMetaStreamBuffer::Allocator HalMetaStreamBufferAllocatorT;
+
+typedef IPipelineFrame::ImageInfoIOMap ImageInfoIOMap;
+typedef IPipelineFrame::MetaInfoIOMap MetaInfoIOMap;
+typedef IPipelineFrame::ImageInfoIOMapSet ImageInfoIOMapSet;
+typedef IPipelineFrame::MetaInfoIOMapSet MetaInfoIOMapSet;
+typedef IPipelineFrame::InfoIOMapSet InfoIOMapSet;
+
+
+/**
+ *
+ */
+struct evaluate_request
+{
+ struct Imp;
+ struct Params
+ {
+ /**
+ * @param[in] request number from framework.
+ * The caller must promise its content.
+ * The callee can not modify it.
+ */
+ MUINT32 requestNo;
+
+ /**
+ * @param[in] frame number for pipeline.
+ * The caller must promise its content.
+ * The callee can not modify it.
+ */
+ MUINT32 frameNo;
+
+ /**
+ * @param[in] A pointer to the callback.
+ * The caller must promise its content.
+ * The callee can not modify it.
+ */
+ IPipelineBufferSetFrameControl::IAppCallback*
+ pAppCallback;
+
+ /**
+ * @param[in,out] input App image stream buffers, if any.
+ * The caller must promise the number of buffers and each content.
+ * The callee will update each buffer's users.
+ */
+ android::KeyedVector<
+ StreamId_T,
+ android::sp<IImageStreamBuffer>
+ >* vIImageBuffers;
+
+ /**
+ * @param[in,out] output App image stream buffers.
+ * The caller must promise the number of buffers and each content.
+ * The callee will update each buffer's users.
+ */
+ android::KeyedVector<
+ StreamId_T,
+ android::sp<IImageStreamBuffer>
+ >* vOImageBuffers;
+
+ /**
+ * @param[in,out] input App meta stream buffers.
+ * The caller must promise the number of buffers and each content.
+ * The callee will update each buffer's users.
+ */
+ android::KeyedVector<
+ StreamId_T,
+ android::sp<IMetaStreamBuffer>
+ >* vIMetaBuffers;
+
+ /**
+ * @param[out] output App meta stream buffers.
+ * By default, this field is empty. The callee must be in charge of
+ * adding buffers and update each buffer's users.
+ * Note that the number of output meta streams equals to the number of
+ * partial meta result callbacks.
+ */
+ android::KeyedVector<
+ StreamId_T,
+ android::sp<IMetaStreamBuffer>
+ >* vOMetaBuffers;
+
+ /**
+ * @param[out] A pointer to the frame.
+ * By default, this field is NULL. The callee is responsible for
+ * filling it.
+ */
+ android::sp<IPipelineFrame>*ppFrame;
+ };
+
+ /**
+ * Evaluate a request from App.
+ *
+ * @param[in,out] rParams: the input/output parameters.
+ *
+ * @return
+ * 0 indicates success; otherwise failure.
+ */
+ MERROR operator()(
+ Params& rParams,
+ IEvaluator const* pEvaluator
+ );
+};
+
+
+/**
+ *
+ */
+struct RequestAppStreamsInfo
+{
+ /**
+ * @param[in] input App image stream info.
+ * The caller must promise its content.
+ * The callee should not modify it.
+ */
+ android::KeyedVector<
+ StreamId_T,
+ android::sp<IImageStreamInfo>
+ > vIAppImageStreams;
+
+ /**
+ * @param[in] output App image stream info.
+ * The caller must promise its content.
+ * The callee should not modify it.
+ */
+ android::KeyedVector<
+ StreamId_T,
+ android::sp<IImageStreamInfo>
+ > vOAppImageStreams;
+
+ /**
+ * @param[in] input App meta stream info.
+ * The caller must promise its content.
+ * The callee should not modify it.
+ */
+ android::KeyedVector<
+ StreamId_T,
+ android::sp<IMetaStreamInfo>
+ > vIAppMetaStreams;
+
+ /**
+ * @param[in,out] output App meta stream info.
+ * The caller must promise its initial value.
+ * The callee has an authority to update it based on its initial value.
+ *
+ * @remark
+ * Note that the number of output meta streams equals to the number of
+ * partial meta result callbacks.
+ */
+ android::KeyedVector<
+ StreamId_T,
+ android::sp<IMetaStreamInfo>
+ > vOAppMetaStreams;
+};
+
+
+/**
+ *
+ */
+struct evaluate_request_pipeline
+{
+ typedef IPipelineFrameNodeMapControl FrameNodeMapT;
+
+ struct Imp;
+ struct Params
+ {
+ /**
+ * @param[in] input App metadata.
+ * The caller must promise its content.
+ * The callee should not modify it.
+ */
+ IMetadata const* pIAppMetaData;
+
+ /**
+ * @param[in,out] App stream info.
+ * The caller must promise its initial value.
+ * The callee has an authority to update it based on its initial value.
+ */
+ RequestAppStreamsInfo* pAppStreams;
+
+ /**
+ * @param[out] a pointer to the resulting stream set.
+ * By default, this field is NULL. The callee is responsible for
+ * filling it.
+ */
+ android::sp<IStreamInfoSetControl>
+ pStreamInfoSet;
+
+ /**
+ * @param[out] a pointer to the resulting pipeline DAG. By default, this
+ * field is NULL. The callee is responsible for filling it.
+ */
+ android::sp<IPipelineDAG> pPipelineDAG;
+
+ /**
+ * @param[out] a pointer to the resulting pipeline node map. By default,
+ * this field is NULL. The callee is responsible for filling it.
+ */
+ android::sp<IPipelineNodeMapControl>
+ pPipelineNodeMap;
+
+ /**
+ * @param[out] a pointer to the resulting pipeline frame node map.
+ * The caller must ensure that it is pointering to a valid instance.
+ * The callee is responsible for filling its content.
+ */
+ android::sp<FrameNodeMapT> pNodeMap;
+
+ };
+
+ /**
+ * Evaluate a REQUEST pipeline based on the CONFIG pipeline.
+ *
+ * @param[in,out] rParams: input/output parameters.
+ *
+ * @return
+ * 0 indicates success; otherwise failure.
+ */
+ MERROR operator()(
+ Params& rParams,
+ IEvaluator const* pEvaluator
+ );
+};
+
+
+/**
+ *
+ */
+struct evaluate_node_io_streams_params
+{
+ /**
+ * @param[in] input App metadata.
+ * The caller must promise its content.
+ * The callee should not modify it.
+ */
+ IMetadata const* pIAppMetaData;
+
+ /**
+ * @param[in] Output App image streams.
+ */
+ android::KeyedVector<
+ StreamId_T,
+ android::sp<IImageStreamInfo>
+ > vOAppImage;
+
+ /**
+ * @param[in] Input App image streams.
+ */
+ android::KeyedVector<
+ StreamId_T,
+ android::sp<IImageStreamInfo>
+ > vIAppImage;
+
+ /**
+ * @param[in,out] Output App meta streams.
+ */
+ android::KeyedVector<
+ StreamId_T,
+ android::sp<IMetaStreamInfo>
+ > vOAppMeta;
+
+ /**
+ * @param[in,out] Input App meta streams.
+ */
+ android::KeyedVector<
+ StreamId_T,
+ android::sp<IMetaStreamInfo>
+ > vIAppMeta;
+
+ /**
+ * @param[in,out] Output Hal image streams.
+ * For example, P1 may be enforced to output two streams due to the
+ * limitation from drivers or hardwares.
+ */
+ android::KeyedVector<
+ StreamId_T,
+ android::sp<IImageStreamInfo>
+ > vOHalImage;
+
+ /**
+ * @param[in,out] Input Hal image streams.
+ */
+ android::KeyedVector<
+ StreamId_T,
+ android::sp<IImageStreamInfo>
+ > vIHalImage;
+
+ /**
+ * @param[in,out] Output Hal meta streams.
+ */
+ android::KeyedVector<
+ StreamId_T,
+ android::sp<IMetaStreamInfo>
+ > vOHalMeta;
+
+ /**
+ * @param[in,out] Input Hal meta streams.
+ */
+ android::KeyedVector<
+ StreamId_T,
+ android::sp<IMetaStreamInfo>
+ > vIHalMeta;
+
+ /**
+ * @param[out] a pointer to I/O map set.
+ * The caller must ensure that it is pointering to a valid instance.
+ * The callee is responsible for filling its content.
+ */
+ InfoIOMapSet* pIOMapSet;
+};
+
+
+/**
+ *
+ */
+struct refine_meta_stream_buffer_params
+{
+ /**
+ * @param[in] Request App image stream info set.
+ * The caller must ensure its content.
+ */
+ android::KeyedVector<
+ StreamId_T,
+ android::sp<IImageStreamInfo>
+ >const* pAppImageStreams;
+
+ /**
+ * @param[in] Request App meta stream info set.
+ * The caller must ensure its content.
+ */
+ android::KeyedVector<
+ StreamId_T,
+ android::sp<IMetaStreamInfo>
+ >const* pAppMetaStreams;
+
+ /**
+ * @param[in] Request Hal image stream info set.
+ * The caller must ensure its content.
+ */
+ android::KeyedVector<
+ StreamId_T,
+ android::sp<IImageStreamInfo>
+ >const* pHalImageStreams;
+
+ /**
+ * @param[in] Request Hal meta stream info set.
+ * The caller must ensure its content.
+ */
+ android::KeyedVector<
+ StreamId_T,
+ android::sp<IMetaStreamInfo>
+ >const* pHalMetaStreams;
+
+ /**
+ * @param[out] App meta streams.
+ * The caller must ensure its instance.
+ * The callee could update its content.
+ */
+ android::KeyedVector<
+ StreamId_T,
+ android::sp<IMetaStreamBuffer>
+ > vAppMetaBuffer;
+
+ /**
+ * @param[out] Hal meta streams.
+ * The caller must ensure its instance.
+ * The callee could update its content.
+ */
+ android::KeyedVector<
+ StreamId_T,
+ android::sp<IMetaStreamBuffer>
+ > vHalMetaBuffer;
+};
+
+
+/**
+ *
+ */
+struct evaluate_request_buffer_users
+{
+ struct Imp;
+ struct Params
+ {
+ /**
+ * @param[in] A REQUEST evaluator.
+ * The caller must promise the instance.
+ * The callee can not modify it.
+ */
+ IEvaluator const* pEvaluator;
+
+ /**
+ * @param[in] A REQUEST pipeline DAG.
+ * The caller must promise its content.
+ * The callee can not modify it.
+ */
+ IPipelineDAG const* pPipelineDAG;
+
+ /**
+ * @param[in] A REQUEST pipeline frame node map.
+ * The caller must promise its content.
+ * The callee can not modify it.
+ */
+ IPipelineFrameNodeMapControl const*
+ pNodeMap;
+
+ /**
+ * @param[in,out] A buffer set of this request.
+ * The caller must prepare all instances of buffer's users manager.
+ * The callee is responsible for evaluating each buffer's users.
+ */
+ IPipelineBufferSetControl* pBufferSet;
+ };
+
+ /**
+ * Evaluate each buffer's users.
+ *
+ * @param[in,out] rParams: the input/output parameters.
+ *
+ * @return
+ * 0 indicates success; otherwise failure.
+ */
+ MERROR operator()(
+ Params& rParams
+ );
+};
+
+
+/**
+ *
+ */
+struct IEvaluator
+{
+public: //// Operations.
+ virtual ~IEvaluator() {}
+
+ virtual IPipelineDAG* getConfigPipelineDAG() const = 0;
+
+ virtual IPipelineNodeMapControl*
+ getConfigPipelineNodeMap() const = 0;
+
+ virtual IPipelineStreamBufferProvider const*
+ getStreamBufferProvider() const = 0;
+
+ /**
+ * Refine REQUEST App stream.
+ *
+ * @param[in,out] rParams: input/output parameters.
+ *
+ * @return
+ * 0 indicates success; otherwise failure.
+ */
+ virtual MERROR refineRequestAppParams(
+ evaluate_request_pipeline::Params& rParams
+ ) const = 0;
+
+ /**
+ * For a specific pipeline node, given partial I/O request stream sets,
+ * evaluate the minimal needed I/O stream sets in order for the node to
+ * handle the request.
+ *
+ * @param[in] nodeId: node Id.
+ *
+ * @param[in,out] rParams: input/output parameters.
+ *
+ * @return
+ * 0 indicates success; otherwise failure.
+ */
+ virtual MERROR evaluateNodeIOStreams(
+ NodeId_T const nodeId,
+ evaluate_node_io_streams_params& rParams
+ ) const = 0;
+
+ /**
+ * Query the minimal usage of a given stream for a specific node.
+ *
+ * @param[in] nodeId: node id.
+ *
+ * @param[in] pStreamInfo: stream info.
+ *
+ * @remark
+ * This function is valid only after configured.
+ *
+ * @return
+ * the minimal usage if this node can handle this the stream;
+ * otherwise 0.
+ */
+ virtual MUINT queryMinimalUsage(
+ NodeId_T const nodeId,
+ IImageStreamInfo const*const pStreamInfo
+ ) const = 0;
+
+ /**
+ * Refine REQUEST meta stream buffers.
+ *
+ * @param[in,out] rParams: input/output parameters.
+ *
+ * @return
+ * 0 indicates success; otherwise failure.
+ */
+ virtual MERROR refineRequestMetaStreamBuffers(
+ refine_meta_stream_buffer_params& rParams
+ ) const = 0;
+
+public: //// Operations.
+ virtual MVOID dump(
+ android::Vector<android::String8>& rLogs,
+ InfoIOMapSet const& rIOMapSet
+ ) const = 0;
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace DefaultStrategy
+}; //namespace Pipeline
+}; //namespace v3
+}; //namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_V3_PIPELINE_DEFAULTPIPELINEMODEL_DEFAULTSTRATEGY_H_
+
diff --git a/include/hardware/include/mtkcam/v3/pipeline/IPipelineBufferSetFrameControl.h b/include/hardware/include/mtkcam/v3/pipeline/IPipelineBufferSetFrameControl.h
new file mode 100644
index 0000000..9be2f23
--- /dev/null
+++ b/include/hardware/include/mtkcam/v3/pipeline/IPipelineBufferSetFrameControl.h
@@ -0,0 +1,270 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_V3_PIPELINE_IPIPELINEBUFFERSETFRAMECONTROL_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_V3_PIPELINE_IPIPELINEBUFFERSETFRAMECONTROL_H_
+//
+#include <utils/RefBase.h>
+#include <utils/StrongPointer.h>
+#include <mtkcam/v3/stream/IStreamBufferSet.h>
+#include <mtkcam/v3/utils/streambuf/StreamBuffers.h>
+#include "IPipelineNode.h"
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+namespace v3 {
+
+
+/**
+ * An interface of pipeline stream buffer provider.
+ */
+struct IPipelineStreamBufferProvider
+ : public virtual android::RefBase
+{
+public: //// Definitions.
+ typedef NSCam::v3::Utils::HalImageStreamBuffer HalImageStreamBuffer;
+
+public: //// Operations.
+ virtual MERROR acquireHalStreamBuffer(
+ android::sp<IImageStreamInfo> const pStreamInfo,
+ android::sp<HalImageStreamBuffer>& rpStreamBuffer
+ ) const = 0;
+
+};
+
+
+/**
+ * An interface of pipeline frame node map.
+ */
+class IPipelineFrameNodeMapControl
+ : public virtual android::RefBase
+{
+public: ////
+ typedef IPipelineFrameNodeMapControl ThisT;
+ typedef IPipelineFrame::NodeId_T NodeId_T;
+ typedef IPipelineFrame::InfoIOMapSet InfoIOMapSet;
+ typedef IStreamInfoSet IStreamInfoSetT;
+ typedef android::sp<IStreamInfoSetT> IStreamInfoSetPtr;
+ typedef android::sp<IStreamInfoSetT const> IStreamInfoSetPtr_CONST;
+
+public: //// Definitions.
+ /**
+ *
+ */
+ struct INode
+ : public virtual android::RefBase
+ {
+ virtual NodeId_T getNodeId() const = 0;
+
+ virtual IStreamInfoSetPtr_CONST
+ getIStreams() const = 0;
+ virtual MVOID setIStreams(IStreamInfoSetPtr p) = 0;
+
+ virtual IStreamInfoSetPtr_CONST
+ getOStreams() const = 0;
+ virtual MVOID setOStreams(IStreamInfoSetPtr p) = 0;
+
+ virtual InfoIOMapSet const&
+ getInfoIOMapSet() const = 0;
+ virtual InfoIOMapSet& editInfoIOMapSet() = 0;
+ };
+
+public: //// Operations.
+ static ThisT* create();
+
+ virtual ssize_t setCapacity(size_t size) = 0;
+ virtual MVOID clear() = 0;
+ virtual ssize_t addNode(NodeId_T const nodeId) = 0;
+
+public: //// Operations.
+ virtual MBOOL isEmpty() const = 0;
+ virtual size_t size() const = 0;
+
+ virtual INode* getNodeFor(NodeId_T const nodeId) const = 0;
+ virtual INode* getNodeAt(size_t index) const = 0;
+
+};
+
+
+/**
+ * An interface of pipeline buffer set control.
+ */
+class IPipelineBufferSetControl
+ : public IStreamBufferSet
+{
+public: //// Definitions.
+ typedef NSCam::v3::Utils::HalImageStreamBuffer HalImageStreamBuffer;
+ typedef NSCam::v3::Utils::HalMetaStreamBuffer HalMetaStreamBuffer;
+
+public: //// Definitions.
+ /**
+ * Stream Buffer Map Interface.
+ */
+ template <class _StreamBuffer_>
+ class IMap
+ : public virtual android::RefBase
+ {
+ public: //// Definitions.
+ typedef _StreamBuffer_ StreamBufferT;
+ typedef typename StreamBufferT::IStreamInfoT
+ IStreamInfoT;
+
+ public: //// Operations.
+ virtual ssize_t add(
+ android::sp<IStreamInfoT> pStreamInfo,
+ android::sp<IUsersManager> pUsersManager
+ ) = 0;
+
+ virtual ssize_t add(
+ android::sp<StreamBufferT> value
+ ) = 0;
+
+ virtual ssize_t setCapacity(size_t size) = 0;
+
+ virtual bool isEmpty() const = 0;
+
+ virtual size_t size() const = 0;
+
+ virtual ssize_t indexOfKey(StreamId_T const key) const = 0;
+
+ virtual StreamId_T keyAt(size_t index) const = 0;
+
+ virtual IUsersManager* usersManagerAt(size_t index) const = 0;
+
+ virtual IStreamInfoT* streamInfoAt(size_t index) const = 0;
+
+ };
+
+public: //// Operations.
+ virtual android::sp<IMap<IImageStreamBuffer> >
+ editMap_AppImage() = 0;
+
+ virtual android::sp<IMap<IMetaStreamBuffer> >
+ editMap_AppMeta() = 0;
+
+ virtual android::sp<IMap<HalImageStreamBuffer> >
+ editMap_HalImage() = 0;
+
+ virtual android::sp<IMap<HalMetaStreamBuffer> >
+ editMap_HalMeta() = 0;
+
+public: //// Operations.
+ virtual MUINT32 getFrameNo() const = 0;
+
+};
+
+
+/**
+ * An interface of (in-flight) pipeline frame control.
+ */
+class IPipelineBufferSetFrameControl
+ : public IPipelineFrame
+ , public IPipelineBufferSetControl
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Definitions.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: ////
+ typedef IPipelineBufferSetFrameControl ThisT;
+
+public: ////
+ typedef NSCam::v3::Utils::HalImageStreamBuffer HalImageStreamBuffer;
+ typedef NSCam::v3::Utils::HalMetaStreamBuffer HalMetaStreamBuffer;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Definitions.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Callback.
+ /**
+ *
+ */
+ class IAppCallback
+ : public virtual android::RefBase
+ {
+ public: //// Operations.
+ virtual MVOID updateFrame(
+ MUINT32 const requestNo,
+ MINTPTR const userId,
+ ssize_t const /*nOutMetaLeft*/,
+ android::Vector<android::sp<IMetaStreamBuffer> > /*vOutMeta*/
+ ) = 0;
+ };
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Operations.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Creation.
+ static ThisT* create(
+ MUINT32 requestNo,
+ MUINT32 frameNo,
+ android::wp<IAppCallback>const& pAppCallback,
+ IPipelineStreamBufferProvider const* pBufferProvider
+ );
+
+public: //// Configuration.
+ virtual MERROR startConfiguration() = 0;
+ virtual MERROR finishConfiguration() = 0;
+
+ virtual MERROR setNodeMap(
+ android::sp<IPipelineFrameNodeMapControl> value
+ ) = 0;
+
+ virtual MERROR setPipelineNodeMap(
+ android::sp<IPipelineNodeMap const> value
+ ) = 0;
+
+ virtual MERROR setPipelineDAG(
+ android::sp<IPipelineDAG const> value
+ ) = 0;
+
+ virtual MERROR setStreamInfoSet(
+ android::sp<IStreamInfoSet const> value
+ ) = 0;
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace v3
+}; //namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_V3_PIPELINE_IPIPELINEBUFFERSETFRAMECONTROL_H_
+
diff --git a/include/hardware/include/mtkcam/v3/pipeline/IPipelineDAG.h b/include/hardware/include/mtkcam/v3/pipeline/IPipelineDAG.h
new file mode 100644
index 0000000..cbabf93
--- /dev/null
+++ b/include/hardware/include/mtkcam/v3/pipeline/IPipelineDAG.h
@@ -0,0 +1,363 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_V3_PIPELINE_IPIPELINEDAG_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_V3_PIPELINE_IPIPELINEDAG_H_
+//
+#include <utils/RefBase.h>
+#include <utils/String8.h>
+#include <utils/Vector.h>
+#include <utils/List.h>
+#include <utils/SortedVector.h>
+#include <mtkcam/common.h>
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+namespace v3 {
+
+
+/**
+ * Type of Camera Pipeline Node Id.
+ */
+typedef MINTPTR Pipeline_NodeId_T;
+
+
+/**
+ * An interface of pipeline directed acyclic graph.
+ */
+class IPipelineDAG
+ : public virtual android::RefBase
+{
+public: //// Definitions.
+
+ template<class _NodeId_T_, class _NodeVal_T_>
+ struct TNodeObj
+ {
+ _NodeId_T_ id;
+ _NodeVal_T_ val;
+ //
+ TNodeObj()
+ : id(-1L)
+ , val(-1L)
+ {}
+ };
+
+ typedef ssize_t NodeVal_T; //Node Value
+ typedef Pipeline_NodeId_T NodeId_T; //Node Id
+ typedef android::SortedVector<NodeId_T> NodeIdSet_T; //Node Id Set
+ typedef TNodeObj<NodeId_T, NodeVal_T> NodeObj_T; //Node Object
+ typedef android::Vector<NodeObj_T> NodeObjSet_T; //Node Object Set
+
+ struct Edge
+ {
+ NodeId_T src;
+ NodeId_T dst;
+ Edge(NodeId_T src = -1L, NodeId_T dst = -1L)
+ : src(src)
+ , dst(dst)
+ {}
+ };
+
+public: //// Operations.
+
+ /**
+ * Create the graph.
+ *
+ * @return
+ * A pointer to a newly-created instance.
+ */
+ static IPipelineDAG* create();
+
+ /**
+ * Clone the graph.
+ *
+ * @return
+ * A pointer to a newly-cloned instance.
+ */
+ virtual IPipelineDAG* clone() const = 0;
+
+ /**
+ * Clone the graph, with a given set of nodes reserved.
+ * Any node beyond the given set of nodes must be removed.
+ *
+ * @param[in] ids: a set of node ids.
+ *
+ * @return
+ * A pointer to a newly-cloned instance.
+ */
+ virtual IPipelineDAG* clone(
+ NodeIdSet_T const& ids
+ ) const = 0;
+
+ /**
+ * Add a node to the graph.
+ *
+ * @param[in] id: node id
+ *
+ * @param[in] val: node value
+ *
+ * @return
+ * 0 indicates success; otherwise failure.
+ */
+ virtual MERROR addNode(
+ NodeId_T id,
+ NodeVal_T const& val = -1L
+ ) = 0;
+
+ /**
+ * Remove a node and its associated edge.
+ *
+ * @param[in] id: node id
+ *
+ * @return
+ * 0 indicates success; otherwise failure.
+ */
+ virtual MERROR removeNode(
+ NodeId_T id
+ ) = 0;
+
+ /**
+ * Add a directed edge to the graph, where a directed edge is from a given
+ * source node to a given destination node.
+ *
+ * @param[in] id_src: the node id of source.
+ *
+ * @param[in] id_dst: the node id of destination.
+ *
+ * @return
+ * 0 indicates success; otherwise failure.
+ */
+ virtual MERROR addEdge(
+ NodeId_T id_src,
+ NodeId_T id_dst
+ ) = 0;
+
+
+ /**
+ * Remove a directed edge from the graph, where a directed edge is from a
+ * given source node to a given destination node.
+ *
+ * @param[in] id_src: the node id of source.
+ *
+ * @param[in] id_dst: the node id of destination.
+ *
+ * @return
+ * 0 indicates success; otherwise failure.
+ */
+ virtual MERROR removeEdge(
+ NodeId_T id_src,
+ NodeId_T id_dst
+ ) = 0;
+
+ /**
+ * Set a node as the root of the graph.
+ *
+ * @param[in] id: node id
+ *
+ * @return
+ * 0 indicates success; otherwise failure.
+ */
+ virtual MERROR setRootNode(
+ NodeId_T id
+ ) = 0;
+
+ /**
+ * Set the value of a specified node.
+ *
+ * @param[in] id: node id
+ *
+ * @param[in] val: node value
+ *
+ * @return
+ * 0 indicates success; otherwise failure.
+ */
+ virtual MERROR setNodeValue(
+ NodeId_T id,
+ NodeVal_T const& val
+ ) = 0;
+
+ /**
+ * Dump.
+ */
+ virtual MVOID dump() const = 0;
+ virtual MVOID dump(
+ android::Vector<android::String8>& rLogs
+ ) const = 0;
+
+public: //// Attributes.
+
+ /**
+ * Get nodes and paths that are needed to make nodes inside the new DAG
+ * reachable from root.
+ *
+ * @param[in] orphanNodes: IDs of nodes that are not reachable from root
+ *
+ * @param[in] checkList: Nodes that are reachable from root
+ *
+ * @param[out] newDAG: DAG with nodes and edges inserted
+ *
+ * @return
+ * 0 indicates success; otherwise, errors.
+ */
+ virtual MERROR getNodesAndPathsForNewDAG(
+ NodeIdSet_T &orphanNodes,
+ NodeIdSet_T &checkList,
+ android::sp<IPipelineDAG> newDAG
+ ) const = 0;
+
+ /**
+ * Get nodes that are not reachable from root.
+ *
+ * @param[out] orphanNodes: IDs of nodes that are not reachable from root
+ *
+ * @param[out] connectedNodes: IDs of nodes that are reachable from root
+ *
+ * @return
+ * 0 indicates success; otherwise, errors.
+ *
+ */
+ virtual MERROR getOrphanNodes(
+ NodeIdSet_T &orphanNodes,
+ NodeIdSet_T &connectedNodes
+ ) const = 0;
+
+ /**
+ * Get the topological order list of the graph.
+ *
+ * @param[out] result: list of node obj in topological order
+ *
+ * @return
+ * 0 indicates success; -1L indicates cycle exists in graph.
+ */
+
+ virtual MERROR getTopological(
+ android::List<NodeObj_T>& result
+ ) const = 0;
+
+ /**
+ * Get the topological sort of the graph.
+ *
+ * @return
+ * An empty vector indicates that the graph is cyclic.
+ */
+ virtual android::Vector<NodeObj_T>const&getToposort() const = 0;
+
+ /**
+ * Get the root node of the graph.
+ *
+ * @return
+ * a node obj type indicates the root node
+ */
+ virtual NodeObj_T getRootNode() const = 0;
+
+ /**
+ * Get node of certain id of the graph.
+ *
+ * @param[in] id: node id
+ *
+ * @return
+ * a node obj type of id node of the graph.
+ */
+ virtual NodeObj_T getNode(NodeId_T id) const = 0;
+
+
+ /**
+ * Get edges of IDs of the graph.
+ *
+ * @param[in] ids: node id set
+ *
+ * @param[out] result: vector of edges related to those node
+ *
+ * @return
+ * 0 indicates success; otherwise failure.
+ */
+ virtual MERROR getEdges(
+ android::Vector<Edge>& result
+ ) const = 0;
+
+
+ /**
+ * Get the number of nodes of the graph.
+ *
+ * @return
+ * size of the graph in size_t.
+ */
+ virtual size_t getNumOfNodes() const = 0;
+
+ /**
+ * Get the in-coming nodes of node id.
+ *
+ * @param[in] id: node id
+ *
+ * @param[out] result: vector of node obj type of the in-coming nodes
+ *
+ * @return
+ * 0 indicates success; otherwise failure.
+ */
+ virtual MERROR getInAdjacentNodes(
+ NodeId_T id,
+ NodeObjSet_T& result
+ ) const = 0;
+
+ /**
+ * Get the out-going nodes of node id.
+ *
+ * @param[in] id: node id
+ *
+ * @param[out] result: vector of node obj type of the out-going nodes
+ *
+ * @return
+ * 0 indicates success; otherwise failure.
+ */
+ virtual MERROR getOutAdjacentNodes(
+ NodeId_T id,
+ NodeObjSet_T& result
+ ) const = 0;
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace v3
+}; //namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_V3_PIPELINE_IPIPELINEDAG_H_
+
diff --git a/include/hardware/include/mtkcam/v3/pipeline/IPipelineFrameControl.h b/include/hardware/include/mtkcam/v3/pipeline/IPipelineFrameControl.h
new file mode 100644
index 0000000..4c0764d
--- /dev/null
+++ b/include/hardware/include/mtkcam/v3/pipeline/IPipelineFrameControl.h
@@ -0,0 +1,100 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_V3_PIPELINE_IPIPELINEFRAMECONTROL_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_V3_PIPELINE_IPIPELINEFRAMECONTROL_H_
+//
+#include <utils/RefBase.h>
+#include <utils/StrongPointer.h>
+#include <mtkcam/v3/utils/streambuf/IStreamBufferSetControl.h>
+#include "IPipelineNode.h"
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+namespace v3 {
+
+
+/**
+ * An interface of (in-flight) pipeline frame control.
+ */
+class IPipelineFrameControl
+ : public IPipelineFrame
+{
+public: //// Definitions.
+
+ typedef IPipelineFrameControl ThisT;
+
+ typedef Utils::IStreamBufferSetControl IStreamBufferSetControl;
+
+public: //// Operations.
+
+ static ThisT* create(MUINT32 frameNo);
+
+ virtual MERROR setPipelineNodeMap(
+ android::sp<IPipelineNodeMap const> value
+ ) = 0;
+
+ virtual MERROR setPipelineDAG(
+ android::sp<IPipelineDAG const> value
+ ) = 0;
+
+ virtual MERROR setStreamBufferSet(
+ android::sp<IStreamBufferSetControl> value
+ ) = 0;
+
+ virtual MERROR setStreamInfoSet(
+ android::sp<IStreamInfoSet const> value
+ ) = 0;
+
+ virtual MERROR addInfoIOMapSet(
+ NodeId_T const& nodeId,
+ InfoIOMapSet const& rIOMapSet
+ ) = 0;
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace v3
+}; //namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_V3_PIPELINE_IPIPELINEFRAMECONTROL_H_
+
diff --git a/include/hardware/include/mtkcam/v3/pipeline/IPipelineFrameNumberGenerator.h b/include/hardware/include/mtkcam/v3/pipeline/IPipelineFrameNumberGenerator.h
new file mode 100644
index 0000000..0e0848c
--- /dev/null
+++ b/include/hardware/include/mtkcam/v3/pipeline/IPipelineFrameNumberGenerator.h
@@ -0,0 +1,83 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_V3_PIPELINE_IPIPELINEFRAMENUMBERGENERATOR_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_V3_PIPELINE_IPIPELINEFRAMENUMBERGENERATOR_H_
+//
+#include <utils/RefBase.h>
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+namespace v3 {
+
+
+/**
+ * An interface of pipeline frameNo generator.
+ */
+class IPipelineFrameNumberGenerator
+ : public virtual android::RefBase
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Operations.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: // Operations
+ static IPipelineFrameNumberGenerator*
+ create();
+ /**
+ * generate pipeline frameNo.
+ *
+ * @return
+ * return pipeline frame number.
+ */
+ virtual uint32_t generateFrameNo() = 0;
+
+ /**
+ * reset pipeline frameNo.
+ *
+ */
+ virtual void resetFrameNo() = 0;
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace v3
+}; //namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_V3_PIPELINE_IPIPELINEFRAMENUMBERGENERATOR_H_
diff --git a/include/hardware/include/mtkcam/v3/pipeline/IPipelineModel.h b/include/hardware/include/mtkcam/v3/pipeline/IPipelineModel.h
new file mode 100644
index 0000000..10fa844
--- /dev/null
+++ b/include/hardware/include/mtkcam/v3/pipeline/IPipelineModel.h
@@ -0,0 +1,166 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_V3_PIPELINE_IPIPELINEMODEL_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_V3_PIPELINE_IPIPELINEMODEL_H_
+//
+#include <utils/RefBase.h>
+#include <utils/StrongPointer.h>
+//
+#include <mtkcam/v3/pipeline/IPipelineBufferSetFrameControl.h>
+#include <mtkcam/v3/pipeline/IPipelineFrameNumberGenerator.h>
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+namespace v3 {
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+class IPipelineModel
+ : public virtual android::RefBase
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Definitions.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Definitions.
+
+ struct AppRequest
+ {
+ /**
+ * @param[in] request number.
+ * The caller must promise its content.
+ * The callee can not modify it.
+ */
+ MUINT32 requestNo;
+
+ /**
+ * @param[in] A pointer to the callback.
+ * The caller must promise its content.
+ * The callee can not modify it.
+ */
+ IPipelineBufferSetFrameControl::IAppCallback*
+ pAppCallback;
+
+ /**
+ * @param[in,out] input App image stream buffers, if any.
+ * The caller must promise the number of buffers and each content.
+ * The callee will update each buffer's users.
+ */
+ android::KeyedVector<
+ StreamId_T,
+ android::sp<IImageStreamBuffer>
+ > vIImageBuffers;
+
+ /**
+ * @param[in,out] output App image stream buffers.
+ * The caller must promise the number of buffers and each content.
+ * The callee will update each buffer's users.
+ */
+ android::KeyedVector<
+ StreamId_T,
+ android::sp<IImageStreamBuffer>
+ > vOImageBuffers;
+
+ /**
+ * @param[in,out] input App meta stream buffers.
+ * The caller must promise the number of buffers and each content.
+ * The callee will update each buffer's users.
+ */
+ android::KeyedVector<
+ StreamId_T,
+ android::sp<IMetaStreamBuffer>
+ > vIMetaBuffers;
+ };
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Interfaces.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Attributes.
+ virtual char const* getName() const = 0;
+ virtual MINT32 getOpenId() const = 0;
+
+public: //// Operations.
+ /**
+ * Submit a request.
+ *
+ * @param[in] request: App request to submit.
+ *
+ * @return
+ * 0 indicates success; otherwise failure.
+ */
+ virtual MERROR submitRequest(AppRequest& request) = 0;
+
+ /**
+ * Set PipelineFrameNumberGenerator.
+ *
+ * @param[in] aPipelineFrameNumberGenerator:
+ * PipelineFrameNumberGenerator to set.
+ *
+ * @return
+ * 0 indicates success; otherwise failure.
+ */
+ virtual MERROR setPipelineFrameNumberGenerator(
+ android::sp<IPipelineFrameNumberGenerator> /*aPipelineFrameNumberGenerator*/
+ ) { return OK; }
+
+ /**
+ * turn on flush flag as flush begin and do flush
+ *
+ */
+ virtual MERROR beginFlush() = 0;
+
+ /**
+ * turn off flush flag as flush end
+ *
+ */
+ virtual MVOID endFlush() = 0;
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace v3
+}; //namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_V3_PIPELINE_IPIPELINEMODEL_H_
+
diff --git a/include/hardware/include/mtkcam/v3/pipeline/IPipelineNode.h b/include/hardware/include/mtkcam/v3/pipeline/IPipelineNode.h
new file mode 100644
index 0000000..80af8f7
--- /dev/null
+++ b/include/hardware/include/mtkcam/v3/pipeline/IPipelineNode.h
@@ -0,0 +1,314 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_V3_PIPELINE_IPIPELINENODE_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_V3_PIPELINE_IPIPELINENODE_H_
+//
+#include <utils/RefBase.h>
+#include <utils/KeyedVector.h>
+#include <mtkcam/common.h>
+#include "../stream/IStreamBufferSet.h"
+#include "../stream/IStreamInfo.h"
+#include "IPipelineDAG.h"
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+namespace v3 {
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+class IPipelineNodeMap;
+class IPipelineFrame;
+class IPipelineNode;
+class IPipelineDAG;
+
+
+/**
+ * Type of Camera Pipeline Node Id.
+ */
+typedef MINTPTR Pipeline_NodeId_T;
+
+
+/**
+ * An interface of Pipeline node map (key:NodeId_T, value:NodePtr_T).
+ */
+class IPipelineNodeMap
+ : public virtual android::RefBase
+{
+public: //// Definitions.
+ typedef Pipeline_NodeId_T NodeId_T;
+ typedef IPipelineNode NodeT;
+ typedef android::sp<NodeT> NodePtrT;
+
+public: //// Operations.
+ virtual MBOOL isEmpty() const = 0;
+ virtual size_t size() const = 0;
+
+ virtual NodePtrT nodeFor(NodeId_T const& id) const = 0;
+ virtual NodePtrT nodeAt(size_t index) const = 0;
+
+};
+
+
+/**
+ * An interface of (in-flight) pipeline frame listener.
+ */
+class IPipelineFrameListener
+ : public virtual android::RefBase
+{
+public: //// Definitions.
+ typedef Pipeline_NodeId_T NodeId_T;
+
+ enum
+ {
+ /** This frame is released */
+ eMSG_FRAME_RELEASED,
+
+ /** All output meta buffers released */
+ eMSG_ALL_OUT_META_BUFFERS_RELEASED,
+
+ /** All output image buffers released */
+ eMSG_ALL_OUT_IMAGE_BUFFERS_RELEASED,
+
+ };
+
+ /**
+ * Invoked when something happens.
+ *
+ * @param[in] frameNo: frame number.
+ *
+ * @param[in] message: a message to indicate what happen.
+ *
+ * @param[in] pCookie: the listener's cookie.
+ */
+ virtual MVOID onPipelineFrame(
+ MUINT32 const frameNo,
+ MUINT32 const message,
+ MVOID*const pCookie
+ ) = 0;
+
+ /**
+ * Invoked when something happens.
+ *
+ * @param[in] frameNo: frame number.
+ *
+ * @param[in] nodeId: node ID.
+ *
+ * @param[in] message: a message to indicate what happen.
+ *
+ * @param[in] pCookie: the listener's cookie.
+ */
+ virtual MVOID onPipelineFrame(
+ MUINT32 const frameNo,
+ NodeId_T const nodeId,
+ MUINT32 const message,
+ MVOID*const pCookie
+ ) = 0;
+
+};
+
+
+/**
+ * An interface of (in-flight) pipeline frame.
+ */
+class IPipelineFrame
+ : public virtual android::RefBase
+{
+public: //// Definitions.
+ typedef Pipeline_NodeId_T NodeId_T;
+
+ struct ImageInfoIOMap
+ {
+ android::DefaultKeyedVector<StreamId_T, android::sp<IImageStreamInfo> > vIn;
+ android::DefaultKeyedVector<StreamId_T, android::sp<IImageStreamInfo> > vOut;
+ };
+
+ struct MetaInfoIOMap
+ {
+ android::DefaultKeyedVector<StreamId_T, android::sp<IMetaStreamInfo> > vIn;
+ android::DefaultKeyedVector<StreamId_T, android::sp<IMetaStreamInfo> > vOut;
+ };
+
+ struct ImageInfoIOMapSet
+ : public android::Vector<ImageInfoIOMap>
+ {
+ };
+
+ struct MetaInfoIOMapSet
+ : public android::Vector<MetaInfoIOMap>
+ {
+ };
+
+ struct InfoIOMapSet
+ {
+ typedef IPipelineFrame::ImageInfoIOMapSet ImageInfoIOMapSet;
+ typedef IPipelineFrame::MetaInfoIOMapSet MetaInfoIOMapSet;
+ ImageInfoIOMapSet mImageInfoIOMapSet;
+ MetaInfoIOMapSet mMetaInfoIOMapSet;
+ };
+
+public: //// Operations.
+
+ virtual MUINT32 getFrameNo() const = 0;
+ virtual MUINT32 getRequestNo() const = 0;
+
+ virtual android::sp<IPipelineNodeMap const>
+ getPipelineNodeMap() const = 0;
+ virtual IPipelineDAG const& getPipelineDAG() const = 0;
+ virtual IStreamBufferSet& getStreamBufferSet() const = 0;
+ virtual IStreamInfoSet const& getStreamInfoSet() const = 0;
+
+ virtual MERROR queryIOStreamInfoSet(
+ NodeId_T const& nodeId,
+ android::sp<IStreamInfoSet const>& rIn,
+ android::sp<IStreamInfoSet const>& rOut
+ ) const = 0;
+
+ virtual MERROR queryInfoIOMapSet(
+ NodeId_T const& nodeId,
+ InfoIOMapSet& rIOMapSet
+ ) const = 0;
+
+ /**
+ * Attach a pipeline frame listener.
+ *
+ * @param[in] pListener: the listener to attach.
+ *
+ * @param[in] pCookie: the listener's cookie.
+ *
+ * @return
+ * 0 indicates success; otherwise failure.
+ */
+ virtual MERROR attachListener(
+ android::wp<IPipelineFrameListener>const& pListener,
+ MVOID*const pCookie
+ ) = 0;
+
+};
+
+
+/**
+ * An interface of pipeline node.
+ */
+
+struct IPipelineNodeCallback;
+class IPipelineNode
+ : public virtual android::RefBase
+{
+public: //// Definitions.
+ typedef Pipeline_NodeId_T NodeId_T;
+
+public: //// Attributes.
+ /**
+ * @return
+ * An index to indicate which camera device to open.
+ */
+ virtual MINT32 getOpenId() const = 0;
+
+ /**
+ * @return
+ * A unique node id.
+ */
+ virtual NodeId_T getNodeId() const = 0;
+
+ /**
+ * @return
+ * A null-terminated string for the node name.
+ */
+ virtual char const* getNodeName() const = 0;
+
+public: //// Operations.
+
+ /**
+ *
+ */
+ virtual MERROR uninit() = 0;
+
+ /**
+ *
+ */
+ virtual MERROR flush() = 0;
+
+ /**
+ *
+ */
+ virtual MERROR flush(
+ android::sp<IPipelineFrame> const &pFrame
+ ) = 0;
+
+ /**
+ *
+ */
+ virtual MERROR queue(
+ android::sp<IPipelineFrame> pFrame
+ ) = 0;
+
+ /**
+ *
+ */
+ virtual MVOID setCallback(
+ android::wp<IPipelineNodeCallback> pCB
+ ) = 0;
+
+};
+
+
+/**
+ * An interface of callback function from node to pipeline
+ */
+struct IPipelineNodeCallback : public virtual android::RefBase
+{
+ virtual MVOID onDispatchFrame(
+ android::sp<IPipelineFrame> const& pFrame,
+ Pipeline_NodeId_T nodeId
+ ) = 0;
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace v3
+}; //namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_V3_PIPELINE_IPIPELINENODE_H_
+
diff --git a/include/hardware/include/mtkcam/v3/pipeline/IPipelineNodeMapControl.h b/include/hardware/include/mtkcam/v3/pipeline/IPipelineNodeMapControl.h
new file mode 100644
index 0000000..2ea1254
--- /dev/null
+++ b/include/hardware/include/mtkcam/v3/pipeline/IPipelineNodeMapControl.h
@@ -0,0 +1,101 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_V3_PIPELINE_IPIPELINENODEMAPCONTROL_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_V3_PIPELINE_IPIPELINENODEMAPCONTROL_H_
+//
+#include "IPipelineNode.h"
+#include <mtkcam/v3/utils/streaminfo/IStreamInfoSetControl.h>
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+namespace v3 {
+
+
+/**
+ * An interface of Pipeline node map (key:NodeId_T, value:NodePtrT).
+ */
+class IPipelineNodeMapControl
+ : public virtual IPipelineNodeMap
+{
+public: //// Definitions.
+ typedef IPipelineNodeMapControl ThisT;
+ typedef Utils::IStreamInfoSetControl IStreamSetT;
+ typedef android::sp<IStreamSetT> IStreamSetPtr;
+ typedef android::sp<IStreamSetT const> IStreamSetPtr_CONST;
+
+ struct INode
+ : public virtual android::RefBase
+ {
+ public: //// Operations.
+ virtual NodePtrT const& getNode() const = 0;
+
+ virtual IStreamSetPtr_CONST getInStreams() const = 0;
+ virtual IStreamSetPtr_CONST getOutStreams() const = 0;
+ virtual IStreamSetPtr const&editInStreams() const = 0;
+ virtual IStreamSetPtr const&editOutStreams() const = 0;
+ };
+
+public: //// Operations.
+
+ static ThisT* create();
+
+ virtual ssize_t setCapacity(size_t size) = 0;
+
+ virtual MVOID clear() = 0;
+
+ virtual ssize_t add(
+ NodeId_T const& id,
+ NodePtrT const& node
+ ) = 0;
+
+ virtual android::sp<INode> getNodeFor(NodeId_T const& id) const = 0;
+ virtual android::sp<INode> getNodeAt(size_t index) const = 0;
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace v3
+}; //namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_V3_PIPELINE_IPIPELINENODEMAPCONTROL_H_
+
diff --git a/include/hardware/include/mtkcam/v3/stream/IStreamBuffer.h b/include/hardware/include/mtkcam/v3/stream/IStreamBuffer.h
new file mode 100644
index 0000000..e26f916
--- /dev/null
+++ b/include/hardware/include/mtkcam/v3/stream/IStreamBuffer.h
@@ -0,0 +1,185 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_V3_STREAM_ISTREAMBUFFER_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_V3_STREAM_ISTREAMBUFFER_H_
+//
+#include <utils/RefBase.h>
+#include <utils/Vector.h>
+#include <utils/List.h>
+#include <mtkcam/common.h>
+#include <mtkcam/utils/Sync.h>
+#include <mtkcam/metadata/IMetadata.h>
+#include "IUsersManager.h"
+#include "IStreamInfo.h"
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+namespace v3 {
+
+
+/**
+ * Camera stream buffer status.
+ */
+struct STREAM_BUFFER_STATUS
+{
+ typedef STREAM_BUFFER_STATUS T;
+ enum
+ {
+ ERROR = (1U << 0),/*!< The buffer may contain invalid data. */
+ WRITE = (1U << 1),/*!< The buffer's content has been touched. */
+ WRITE_OK = T::WRITE,
+ WRITE_ERROR = T::WRITE | T::ERROR,
+ };
+};
+
+
+/**
+ * An interface of stream buffer.
+ */
+class IStreamBuffer
+ : public virtual IUsersManager
+{
+public: //// Attributes.
+ virtual char const* getName() const = 0;
+ virtual MUINT32 getStatus() const = 0;
+ virtual MBOOL hasStatus(MUINT32 mask) const = 0;
+ virtual MVOID markStatus(MUINT32 mask) = 0;
+ virtual MVOID clearStatus() = 0;
+
+};
+
+
+/**
+ * An interface template of stream buffer.
+ *
+ * @param <_IStreamInfoT_> the type of stream info interface.
+ *
+ * @param <_IBufferT_> the type of buffer interface.
+ */
+template<
+ class _IStreamInfoT_,
+ class _IBufferT_
+>
+class TIStreamBuffer
+ : public virtual IStreamBuffer
+{
+public: //// Definitions.
+ typedef _IStreamInfoT_ IStreamInfoT;
+ typedef _IBufferT_ IBufferT;
+
+public: //// Attributes.
+ virtual IStreamInfoT const* getStreamInfo() const = 0;
+
+public: //// Operations.
+ /**
+ * Release the buffer and unlock its use.
+ *
+ * @remark Make sure that the caller name must be the same as that passed
+ * during tryReadLock or tryWriteLock.
+ */
+ virtual MVOID unlock(
+ char const* szCallName,
+ IBufferT* pBuffer
+ ) = 0;
+
+ /**
+ * A reader must try to lock the buffer for reading.
+ *
+ * @remark The same caller name must be passed to unlock.
+ */
+ virtual IBufferT* tryReadLock(
+ char const* szCallName
+ ) = 0;
+
+ /**
+ * A writer must try to lock the buffer for writing.
+ *
+ * @remark The same caller name must be passed to unlock.
+ */
+ virtual IBufferT* tryWriteLock(
+ char const* szCallName
+ ) = 0;
+};
+
+
+/**
+ * An interface of metadata stream buffer.
+ */
+class IMetaStreamBuffer
+ : public TIStreamBuffer<IMetaStreamInfo, IMetadata>
+{
+public: //// Definitions.
+
+public: //// Attributes.
+
+ /**
+ * MTRUE indicates that the meta settnigs are identical to the most-recently
+ * submitted meta settnigs; otherwise MFALSE.
+ */
+ virtual MBOOL isRepeating() const = 0;
+
+public: //// Operations.
+
+};
+
+
+/**
+ * An interface of image stream buffer.
+ */
+class IImageStreamBuffer
+ : public TIStreamBuffer<IImageStreamInfo, IImageBufferHeap>
+{
+public: //// Definitions.
+
+public: //// Attributes.
+
+public: //// Operations.
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace v3
+}; //namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_V3_STREAM_ISTREAMBUFFER_H_
+
diff --git a/include/hardware/include/mtkcam/v3/stream/IStreamBufferSet.h b/include/hardware/include/mtkcam/v3/stream/IStreamBufferSet.h
new file mode 100644
index 0000000..a224374
--- /dev/null
+++ b/include/hardware/include/mtkcam/v3/stream/IStreamBufferSet.h
@@ -0,0 +1,206 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_V3_STREAM_ISTREAMBUFFERSET_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_V3_STREAM_ISTREAMBUFFERSET_H_
+//
+#include <utils/RefBase.h>
+#include <utils/StrongPointer.h>
+#include <mtkcam/v3/stream/IStreamBuffer.h>
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+namespace v3 {
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+class IStreamBufferSet
+ : public virtual android::RefBase
+{
+public: //// Definitions.
+ typedef IUsersManager::UserId_T UserId_T;
+
+public: //// Operations.
+#if 0
+ /**
+ * Create a subject's acquire fence associated with a user.
+ * This user must wait on this fence before attempting to use the subject.
+ *
+ * @param[in] streamId: A stream Id.
+ *
+ * @param[in] userId: A specified user Id.
+ *
+ * @return
+ * A bad fence indicates this subject has not been initialized or need
+ * not to wait before using it.
+ */
+ virtual MINT createAcquireFence(
+ StreamId_T const streamId,
+ UserId_T userId
+ ) const = 0;
+
+ /**
+ * Set a specified user's release fence.
+ * The specified user must be enqueued before this call.
+ *
+ * @param[in] streamId: A stream Id.
+ *
+ * @param[in] userId: A specified unique user Id.
+ *
+ * @param[in] releaseFence: A release fence to register.
+ * The callee takes the ownership of the fence file descriptor and is
+ * charge of closing it.
+ * If a release fence associated with this user is specified during
+ * enqueUserList(), the old release fence will be replaced with the
+ * specified release fence after this call.
+ *
+ * @return
+ * 0 indicates success; otherwise failure.
+ * NAME_NOT_FOUND indicates a bad user Id.
+ */
+ virtual MERROR setUserReleaseFence(
+ StreamId_T const streamId,
+ UserId_T userId,
+ MINT releaseFence
+ ) = 0;
+
+ /**
+ * Query a specific user's group usage.
+ *
+ * @param[in] streamId: A stream Id.
+ *
+ * @param[in] userId: A specified unique user Id.
+ *
+ * @return
+ * A group usage associated with this user.
+ */
+ virtual MUINT queryGroupUsage(
+ StreamId_T const streamId,
+ UserId_T userId
+ ) const = 0;
+#endif
+
+public: //// Operations.
+ /**
+ * This call marks a specified user's status.
+ *
+ * @param[in] streamId: A stream Id.
+ *
+ * @param[in] userId: A specified unique user Id.
+ *
+ * @param[in] eStatus: user status.
+ * ACQUIRE : This user has waited on the subject's acquire fence.
+ * PRE_RELEASE : This user is ready to pre-release the subject and will
+ * still use it after its pre-release until a release
+ * fence is signalled.
+ * USED : This user has used the subject.
+ * RELEASE : This user is ready to release the subject and will not
+ * use it after its release.
+ *
+ * @return
+ * the current status mask.
+ */
+ virtual MUINT32 markUserStatus(
+ StreamId_T const streamId,
+ UserId_T userId,
+ MUINT32 eStatus
+ ) = 0;
+
+public: //// Operations.
+ /**
+ * Apply to pre-release.
+ * After this call, all of PRE_RELEASE-marked buffers are pre-released by
+ * this user.
+ *
+ * @param[in] userId: A specified unique user Id.
+ *
+ */
+ virtual MVOID applyPreRelease(
+ UserId_T userId
+ ) = 0;
+
+ /**
+ * Apply to release.
+ * After this call, all of RELEASE-marked buffers are released by this user.
+ *
+ * @param[in] userId: A specified unique user Id.
+ *
+ */
+ virtual MVOID applyRelease(
+ UserId_T userId
+ ) = 0;
+
+public: //// Operations.
+
+ /**
+ * For a specific stream buffer (associated with a stream Id), a user (with
+ * a unique user Id) could successfully acquire the buffer from this buffer
+ * set only if all users ahead of this user have pre-released or released
+ * the buffer.
+ *
+ * @param[in] streamId: A specified unique stream Id.
+ *
+ * @param[in] userId: A specified unique user Id.
+ *
+ * @return
+ * A pointer to the buffer associated with the given stream Id.
+ */
+ virtual android::sp<IMetaStreamBuffer> getMetaBuffer(
+ StreamId_T streamId,
+ UserId_T userId
+ ) const = 0;
+
+ virtual android::sp<IImageStreamBuffer> getImageBuffer(
+ StreamId_T streamId,
+ UserId_T userId
+ ) const = 0;
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace v3
+}; //namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_V3_STREAM_ISTREAMBUFFERSET_H_
+
diff --git a/include/hardware/include/mtkcam/v3/stream/IStreamInfo.h b/include/hardware/include/mtkcam/v3/stream/IStreamInfo.h
new file mode 100644
index 0000000..7946269
--- /dev/null
+++ b/include/hardware/include/mtkcam/v3/stream/IStreamInfo.h
@@ -0,0 +1,274 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_V3_STREAM_ISTREAMINFO_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_V3_STREAM_ISTREAMINFO_H_
+//
+#include <utils/Vector.h>
+#include <utils/RefBase.h>
+#include <hardware/camera3.h>
+#include <mtkcam/common.h>
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+namespace v3 {
+
+
+/**
+ * Type of Camera Stream Id.
+ */
+typedef MINTPTR StreamId_T;
+
+
+/**
+ * Camera stream type declaration.
+ */
+enum EStreamType
+{
+ // Image Streams
+ eSTREAMTYPE_IMAGE_OUT = CAMERA3_STREAM_OUTPUT,
+ eSTREAMTYPE_IMAGE_IN = CAMERA3_STREAM_INPUT,
+ eSTREAMTYPE_IMAGE_INOUT = CAMERA3_STREAM_BIDIRECTIONAL,
+ eSTREAMTYPE_IMAGE_END_OF_TYPES = CAMERA3_NUM_STREAM_TYPES,
+
+ // Metadata Streams
+ eSTREAMTYPE_META_OUT, //DYNAMIC
+ eSTREAMTYPE_META_IN, //CONTROL
+ eSTREAMTYPE_META_INOUT, //CONTROL/DYNAMIC
+
+};
+
+
+/**
+ * An interface of stream info.
+ */
+class IStreamInfo : public virtual android::RefBase
+{
+public: //// Definitions.
+ typedef NSCam::v3::StreamId_T StreamId_T;
+
+public: //// Attributes.
+
+ /**
+ * A stream name.
+ *
+ * @remark This should be fixed and unchangable.
+ */
+ virtual char const* getStreamName() const = 0;
+
+ /**
+ * A unique stream ID.
+ *
+ * @remark This should be fixed and unchangable.
+ */
+ virtual StreamId_T getStreamId() const = 0;
+
+ /**
+ * A stream type of eSTREAMTYPE_xxx.
+ *
+ * @remark This should be fixed and unchangable.
+ */
+ virtual MUINT32 getStreamType() const = 0;
+
+ /**
+ * The maximum number of buffers which may be used at the same time.
+ *
+ * @remark This should be fixed and unchangable.
+ */
+ virtual size_t getMaxBufNum() const = 0;
+
+ /**
+ * Set the maximum number of buffers which may be used at the same time.
+ *
+ * @param[in] count: the max. number of buffers.
+ */
+ virtual MVOID setMaxBufNum(size_t count) = 0;
+
+ /**
+ * The minimum number of buffers which is suggested to allocate initially.
+ *
+ * @remark This should be fixed and unchangable.
+ */
+ virtual size_t getMinInitBufNum() const = 0;
+
+public: //// Operations.
+
+ /**
+ * dump to the log for debug.
+ */
+
+ /**
+ * dump to a string for debug.
+ */
+
+ /**
+ * dump to the specified file descriptor for debug.
+ */
+
+};
+
+
+/**
+ * An interface of metadata stream info.
+ */
+class IMetaStreamInfo : public virtual IStreamInfo
+{
+public: //// Definitions.
+public: //// Attributes.
+ /**
+ * Query the maximum number of tags or sections.
+ */
+
+};
+
+
+/**
+ * An interface of image stream info.
+ */
+class IImageStreamInfo : public virtual IStreamInfo
+{
+public: //// Definitions.
+
+ /**
+ * A single color plane of image buffer.
+ */
+ struct BufPlane {
+ /**
+ * The size for this color plane, in bytes.
+ */
+ size_t sizeInBytes;
+
+ /**
+ * The row stride for this color plane, in bytes.
+ *
+ * This is the distance between the start of two consecutive rows of
+ * pixels in the image. The row stride is always greater than 0.
+ */
+ size_t rowStrideInBytes;
+
+ };
+
+ typedef android::Vector<BufPlane> BufPlanes_t;
+
+public: //// Attributes.
+
+ /**
+ * Usage for buffer consumer.
+ *
+ * @remark Both usages for allocator and consumer may have no intersection.
+ */
+ virtual MUINT getUsageForConsumer() const = 0;
+
+ /**
+ * Usage for buffer allocator.
+ *
+ * @remark Both usages for allocator and consumer may have no intersection.
+ */
+ virtual MUINT getUsageForAllocator() const = 0;
+
+ /**
+ * Image format.
+ */
+ virtual MINT getImgFormat() const = 0;
+
+ /**
+ * Image resolution, in pixels, without cropping.
+ *
+ * @remark This should be fixed and unchangable.
+ */
+ virtual MSize getImgSize() const = 0;
+
+ /**
+ * A vector of buffer planes.
+ */
+ virtual BufPlanes_t const& getBufPlanes() const = 0;
+
+ /**
+ * Image transform type.
+ */
+ virtual MUINT32 getTransform() const = 0;
+
+};
+
+
+
+/**
+ * An interface of stream info set.
+ */
+class IStreamInfoSet
+ : public virtual android::RefBase
+{
+public: //// Definitions.
+ template <class _IStreamInfoT_>
+ struct IMap
+ : public virtual android::RefBase
+ {
+ public: //// Operations.
+ typedef _IStreamInfoT_ IStreamInfoT;
+
+ virtual size_t size() const = 0;
+ virtual ssize_t indexOfKey(StreamId_T id) const = 0;
+ virtual android::sp<IStreamInfoT> valueFor(StreamId_T id) const = 0;
+ virtual android::sp<IStreamInfoT> valueAt(size_t index) const = 0;
+ };
+
+public: //// Operations.
+ virtual android::sp<IMap<IMetaStreamInfo> >
+ getMetaInfoMap() const = 0;
+ virtual size_t getMetaInfoNum() const = 0;
+ virtual android::sp<IMetaStreamInfo> getMetaInfoFor(StreamId_T id) const = 0;
+ virtual android::sp<IMetaStreamInfo> getMetaInfoAt(size_t index) const = 0;
+
+ virtual android::sp<IMap<IImageStreamInfo> >
+ getImageInfoMap() const = 0;
+ virtual size_t getImageInfoNum() const = 0;
+ virtual android::sp<IImageStreamInfo> getImageInfoFor(StreamId_T id) const= 0;
+ virtual android::sp<IImageStreamInfo> getImageInfoAt(size_t index) const = 0;
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace v3
+}; //namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_V3_STREAM_ISTREAMINFO_H_
+
diff --git a/include/hardware/include/mtkcam/v3/stream/IUsersManager.h b/include/hardware/include/mtkcam/v3/stream/IUsersManager.h
new file mode 100644
index 0000000..b17fa22
--- /dev/null
+++ b/include/hardware/include/mtkcam/v3/stream/IUsersManager.h
@@ -0,0 +1,482 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_V3_STREAM_IUSERSMANAGER_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_V3_STREAM_IUSERSMANAGER_H_
+//
+#include <utils/RefBase.h>
+#include <mtkcam/common.h>
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+namespace v3 {
+
+
+/**
+ * An interface of subject users manager.
+ * It is designed for managing a specific subject and its users.
+ */
+class IUsersManager
+ : public virtual android::RefBase
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Interfaces.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Definitions.
+
+ /**
+ * The type of subject to use.
+ */
+ typedef MINTPTR Subject_T;
+
+ /**
+ * The type of user Id.
+ */
+ typedef MINTPTR UserId_T;
+
+ /**
+ * User Category.
+ */
+ struct Category
+ {
+ enum
+ {
+ PRODUCER = 0, //this user is a producer
+ CONSUMER = 1, //this user is a consumer
+ NONE = 2, //this is not a valid user
+ };
+ };
+
+ /**
+ * User.
+ */
+ struct User
+ {
+ /**
+ * A unique user Id.
+ */
+ UserId_T mUserId;
+
+ /**
+ * Acquire fence.
+ * The callee takes the ownership of the fence file descriptor and is
+ * charge of closing it.
+ * This user must wait on this fence before using its associated subject.
+ */
+ MINT mAcquireFence;
+
+ /**
+ * Release fence.
+ * The callee takes the ownership of the fence file descriptor and is
+ * charge of closing it.
+ * This fence will be signaled after its associated subject is used done
+ * by this user.
+ */
+ MINT mReleaseFence;
+
+ /**
+ * Usage.
+ */
+ MUINT mUsage;
+
+ /**
+ * User category
+ * Category::PRODUCER
+ * Category::CONSUMER
+ * Category::NONE
+ */
+ MUINT mCategory;
+
+ /**
+ * Constructor.
+ */
+ User()
+ : mUserId(-1)
+ , mAcquireFence(-1)
+ , mReleaseFence(-1)
+ , mUsage(0)
+ , mCategory(0)
+ {}
+ };
+
+
+ class IUserGraph
+ : public virtual android::RefBase
+ {
+ public:
+
+ /**
+ * Add a user to the graph.
+ *
+ * @param[in] usr: a user.
+ *
+ * @return
+ * 0 indicates success; otherwise failure.
+ */
+ virtual MERROR addUser(
+ User const& usr
+ ) = 0;
+
+ /**
+ * Remove a node and its associated edge.
+ *
+ * @param[in] id: node id
+ *
+ * @return
+ * 0 indicates success; otherwise failure.
+ */
+ virtual MERROR removeUser(
+ UserId_T id
+ ) = 0;
+
+ /**
+ * Add a directed edge to the graph, where a directed edge is from a
+ * given source node to a given destination node.
+ *
+ * @param[in] id_src: the node id of source.
+ *
+ * @param[in] id_dst: the node id of destination.
+ *
+ * @return
+ * 0 indicates success; otherwise failure.
+ */
+ virtual MERROR addEdge(
+ UserId_T id_src,
+ UserId_T id_dst
+ ) = 0;
+
+ /**
+ * Remove a directed edge from the graph, where a directed edge is from
+ * a given source node to a given destination node.
+ *
+ * @param[in] id_src: the node id of source.
+ *
+ * @param[in] id_dst: the node id of destination.
+ *
+ * @return
+ * 0 indicates success; otherwise failure.
+ */
+ virtual MERROR removeEdge(
+ UserId_T id_src,
+ UserId_T id_dst
+ ) = 0;
+
+ /**
+ * Set capacity of vector inside
+ */
+ virtual MERROR setCapacity(
+ size_t size
+ ) = 0;
+
+ /**
+ * Get the number of users.
+ */
+ virtual size_t size() const = 0;
+
+ /**
+ * Get the in-coming number of users.
+ */
+ virtual size_t indegree(size_t index) const = 0;
+
+ /**
+ * Get the out-going number of users.
+ */
+ virtual size_t outdegree(size_t index) const = 0;
+
+ /**
+ * Set a specified user's acquire fence.
+ */
+ virtual MERROR setAcquireFence(
+ size_t index,
+ MINT fence
+ ) = 0;
+
+ /**
+ * Get group index of graph
+ */
+ virtual size_t getGroupIndex() const = 0;
+ };
+
+ /**
+ * ACQUIRE : This user has waited on the subject's acquire fence.
+ * PRE_RELEASE : This user is ready to pre-release the subject and will
+ * still use it after its pre-release until a release fence
+ * is signalled.
+ * USED : This user has used the subject.
+ * RELEASE : This user is ready to release the subject and will not use
+ * it after its release.
+ */
+ struct UserStatus
+ {
+ enum
+ {
+ ACQUIRE = (0x00000001 << 0),
+ PRE_RELEASE = (0x00000001 << 1),
+ USED = (0x00000001 << 2),
+ RELEASE = (0x00000001 << 3),
+ };
+ };
+
+
+public: //// Operations.
+
+ /**
+ * Return the subject id.
+ */
+ virtual Subject_T getSubject() const = 0;
+
+ /**
+ * Return the subject name.
+ */
+ virtual char const* getSubjectName() const = 0;
+
+public: //// Operations.
+
+ /**
+ * Create a user graph.
+ */
+ virtual IUserGraph* createGraph() = 0;
+
+ /**
+ * Enqueue a specified user graph to a specified group.
+ *
+ * A user group could contain several user graphs, and a user graph could
+ * contain several users.
+ *
+ * @param[in] pUserGraph: A specified user graph.
+ *
+ * @return
+ * >=0: an index of user group where the user graph is added into.
+ * < 0: an error code.
+ */
+ virtual ssize_t enqueUserGraph(
+ android::sp<IUserGraph> pUserGraph
+ ) = 0;
+
+ /**
+ * Completes the user setup process.
+ *
+ * @return
+ * 0 indicates success; otherwise failure.
+ */
+ virtual MERROR finishUserSetup() = 0;
+
+ /**
+ * Reset.
+ */
+ virtual MVOID reset() = 0;
+
+public: //// Operations.
+
+ /**
+ * This call marks a specified user's status.
+ *
+ * @param[in] userId: A specified unique user Id.
+ *
+ * @param[in] statusMask: User status.
+ * It's available to mark two status. (ex. 0x0001, 0x1100, ...)
+ *
+ * @return
+ * the current status mask.
+ */
+ virtual MUINT32 markUserStatus(
+ UserId_T userId,
+ MUINT32 const statusMask
+ ) = 0;
+
+ /**
+ * Retrieve a specified user's status mask.
+ *
+ * @param[in] userId: A specified unique user Id.
+ *
+ * @return
+ * the current status mask.
+ */
+ virtual MUINT32 getUserStatus(
+ UserId_T userId
+ ) const = 0;
+
+ /**
+ * Retrieve a specific user's category.
+ *
+ * @param[in] userId: A specified unique user Id.
+ *
+ * @return
+ * the user's category (Category::xxx).
+ */
+ virtual MUINT getUserCategory(
+ UserId_T userId
+ ) const = 0;
+
+ /**
+ * Set a specified user's release fence.
+ * The specified user must be enqueued before this call.
+ *
+ * @param[in] userId: A specified unique user Id.
+ *
+ * @param[in] releaseFence: A release fence to register.
+ * The callee takes the ownership of the fence file descriptor and is
+ * charge of closing it.
+ * If a release fence associated with this user is specified during
+ * enqueUserGraph(), the old release fence will be replaced with the
+ * specified release fence after this call.
+ *
+ * @return
+ * 0 indicates success; otherwise failure.
+ * NAME_NOT_FOUND indicates a bad user Id.
+ */
+ virtual MERROR setUserReleaseFence(
+ UserId_T userId,
+ MINT releaseFence
+ ) = 0;
+
+ /**
+ * Query a specific user's group usage.
+ *
+ * @param[in] userId: A specified unique user Id.
+ *
+ * @return
+ * A group usage associated with this user.
+ */
+ virtual MUINT queryGroupUsage(
+ UserId_T userId
+ ) const = 0;
+
+ /**
+ * Retrieve the number of producer users.
+ */
+ virtual size_t getNumberOfProducers() const = 0;
+
+ /**
+ * Retrieve the number of consumer users.
+ */
+ virtual size_t getNumberOfConsumers() const = 0;
+
+public: //// Operations.
+
+ /**
+ * Create a subject's acquire fence associated with a user.
+ * This user must wait on this fence before attempting to use the subject.
+ *
+ * @param[in] userId: A specified user Id.
+ *
+ * @return
+ * A bad fence indicates this subject has not been initialized or need
+ * not to wait before using it.
+ */
+ virtual MINT createAcquireFence(
+ UserId_T userId
+ ) const = 0;
+
+ /**
+ * Create a subject's release fence associated with a user.
+ * The signaling of this fence indicates that this subject is accessed done
+ * and released by this user
+ *
+ * @param[in] userId: A specified user Id.
+ *
+ * @return
+ * A bad fence indicates this subject has not been initialized or need
+ * not to wait before using it.
+ */
+ virtual MINT createReleaseFence(
+ UserId_T userId
+ ) const = 0;
+
+ /**
+ * Create a subject's final release fence.
+ * The signaling of this fence indicates that no more users attempt to
+ * use this given subject.
+ *
+ * @return
+ * A bad fence indicates this subject has not been initialized or need
+ * not to wait before accessing it.
+ */
+ virtual MINT createReleaseFence(
+ ) const = 0;
+
+public: //// Operations.
+
+ /**
+ * return OK if all users ahead of this user are released or pre-released.
+ */
+ virtual MERROR haveAllUsersReleasedOrPreReleased(
+ UserId_T userId
+ ) const = 0;
+
+ /**
+ *
+ */
+ virtual MERROR haveAllUsersReleased(
+ ) const = 0;
+
+ /**
+ * return UserStatus::RELEASE
+ if all users are released
+
+ return UserStatus::PRE_RELEASE
+ if all users are released or pre-released.
+
+ return 0
+ if NOT all users are released or pre-released.
+ */
+ virtual MUINT32 getAllUsersStatus() const = 0;
+
+
+ /**
+ *
+ */
+ virtual MERROR haveAllProducerUsersReleased(
+ ) const = 0;
+
+ /**
+ *
+ */
+ virtual MERROR haveAllProducerUsersUsed() const = 0;
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace v3
+}; //namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_V3_STREAM_IUSERSMANAGER_H_
+
diff --git a/include/hardware/include/mtkcam/v3/utils/streambuf/IStreamBufferPool.h b/include/hardware/include/mtkcam/v3/utils/streambuf/IStreamBufferPool.h
new file mode 100644
index 0000000..90b536c
--- /dev/null
+++ b/include/hardware/include/mtkcam/v3/utils/streambuf/IStreamBufferPool.h
@@ -0,0 +1,184 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_V3_UTILS_STREAMBUF_ISTREAMBUFFERPOOL_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_V3_UTILS_STREAMBUF_ISTREAMBUFFERPOOL_H_
+//
+#include <utils/Timers.h>
+#include <utils/RefBase.h>
+#include <utils/StrongPointer.h>
+#include <mtkcam/common.h>
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+namespace v3 {
+namespace Utils {
+
+
+/**
+ * @class IStreamBufferPool
+ *
+ * @param <_IBufferT_> the type of buffer interface.
+ * This type must have operations of incStrong and decStrong.
+ */
+template <class _IBufferT_>
+class IStreamBufferPool : public virtual android::RefBase
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Definitions.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Definitions.
+ typedef _IBufferT_ IBufferT;
+ typedef android::sp<IBufferT> SP_IBufferT;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Instantiation.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+private: //// Disallowed.
+ // Copy constructor and Copy assignment are disallowed.
+ IStreamBufferPool(IStreamBufferPool const&);
+ IStreamBufferPool& operator=(IStreamBufferPool const&);
+
+protected: //// Instantiation.
+ IStreamBufferPool() {}
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Pool/Buffer
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Operations.
+
+ /**
+ * Pool name.
+ */
+ virtual char const* poolName() const = 0;
+
+ /**
+ * Dump information for debug.
+ */
+ virtual MVOID dumpPool() const = 0;
+
+ /**
+ * Initialize the pool.
+ *
+ * @param[in] szCallerName: a null-terminated string for a caller name.
+ *
+ * @param[in] maxNumberOfBuffers: maximum number of buffers which can be
+ * allocated from this pool.
+ *
+ * @param[in] minNumberOfInitialCommittedBuffers: minimum number of buffers
+ * which are initially committed.
+ *
+ * @return 0 indicates success; non-zero indicates an error code.
+ */
+ virtual MERROR initPool(
+ char const* szCallerName,
+ size_t maxNumberOfBuffers,
+ size_t minNumberOfInitialCommittedBuffers
+ ) = 0;
+
+ /**
+ * Uninitialize the pool and free all buffers.
+ *
+ * @param[in] szCallerName: a null-terminated string for a caller name.
+ */
+ virtual MVOID uninitPool(
+ char const* szCallerName
+ ) = 0;
+
+ /**
+ * Commit all buffers in the pool.
+ * This is a non-blocking call and will enforce to allocate buffers up to
+ * the max. count in background.
+ *
+ * @param[in] szCallerName: a null-terminated string for a caller name.
+ *
+ * @return 0 indicates success; non-zero indicates an error code.
+ */
+ virtual MERROR commitPool(
+ char const* szCallerName
+ ) = 0;
+
+ /**
+ * Try to acquire a buffer from the pool.
+ *
+ * @param[in] szCallerName: a null-terminated string for a caller name.
+ *
+ * @param[out] rpBuffer: a reference to a newly acquired buffer.
+ *
+ * @param[in] nsTimeout: a timeout in nanoseconds.
+ * timeout=0: this call will try acquiring a buffer and return immediately.
+ * timeout>0: this call will block to return until a buffer is acquired,
+ * the timeout expires, or an error occurs.
+ * timeout<0: this call will block to return until a buffer is acquired, or
+ * an error occurs.
+ *
+ * @return 0 indicates success; non-zero indicates an error code.
+ */
+ virtual MERROR acquireFromPool(
+ char const* szCallerName,
+ SP_IBufferT& rpBuffer,
+ nsecs_t nsTimeout
+ ) = 0;
+
+ /**
+ * Release a buffer to the pool.
+ *
+ * @param[in] szCallerName: a null-terminated string for a caller name.
+ *
+ * @param[in] pBuffer: a buffer to release.
+ *
+ * @return 0 indicates success; non-zero indicates an error code.
+ */
+ virtual MERROR releaseToPool(
+ char const* szCallerName,
+ SP_IBufferT pBuffer
+ ) = 0;
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace Utils
+}; //namespace v3
+}; //namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_V3_UTILS_STREAMBUF_ISTREAMBUFFERPOOL_H_
+
diff --git a/include/hardware/include/mtkcam/v3/utils/streambuf/IStreamBufferSetControl.h b/include/hardware/include/mtkcam/v3/utils/streambuf/IStreamBufferSetControl.h
new file mode 100644
index 0000000..73cd204
--- /dev/null
+++ b/include/hardware/include/mtkcam/v3/utils/streambuf/IStreamBufferSetControl.h
@@ -0,0 +1,160 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_V3_UTILS_STREAMBUF_ISTREAMBUFFERSETCONTROL_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_V3_UTILS_STREAMBUF_ISTREAMBUFFERSETCONTROL_H_
+//
+#include <mtkcam/v3/stream/IStreamBufferSet.h>
+#include "StreamBuffers.h"
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+namespace v3 {
+namespace Utils {
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+class IStreamBufferSetControl
+ : public IStreamBufferSet
+{
+public: //// Definitions.
+ /**
+ *
+ */
+ class IAppCallback
+ : public virtual android::RefBase
+ {
+ public: //// Operations.
+ virtual MVOID updateFrame(
+ MUINT32 const frameNo,
+ MINTPTR const userId
+ ) = 0;
+ };
+
+ /**
+ *
+ */
+ class IListener
+ : public virtual android::RefBase
+ {
+ public:
+ /**
+ * Invoked when the buffer set is updated.
+ *
+ * @param[in] pCookie: the listener's cookie.
+ */
+ virtual MVOID onStreamBufferSet_Updated(
+ MVOID* pCookie
+ ) = 0;
+ };
+
+ /**
+ *
+ */
+ template <class _StreamBuffer_>
+ class IMap
+ : public virtual android::RefBase
+ {
+ public: //// Definitions.
+ typedef _StreamBuffer_ StreamBufferT;
+
+ public: //// Operations.
+ virtual ssize_t add(
+ android::sp<StreamBufferT> pBuffer
+ ) = 0;
+
+ virtual ssize_t setCapacity(size_t size) = 0;
+
+ virtual bool isEmpty() const = 0;
+
+ virtual size_t size() const = 0;
+
+ virtual ssize_t indexOfKey(StreamId_T const key) const = 0;
+
+ virtual StreamId_T keyAt(size_t index) const = 0;
+
+ virtual android::sp<StreamBufferT>const&
+ valueAt(size_t index) const = 0;
+
+ virtual android::sp<StreamBufferT>const&
+ valueFor(StreamId_T const key) const = 0;
+
+ };
+
+public: //// Operations.
+ virtual android::sp<IMap<IImageStreamBuffer> >
+ editMap_AppImage() = 0;
+
+ virtual android::sp<IMap<IMetaStreamBuffer> >
+ editMap_AppMeta() = 0;
+
+ virtual android::sp<IMap<HalImageStreamBuffer> >
+ editMap_HalImage() = 0;
+
+ virtual android::sp<IMap<HalMetaStreamBuffer> >
+ editMap_HalMeta() = 0;
+
+public: //// Operations.
+ static android::sp<IStreamBufferSetControl>
+ create(
+ MUINT32 frameNo,
+ android::wp<IAppCallback>const& pAppCallback
+ );
+
+ virtual MERROR attachListener(
+ android::wp<IListener>const& pListener,
+ MVOID* pCookie
+ ) = 0;
+
+ virtual MUINT32 getFrameNo() const = 0;
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace Utils
+}; //namespace v3
+}; //namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_V3_UTILS_STREAMBUF_ISTREAMBUFFERSETCONTROL_H_
+
diff --git a/include/hardware/include/mtkcam/v3/utils/streambuf/StreamBufferPool.h b/include/hardware/include/mtkcam/v3/utils/streambuf/StreamBufferPool.h
new file mode 100644
index 0000000..dd91f63
--- /dev/null
+++ b/include/hardware/include/mtkcam/v3/utils/streambuf/StreamBufferPool.h
@@ -0,0 +1,466 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_V3_UTILS_STREAMBUF_STREAMBUFFERPOOL_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_V3_UTILS_STREAMBUF_STREAMBUFFERPOOL_H_
+//
+#include <utils/String8.h>
+#include <utils/Thread.h>
+#include <utils/List.h>
+
+#include "IStreamBufferPool.h"
+#include "StreamBufferPoolImpl.h"
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+namespace v3 {
+namespace Utils {
+
+
+/**
+ * @class StreamBufferPoolImp
+ *
+ * @param <_IBufferT_> the type of buffer interface.
+ * This type must have operations of incStrong and decStrong.
+ *
+ * @param <_BufferT_> the type of buffer which is a subclass of _IBufferT_.
+ *
+ * @param <_AllocatorT_> the type of allocator.
+ * This type must have a call operator as below:
+ * _BufferT_* _AllocatorT_::operator()(IStreamBufferPool*);
+ */
+template <
+ class _IBufferT_,
+ class _BufferT_,
+ class _AllocatorT_
+>
+class StreamBufferPoolImp
+ : public virtual IStreamBufferPool<_IBufferT_>,
+ private StreamBufferPoolImpl
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Definitions.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: ////
+ typedef android::String8 String8;
+
+ typedef IStreamBufferPool<_IBufferT_> IPoolT;
+ typedef typename IPoolT::IBufferT IBufferT;
+ typedef typename IPoolT::SP_IBufferT SP_IBufferT;
+ typedef _BufferT_ BufferT;
+ typedef android::sp<BufferT> SP_BufferT;
+ typedef _AllocatorT_ AllocatorT;
+
+private:
+
+ typedef struct
+ {
+ SP_BufferT mBuf;
+ } MyBufferT;
+ typedef android::List< MyBufferT > BufferList_t;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// IStreamBufferPool Interface.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Operations.
+
+ virtual char const* poolName() const { return mPoolName.string(); }
+
+ virtual MVOID dumpPool() const;
+
+ virtual MERROR initPool(
+ char const* szCallerName,
+ size_t maxNumberOfBuffers,
+ size_t minNumberOfInitialCommittedBuffers
+ );
+
+ virtual MVOID uninitPool(
+ char const* szCallerName
+ );
+
+ virtual MERROR commitPool(
+ char const* szCallerName
+ );
+
+ virtual MERROR acquireFromPool(
+ char const* szCallerName,
+ SP_BufferT& rpBuffer,
+ nsecs_t nsTimeout
+ );
+
+ virtual MERROR releaseToPool(
+ char const* szCallerName,
+ SP_IBufferT pBuffer
+ );
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Implementations.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected:
+ virtual MERROR do_construct(MUINT32& returnIndex);
+ MVOID get_itemLocation(SP_BufferT& rpBuffer, MUINT32 index);
+ ////
+public: //// Instantiation.
+
+ /**
+ * Constructor.
+ *
+ * @param[in] szPoolName: a null-terminated string for a pool name.
+ *
+ * @param[in] rAllocator: a function object for a buffer allocator.
+ *
+ */
+ StreamBufferPoolImp(
+ char const* szPoolName,
+ AllocatorT const& rAllocator
+ );
+
+ virtual ~StreamBufferPoolImp();
+
+protected: //// Data Members.
+ mutable android::Mutex mLock;
+ String8 mPoolName;
+ AllocatorT mAllocator;
+
+ BufferList_t mStorage;
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+template <class _IBufferT_, class _BufferT_, class _AllocatorT_>
+StreamBufferPoolImp<_IBufferT_, _BufferT_, _AllocatorT_>::
+StreamBufferPoolImp(
+ char const* szPoolName,
+ AllocatorT const& rAllocator
+)
+ : StreamBufferPoolImpl(),
+ mPoolName(szPoolName),
+ mAllocator(rAllocator)
+{
+}
+
+
+template <class _IBufferT_, class _BufferT_, class _AllocatorT_>
+StreamBufferPoolImp<_IBufferT_, _BufferT_, _AllocatorT_>::
+~StreamBufferPoolImp()
+{}
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+template <class _IBufferT_, class _BufferT_, class _AllocatorT_>
+MVOID
+StreamBufferPoolImp<_IBufferT_, _BufferT_, _AllocatorT_>::
+dumpPool() const
+{
+ dumpPoolImpl();
+}
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+template <class _IBufferT_, class _BufferT_, class _AllocatorT_>
+MERROR
+StreamBufferPoolImp<_IBufferT_, _BufferT_, _AllocatorT_>::
+initPool(
+ char const* szCallerName,
+ size_t maxNumberOfBuffers,
+ size_t minNumberOfInitialCommittedBuffers
+)
+{
+ return initPoolImpl( szCallerName,
+ maxNumberOfBuffers,
+ minNumberOfInitialCommittedBuffers);
+}
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+template <class _IBufferT_, class _BufferT_, class _AllocatorT_>
+MVOID
+StreamBufferPoolImp<_IBufferT_, _BufferT_, _AllocatorT_>::
+uninitPool(
+ char const* szCallerName
+)
+{
+ uninitPoolImpl( szCallerName );
+}
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+template <class _IBufferT_, class _BufferT_, class _AllocatorT_>
+MERROR
+StreamBufferPoolImp<_IBufferT_, _BufferT_, _AllocatorT_>::
+commitPool(
+ char const* szCallerName
+)
+{
+ return commitPoolImpl( szCallerName );
+ //return join();
+}
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+template <class _IBufferT_, class _BufferT_, class _AllocatorT_>
+MERROR
+StreamBufferPoolImp<_IBufferT_, _BufferT_, _AllocatorT_>::
+acquireFromPool(
+ char const* szCallerName,
+ SP_BufferT& rpBuffer,
+ nsecs_t nsTimeout
+)
+{
+
+ MUINT32 returnBufIndex = 0;
+ bool getBuf = acquireFromPoolImpl( szCallerName, returnBufIndex, nsTimeout );
+
+ if(getBuf != OK) {
+ return NO_MEMORY;
+ }
+
+ get_itemLocation(rpBuffer, returnBufIndex);
+ //
+ return OK;
+}
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+template <class _IBufferT_, class _BufferT_, class _AllocatorT_>
+MERROR
+StreamBufferPoolImp<_IBufferT_, _BufferT_, _AllocatorT_>::
+releaseToPool(
+ char const* szCallerName,
+ SP_IBufferT pBuffer
+)
+{
+ android::Mutex::Autolock _l(mLock);
+ //
+ MUINT32 counter = 0;
+ typename android::List<MyBufferT>::iterator iter = mStorage.begin();
+ for( ; iter != mStorage.end(); iter++ )
+ {
+ if( iter->mBuf.get() == pBuffer.get() ) {
+ return releaseToPoolImpl( szCallerName, counter);
+ }
+ counter++;
+ }
+
+ return INVALID_OPERATION;
+}
+
+template <class _IBufferT_, class _BufferT_, class _AllocatorT_>
+MERROR
+StreamBufferPoolImp<_IBufferT_, _BufferT_, _AllocatorT_>::
+do_construct(MUINT32& returnIndex)
+{
+ SP_BufferT pBuffer = mAllocator(this);
+ if( pBuffer == NULL ) {
+ return NO_MEMORY;
+ }
+
+ MyBufferT buf;
+ buf.mBuf = pBuffer;
+ mStorage.push_back(buf);
+ //
+ returnIndex = mStorage.size() - 1;
+ return OK;
+}
+
+
+template <class _IBufferT_, class _BufferT_, class _AllocatorT_>
+MVOID
+StreamBufferPoolImp<_IBufferT_, _BufferT_, _AllocatorT_>::
+ get_itemLocation(SP_BufferT& rpBuffer, MUINT32 index)
+{
+ typename android::List<MyBufferT>::iterator iter = mStorage.begin();
+ while(index--) {
+ iter++;
+ }
+
+ rpBuffer = iter->mBuf;
+}
+
+
+/**
+ * @class StreamBufferPool
+ *
+ * @param <_IBufferT_> the type of buffer interface.
+ * This type must have operations of incStrong and decStrong.
+ *
+ * @param <_BufferT_> the type of buffer which is a subclass of _IBufferT_.
+ *
+ * @param <_AllocatorT_> the type of allocator.
+ * This type must have a call operator as below:
+ * _BufferT_* _AllocatorT_::operator()(IStreamBufferPool*);
+ */
+template <
+ class _IBufferT_,
+ class _BufferT_,
+ class _AllocatorT_
+>
+class StreamBufferPool
+ : public StreamBufferPoolImp<_IBufferT_, _BufferT_, _AllocatorT_>
+{
+public: //// Definitions.
+ typedef StreamBufferPoolImp<_IBufferT_, _BufferT_, _AllocatorT_>
+ ParentT;
+ typedef typename ParentT::AllocatorT AllocatorT;
+ typedef typename ParentT::IBufferT IBufferT;
+ typedef typename ParentT::BufferT BufferT;
+ typedef typename ParentT::SP_IBufferT SP_IBufferT;
+ typedef typename ParentT::SP_BufferT SP_BufferT;
+
+public: //// Operations.
+
+ /**
+ * Constructor.
+ *
+ * @param[in] szPoolName: a null-terminated string for a pool name.
+ *
+ * @param[in] rAllocator: a function object for a buffer allocator.
+ *
+ */
+ StreamBufferPool(
+ char const* szPoolName,
+ AllocatorT const& rAllocator
+ )
+ : ParentT(szPoolName, rAllocator)
+ {
+ }
+
+ virtual MERROR acquireFromPool(
+ char const* szCallerName,
+ SP_IBufferT& rpBuffer,
+ nsecs_t nsTimeout
+ )
+ {
+ SP_BufferT pBuffer;
+ MERROR err = ParentT::acquireFromPool(
+ szCallerName,
+ pBuffer,
+ nsTimeout
+ );
+ if ( OK == err && pBuffer != 0 ) {
+ rpBuffer = pBuffer;
+ }
+ return err;
+ }
+
+
+ virtual MERROR acquireFromPool(
+ char const* szCallerName,
+ SP_BufferT& rpBuffer,
+ nsecs_t nsTimeout
+ )
+ {
+ return ParentT::acquireFromPool(
+ szCallerName,
+ rpBuffer,
+ nsTimeout
+ );
+ }
+};
+
+
+/**
+ * @class StreamBufferPool
+ *
+ * @param <_BufferT_> the type of buffer.
+ * This type must have operations of incStrong and decStrong.
+ *
+ * @param <_AllocatorT_> the type of allocator.
+ * This type must have a call operator as below:
+ * _BufferT_* _AllocatorT_::operator()(IStreamBufferPool*);
+ *
+ * @remark This is a version of partial template specialization.
+ */
+template <
+ class _BufferT_,
+ class _AllocatorT_
+>
+class StreamBufferPool<_BufferT_, _BufferT_, _AllocatorT_>
+ : public StreamBufferPoolImp<_BufferT_, _BufferT_, _AllocatorT_>
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Definitions.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Definitions.
+ typedef StreamBufferPoolImp<_BufferT_, _BufferT_, _AllocatorT_>
+ ParentT;
+ typedef typename ParentT::AllocatorT AllocatorT;
+
+public: //// Operations.
+
+ /**
+ * Constructor.
+ *
+ * @param[in] szPoolName: a null-terminated string for a pool name.
+ *
+ * @param[in] rAllocator: a function object for a buffer allocator.
+ *
+ */
+ StreamBufferPool(
+ char const* szPoolName,
+ AllocatorT const& rAllocator
+ )
+ : ParentT(szPoolName, rAllocator)
+ {
+ }
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace Utils
+}; //namespace v3
+}; //namespace NSCam
+
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_V3_UTILS_STREAMBUF_STREAMBUFFERPOOL_H_
+
diff --git a/include/hardware/include/mtkcam/v3/utils/streambuf/StreamBufferPoolImpl.h b/include/hardware/include/mtkcam/v3/utils/streambuf/StreamBufferPoolImpl.h
new file mode 100644
index 0000000..33415ed
--- /dev/null
+++ b/include/hardware/include/mtkcam/v3/utils/streambuf/StreamBufferPoolImpl.h
@@ -0,0 +1,125 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_V3_UTILS_STREAMBUF_STREAMBUFFERPOOLIMPL_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_V3_UTILS_STREAMBUF_STREAMBUFFERPOOLIMPL_H_
+//
+#include <utils/Timers.h>
+#include <utils/Thread.h>
+#include <utils/List.h>
+#include <mtkcam/common.h>
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+namespace v3 {
+namespace Utils {
+
+class StreamBufferPoolImpl
+ : protected virtual android::Thread
+{
+public:
+ StreamBufferPoolImpl();
+ virtual ~StreamBufferPoolImpl();
+
+ MVOID finishImpl();
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Pool/Buffer
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Operations.
+ MVOID dumpPoolImpl() const;
+ MERROR initPoolImpl(
+ char const* szCallerName,
+ size_t maxNumberOfBuffers,
+ size_t minNumberOfInitialCommittedBuffers
+ );
+ MVOID uninitPoolImpl(
+ char const* szCallerName
+ );
+ MERROR commitPoolImpl(
+ char const* szCallerName
+ );
+ MERROR acquireFromPoolImpl(
+ char const* szCallerName,
+ MUINT32& rpBufferIndex,
+ nsecs_t nsTimeout
+ );
+ MERROR releaseToPoolImpl(
+ char const* szCallerName,
+ MUINT32 pBufferIndex
+ );
+
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Thread Operations.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+private:
+ virtual bool threadLoop();
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Operations
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected:
+
+ //signal a user acquring buffer
+ MVOID signalUserLocked();
+
+
+protected:
+ // for alloc buffer
+ virtual MERROR do_construct(MUINT32& returnIndex) = 0;
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Data Members
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected:
+ mutable android::Mutex mLock;
+ MUINT32 muToAllocCnt;
+ android::List<MUINT32> mlAvailableBuf;
+ android::List<MUINT32> mlInUseBuf;
+
+ //
+ android::List<android::Condition*> mWaitingList;
+}; //StreamBufferPoolImpl
+
+
+}; //namespace Utils
+}; //namespace v3
+}; //namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_V3_UTILS_STREAMBUF_STREAMBUFFERPOOLIMPL_H_ \ No newline at end of file
diff --git a/include/hardware/include/mtkcam/v3/utils/streambuf/StreamBuffers.h b/include/hardware/include/mtkcam/v3/utils/streambuf/StreamBuffers.h
new file mode 100644
index 0000000..21c3e6d
--- /dev/null
+++ b/include/hardware/include/mtkcam/v3/utils/streambuf/StreamBuffers.h
@@ -0,0 +1,500 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_V3_UTILS_STREAMBUF_STREAMBUFFERS_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_V3_UTILS_STREAMBUF_STREAMBUFFERS_H_
+//
+#include <mtkcam/common.h>
+#include <utils/Mutex.h>
+#include <utils/RWLock.h>
+#include <utils/List.h>
+#include <utils/String8.h>
+#include <mtkcam/utils/imagebuf/IIonImageBufferHeap.h>
+#include <mtkcam/v3/stream/IStreamBuffer.h>
+#include "UsersManager.h"
+#include "StreamBufferPool.h"
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+namespace v3 {
+namespace Utils {
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+/**
+ * An implementation of stream buffer.
+ */
+class StreamBufferImp
+ : public virtual IStreamBuffer
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Definitions.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Definitions.
+ typedef android::status_t status_t;
+ typedef android::Mutex Mutex;
+ typedef android::RWLock RWLock;
+ typedef android::String8 String8;
+
+protected: //// Definitions.
+ struct RWUser
+ {
+ String8 name;
+ //
+ RWUser(char const* _name)
+ : name(_name)
+ {}
+ };
+ typedef android::List<RWUser> RWUserListT;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Implementations.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+private: //// Data Members.
+ android::sp<IStreamInfo> const mStreamInfo;
+
+protected: //// Data Members.
+ mutable android::Mutex mBufMutex;
+ MUINT32 mBufStatus;
+ android::sp<IUsersManager> mUsersManager;
+
+protected: //// Data Members.
+ mutable RWUserListT mWriters;
+ mutable RWUserListT mReaders;
+ MVOID*const mpBuffer;
+
+protected: //// Operations.
+ MVOID dumpLocked() const;
+
+ virtual MVOID onUnlock(
+ char const* szCallName,
+ MVOID*const pBuffer
+ );
+
+ virtual MVOID* onTryReadLock(
+ char const* szCallName
+ );
+
+ virtual MVOID* onTryWriteLock(
+ char const* szCallName
+ );
+
+public: //// Operations.
+ StreamBufferImp(
+ android::sp<IStreamInfo> pStreamInfo,
+ MVOID*const pBuffer,
+ IUsersManager* pUsersManager = 0
+ );
+
+ virtual MVOID setUsersManager(
+ android::sp<IUsersManager> value
+ );
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// IUsersManager Interface.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Operations.
+ virtual Subject_T getSubject() const;
+ virtual char const* getSubjectName() const;
+
+public: //// Operations.
+ virtual IUsersManager::IUserGraph* createGraph();
+
+ virtual ssize_t enqueUserGraph(
+ android::sp<IUserGraph> pUserGraph
+ );
+
+ virtual MERROR finishUserSetup();
+
+ virtual MVOID reset();
+
+public: //// Operations.
+ virtual MUINT32 markUserStatus(
+ UserId_T userId,
+ MUINT32 const statusMask
+ );
+
+ virtual MUINT32 getUserStatus(
+ UserId_T userId
+ ) const;
+
+ virtual MUINT getUserCategory(
+ UserId_T userId
+ ) const;
+
+ virtual MERROR setUserReleaseFence(
+ UserId_T userId,
+ MINT releaseFence
+ );
+
+ virtual MUINT queryGroupUsage(
+ UserId_T userId
+ ) const;
+
+ virtual size_t getNumberOfProducers() const;
+ virtual size_t getNumberOfConsumers() const;
+
+public: //// Operations.
+ virtual MINT createAcquireFence(
+ UserId_T userId
+ ) const;
+
+ virtual MINT createReleaseFence(
+ UserId_T userId
+ ) const;
+
+ virtual MINT createReleaseFence(
+ ) const;
+
+public: //// Operations.
+ virtual MERROR haveAllUsersReleasedOrPreReleased(
+ UserId_T userId
+ ) const;
+
+ virtual MERROR haveAllUsersReleased(
+ ) const;
+
+ virtual MUINT32 getAllUsersStatus() const;
+
+ virtual MERROR haveAllProducerUsersReleased(
+ ) const;
+
+ virtual MERROR haveAllProducerUsersUsed() const;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// IStreamBuffer Interface.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Attributes.
+ virtual char const* getName() const
+ {
+ return mStreamInfo->getStreamName();
+ }
+
+ virtual StreamId_T getStreamId() const
+ {
+ return mStreamInfo->getStreamId();
+ }
+
+ virtual MUINT32 getStatus() const
+ {
+ android::Mutex::Autolock _l(mBufMutex);
+ return mBufStatus;
+ }
+
+ virtual MBOOL hasStatus(MUINT32 mask) const
+ {
+ android::Mutex::Autolock _l(mBufMutex);
+ return 0 != (mBufStatus & mask);
+ }
+
+ virtual MVOID markStatus(MUINT32 mask)
+ {
+ android::Mutex::Autolock _l(mBufMutex);
+ mBufStatus |= mask;
+ }
+
+ virtual MVOID clearStatus()
+ {
+ android::Mutex::Autolock _l(mBufMutex);
+ mBufStatus = 0;
+ }
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+/**
+ * An implementation of stream buffer template.
+ */
+template <
+ class _StreamBufferT_,
+ class _IStreamBufferT_
+>
+class TStreamBuffer
+ : public _IStreamBufferT_
+ , public StreamBufferImp
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Definitions.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Definitions.
+ typedef TStreamBuffer TStreamBufferT;
+ typedef _StreamBufferT_ StreamBufferT;
+ typedef _IStreamBufferT_ IStreamBufferT;
+ typedef typename IStreamBufferT::IBufferT IBufferT;
+ typedef typename IStreamBufferT::IStreamInfoT
+ IStreamInfoT;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Implementations.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected: //// Data Members.
+ android::sp<IStreamInfoT> const mStreamInfo;
+
+public: //// Operations.
+ TStreamBuffer(
+ android::sp<IStreamInfoT> pStreamInfo,
+ IBufferT& rIBuffer,
+ IUsersManager* pUsersManager = 0
+ )
+ : StreamBufferImp(pStreamInfo, &rIBuffer, pUsersManager)
+ , mStreamInfo(pStreamInfo)
+ {
+ }
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// IStreamBuffer Interface.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Attributes.
+ virtual IStreamInfoT const* getStreamInfo() const
+ {
+ return mStreamInfo.get();
+ }
+
+public: //// Operations.
+ virtual MVOID unlock(
+ char const* szCallName,
+ IBufferT* pBuffer
+ )
+ {
+ onUnlock(szCallName, pBuffer);
+ }
+
+ virtual IBufferT* tryReadLock(
+ char const* szCallName
+ )
+ {
+ return (IBufferT*)onTryReadLock(szCallName);
+ }
+
+ virtual IBufferT* tryWriteLock(
+ char const* szCallName
+ )
+ {
+ return (IBufferT*)onTryWriteLock(szCallName);
+ }
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+/**
+ * A template implementation of stream buffer with a pool.
+ */
+template <
+ class _StreamBufferT_,
+ class _IStreamBufferT_
+>
+class TStreamBufferWithPool
+ : public TStreamBuffer<_StreamBufferT_, _IStreamBufferT_>
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Definitions.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Definitions.
+ typedef _StreamBufferT_ StreamBufferT;
+ typedef _IStreamBufferT_ IStreamBufferT;
+ typedef TStreamBuffer<StreamBufferT, IStreamBufferT>
+ ParentT;
+ typedef IStreamBufferPool<IStreamBufferT> IStreamBufferPoolT;
+ typedef typename IStreamBufferT::IBufferT IBufferT;
+ typedef typename IStreamBufferT::IStreamInfoT
+ IStreamInfoT;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Implementations.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected: //// Data Members.
+ mutable android::Mutex mBufPoolMutex;
+ android::wp<IStreamBufferPoolT> const mBufPool;
+
+public: //// Operations.
+ TStreamBufferWithPool(
+ android::wp<IStreamBufferPoolT> pStreamBufPool,
+ android::sp<IStreamInfoT> pStreamInfo,
+ IBufferT& rIBuffer
+ )
+ : ParentT(pStreamInfo, rIBuffer)
+ , mBufPoolMutex()
+ , mBufPool(pStreamBufPool)
+ {
+ }
+
+public: //// Operations.
+ virtual android::sp<IStreamBufferPoolT> tryGetBufferPool() const;
+ virtual MVOID resetBuffer() = 0;
+ virtual MVOID releaseBuffer();
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+/**
+ * An implementation of hal image stream buffer.
+ */
+class HalImageStreamBuffer
+ : public TStreamBufferWithPool<HalImageStreamBuffer, IImageStreamBuffer>
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Definitions.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Definitions.
+
+ struct Allocator
+ {
+ public: //// Definitions.
+ typedef StreamBufferPool<
+ IStreamBufferT,
+ StreamBufferT,
+ Allocator
+ > StreamBufferPoolT;
+
+ public: //// Data Members.
+ android::sp<IStreamInfoT> mpStreamInfo;
+ IIonImageBufferHeap::AllocImgParam_t mAllocImgParam;
+
+ public: //// Operations.
+ Allocator(
+ IStreamInfoT* pStreamInfo,
+ IIonImageBufferHeap::AllocImgParam_t const& rAllocImgParam
+ );
+
+ public: //// Operator.
+ StreamBufferT* operator()(IStreamBufferPoolT* pPool = NULL);
+
+ };
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Implementations.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected: //// Data Members.
+ android::sp<IIonImageBufferHeap> mImageBufferHeap;
+
+public: //// Operations.
+ HalImageStreamBuffer(
+ android::sp<IStreamInfoT> pStreamInfo,
+ android::wp<IStreamBufferPoolT> pStreamBufPool,
+ android::sp<IIonImageBufferHeap>pImageBufferHeap
+ );
+
+public: //// Operations.
+ virtual MVOID resetBuffer();
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+/**
+ * An implementation of hal metadata stream buffer.
+ */
+class HalMetaStreamBuffer
+ : public TStreamBufferWithPool<HalMetaStreamBuffer, IMetaStreamBuffer>
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Definitions.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Definitions.
+
+ struct Allocator
+ {
+ public: //// Definitions.
+ typedef StreamBufferPool<
+ IStreamBufferT,
+ StreamBufferT,
+ Allocator
+ > StreamBufferPoolT;
+
+ public: //// Data Members.
+ android::sp<IStreamInfoT> mpStreamInfo;
+
+ public: //// Operations.
+ Allocator(
+ IStreamInfoT* pStreamInfo
+ );
+
+ public: //// Operator.
+ StreamBufferT* operator()(IStreamBufferPoolT* pPool = NULL);
+ StreamBufferT* operator()(NSCam::IMetadata const& metadata, IStreamBufferPoolT* pPool = NULL);
+ };
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Implementations.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected: //// Data Members.
+ NSCam::IMetadata mMetadata; // IBufferT-derived object.
+
+public: //// Operations.
+ HalMetaStreamBuffer(
+ android::sp<IStreamInfoT> pStreamInfo,
+ android::wp<IStreamBufferPoolT> pStreamBufPool
+ );
+ HalMetaStreamBuffer(
+ NSCam::IMetadata const& metadata,
+ android::sp<IStreamInfoT> pStreamInfo,
+ android::wp<IStreamBufferPoolT> pStreamBufPool
+ );
+
+public: //// Operations.
+ virtual MVOID resetBuffer();
+
+public: //// Attributes.
+ virtual MBOOL isRepeating() const { return MFALSE; }
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace Utils
+}; //namespace v3
+}; //namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_V3_UTILS_STREAMBUF_STREAMBUFFERS_H_
+
diff --git a/include/hardware/include/mtkcam/v3/utils/streambuf/UsersManager.h b/include/hardware/include/mtkcam/v3/utils/streambuf/UsersManager.h
new file mode 100644
index 0000000..00cee55
--- /dev/null
+++ b/include/hardware/include/mtkcam/v3/utils/streambuf/UsersManager.h
@@ -0,0 +1,329 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_V3_UTILS_STREAMBUF_USERSMANAGER_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_V3_UTILS_STREAMBUF_USERSMANAGER_H_
+//
+#include <utils/BitSet.h>
+#include <utils/RWLock.h>
+#include <utils/KeyedVector.h>
+#include <utils/StrongPointer.h>
+#include <mtkcam/utils/Sync.h>
+#include <mtkcam/v3/stream/IUsersManager.h>
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+namespace v3 {
+namespace Utils {
+
+
+/**
+ * An implementation of subject users manager.
+ */
+class UsersManager
+ : public virtual IUsersManager
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Implementations.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Definitions.
+
+ /**
+ * The type of a fence in order to sync. accessing a given subject.
+ */
+ typedef android::sp<
+ NSCam::Utils::Sync::IFence
+ > IFencePtr_T;
+
+ struct MyUser
+ : public android::LightRefBase<MyUser>
+ {
+ UserId_T mUserId;
+ IFencePtr_T mAcquireFence;
+ IFencePtr_T mReleaseFence;
+ MUINT mUsage;
+ MUINT mCategory;
+ ssize_t mGroupIndex;
+ MUINT32 mUserStatus;
+ //
+ MyUser(
+ User const& user,
+ ssize_t groupIndex
+ );
+ };
+
+ class MyUserGraph : public IUsersManager::IUserGraph
+ {
+ friend class UsersManager;
+ public: //// Definitions.
+
+ struct UserNode
+ {
+ android::sp<MyUser> mMyUser;
+
+ /**
+ * In-coming edges of this node
+ */
+ android::SortedVector<UserId_T>
+ mIn;
+
+ /**
+ * Out-going edges of this node
+ */
+ android::SortedVector<UserId_T>
+ mOut;
+
+ UserNode(android::sp<MyUser> pUser = 0)
+ : mMyUser(pUser)
+ {}
+ };
+
+ protected: //// Data Members.
+ mutable android::RWLock mRWLock;
+ MUINT mConsumerUsage;
+ size_t mGroupIndex;
+ android::KeyedVector<
+ UserId_T, UserNode
+ > mUserVector;
+
+ public: //// Operations.
+ MyUserGraph(
+ size_t groupIndex
+ );
+
+ virtual MERROR addUser(
+ User const& usr
+ );
+
+ virtual MERROR removeUser(
+ UserId_T id
+ );
+
+ virtual MERROR addEdge(
+ UserId_T id_src,
+ UserId_T id_dst
+ );
+
+ virtual MERROR removeEdge(
+ UserId_T id_src,
+ UserId_T id_dst
+ );
+
+ virtual MERROR setCapacity(
+ size_t size
+ );
+
+ virtual size_t getGroupIndex() const;
+
+ virtual size_t size() const;
+
+ virtual size_t indegree(size_t index) const;
+
+ virtual size_t outdegree(size_t index) const;
+
+ android::sp<MyUser> userAt(size_t index) const;
+
+ MERROR setAcquireFence(
+ size_t index,
+ MINT fence
+ );
+
+ MERROR getInUsers(
+ size_t userId,
+ android::Vector<android::sp<MyUser> >& result
+ ) const;
+
+ MERROR DFS(
+ size_t userId,
+ android::Vector<android::sp<MyUser> >& result
+ ) const;
+
+ MERROR getPriorUsers(
+ size_t userId,
+ android::Vector<android::sp<MyUser> >& result
+ ) const;
+ };
+
+ struct MyUserGroupGraph
+ : public android::Vector< android::sp<MyUserGraph> >
+ {
+ //Override clear() if additional members are added.
+ };
+
+ struct MyUserMap
+ : public android::DefaultKeyedVector<UserId_T, android::sp<MyUser> >
+ {
+ typedef android::DefaultKeyedVector<UserId_T, android::sp<MyUser> >
+ ParentT;
+ android::BitSet32 mBitSetUsed;
+ android::BitSet32 mBitSetReleased;
+ android::BitSet32 mBitSetPreReleased;
+
+ MVOID clear()
+ {
+ ParentT::clear();
+ mBitSetUsed.clear();
+ mBitSetReleased.clear();
+ mBitSetPreReleased.clear();
+ }
+ };
+
+private: //// Data Members.
+ Subject_T const mSubject;
+ android::String8 mSubjectName;
+ mutable android::RWLock mRWLock;
+ MBOOL mUserInit;
+ MyUserGroupGraph mUserGroupGraph;
+ MyUserMap mProducerMap;
+ MyUserMap mConsumerMap;
+
+public: //// Operations.
+ UsersManager(Subject_T subject, char const* name = "");
+
+protected: //// Operations.
+ android::sp<MyUser> queryUser_(UserId_T const userId) const;
+
+ ssize_t enqueUserGraph_(
+ size_t groupIndex
+ );
+
+ android::sp<MyUserGraph> queryUserGraph(
+ IUserGraph*const pUserGraph
+ ) const;
+
+ MERROR haveAllUsersReleasedLocked() const;
+ MERROR haveAllUsersReleasedOrPreReleasedLocked() const;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// IUsersManager Interfaces.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Operations.
+ virtual Subject_T getSubject() const;
+ virtual char const* getSubjectName() const;
+
+public: //// Operations.
+
+ virtual IUsersManager::IUserGraph* createGraph();
+
+ virtual ssize_t enqueUserGraph(
+ android::sp<IUserGraph> pUserGraph
+ );
+
+ virtual MERROR finishUserSetup();
+
+ virtual MVOID reset();
+
+public: //// Operations.
+
+ virtual MUINT32 markUserStatus(
+ UserId_T userId,
+ MUINT32 const statusMask
+ );
+
+ virtual MUINT32 getUserStatus(
+ UserId_T userId
+ ) const;
+
+ virtual MUINT getUserCategory(
+ UserId_T userId
+ ) const;
+
+ virtual MERROR setUserReleaseFence(
+ UserId_T userId,
+ MINT releaseFence
+ );
+
+ virtual MUINT queryGroupUsage(
+ UserId_T userId
+ ) const;
+
+ virtual size_t getNumberOfProducers() const;
+ virtual size_t getNumberOfConsumers() const;
+
+public: //// Operations.
+
+ virtual MINT createAcquireFence(
+ UserId_T userId
+ ) const;
+
+ virtual MINT createReleaseFence(
+ UserId_T userId
+ ) const;
+
+ virtual MINT createReleaseFence() const;
+
+public: //// Operations.
+
+ /**
+ * return OK if all users ahead of this user are released or pre-released.
+ */
+ virtual MERROR haveAllUsersReleasedOrPreReleased(
+ UserId_T userId
+ ) const;
+ // All User
+ virtual MERROR haveAllUsersReleased() const;
+
+ /**
+ * return UserStatus::RELEASE
+ if all users are released
+
+ return UserStatus::PRE_RELEASE
+ if all users are released or pre-released.
+
+ return 0
+ if NOT all users are released or pre-released.
+ */
+ virtual MUINT32 getAllUsersStatus() const;
+
+ // All Producer
+ virtual MERROR haveAllProducerUsersReleased() const;
+
+ virtual MERROR haveAllProducerUsersUsed() const;
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace Utils
+}; //namespace v3
+}; //namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_V3_UTILS_STREAMBUF_USERSMANAGER_H_
+
diff --git a/include/hardware/include/mtkcam/v3/utils/streaminfo/BaseStreamInfoImp.h b/include/hardware/include/mtkcam/v3/utils/streaminfo/BaseStreamInfoImp.h
new file mode 100644
index 0000000..e7229ee
--- /dev/null
+++ b/include/hardware/include/mtkcam/v3/utils/streaminfo/BaseStreamInfoImp.h
@@ -0,0 +1,102 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_V3_UTILS_STREAMINFO_BASESTREAMINFOIMP_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_V3_UTILS_STREAMINFO_BASESTREAMINFOIMP_H_
+//
+#include <utils/RefBase.h>
+#include <utils/String8.h>
+#include <mtkcam/common.h>
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+namespace v3 {
+namespace Utils {
+
+
+/**
+ * Base Stream Info Implementation.
+ */
+class BaseStreamInfoImp : public virtual android::RefBase
+{
+public: //// Attributes.
+
+ inline char const* getStreamName() const { return mStreamName.string(); }
+ inline StreamId_T getStreamId() const { return mStreamId; }
+ inline MUINT32 getStreamType() const { return mStreamType; }
+ inline size_t getMaxBufNum() const { return mMaxBufNum; }
+ inline size_t getMinInitBufNum() const { return mMinInitBufNum; }
+ inline MVOID setMaxBufNum(size_t count) { mMaxBufNum = count; }
+
+public: //// Instantiation.
+ BaseStreamInfoImp(
+ char const* streamName,
+ StreamId_T streamId,
+ MUINT32 streamType,
+ size_t maxBufNum,
+ size_t minInitBufNum
+ )
+ : android::RefBase()
+ , mStreamName(streamName)
+ , mStreamId(streamId)
+ , mStreamType(streamType)
+ , mMaxBufNum(maxBufNum)
+ , mMinInitBufNum(minInitBufNum)
+ {
+ }
+
+protected: //// Data Members.
+ android::String8 mStreamName;
+ StreamId_T mStreamId;
+ MUINT32 mStreamType;
+ size_t mMaxBufNum;
+ size_t mMinInitBufNum;
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace Utils
+}; //namespace v3
+}; //namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_V3_UTILS_STREAMINFO_BASESTREAMINFOIMP_H_
+
diff --git a/include/hardware/include/mtkcam/v3/utils/streaminfo/IStreamInfoSetControl.h b/include/hardware/include/mtkcam/v3/utils/streaminfo/IStreamInfoSetControl.h
new file mode 100644
index 0000000..cb6e849
--- /dev/null
+++ b/include/hardware/include/mtkcam/v3/utils/streaminfo/IStreamInfoSetControl.h
@@ -0,0 +1,279 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_V3_UTILS_STREAMINFO_ISTREAMINFOSETCONTROL_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_V3_UTILS_STREAMINFO_ISTREAMINFOSETCONTROL_H_
+//
+#include <utils/KeyedVector.h>
+#include <mtkcam/v3/stream/IStreamInfo.h>
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+namespace v3 {
+namespace Utils {
+
+
+/**
+ * An interface of stream info set control.
+ */
+class SimpleStreamInfoSetControl
+ : public virtual IStreamInfoSet
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Definitions.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: ////
+
+ template <class IStreamInfoT>
+ struct Map
+ : public IMap<IStreamInfoT>
+ , public android::KeyedVector<StreamId_T, android::sp<IStreamInfoT> >
+ {
+ public: ////
+ typedef android::KeyedVector<StreamId_T, android::sp<IStreamInfoT> >
+ ParentT;
+ typedef typename ParentT::key_type key_type;
+ typedef typename ParentT::value_type value_type;
+
+ public: //// Operations.
+ virtual size_t size() const
+ {
+ return ParentT::size();
+ }
+
+ virtual ssize_t indexOfKey(StreamId_T id) const
+ {
+ return ParentT::indexOfKey(id);
+ }
+
+ virtual android::sp<IStreamInfoT> valueFor(StreamId_T id) const
+ {
+ return ParentT::valueFor(id);
+ }
+
+ virtual android::sp<IStreamInfoT> valueAt(size_t index) const
+ {
+ return ParentT::valueAt(index);
+ }
+
+ ssize_t addStream(value_type const& p)
+ {
+ return ParentT::add(p->getStreamId(), p);
+ }
+ };
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Implementations.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected: //// Data Members.
+ android::sp<Map<IMetaStreamInfo> > mpMeta;
+ android::sp<Map<IImageStreamInfo> > mpImage;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Interface.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Operations.
+ SimpleStreamInfoSetControl()
+ : mpMeta(new Map<IMetaStreamInfo>)
+ , mpImage(new Map<IImageStreamInfo>)
+ {
+ }
+
+ virtual Map<IMetaStreamInfo> const& getMeta() const { return *mpMeta; }
+ virtual Map<IImageStreamInfo>const& getImage()const { return *mpImage; }
+
+ virtual Map<IMetaStreamInfo>& editMeta() { return *mpMeta; }
+ virtual Map<IImageStreamInfo>& editImage() { return *mpImage; }
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// IStreamInfoSet Interface.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Operations.
+#define _IMPLEMENT_(_type_) \
+ virtual android::sp<IMap<I##_type_##StreamInfo> > \
+ get##_type_##InfoMap() const { return mp##_type_; } \
+ \
+ virtual size_t \
+ get##_type_##InfoNum() const { return mp##_type_->size(); } \
+ \
+ virtual android::sp<I##_type_##StreamInfo> \
+ get##_type_##InfoFor(StreamId_T id) const { return mp##_type_->valueFor(id); } \
+ \
+ virtual android::sp<I##_type_##StreamInfo> \
+ get##_type_##InfoAt(size_t index) const { return mp##_type_->valueAt(index); }
+
+ _IMPLEMENT_(Meta)
+ _IMPLEMENT_(Image)
+
+#undef _IMPLEMENT_
+
+};
+
+
+/**
+ * An interface of stream info set control.
+ */
+class IStreamInfoSetControl
+ : public IStreamInfoSet
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// IStreamInfoSetControl Interface.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Definitions.
+
+ template <class IStreamInfoT>
+ struct Map
+ : public android::KeyedVector<StreamId_T, android::sp<IStreamInfoT> >
+ {
+ public: ////
+ typedef android::KeyedVector<StreamId_T, android::sp<IStreamInfoT> >
+ ParentT;
+ typedef typename ParentT::key_type key_type;
+ typedef typename ParentT::value_type value_type;
+
+ public: //// Operations.
+ ssize_t addStream(value_type const& p)
+ {
+ return ParentT::add(p->getStreamId(), p);
+ }
+ };
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Implementations.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+protected: //// Definitions.
+
+ template <class IStreamInfoT>
+ struct Set
+ : public IMap<IStreamInfoT>
+ {
+ typedef Map<IStreamInfoT> MapT;
+ MapT mApp;
+ MapT mHal;
+
+ size_t size() const
+ {
+ return mApp.size() + mHal.size();
+ }
+
+ virtual ssize_t indexOfKey(StreamId_T id) const
+ {
+ ssize_t index = 0;
+ if ( 0 <= (index = mApp.indexOfKey(id)) ) return index;
+ if ( 0 <= (index = mHal.indexOfKey(id)) ) return index + mApp.size();
+ return NAME_NOT_FOUND;
+ }
+
+ virtual android::sp<IStreamInfoT> valueFor(StreamId_T id) const
+ {
+ ssize_t index = 0;
+ if ( 0 <= (index = mApp.indexOfKey(id)) ) return mApp.valueAt(index);
+ if ( 0 <= (index = mHal.indexOfKey(id)) ) return mHal.valueAt(index);
+ return NULL;
+ }
+
+ virtual android::sp<IStreamInfoT> valueAt(size_t index) const
+ {
+ if ( mApp.size() > index ) return mApp.valueAt(index);
+ index -= mApp.size();
+ if ( mHal.size() > index ) return mHal.valueAt(index);
+ return NULL;
+ }
+ };
+
+protected: //// Data Members.
+ android::sp<Set<IMetaStreamInfo> > mpSetMeta;
+ android::sp<Set<IImageStreamInfo> > mpSetImage;
+
+protected: //// Operations.
+ IStreamInfoSetControl()
+ : mpSetMeta(new Set<IMetaStreamInfo>)
+ , mpSetImage(new Set<IImageStreamInfo>)
+ {}
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// IStreamInfoSetControl Interface.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Operations.
+ static IStreamInfoSetControl* create() { return new IStreamInfoSetControl; }
+
+ virtual Map<IMetaStreamInfo> const& getAppMeta() const { return mpSetMeta->mApp; }
+ virtual Map<IMetaStreamInfo> const& getHalMeta() const { return mpSetMeta->mHal; }
+ virtual Map<IImageStreamInfo>const& getAppImage()const { return mpSetImage->mApp; }
+ virtual Map<IImageStreamInfo>const& getHalImage()const { return mpSetImage->mHal; }
+
+ virtual Map<IMetaStreamInfo>& editAppMeta() { return mpSetMeta->mApp; }
+ virtual Map<IMetaStreamInfo>& editHalMeta() { return mpSetMeta->mHal; }
+ virtual Map<IImageStreamInfo>& editAppImage() { return mpSetImage->mApp; }
+ virtual Map<IImageStreamInfo>& editHalImage() { return mpSetImage->mHal; }
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// IStreamInfoSet Interface.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Operations.
+#define _IMPLEMENT_(_type_) \
+ virtual android::sp<IMap<I##_type_##StreamInfo> > \
+ get##_type_##InfoMap() const { return mpSet##_type_; } \
+ \
+ virtual size_t \
+ get##_type_##InfoNum() const { return mpSet##_type_->size(); } \
+ \
+ virtual android::sp<I##_type_##StreamInfo> \
+ get##_type_##InfoFor(StreamId_T id) const { return mpSet##_type_->valueFor(id); } \
+ \
+ virtual android::sp<I##_type_##StreamInfo> \
+ get##_type_##InfoAt(size_t index) const { return mpSet##_type_->valueAt(index); }
+
+ _IMPLEMENT_(Meta) // IMetaStreamInfo, mAppMeta, mHalMeta
+ _IMPLEMENT_(Image) //IImageStreamInfo, mAppImage, mHalImage
+
+#undef _IMPLEMENT_
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace Utils
+}; //namespace v3
+}; //namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_V3_UTILS_STREAMINFO_ISTREAMINFOSETCONTROL_H_
+
diff --git a/include/hardware/include/mtkcam/v3/utils/streaminfo/ImageStreamInfo.h b/include/hardware/include/mtkcam/v3/utils/streaminfo/ImageStreamInfo.h
new file mode 100644
index 0000000..3f952de
--- /dev/null
+++ b/include/hardware/include/mtkcam/v3/utils/streaminfo/ImageStreamInfo.h
@@ -0,0 +1,127 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_V3_UTILS_STREAMINFO_IMAGESTREAMINFO_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_V3_UTILS_STREAMINFO_IMAGESTREAMINFO_H_
+//
+#include <mtkcam/v3/stream/IStreamInfo.h>
+#include "BaseStreamInfoImp.h"
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+namespace v3 {
+namespace Utils {
+
+
+/**
+ * image stream info.
+ */
+class ImageStreamInfo : public IImageStreamInfo
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// IStreamInfo Interface.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Attributes.
+
+ virtual char const* getStreamName() const;
+
+ virtual StreamId_T getStreamId() const;
+
+ virtual MUINT32 getStreamType() const;
+
+ virtual size_t getMaxBufNum() const;
+
+ virtual MVOID setMaxBufNum(size_t count);
+
+ virtual size_t getMinInitBufNum() const;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// IImageStreamInfo Interface.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Attributes.
+
+ virtual MUINT getUsageForConsumer() const;
+
+ virtual MUINT getUsageForAllocator() const;
+
+ virtual MINT getImgFormat() const;
+
+ virtual MSize getImgSize() const;
+
+ virtual BufPlanes_t const& getBufPlanes() const;
+
+ virtual MUINT32 getTransform() const;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Implementations.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Instantiation.
+ ImageStreamInfo(
+ char const* streamName,
+ StreamId_T streamId,
+ MUINT32 streamType,
+ size_t maxBufNum,
+ size_t minInitBufNum,
+ MUINT usageForAllocator,
+ MINT imgFormat,
+ MSize const& imgSize,
+ BufPlanes_t const& bufPlanes,
+ MUINT32 transform = 0
+ );
+
+protected: //// Data Members.
+ BaseStreamInfoImp mImp; /**< base implementator. */
+ MUINT mUsageForAllocator; /**< usage for buffer allocator. */
+ MINT mImgFormat;
+ MSize mImgSize;
+ BufPlanes_t mvbufPlanes;
+ MUINT32 mTransform;
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace Utils
+}; //namespace v3
+}; //namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_V3_UTILS_STREAMINFO_IMAGESTREAMINFO_H_
+
diff --git a/include/hardware/include/mtkcam/v3/utils/streaminfo/MetaStreamInfo.h b/include/hardware/include/mtkcam/v3/utils/streaminfo/MetaStreamInfo.h
new file mode 100644
index 0000000..d66feb6
--- /dev/null
+++ b/include/hardware/include/mtkcam/v3/utils/streaminfo/MetaStreamInfo.h
@@ -0,0 +1,100 @@
+/* Copyright Statement:
+ *
+ * This software/firmware and related documentation ("MediaTek Software") are
+ * protected under relevant copyright laws. The information contained herein is
+ * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
+ * the prior written permission of MediaTek inc. and/or its licensors, any
+ * reproduction, modification, use or disclosure of MediaTek Software, and
+ * information contained herein, in whole or in part, shall be strictly
+ * prohibited.
+ *
+ * MediaTek Inc. (C) 2010. All rights reserved.
+ *
+ * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
+ * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
+ * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
+ * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
+ * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
+ * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
+ * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
+ * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
+ * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
+ * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
+ * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
+ * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
+ * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
+ * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * The following software/firmware and/or related documentation ("MediaTek
+ * Software") have been modified by MediaTek Inc. All revisions are subject to
+ * any receiver's applicable license agreements with MediaTek Inc.
+ */
+
+#ifndef _MTK_HARDWARE_INCLUDE_MTKCAM_V3_UTILS_STREAMINFO_METASTREAMINFO_H_
+#define _MTK_HARDWARE_INCLUDE_MTKCAM_V3_UTILS_STREAMINFO_METASTREAMINFO_H_
+//
+#include <mtkcam/v3/stream/IStreamInfo.h>
+#include "BaseStreamInfoImp.h"
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+namespace NSCam {
+namespace v3 {
+namespace Utils {
+
+
+/**
+ * metadata stream info.
+ */
+class MetaStreamInfo : public IMetaStreamInfo
+{
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// IStreamInfo Interface.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Attributes.
+
+ virtual char const* getStreamName() const;
+
+ virtual StreamId_T getStreamId() const;
+
+ virtual MUINT32 getStreamType() const;
+
+ virtual size_t getMaxBufNum() const;
+
+ virtual MVOID setMaxBufNum(size_t count);
+
+ virtual size_t getMinInitBufNum() const;
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// Implementations.
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+public: //// Instantiation.
+ MetaStreamInfo(
+ char const* streamName,
+ StreamId_T streamId,
+ MUINT32 streamType,
+ size_t maxBufNum,
+ size_t minInitBufNum = 0
+ );
+
+protected: //// Data Members.
+ BaseStreamInfoImp mImp; /**< base implementator. */
+
+};
+
+
+/******************************************************************************
+ *
+ ******************************************************************************/
+}; //namespace Utils
+}; //namespace v3
+}; //namespace NSCam
+#endif //_MTK_HARDWARE_INCLUDE_MTKCAM_V3_UTILS_STREAMINFO_METASTREAMINFO_H_
+