Initial codes for tizen branch 47/48947/3
authorsejong123.park <sejong123.park@samsung.com>
Fri, 2 Oct 2015 04:59:47 +0000 (13:59 +0900)
committersejong123.park <sejong123.park@samsung.com>
Fri, 2 Oct 2015 08:58:31 +0000 (17:58 +0900)
Change-Id:I77792a40d7fe69db882b4d2d3f91cb96ca3de35e
Signed-off-by: sejong123.park <sejong123.park@samsung.com>
18 files changed:
AUTHORS [new file with mode: 0644]
CMakeLists.txt [new file with mode: 0755]
LICENSE.APLv2 [new file with mode: 0644]
NOTICE [new file with mode: 0644]
legacy/CMakeLists.txt [new file with mode: 0755]
legacy/include/legacy_camera.h [new file with mode: 0755]
legacy/include/legacy_camera_internal.h [new file with mode: 0755]
legacy/include/legacy_camera_private.h [new file with mode: 0755]
legacy/src/legacy_camera.c [new file with mode: 0755]
legacy/src/legacy_camera_internal.c [new file with mode: 0755]
mmsvc-camera.manifest [new file with mode: 0644]
mmsvc-camera.pc.in [new file with mode: 0644]
muse/CMakeLists.txt [new file with mode: 0755]
muse/include/muse_camera.h [new file with mode: 0644]
muse/include/muse_camera_msg.h [new file with mode: 0755]
muse/src/muse_camera_dispatcher.c [new file with mode: 0755]
muse/src/muse_camera_ipc.c [new file with mode: 0644]
packaging/mmsvc-camera.spec [new file with mode: 0644]

diff --git a/AUTHORS b/AUTHORS
new file mode 100644 (file)
index 0000000..af26fcd
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,3 @@
+Jeongmo Yang <jm80.yang at samsung dot com>
+Hyuntae Kim <ht1211.kim at samsung dot com>
+Sejong Park <sejong123.park at samsung dot com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..4369303
--- /dev/null
@@ -0,0 +1,82 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+
+SET(Services
+        "application"
+        "base"
+        "content"
+        "location"
+        "media"
+        "messaging"
+        "network"
+        "social"
+        "telephony"
+        "system"
+   )
+
+# project
+SET(prefix "/usr")
+SET(version "0.0.1")
+SET(maintainer "Jeongmo Yang<jm80.yang>, Hyuntae Kim<ht1211.kim@samsung.com>, Sejong Park<sejong123.park@samsung.com>")
+SET(description "A Camera library in Tizen Native API")
+SET(service "mmsvc")
+SET(submodule "camera")
+SET(fw_name "${service}-${submodule}")
+
+PROJECT(${fw_name})
+
+SET(CMAKE_INSTALL_PREFIX ${prefix})
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+SET(VERSION ${version})
+
+SET(INC_DIR legacy/include)
+INCLUDE_DIRECTORIES(${INC_DIR})
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Wextra -Wno-array-bounds -Wno-empty-body -Wno-ignored-qualifiers -Wno-unused-parameter -Wshadow -Wwrite-strings -Wswitch-default -Wno-unused-but-set-parameter -Wno-unused-but-set-variable")
+SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
+
+IF("${ARCH}" STREQUAL "arm")
+    ADD_DEFINITIONS("-DTARGET")
+ENDIF("${ARCH}" STREQUAL "arm")
+
+ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
+ADD_DEFINITIONS("-DTIZEN_DEBUG")
+
+CONFIGURE_FILE(
+    ${fw_name}.pc.in
+    ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc
+    @ONLY
+)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
+
+ADD_SUBDIRECTORY(legacy)
+ADD_SUBDIRECTORY(muse)
+
+IF(UNIX)
+
+ADD_CUSTOM_TARGET (distclean @echo cleaning for source distribution)
+ADD_CUSTOM_COMMAND(
+        DEPENDS clean
+        COMMENT "distribution clean"
+        COMMAND find
+        ARGS    .
+        -not -name config.cmake -and \(
+        -name tester.c -or
+        -name Testing -or
+        -name CMakeFiles -or
+        -name cmake.depends -or
+        -name cmake.check_depends -or
+        -name CMakeCache.txt -or
+        -name cmake.check_cache -or
+        -name *.cmake -or
+        -name Makefile -or
+        -name core -or
+        -name core.* -or
+        -name gmon.out -or
+        -name install_manifest.txt -or
+        -name *.pc -or
+        -name *~ \)
+        | grep -v TC | xargs rm -rf
+        TARGET  distclean
+        VERBATIM
+)
+
+ENDIF(UNIX)
diff --git a/LICENSE.APLv2 b/LICENSE.APLv2
new file mode 100644 (file)
index 0000000..bbe9d02
--- /dev/null
@@ -0,0 +1,206 @@
+Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
+\r
+                                 Apache License\r
+                           Version 2.0, January 2004\r
+                        http://www.apache.org/licenses/\r
+\r
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\r
+\r
+   1. Definitions.\r
+\r
+      "License" shall mean the terms and conditions for use, reproduction,\r
+      and distribution as defined by Sections 1 through 9 of this document.\r
+\r
+      "Licensor" shall mean the copyright owner or entity authorized by\r
+      the copyright owner that is granting the License.\r
+\r
+      "Legal Entity" shall mean the union of the acting entity and all\r
+      other entities that control, are controlled by, or are under common\r
+      control with that entity. For the purposes of this definition,\r
+      "control" means (i) the power, direct or indirect, to cause the\r
+      direction or management of such entity, whether by contract or\r
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the\r
+      outstanding shares, or (iii) beneficial ownership of such entity.\r
+\r
+      "You" (or "Your") shall mean an individual or Legal Entity\r
+      exercising permissions granted by this License.\r
+\r
+      "Source" form shall mean the preferred form for making modifications,\r
+      including but not limited to software source code, documentation\r
+      source, and configuration files.\r
+\r
+      "Object" form shall mean any form resulting from mechanical\r
+      transformation or translation of a Source form, including but\r
+      not limited to compiled object code, generated documentation,\r
+      and conversions to other media types.\r
+\r
+      "Work" shall mean the work of authorship, whether in Source or\r
+      Object form, made available under the License, as indicated by a\r
+      copyright notice that is included in or attached to the work\r
+      (an example is provided in the Appendix below).\r
+\r
+      "Derivative Works" shall mean any work, whether in Source or Object\r
+      form, that is based on (or derived from) the Work and for which the\r
+      editorial revisions, annotations, elaborations, or other modifications\r
+      represent, as a whole, an original work of authorship. For the purposes\r
+      of this License, Derivative Works shall not include works that remain\r
+      separable from, or merely link (or bind by name) to the interfaces of,\r
+      the Work and Derivative Works thereof.\r
+\r
+      "Contribution" shall mean any work of authorship, including\r
+      the original version of the Work and any modifications or additions\r
+      to that Work or Derivative Works thereof, that is intentionally\r
+      submitted to Licensor for inclusion in the Work by the copyright owner\r
+      or by an individual or Legal Entity authorized to submit on behalf of\r
+      the copyright owner. For the purposes of this definition, "submitted"\r
+      means any form of electronic, verbal, or written communication sent\r
+      to the Licensor or its representatives, including but not limited to\r
+      communication on electronic mailing lists, source code control systems,\r
+      and issue tracking systems that are managed by, or on behalf of, the\r
+      Licensor for the purpose of discussing and improving the Work, but\r
+      excluding communication that is conspicuously marked or otherwise\r
+      designated in writing by the copyright owner as "Not a Contribution."\r
+\r
+      "Contributor" shall mean Licensor and any individual or Legal Entity\r
+      on behalf of whom a Contribution has been received by Licensor and\r
+      subsequently incorporated within the Work.\r
+\r
+   2. Grant of Copyright License. Subject to the terms and conditions of\r
+      this License, each Contributor hereby grants to You a perpetual,\r
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
+      copyright license to reproduce, prepare Derivative Works of,\r
+      publicly display, publicly perform, sublicense, and distribute the\r
+      Work and such Derivative Works in Source or Object form.\r
+\r
+   3. Grant of Patent License. Subject to the terms and conditions of\r
+      this License, each Contributor hereby grants to You a perpetual,\r
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
+      (except as stated in this section) patent license to make, have made,\r
+      use, offer to sell, sell, import, and otherwise transfer the Work,\r
+      where such license applies only to those patent claims licensable\r
+      by such Contributor that are necessarily infringed by their\r
+      Contribution(s) alone or by combination of their Contribution(s)\r
+      with the Work to which such Contribution(s) was submitted. If You\r
+      institute patent litigation against any entity (including a\r
+      cross-claim or counterclaim in a lawsuit) alleging that the Work\r
+      or a Contribution incorporated within the Work constitutes direct\r
+      or contributory patent infringement, then any patent licenses\r
+      granted to You under this License for that Work shall terminate\r
+      as of the date such litigation is filed.\r
+\r
+   4. Redistribution. You may reproduce and distribute copies of the\r
+      Work or Derivative Works thereof in any medium, with or without\r
+      modifications, and in Source or Object form, provided that You\r
+      meet the following conditions:\r
+\r
+      (a) You must give any other recipients of the Work or\r
+          Derivative Works a copy of this License; and\r
+\r
+      (b) You must cause any modified files to carry prominent notices\r
+          stating that You changed the files; and\r
+\r
+      (c) You must retain, in the Source form of any Derivative Works\r
+          that You distribute, all copyright, patent, trademark, and\r
+          attribution notices from the Source form of the Work,\r
+          excluding those notices that do not pertain to any part of\r
+          the Derivative Works; and\r
+\r
+      (d) If the Work includes a "NOTICE" text file as part of its\r
+          distribution, then any Derivative Works that You distribute must\r
+          include a readable copy of the attribution notices contained\r
+          within such NOTICE file, excluding those notices that do not\r
+          pertain to any part of the Derivative Works, in at least one\r
+          of the following places: within a NOTICE text file distributed\r
+          as part of the Derivative Works; within the Source form or\r
+          documentation, if provided along with the Derivative Works; or,\r
+          within a display generated by the Derivative Works, if and\r
+          wherever such third-party notices normally appear. The contents\r
+          of the NOTICE file are for informational purposes only and\r
+          do not modify the License. You may add Your own attribution\r
+          notices within Derivative Works that You distribute, alongside\r
+          or as an addendum to the NOTICE text from the Work, provided\r
+          that such additional attribution notices cannot be construed\r
+          as modifying the License.\r
+\r
+      You may add Your own copyright statement to Your modifications and\r
+      may provide additional or different license terms and conditions\r
+      for use, reproduction, or distribution of Your modifications, or\r
+      for any such Derivative Works as a whole, provided Your use,\r
+      reproduction, and distribution of the Work otherwise complies with\r
+      the conditions stated in this License.\r
+\r
+   5. Submission of Contributions. Unless You explicitly state otherwise,\r
+      any Contribution intentionally submitted for inclusion in the Work\r
+      by You to the Licensor shall be under the terms and conditions of\r
+      this License, without any additional terms or conditions.\r
+      Notwithstanding the above, nothing herein shall supersede or modify\r
+      the terms of any separate license agreement you may have executed\r
+      with Licensor regarding such Contributions.\r
+\r
+   6. Trademarks. This License does not grant permission to use the trade\r
+      names, trademarks, service marks, or product names of the Licensor,\r
+      except as required for reasonable and customary use in describing the\r
+      origin of the Work and reproducing the content of the NOTICE file.\r
+\r
+   7. Disclaimer of Warranty. Unless required by applicable law or\r
+      agreed to in writing, Licensor provides the Work (and each\r
+      Contributor provides its Contributions) on an "AS IS" BASIS,\r
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\r
+      implied, including, without limitation, any warranties or conditions\r
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\r
+      PARTICULAR PURPOSE. You are solely responsible for determining the\r
+      appropriateness of using or redistributing the Work and assume any\r
+      risks associated with Your exercise of permissions under this License.\r
+\r
+   8. Limitation of Liability. In no event and under no legal theory,\r
+      whether in tort (including negligence), contract, or otherwise,\r
+      unless required by applicable law (such as deliberate and grossly\r
+      negligent acts) or agreed to in writing, shall any Contributor be\r
+      liable to You for damages, including any direct, indirect, special,\r
+      incidental, or consequential damages of any character arising as a\r
+      result of this License or out of the use or inability to use the\r
+      Work (including but not limited to damages for loss of goodwill,\r
+      work stoppage, computer failure or malfunction, or any and all\r
+      other commercial damages or losses), even if such Contributor\r
+      has been advised of the possibility of such damages.\r
+\r
+   9. Accepting Warranty or Additional Liability. While redistributing\r
+      the Work or Derivative Works thereof, You may choose to offer,\r
+      and charge a fee for, acceptance of support, warranty, indemnity,\r
+      or other liability obligations and/or rights consistent with this\r
+      License. However, in accepting such obligations, You may act only\r
+      on Your own behalf and on Your sole responsibility, not on behalf\r
+      of any other Contributor, and only if You agree to indemnify,\r
+      defend, and hold each Contributor harmless for any liability\r
+      incurred by, or claims asserted against, such Contributor by reason\r
+      of your accepting any such warranty or additional liability.\r
+\r
+   END OF TERMS AND CONDITIONS\r
+\r
+   APPENDIX: How to apply the Apache License to your work.\r
+\r
+      To apply the Apache License to your work, attach the following\r
+      boilerplate notice, with the fields enclosed by brackets "[]"\r
+      replaced with your own identifying information. (Don't include\r
+      the brackets!)  The text should be enclosed in the appropriate\r
+      comment syntax for the file format. We also recommend that a\r
+      file or class name and description of purpose be included on the\r
+      same "printed page" as the copyright notice for easier\r
+      identification within third-party archives.\r
+\r
+   Copyright [yyyy] [name of copyright owner]\r
+\r
+   Licensed under the Apache License, Version 2.0 (the "License");\r
+   you may not use this file except in compliance with the License.\r
+   You may obtain a copy of the License at\r
+\r
+       http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+   Unless required by applicable law or agreed to in writing, software\r
+   distributed under the License is distributed on an "AS IS" BASIS,\r
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+   See the License for the specific language governing permissions and\r
+   limitations under the License.\r
+\r
+\r
+\r
diff --git a/NOTICE b/NOTICE
new file mode 100644 (file)
index 0000000..0e0f016
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,3 @@
+Copyright (c) Samsung Electronics Co., Ltd. All rights reserved.
+Except as noted, this software is licensed under Apache License, Version 2.
+Please, see the LICENSE.APLv2 file for Apache License terms and conditions.
diff --git a/legacy/CMakeLists.txt b/legacy/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..dbd8d02
--- /dev/null
@@ -0,0 +1,69 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+
+SET(service "legacy")
+SET(submodule "camera")
+
+# for package file
+SET(dependents "dlog audio-session-mgr mm-camcorder capi-base-common capi-media-tool gstreamer-1.0 libtbm evas ecore elementary vconf")
+SET(pc_dependents "mm-camcorder capi-base-common capi-media-tool gstreamer-1.0 libtbm evas ecore elementary")
+
+SET(fw_name "${service}-${submodule}")
+
+PROJECT(${fw_name})
+
+SET(CMAKE_INSTALL_PREFIX /usr)
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+
+SET(INC_DIR include)
+INCLUDE_DIRECTORIES(${INC_DIR})
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(${fw_name} REQUIRED ${dependents})
+FOREACH(flag ${${fw_name}_CFLAGS})
+    SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Wextra -Wno-array-bounds -Wno-empty-body -Wno-ignored-qualifiers -Wno-unused-parameter -Wshadow -Wwrite-strings -Wswitch-default -Wno-unused-but-set-parameter -Wno-unused-but-set-variable")
+SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
+
+IF("${ARCH}" STREQUAL "arm")
+    ADD_DEFINITIONS("-DTARGET")
+ENDIF("${ARCH}" STREQUAL "arm")
+
+IF(WAYLAND_SUPPORT)
+    ADD_DEFINITIONS("-DHAVE_WAYLAND")
+ENDIF(WAYLAND_SUPPORT)
+IF(X11_SUPPORT)
+    ADD_DEFINITIONS("-DHAVE_X11")
+ENDIF(X11_SUPPORT)
+
+ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
+ADD_DEFINITIONS("-DTIZEN_DEBUG")
+
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIB_INSTALL_DIR}")
+
+aux_source_directory(src LEGACY_SOURCES)
+ADD_LIBRARY(${fw_name} SHARED ${LEGACY_SOURCES})
+
+SET_TARGET_PROPERTIES(${fw_name}
+     PROPERTIES
+     VERSION ${FULLVER}
+     SOVERSION ${MAJORVER}
+     CLEAN_DIRECT_OUTPUT 1
+)
+
+
+TARGET_LINK_LIBRARIES(${fw_name} ${${fw_name}_LDFLAGS})
+
+INSTALL(TARGETS ${fw_name} DESTINATION ${LIB_INSTALL_DIR})
+INSTALL(
+        DIRECTORY ${INC_DIR}/ DESTINATION include/media
+        FILES_MATCHING
+        PATTERN "*_private.h" EXCLUDE
+        PATTERN "${INC_DIR}/*.h"
+        )
+
+SET(PC_NAME ${fw_name})
+SET(PC_REQUIRED ${pc_dependents})
+SET(PC_LDFLAGS -l${fw_name})
+SET(PC_CFLAGS -I\${includedir}/media)
\ No newline at end of file
diff --git a/legacy/include/legacy_camera.h b/legacy/include/legacy_camera.h
new file mode 100755 (executable)
index 0000000..0145f2d
--- /dev/null
@@ -0,0 +1,3457 @@
+/*
+* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* 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 __TIZEN_MULTIMEDIA_CAMERA_H__
+#define __TIZEN_MULTIMEDIA_CAMERA_H__
+
+#include <tizen.h>
+#include <media_packet.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @file camera.h
+ * @brief This file contains the Camera API, related structures and enumerations.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_CAMERA_MODULE
+ * @{
+ */
+
+#define CAMERA_ERROR_CLASS          TIZEN_ERROR_CAMERA | 0x00
+
+/**
+ * @brief Enumeration for the error codes of Camera.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+typedef enum
+{
+    CAMERA_ERROR_NONE                   = TIZEN_ERROR_NONE,                     /**< Successful */
+    CAMERA_ERROR_INVALID_PARAMETER      = TIZEN_ERROR_INVALID_PARAMETER,        /**< Invalid parameter */
+    CAMERA_ERROR_INVALID_STATE          = CAMERA_ERROR_CLASS | 0x02,            /**< Invalid state */
+    CAMERA_ERROR_OUT_OF_MEMORY          = TIZEN_ERROR_OUT_OF_MEMORY,            /**< Out of memory */
+    CAMERA_ERROR_DEVICE                 = CAMERA_ERROR_CLASS | 0x04,            /**< Device error */
+    CAMERA_ERROR_INVALID_OPERATION      = TIZEN_ERROR_INVALID_OPERATION,        /**< Internal error */
+    CAMERA_ERROR_SOUND_POLICY           = CAMERA_ERROR_CLASS | 0x06,            /**< Blocked by Audio Session Manager (Deprecated since 3.0) */
+    CAMERA_ERROR_SECURITY_RESTRICTED    = CAMERA_ERROR_CLASS | 0x07,            /**< Restricted by security system policy */
+    CAMERA_ERROR_DEVICE_BUSY            = CAMERA_ERROR_CLASS | 0x08,            /**< The device is using another application or working on some operation */
+    CAMERA_ERROR_DEVICE_NOT_FOUND       = CAMERA_ERROR_CLASS | 0x09,            /**< No camera device */
+    CAMERA_ERROR_SOUND_POLICY_BY_CALL   = CAMERA_ERROR_CLASS | 0x0a,            /**< Blocked by Audio Session Manager - CALL (Deprecated since 3.0) */
+    CAMERA_ERROR_SOUND_POLICY_BY_ALARM  = CAMERA_ERROR_CLASS | 0x0b,            /**< Blocked by Audio Session Manager - ALARM (Deprecated since 3.0) */
+    CAMERA_ERROR_ESD                    = CAMERA_ERROR_CLASS | 0x0c,            /**< ESD situation */
+    CAMERA_ERROR_PERMISSION_DENIED      = TIZEN_ERROR_PERMISSION_DENIED,        /**< The access to the resources can not be granted*/
+    CAMERA_ERROR_NOT_SUPPORTED          = TIZEN_ERROR_NOT_SUPPORTED,            /**< The feature is not supported */
+    CAMERA_ERROR_RESOURCE_CONFLICT      = CAMERA_ERROR_CLASS | 0x0d,            /**< Blocked by resource conflict (Since 3.0) */
+} camera_error_e;
+
+/**
+ * @brief Enumeration for the camera state.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+typedef enum
+{
+    CAMERA_STATE_NONE,       /**< Before creating */
+    CAMERA_STATE_CREATED,    /**< Created, but not initialized yet */
+    CAMERA_STATE_PREVIEW,    /**< Preview */
+    CAMERA_STATE_CAPTURING,  /**< While capturing */
+    CAMERA_STATE_CAPTURED    /**< After capturing */
+} camera_state_e;
+
+/**
+ * @brief Enumeration for the camera device.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+typedef enum
+{
+    CAMERA_DEVICE_CAMERA0 = 0, /**< Primary camera */
+    CAMERA_DEVICE_CAMERA1      /**< Secondary camera */
+} camera_device_e;
+
+/**
+ * @brief Enumeration for the camera pixel format.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+typedef enum
+{
+       CAMERA_PIXEL_FORMAT_INVALID = -1,   /**< Invalid pixel format */
+       CAMERA_PIXEL_FORMAT_NV12,           /**< NV12 pixel format */
+       CAMERA_PIXEL_FORMAT_NV12T,          /**< NV12 Tiled pixel format */
+       CAMERA_PIXEL_FORMAT_NV16,           /**< NV16 pixel format */
+       CAMERA_PIXEL_FORMAT_NV21,           /**< NV21 pixel format */
+       CAMERA_PIXEL_FORMAT_YUYV,           /**< YUYV(YUY2) pixel format */
+       CAMERA_PIXEL_FORMAT_UYVY,           /**< UYVY pixel format */
+       CAMERA_PIXEL_FORMAT_422P,           /**< YUV422(Y:U:V) planar pixel format */
+       CAMERA_PIXEL_FORMAT_I420,           /**< I420 pixel format */
+       CAMERA_PIXEL_FORMAT_YV12,           /**< YV12 pixel format */
+       CAMERA_PIXEL_FORMAT_RGB565,         /**< RGB565 pixel format */
+       CAMERA_PIXEL_FORMAT_RGB888,         /**< RGB888 pixel format */
+       CAMERA_PIXEL_FORMAT_RGBA,           /**< RGBA pixel format */
+       CAMERA_PIXEL_FORMAT_ARGB,           /**< ARGB pixel format */
+       CAMERA_PIXEL_FORMAT_JPEG,           /**< Encoded pixel format */
+} camera_pixel_format_e;
+
+/**
+ * @brief Enumeration for the camera display type.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+typedef enum
+{
+       CAMERA_DISPLAY_TYPE_OVERLAY = 0,        /**< Overlay surface display */
+       CAMERA_DISPLAY_TYPE_EVAS,               /**< Evas object surface display */
+       CAMERA_DISPLAY_TYPE_NONE                /**< This disposes off buffers */
+} camera_display_type_e;
+
+/**
+ * @brief Enumeration for the camera policy.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+typedef enum
+{
+       CAMERA_POLICY_NONE = 0,         /**< None */
+       CAMERA_POLICY_SOUND,            /**< Sound policy (Deprecated since 3.0) */
+       CAMERA_POLICY_SOUND_BY_CALL,    /**< Sound policy by CALL (Deprecated since 3.0) */
+       CAMERA_POLICY_SOUND_BY_ALARM,   /**< Sound policy by ALARM (Deprecated since 3.0) */
+       CAMERA_POLICY_SECURITY,         /**< Security policy */
+       CAMERA_POLICY_RESOURCE_CONFLICT /**< Resource conflict (Since 3.0) */
+} camera_policy_e;
+
+/**
+ * @brief Enumeration for the camera rotation type.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+typedef enum
+{
+       CAMERA_ROTATION_NONE,   /**< No rotation */
+       CAMERA_ROTATION_90,             /**< 90 degree rotation */
+       CAMERA_ROTATION_180,    /**< 180 degree rotation */
+       CAMERA_ROTATION_270,    /**< 270 degree rotation */
+} camera_rotation_e;
+
+
+/**
+ * @brief Enumeration for the camera flip type.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+typedef enum
+{
+       CAMERA_FLIP_NONE,       /**< No Flip */
+       CAMERA_FLIP_HORIZONTAL, /**< Horizontal flip */
+       CAMERA_FLIP_VERTICAL,   /**< Vertical flip */
+       CAMERA_FLIP_BOTH        /** Horizontal and vertical flip */
+} camera_flip_e;
+
+/**
+ * @brief Enumeration for the camera focus state.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+typedef enum
+{
+    CAMERA_FOCUS_STATE_RELEASED = 0, /**< Focus released */
+    CAMERA_FOCUS_STATE_ONGOING,      /**< Focus in progress */
+    CAMERA_FOCUS_STATE_FOCUSED,      /**< Focus succeeded */
+    CAMERA_FOCUS_STATE_FAILED,       /**< Focus failed */
+} camera_focus_state_e;
+
+/**
+ * @brief The structure type of the image data.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+ typedef struct
+{
+       unsigned char *data;            /**< The image buffer */
+       unsigned int size;              /**< The size of the buffer */
+       int width;                      /**< The width of the image */
+       int height;                     /**< The height of the image */
+       camera_pixel_format_e format;   /**< The format of the image pixel */
+       unsigned char *exif;            /**< The exif raw data */
+       unsigned int exif_size;         /**< The size of the exif data */
+} camera_image_data_s;
+
+/**
+ * @brief The structure type for face detection.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+typedef struct
+{
+       int id;         /**< The ID of each face */
+       int score;      /**< The confidence level for the detection of the face */
+       int x;          /**< The x coordinates of the face */
+       int y;          /**< The y coordinates of the face */
+       int width;      /**< The width of the face */
+       int height;     /**< The height of the face */
+} camera_detected_face_s;
+
+/**
+ * @brief The structure type to preview stream data.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+typedef struct
+{
+       camera_pixel_format_e format;   /**< The format of the frame pixel */
+       int width;                      /**< The width of the frame */
+       int height;                     /**< The height of the frame */
+       int num_of_planes;              /**< The number of planes */
+       unsigned int timestamp;         /**< The timestamp of the frame */
+       union {
+               struct {
+                       unsigned char *yuv;     /**< The yuv data pointer */
+                       unsigned int size;      /**< The size of data */
+               } single_plane;                 /**< single plane frame data */
+
+               struct {
+                       unsigned char *y;       /**< The y data pointer */
+                       unsigned char *uv;      /**< The uv data pointer */
+                       unsigned int y_size;    /**< The size of y data */
+                       unsigned int uv_size;   /**< The size of uv data */
+               } double_plane;                 /**< double plane frame data */
+
+               struct {
+                       unsigned char *y;       /**< The y data pointer */
+                       unsigned char *u;       /**< The u data pointer */
+                       unsigned char *v;       /**< The v data pointer */
+                       unsigned int y_size;    /**< The size of y data */
+                       unsigned int u_size;    /**< The size of u data */
+                       unsigned int v_size;    /**< The size of v data */
+               } triple_plane;                 /**< triple plane frame data */
+       } data;
+} camera_preview_data_s;
+
+/**
+ * @brief The Camera handle.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @see        recorder_create_videorecorder()
+ */
+typedef struct camera_s *camera_h;
+
+/**
+ * @brief The Camera display handle.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+typedef void *camera_display_h;
+
+#ifndef GET_DISPLAY
+
+/**
+ * @brief Gets a display handle.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+#define GET_DISPLAY(x) (void*)(x)
+
+#endif
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_CAMERA_DISPLAY_MODULE
+ * @{
+ */
+
+/**
+ * @brief Enumeration for the camera display mode.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+typedef enum
+{
+       CAMERA_DISPLAY_MODE_LETTER_BOX = 0,    /**< Letter box */
+       CAMERA_DISPLAY_MODE_ORIGIN_SIZE,       /**< Origin size */
+       CAMERA_DISPLAY_MODE_FULL,              /**< Full screen */
+       CAMERA_DISPLAY_MODE_CROPPED_FULL,      /**< Cropped full screen */
+} camera_display_mode_e;
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_CAMERA_ATTRIBUTES_MODULE
+ * @{
+ */
+
+/**
+ * @brief Enumeration for the color tone, which provides the impression of looking through a tinted glass.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+typedef enum
+{
+    CAMERA_ATTR_EFFECT_NONE = 0,              /**< None */
+    CAMERA_ATTR_EFFECT_MONO,                  /**< Mono */
+    CAMERA_ATTR_EFFECT_SEPIA,                 /**< Sepia */
+    CAMERA_ATTR_EFFECT_NEGATIVE,              /**< Negative */
+    CAMERA_ATTR_EFFECT_BLUE,                  /**< Blue */
+    CAMERA_ATTR_EFFECT_GREEN,                 /**< Green */
+    CAMERA_ATTR_EFFECT_AQUA,                  /**< Aqua */
+    CAMERA_ATTR_EFFECT_VIOLET,                /**< Violet */
+    CAMERA_ATTR_EFFECT_ORANGE,                /**< Orange */
+    CAMERA_ATTR_EFFECT_GRAY,                  /**< Gray */
+    CAMERA_ATTR_EFFECT_RED,                   /**< Red */
+    CAMERA_ATTR_EFFECT_ANTIQUE,               /**< Antique */
+    CAMERA_ATTR_EFFECT_WARM,                  /**< Warm */
+    CAMERA_ATTR_EFFECT_PINK,                  /**< Pink */
+    CAMERA_ATTR_EFFECT_YELLOW,                /**< Yellow */
+    CAMERA_ATTR_EFFECT_PURPLE,                /**< Purple */
+    CAMERA_ATTR_EFFECT_EMBOSS,                /**< Emboss */
+    CAMERA_ATTR_EFFECT_OUTLINE,               /**< Outline */
+    CAMERA_ATTR_EFFECT_SOLARIZATION,          /**< Solarization */
+    CAMERA_ATTR_EFFECT_SKETCH,                /**< Sketch */
+    CAMERA_ATTR_EFFECT_WASHED,                /**< Washed */
+    CAMERA_ATTR_EFFECT_VINTAGE_WARM,          /**< Vintage warm  */
+    CAMERA_ATTR_EFFECT_VINTAGE_COLD,          /**< Vintage cold */
+    CAMERA_ATTR_EFFECT_POSTERIZATION,         /**< Posterization */
+    CAMERA_ATTR_EFFECT_CARTOON,               /**< Cartoon */
+    CAMERA_ATTR_EFFECT_SELECTIVE_RED,         /**< Selective color - Red */
+    CAMERA_ATTR_EFFECT_SELECTIVE_GREEN,       /**< Selective color - Green */
+    CAMERA_ATTR_EFFECT_SELECTIVE_BLUE,        /**< Selective color - Blue */
+    CAMERA_ATTR_EFFECT_SELECTIVE_YELLOW,      /**< Selective color - Yellow */
+    CAMERA_ATTR_EFFECT_SELECTIVE_RED_YELLOW,  /**< Selective color - Red and Yellow */
+    CAMERA_ATTR_EFFECT_OTHER_GRAPHICS,        /**< Other Graphic effects */
+} camera_attr_effect_mode_e;
+
+/**
+ * @brief Enumeration for the white balance levels of the camera.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+typedef enum
+{
+    CAMERA_ATTR_WHITE_BALANCE_NONE = 0,     /**< None */
+    CAMERA_ATTR_WHITE_BALANCE_AUTOMATIC,    /**< Automatic */
+    CAMERA_ATTR_WHITE_BALANCE_DAYLIGHT,     /**< Daylight */
+    CAMERA_ATTR_WHITE_BALANCE_CLOUDY,       /**< Cloudy */
+    CAMERA_ATTR_WHITE_BALANCE_FLUORESCENT,  /**< Fluorescent */
+    CAMERA_ATTR_WHITE_BALANCE_INCANDESCENT, /**< Incandescent */
+    CAMERA_ATTR_WHITE_BALANCE_SHADE,        /**< Shade */
+    CAMERA_ATTR_WHITE_BALANCE_HORIZON,      /**< Horizon */
+    CAMERA_ATTR_WHITE_BALANCE_FLASH,        /**< Flash */
+    CAMERA_ATTR_WHITE_BALANCE_CUSTOM,       /**< Custom */
+} camera_attr_whitebalance_e;
+
+/**
+ * @brief Enumeration for the scene mode.
+ * @details The mode of operation can be in daylight, night, or back-light.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+typedef enum
+{
+    CAMERA_ATTR_SCENE_MODE_NORMAL = 0,     /**< Normal */
+    CAMERA_ATTR_SCENE_MODE_PORTRAIT,       /**< Portrait */
+    CAMERA_ATTR_SCENE_MODE_LANDSCAPE,      /**< Landscape */
+    CAMERA_ATTR_SCENE_MODE_SPORTS,         /**< Sports */
+    CAMERA_ATTR_SCENE_MODE_PARTY_N_INDOOR, /**< Party & indoor */
+    CAMERA_ATTR_SCENE_MODE_BEACH_N_INDOOR, /**< Beach & indoor */
+    CAMERA_ATTR_SCENE_MODE_SUNSET,         /**< Sunset */
+    CAMERA_ATTR_SCENE_MODE_DUSK_N_DAWN,    /**< Dusk & dawn */
+    CAMERA_ATTR_SCENE_MODE_FALL_COLOR,     /**< Fall */
+    CAMERA_ATTR_SCENE_MODE_NIGHT_SCENE,    /**< Night scene */
+    CAMERA_ATTR_SCENE_MODE_FIREWORK,       /**< Firework */
+    CAMERA_ATTR_SCENE_MODE_TEXT,           /**< Text */
+    CAMERA_ATTR_SCENE_MODE_SHOW_WINDOW,    /**< Show window */
+    CAMERA_ATTR_SCENE_MODE_CANDLE_LIGHT,   /**< Candle light */
+    CAMERA_ATTR_SCENE_MODE_BACKLIGHT,      /**< Backlight */
+    CAMERA_ATTR_SCENE_MODE_AQUA,           /**< Aqua */
+} camera_attr_scene_mode_e;
+
+/**
+ * @brief Enumeration for the auto focus mode.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+typedef enum
+{
+    CAMERA_ATTR_AF_NONE = 0,    /**< auto-focus is not set */
+    CAMERA_ATTR_AF_NORMAL,      /**< auto-focus in the normal mode  */
+    CAMERA_ATTR_AF_MACRO,       /**< auto-focus in the macro mode(close distance)  */
+    CAMERA_ATTR_AF_FULL,        /**< auto-focus in the full mode(all range scan, limited by device spec) */
+} camera_attr_af_mode_e;
+
+/**
+ * @brief Enumeration for the ISO levels of the camera.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+typedef enum
+{
+    CAMERA_ATTR_ISO_AUTO = 0, /**< ISO auto mode */
+    CAMERA_ATTR_ISO_50,       /**< ISO 50 */
+    CAMERA_ATTR_ISO_100,      /**< ISO 100 */
+    CAMERA_ATTR_ISO_200,      /**< ISO 200 */
+    CAMERA_ATTR_ISO_400,      /**< ISO 400 */
+    CAMERA_ATTR_ISO_800,      /**< ISO 800 */
+    CAMERA_ATTR_ISO_1600,     /**< ISO 1600 */
+    CAMERA_ATTR_ISO_3200,     /**< ISO 3200 */
+} camera_attr_iso_e;
+
+/**
+ * @brief Enumeration for the camera exposure modes.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+typedef enum
+{
+    CAMERA_ATTR_EXPOSURE_MODE_OFF = 0,   /**< Off */
+    CAMERA_ATTR_EXPOSURE_MODE_ALL,       /**< All mode */
+    CAMERA_ATTR_EXPOSURE_MODE_CENTER,    /**< Center mode */
+    CAMERA_ATTR_EXPOSURE_MODE_SPOT,      /**< Spot mode */
+    CAMERA_ATTR_EXPOSURE_MODE_CUSTOM,    /**< Custom mode */
+} camera_attr_exposure_mode_e;
+
+/**
+ * @brief Enumeration for the orientation values of tag.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+typedef enum
+{
+    CAMERA_ATTR_TAG_ORIENTATION_TOP_LEFT = 1,      /**< Row #0 is at the top, Column #0 is to the left */
+    CAMERA_ATTR_TAG_ORIENTATION_TOP_RIGHT = 2,     /**< Row #0 is at the top, Column #0 is to the right (flipped) */
+    CAMERA_ATTR_TAG_ORIENTATION_BOTTOM_RIGHT = 3,  /**< Row #0 is at the bottom, Column #0 is to the right */
+    CAMERA_ATTR_TAG_ORIENTATION_BOTTOM_LEFT = 4,   /**< Row #0 is at the bottom, Column #0 is to the left (flipped) */
+    CAMERA_ATTR_TAG_ORIENTATION_LEFT_TOP = 5,      /**< Row #0 is to the left, Column #0 is at the top (flipped) */
+    CAMERA_ATTR_TAG_ORIENTATION_RIGHT_TOP = 6,     /**< Row #0 is to the right, Column #0 is at the top */
+    CAMERA_ATTR_TAG_ORIENTATION_RIGHT_BOTTOM = 7,  /**< Row #0 is to the right, Column #0 is at the bottom (flipped) */
+    CAMERA_ATTR_TAG_ORIENTATION_LEFT_BOTTOM = 8,   /**< Row #0 is to the left, Column #0 is at the bottom */
+} camera_attr_tag_orientation_e;
+
+/**
+ * @brief Enumeration for the flash mode.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+typedef enum
+{
+    CAMERA_ATTR_FLASH_MODE_OFF = 0,          /**< Always off */
+    CAMERA_ATTR_FLASH_MODE_ON,               /**< Always splashes */
+    CAMERA_ATTR_FLASH_MODE_AUTO,             /**< Depending on intensity of light, strobe starts to flash */
+    CAMERA_ATTR_FLASH_MODE_REDEYE_REDUCTION, /**< Red eye reduction. Multiple flash before capturing */
+    CAMERA_ATTR_FLASH_MODE_SLOW_SYNC,        /**< Slow sync curtain synchronization */
+    CAMERA_ATTR_FLASH_MODE_FRONT_CURTAIN,    /**< Front curtain synchronization */
+    CAMERA_ATTR_FLASH_MODE_REAR_CURTAIN,     /**< Rear curtain synchronization */
+    CAMERA_ATTR_FLASH_MODE_PERMANENT,        /**< Keep turned on until turning off */
+} camera_attr_flash_mode_e;
+
+/**
+ * @brief Enumeration to preview FPS.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+typedef enum
+{
+    CAMERA_ATTR_FPS_AUTO = 0, /**< AUTO FPS */
+    CAMERA_ATTR_FPS_7 = 7,    /**< 7 FPS */
+    CAMERA_ATTR_FPS_8 = 8,    /**< 8 FPS */
+    CAMERA_ATTR_FPS_15 = 15,  /**< 15 FPS */
+    CAMERA_ATTR_FPS_20 = 20,  /**< 20 FPS */
+    CAMERA_ATTR_FPS_24 = 24,  /**< 24 FPS */
+    CAMERA_ATTR_FPS_25 = 25,  /**< 25 FPS */
+    CAMERA_ATTR_FPS_30 = 30,  /**< 30 FPS */
+    CAMERA_ATTR_FPS_60 = 60,  /**< 60 FPS */
+    CAMERA_ATTR_FPS_90 = 90,  /**< 90 FPS */
+    CAMERA_ATTR_FPS_120 = 120 /**< 120 FPS */
+} camera_attr_fps_e;
+
+/**
+ * @brief Enumeration for the theater mode.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+typedef enum
+{
+       CAMERA_ATTR_THEATER_MODE_DISABLE = 0, /**< Disable theater mode - External display shows same image as device display */
+       CAMERA_ATTR_THEATER_MODE_ENABLE = 2,  /**< Enable theater mode - Preview image is displayed on external display with full screen mode, but preview image is not shown on device display */
+       CAMERA_ATTR_THEATER_MODE_CLONE = 1    /**< Clone mode - Preview image is displayed on external display with full screen mode. Also preview image is shown by the UI on device display */
+} camera_attr_theater_mode_e;
+
+/**
+ * @brief Enumeration for HDR capture mode.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+typedef enum
+{
+       CAMERA_ATTR_HDR_MODE_DISABLE = 0,  /**< Disable HDR capture */
+       CAMERA_ATTR_HDR_MODE_ENABLE,       /**< Enable HDR capture */
+       CAMERA_ATTR_HDR_MODE_KEEP_ORIGINAL /**< Enable HDR capture and keep original image data */
+} camera_attr_hdr_mode_e;
+
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_CAMERA_MODULE
+ * @{
+ */
+
+/**
+ * @brief Called when the camera state is changed.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @param[in] previous The previous state of the camera
+ * @param[in] current The current state of the camera
+ * @param[in] by_policy If @c true the state is changed by policy, otherwise @c false
+ * @param[in] user_data The user data passed from the callback registration function
+ * @pre camera_start_preview(), camera_start_capture() or camera_stop_preview()
+ *      will invoke this callback if you register this callback using camera_set_state_changed_cb().
+ * @see        camera_set_state_changed_cb()
+ */
+typedef void (*camera_state_changed_cb)(camera_state_e previous, camera_state_e current,
+        bool by_policy, void *user_data);
+
+/**
+ * @brief Called when the camera is interrupted by policy.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @param[in] policy The policy that interrupted the camera
+ * @param[in] previous The previous state of the camera
+ * @param[in] current The current state of the camera
+ * @param[in] user_data The user data passed from the callback registration function
+ * @see        camera_set_interrupted_cb()
+ */
+typedef void (*camera_interrupted_cb)(camera_policy_e policy, camera_state_e previous, camera_state_e current, void *user_data);
+
+/**
+ * @brief Called when the camera focus state is changed.
+ * @details When the camera auto focus completes or a change to the focus state occurs,
+ *          this callback is invoked. \n \n
+ *          Changes of focus state are as follows: \n
+ *          #CAMERA_FOCUS_STATE_RELEASED -> start focusing -> #CAMERA_FOCUS_STATE_ONGOING -> working ->
+ *          #CAMERA_FOCUS_STATE_FOCUSED or #CAMERA_FOCUS_STATE_FAILED.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @param[in] state The current state of the auto-focus
+ * @param[in] user_data The user data passed from the callback registration function
+ * @pre camera_start_focusing() will invoke this callback if you register it using camera_set_focus_changed_cb().
+ * @see        camera_set_focus_changed_cb()
+ * @see        camera_unset_focus_changed_cb()
+ * @see        camera_start_focusing()
+ * @see camera_cancel_focusing()
+ */
+typedef void (*camera_focus_changed_cb)(camera_focus_state_e state, void *user_data);
+
+/**
+ * @brief Called to register for notifications about delivering a copy of the new preview frame when every preview frame is displayed.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks This function is issued in the context of gstreamer so the UI update code should not be directly invoked.\n
+ *          If the camera is used as a recorder then this callback function won't be called.
+ *
+ * @param[in] frame The reference pointer to preview stream data
+ * @param[in] user_data The user data passed from the callback registration function
+ * @pre        camera_start_preview() will invoke this callback function if you register this callback using camera_set_preview_cb().
+ * @see        camera_start_preview()
+ * @see        camera_set_preview_cb()
+ * @see        camera_unset_preview_cb()
+ */
+typedef void (*camera_preview_cb)(camera_preview_data_s *frame, void *user_data);
+
+/**
+ * @brief Called to register for notifications about delivering media packet when every preview frame is displayed.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks This function is issued in the context of gstreamer so the UI update code should not be directly invoked.\n
+ *          If the camera is used as a recorder then this callback function won't be called.\n
+ *          and the packet should be released by media_packet_destroy() after use.
+ *
+ * @param[in] pkt Reference pointer to media packet
+ * @param[in] user_data The user data passed from the callback registration function
+ * @pre        camera_start_preview() will invoke this callback function if you register this callback using camera_set_media_packet_preview_cb().
+ * @see        camera_start_preview()
+ * @see        camera_set_media_packet_preview_cb()
+ * @see        camera_unset_media_packet_preview_cb()
+ */
+typedef void (*camera_media_packet_preview_cb)(media_packet_h pkt, void *user_data);
+
+/**
+ * @brief Called to get information about image data taken by the camera once per frame while capturing.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks This function is issued in the context of gstreamer (video source thread) so the UI update code should not be directly invoked.
+ *          You must not call camera_start_preview() within this callback.
+ *
+ * @param[in] image The image data of the captured picture
+ * @param[in] postview The image data of the postview
+ * @param[in] thumbnail The image data of the thumbnail (it should be @c NULL if the available thumbnail data does not exist)
+ * @param[in] user_data The user data passed from the callback registration function
+ * @pre        camera_start_capture() or camera_start_continuous_capture() will invoke this callback function if it is registered using camera_start_capture() or camera_start_continuous_capture().
+ * @see        camera_start_capture()
+ * @see        camera_start_continuous_capture()
+ * @see        camera_capture_completed_cb()
+ */
+typedef void (*camera_capturing_cb)(camera_image_data_s* image, camera_image_data_s* postview, camera_image_data_s* thumbnail, void *user_data);
+
+/**
+ * @brief Called when the camera capturing completes.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks The callback is called after camera_capturing_cb() is completed.\n
+ *          If you want to show the user a preview after capturing is finished, an application can use camera_start_preview() after calling this callback.
+ *
+ * @param[in] user_data The user data passed from the callback registration function
+ * @pre        This callback function is invoked if it is registered using camera_start_capture() or camera_start_continuous_capture().
+ * @see        camera_start_capture()
+ * @see        camera_start_continuous_capture()
+ * @see        camera_capturing_cb()
+ */
+typedef void (*camera_capture_completed_cb)(void *user_data);
+
+/**
+ * @brief Called when an error occurs.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks This callback informs about a critical error situation.\n
+ *          When this callback is invoked, the user should release the resource and terminate the application.\n
+ *          In case of errors, one of these codes occur:\n
+ * #CAMERA_ERROR_DEVICE,\n
+ * #CAMERA_ERROR_INVALID_OPERATION,\n
+ * #CAMERA_ERROR_OUT_OF_MEMORY.\n
+ *
+ * @param[in] error The error code
+ * @param[in] current_state The current state of the camera
+ * @param[in] user_data        The user data passed from the callback registration function
+ * @pre        This callback function is invoked if it is registered using camera_set_error_cb().
+ * @see        camera_set_error_cb()
+ * @see        camera_unset_error_cb()
+ */
+typedef void (*camera_error_cb)(camera_error_e error, camera_state_e current_state, void *user_data);
+
+/**
+ * @brief Called when a face is detected in the preview frame.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] faces The detected face array
+ * @param[in] count The length of the array
+ * @param[in] user_data The user data passed from the callback registration function
+ * @see        camera_start_face_detection()
+ */
+typedef void (*camera_face_detected_cb)(camera_detected_face_s *faces, int count, void *user_data);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_CAMERA_CAPABILITY_MODULE
+ * @{
+ */
+
+/**
+ * @brief Called once for each supported preview resolution.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] width The preview image width
+ * @param[in] height The preview image height
+ * @param[in] user_data The user data passed from the foreach function
+ * @return @c true to continue with the next iteration of the loop, \n otherwise @c false to break out of the loop
+ * @pre        camera_foreach_supported_preview_resolution() will invoke this callback.
+ * @see        camera_foreach_supported_preview_resolution()
+ */
+typedef bool (*camera_supported_preview_resolution_cb)(int width, int height, void *user_data);
+
+/**
+ * @brief Called once for each supported capture resolution.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] width The capture resolution width
+ * @param[in] height The capture resolution height
+ * @param[in] user_data The user data passed from the foreach function
+ * @return @c true to continue with the next iteration of the loop, \n otherwise @c false to break out of the loop
+ * @pre        camera_foreach_supported_capture_resolution() will invoke this callback.
+ * @see        camera_foreach_supported_capture_resolution()
+ */
+typedef bool (*camera_supported_capture_resolution_cb)(int width, int height, void *user_data);
+
+/**
+ * @brief Called once for the pixel format of each supported capture format.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] format The supported pixel format
+ * @param[in] user_data The user data passed from the foreach function
+ * @return @c true to continue with the next iteration of the loop, \n otherwise @c false to break out of the loop
+ * @pre        camera_foreach_supported_capture_format() will invoke this callback.
+ * @see        camera_foreach_supported_capture_format()
+ */
+typedef bool (*camera_supported_capture_format_cb)(camera_pixel_format_e format,
+        void *user_data);
+
+/**
+ * @brief Called once for the pixel format of each supported preview format.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] format The supported preview data format
+ * @param[in] user_data The user data passed from the foreach function
+ * @return @c true to continue with the next iteration of the loop, \n otherwise @c false to break out of the loop
+ * @pre        camera_foreach_supported_preview_format() will invoke this callback.
+ * @see        camera_foreach_supported_preview_format()
+ */
+typedef bool (*camera_supported_preview_format_cb)(camera_pixel_format_e format,
+        void *user_data);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_CAMERA_MODULE
+ * @{
+ */
+
+/**
+ * @brief Creates a new camera handle for controlling a camera.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/camera
+ * @remarks Multiple handles on a context at the same time are allowed to be created. However,
+ *          camera cannot guarantee proper operation because of limited resources, such as
+ *          camera device, audio device, and display device.\n.
+ *          A @a camera must be released using camera_destroy().
+ * @param[in] device The hardware camera to access
+ * @param[out] camera A newly returned handle to the camera
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #CAMERA_ERROR_SOUND_POLICY Sound policy error
+ * @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @post If it succeeds, the camera state will be #CAMERA_STATE_CREATED.
+ *
+ * @see        camera_destroy()
+ */
+int legacy_camera_create(camera_device_e device, camera_h *camera);
+
+/**
+ * @brief Destroys the camera handle and releases all its resources.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/camera
+ * @param[in] camera The handle to the camera
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
+ * @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_create()
+ */
+int legacy_camera_destroy(camera_h camera);
+
+/**
+ * @brief Starts capturing and drawing preview frames on the screen.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/camera
+ * @param[in] camera The handle to the camera
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
+ * @retval #CAMERA_ERROR_SOUND_POLICY Sound policy error
+ * @retval #CAMERA_ERROR_RESOURCE_CONFLICT Resource conflict error
+ * @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #CAMERA_ERROR_DEVICE_BUSY The device is being used in another application or is performing other operations
+ * @retval #CAMERA_ERROR_DEVICE_NOT_FOUND No camera device
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @pre    The camera state must be set to #CAMERA_STATE_CREATED or #CAMERA_STATE_CAPTURED.\n
+ *         You must set the display handle. \n
+ *         If needed, modify preview FPS(camera_attr_set_preview_fps()),
+ *         preview resolution(camera_set_preview_resolution()), or preview format(camera_set_preview_format()).
+ * @post   If it succeeds, the camera state will be #CAMERA_STATE_PREVIEW.\n
+ *         legacy_camera_preview_cb() will be called when preview image data becomes available.
+ *
+ * @see        camera_stop_preview()
+ * @see legacy_camera_set_display()
+ * @see legacy_camera_set_preview_cb()
+ * @see legacy_camera_set_media_packet_preview_cb()
+ * @see legacy_camera_foreach_supported_preview_resolution()
+ * @see legacy_camera_set_preview_resolution()
+ * @see legacy_camera_get_preview_resolution()
+ * @see legacy_camera_foreach_supported_preview_format()
+ * @see legacy_camera_set_preview_format()
+ * @see legacy_camera_get_preview_format()
+ * @see legacy_camera_attr_foreach_supported_fps()
+ * @see legacy_camera_attr_set_preview_fps()
+ * @see legacy_camera_attr_get_preview_fps()
+ */
+int legacy_camera_start_preview(camera_h camera);
+
+/**
+ * @brief Stops capturing and drawing preview frames.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/camera
+ * @param[in] camera The handle to the camera
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
+ * @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @pre The camera state must be set to #CAMERA_STATE_PREVIEW.
+ * @post The camera state will be #CAMERA_STATE_CREATED.
+ * @see        camera_start_preview()
+ * @see        camera_unset_preview_cb()
+ * @see        camera_unset_media_packet_preview_cb()
+ */
+int legacy_camera_stop_preview(camera_h camera);
+
+/**
+ * @brief Starts capturing of still images.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/camera
+ * @remarks This function causes the transition of the camera state from #CAMERA_STATE_CAPTURING to #CAMERA_STATE_CAPTURED automatically\n
+ *          and the corresponding callback function legacy_camera_capturing_cb() and legacy_camera_capture_completed_cb() will be invoked\n
+ *          The captured image will be delivered through legacy_camera_capturing_cb().\n
+ *          legacy_camera_capture_completed_cb() callback notifies about completion of legacy_camera_capturing_cb(). \n
+ *          The camera's preview should be restarted by calling legacy_camera_start_preview().
+ * @param[in] camera The handle to the camera
+ * @param[in] capturing_cb The callback for capturing data
+ * @param[in] completed_cb The callback for notification of completion
+ * @param[in] user_data The user data
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
+ * @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @pre The camera state must be set to #CAMERA_STATE_PREVIEW. \n
+ *      If needed, modify capture resolution(camera_set_capture_resolution()),
+ *      capture format(camera_set_capture_format()), or image quality(camera_attr_set_image_quality()).
+ * @post If it succeeds the camera state will be #CAMERA_STATE_CAPTURED.
+ *
+ * @see legacy_camera_start_preview()
+ * @see legacy_camera_start_continuous_capture();
+ * @see legacy_camera_foreach_supported_capture_resolution()
+ * @see legacy_camera_set_capture_resolution()
+ * @see legacy_camera_get_capture_resolution()
+ * @see legacy_camera_foreach_supported_capture_format()
+ * @see legacy_camera_set_capture_format()
+ * @see legacy_camera_get_capture_format()
+ * @see legacy_camera_attr_set_image_quality()
+ * @see legacy_camera_attr_get_image_quality()
+ */
+int legacy_camera_start_capture(camera_h camera, camera_capturing_cb capturing_cb , camera_capture_completed_cb completed_cb , void *user_data);
+
+/**
+ * @brief Starts continuously capturing still images.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/camera
+ * @remarks If this is not supported zero shutter lag occurs. The capture resolution could be changed to the preview resolution.\n
+ *          This function causes the transition of the camera state from #CAMERA_STATE_CAPTURING to #CAMERA_STATE_CAPTURED automatically\n
+ *          and the corresponding callback function legacy_camera_capturing_cb() and legacy_camera_capture_completed_cb() will be invoked\n
+ *          Each Captured image will be delivered through legacy_camera_capturing_cb().\n
+ *          The legacy_camera_capture_completed_cb() callback notifies about the completion of an entire capture.\n
+ *          The camera's preview should be restarted by calling legacy_camera_start_preview().\n.
+ * @param[in] camera The handle to the camera
+ * @param[in] count The number of still images
+ * @param[in] interval The interval of the capture (millisecond)
+ * @param[in] capturing_cb The callback for capturing data
+ * @param[in] completed_cb The callback for notification of completion
+ * @param[in] user_data The user data
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
+ * @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @post   If it succeeds the camera state will be #CAMERA_STATE_CAPTURED.
+ *
+ * @see legacy_camera_start_preview()
+ * @see legacy_camera_start_capture();
+ * @see legacy_camera_stop_continuous_capture()
+ * @see legacy_camera_is_supported_zero_shutter_lag()
+ */
+int legacy_camera_start_continuous_capture(camera_h camera, int count, int interval, camera_capturing_cb capturing_cb, camera_capture_completed_cb completed_cb , void *user_data);
+
+/**
+ * @brief Aborts continuous capturing.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/camera
+ * @remarks The camera state will be changed to #CAMERA_STATE_CAPTURED.
+ * @param[in] camera The handle to the camera
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
+ * @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @pre The camera state must be set to #CAMERA_STATE_PREVIEW.
+ *
+ * @see legacy_camera_start_continuous_capture()
+ */
+int legacy_camera_stop_continuous_capture(camera_h camera);
+
+/**
+ * @brief Gets the state of the camera.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[out] state The current state of the camera
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_create()
+ * @see legacy_camera_start_preview()
+ * @see legacy_camera_stop_preview()
+ * @see legacy_camera_start_capture()
+ */
+int legacy_camera_get_state(camera_h camera, camera_state_e *state);
+
+/**
+ * @brief Starts camera auto-focusing, asynchronously.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/camera
+ * @remarks If continuous status is @c true, the camera continuously tries to focus.
+ * @param[in] camera The handle to the camera
+ * @param[in] continuous The status of continuous focusing
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
+ * @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @pre The camera state must be set to #CAMERA_STATE_PREVIEW.
+ * @post The camera focus state will be #CAMERA_FOCUS_STATE_ONGOING.
+ *
+ * @see legacy_camera_cancel_focusing()
+ * @see legacy_camera_set_focus_changed_cb()
+ * @see legacy_camera_focus_changed_cb()
+ * @see legacy_camera_attr_set_af_mode()
+ */
+int legacy_camera_start_focusing(camera_h camera, bool continuous);
+
+/**
+ * @brief Stops camera auto focusing.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/camera
+ * @param[in] camera The handle to the camera
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
+ * @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @pre The camera state must be set to #CAMERA_STATE_PREVIEW.
+ *
+ * @see legacy_camera_start_focusing()
+ * @see        camera_focus_changed_cb()
+ */
+int legacy_camera_cancel_focusing(camera_h camera);
+
+/**
+ * @brief Sets the display handle to show preview images.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @remarks This function must be called before previewing (see legacy_camera_start_preview()).
+ * @param[in] camera The handle to the camera
+ * @param[in] type The display type
+ * @param[in] display The display handle from #GET_DISPLAY
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @pre The camera state must be set to #CAMERA_STATE_CREATED.
+ *
+ * @see legacy_camera_start_preview()
+ * @see #GET_DISPLAY
+ */
+int legacy_camera_set_display(camera_h camera, camera_display_type_e type, camera_display_h display);
+
+/**
+ * @brief Sets the resolution of the preview.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/camera
+ * @remarks This function should be called before previewing (camera_start_preview()).
+ * @param[in] camera The handle to the camera
+ * @param[in] width The preview width
+ * @param[in] height The preview height
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @pre The camera state must be set to #CAMERA_STATE_CREATED or #CAMERA_STATE_PREVIEW.
+ *
+ * @see legacy_camera_start_preview()
+ * @see        camera_get_preview_resolution()
+ * @see        camera_foreach_supported_preview_resolution()
+ */
+int legacy_camera_set_preview_resolution(camera_h camera, int width, int height);
+
+/**
+ * @brief Gets the resolution of the preview.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[out] width The preview width
+ * @param[out] height The preview height
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see        camera_set_preview_resolution()
+ * @see        camera_foreach_supported_preview_resolution()
+ */
+int legacy_camera_get_preview_resolution(camera_h camera, int *width, int *height);
+
+/**
+ * @brief Gets the recommended preview resolution.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @remarks Depending on the capture resolution aspect ratio and display resolution, the recommended preview resolution is determined.
+ * @param[in] camera The handle to the camera
+ * @param[out] width The preview width
+ * @param[out] height The preview height
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see        camera_set_preview_resolution()
+ * @see        camera_foreach_supported_preview_resolution()
+ */
+int legacy_camera_get_recommended_preview_resolution(camera_h camera, int *width, int *height);
+
+/**
+ * @brief Starts face detection.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/camera
+ * @remarks This should be called after the preview is started.\n
+ *          This callback will be invoked when the face is detected in the preview frame.\n
+ *          Internally it starts continuous focus and focusing on the detected face.\n
+ *          When face detection is running, the legacy_camera_start_focusing(), legacy_camera_cancel_focusing(), legacy_camera_attr_set_af_mode(), legacy_camera_attr_set_af_area(), legacy_camera_attr_set_exposure_mode(), and legacy_camera_attr_set_whitebalance() settings are ignored.\n
+ *          If legacy_camera_stop_preview() is invoked, face detection is stopped and then preview is resumed using legacy_camera_start_preview(), this method should be called again to resume face detection.
+ * @param[in] camera The handle to the camera
+ * @param[in] callback The callback to notify face detection
+ * @param[in] user_data The user data to be passed to the callback function
+ *
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_INVALID_STATE Not preview state
+ * @retval #CAMERA_ERROR_INVALID_OPERATION Not supported this feature
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @pre The camera state must be #CAMERA_STATE_PREVIEW.
+ *
+ * @see legacy_camera_stop_face_detection()
+ * @see legacy_camera_face_detected_cb()
+ * @see legacy_camera_is_supported_face_detection()
+ */
+int legacy_camera_start_face_detection(camera_h camera, camera_face_detected_cb callback, void * user_data);
+
+/**
+ * @brief Stops face detection.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/camera
+ * @param[in] camera The handle to the camera
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @pre This should be called after face detection is started.
+ *
+ * @see legacy_camera_start_face_detection()
+ * @see legacy_camera_is_supported_face_detection()
+ */
+int legacy_camera_stop_face_detection(camera_h camera);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_CAMERA_CAPABILITY_MODULE
+ * @{
+ */
+
+/**
+ * @brief Gets continuous capture feature's supported state.
+ * @ingroup CAPI_MEDIA_CAMERA_CAPABILITY_MODULE
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
+ * @param[in] camera The handle to the camera
+ * @return @c true on supported, otherwise false
+ * @exception #CAMERA_ERROR_NONE Successful
+ * @exception #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @exception #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @exception #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ *
+ */
+ bool legacy_camera_is_supported_continuous_capture(camera_h camera);
+
+/**
+ * @brief Retrieves all supported camera preview resolutions by invoking the callback function once for each supported camera preview resolution.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[in] callback The callback function to be invoked
+ * @param[in] user_data        The user data to be passed to the callback function
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @post This function invokes legacy_camera_supported_preview_resolution_cb() repeatedly to retrieve each supported preview resolution.
+ *
+ * @see        camera_set_preview_resolution()
+ * @see        camera_get_preview_resolution()
+ * @see        camera_supported_preview_resolution_cb()
+ */
+int legacy_camera_foreach_supported_preview_resolution(camera_h camera,
+        camera_supported_preview_resolution_cb callback, void *user_data);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_CAMERA_MODULE
+ * @{
+ */
+
+/**
+ * @ingroup CAPI_MEDIA_CAMERA_DISPLAY_MODULE
+ * @brief Sets the display rotation.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/camera
+ * @remarks This function should be called before previewing (see legacy_camera_start_preview())
+ * @param[in] camera The handle to the camera
+ * @param[in] rotation The display rotation
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
+ * @retval #CAMERA_ERROR_INVALID_OPERATION Display type is incorrect
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_start_preview()
+ * @see        camera_get_display_rotation()
+ */
+int legacy_camera_set_display_rotation(camera_h camera, camera_rotation_e rotation);
+
+/**
+ * @ingroup CAPI_MEDIA_CAMERA_DISPLAY_MODULE
+ * @brief Gets the display rotation.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[out] rotation The display rotation
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_set_display_rotation()
+ */
+int legacy_camera_get_display_rotation(camera_h camera, camera_rotation_e *rotation);
+
+/**
+ * @ingroup CAPI_MEDIA_CAMERA_DISPLAY_MODULE
+ * @brief Sets the display flip.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/camera
+ * @param[in] camera The handle to the camera
+ * @param[in] flip The display flip
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
+ * @retval #CAMERA_ERROR_INVALID_OPERATION Display type is incorrect
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see        camera_get_display_flip()
+ */
+int legacy_camera_set_display_flip(camera_h camera, camera_flip_e flip);
+
+/**
+ * @ingroup CAPI_MEDIA_CAMERA_DISPLAY_MODULE
+ * @brief Gets the display flip.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[out] flip The display flip
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_set_display_flip()
+ */
+int legacy_camera_get_display_flip(camera_h camera, camera_flip_e *flip);
+
+/**
+ * @ingroup CAPI_MEDIA_CAMERA_DISPLAY_MODULE
+ * @brief Sets the visible property for display.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/camera
+ * @param[in] camera The handle to the camera
+ * @param[in] visible The display visibility property
+ *
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_is_display_visible()
+ */
+int legacy_camera_set_display_visible(camera_h camera, bool visible);
+
+/**
+ * @ingroup CAPI_MEDIA_CAMERA_DISPLAY_MODULE
+ * @brief Gets the visible property of display.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[out] visible @c true if camera display is visible, otherwise @c false
+ *
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_set_display_visible()
+ */
+int legacy_camera_is_display_visible(camera_h camera, bool *visible);
+
+/**
+ * @ingroup CAPI_MEDIA_CAMERA_DISPLAY_MODULE
+ * @brief Sets the display mode.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[in] mode The display mode
+ *
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_get_display_mode()
+ */
+int legacy_camera_set_display_mode(camera_h camera , camera_display_mode_e mode);
+
+/**
+ * @ingroup CAPI_MEDIA_CAMERA_DISPLAY_MODULE
+ * @brief Gets the display mode.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[out] mode The display mode
+ *
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_set_display_mode()
+ */
+int legacy_camera_get_display_mode(camera_h camera, camera_display_mode_e *mode);
+
+/**
+ * @brief Sets the resolution of the captured image.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/camera
+ * @param[in] camera The handle to the camera
+ * @param[in] width The capture width
+ * @param[in] height The capture height
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @pre The camera state must be set to #CAMERA_STATE_CREATED or #CAMERA_STATE_PREVIEW.
+ * @see legacy_camera_start_capture()
+ * @see        camera_get_capture_resolution()
+ * @see        camera_foreach_supported_capture_resolution()
+ */
+int legacy_camera_set_capture_resolution(camera_h camera, int width, int height);
+
+/**
+ * @brief Gets the resolution of the captured image.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[out] width The capture width
+ * @param[out] height The capture height
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_set_capture_resolution()
+ * @see legacy_camera_foreach_supported_capture_resolution()
+ */
+int legacy_camera_get_capture_resolution(camera_h camera, int *width, int *height);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_CAMERA_CAPABILITY_MODULE
+ * @{
+ */
+
+/**
+ * @brief Retrieves all supported camera captured resolutions by invoking the callback function once for each supported camera capture resolution.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[in] callback The callback function to register
+ * @param[in] user_data        The user data to be passed to the callback function
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @post This function invokes legacy_camera_supported_capture_resolution_cb() repeatedly to retrieve each supported capture resolution.
+ * @see legacy_camera_set_capture_resolution()
+ * @see legacy_camera_get_capture_resolution()
+ * @see        camera_supported_capture_resolution_cb()
+ */
+int legacy_camera_foreach_supported_capture_resolution(camera_h camera,
+        camera_supported_capture_resolution_cb callback, void *user_data);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_CAMERA_MODULE
+ * @{
+ */
+
+/**
+ * @brief Sets the format of an image to be captured.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @remarks This function should be called before capturing (see legacy_camera_start_capture()).
+ * @param[in] camera The handle to the camera
+ * @param[out] format The format of the image to be captured
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @pre        The camera state must be set to #CAMERA_STATE_CREATED or #CAMERA_STATE_PREVIEW.
+ * @see legacy_camera_start_capture()
+ * @see        camera_get_capture_format()
+ * @see        camera_foreach_supported_capture_format()
+ */
+int legacy_camera_set_capture_format(camera_h camera, camera_pixel_format_e format);
+
+/**
+ * @brief Gets the format of the image to be captured.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[out] format The format of the image to be captured
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see        camera_set_capture_format()
+ * @see        camera_foreach_supported_capture_format()
+ */
+int legacy_camera_get_capture_format(camera_h camera, camera_pixel_format_e *format);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_CAMERA_CAPABILITY_MODULE
+ * @{
+ */
+
+/**
+ * @brief Retrieves all supported camera capture formats by invoking the callback function once for each supported camera capture format.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[in] callback The callback function to be invoked
+ * @param[in] user_data        The user data to be passed to the callback function
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @post This function invokes legacy_camera_supported_capture_format_cb() repeatedly to retrieve each supported capture format.
+ * @see        camera_set_capture_format()
+ * @see        camera_get_capture_format()
+ * @see        camera_supported_capture_format_cb()
+ */
+int legacy_camera_foreach_supported_capture_format(camera_h camera,
+        camera_supported_capture_format_cb callback, void *user_data);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_CAMERA_MODULE
+ * @{
+ */
+
+/**
+ * @brief Sets the preview data format.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @remarks This function should be called before previewing (see legacy_camera_start_preview()).
+ * @param[in] camera The handle to the camera
+ * @param[in] format The preview data format
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @pre The camera state must be set to #CAMERA_STATE_CREATED.
+ * @see legacy_camera_start_preview()
+ * @see        camera_get_preview_format()
+ * @see        camera_foreach_supported_preview_format()
+ */
+int legacy_camera_set_preview_format(camera_h camera, camera_pixel_format_e format);
+
+/**
+ * @brief Gets the format of the preview stream.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[out] format The preview data format
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see        camera_set_preview_format()
+ * @see        camera_foreach_supported_preview_format()
+ */
+int legacy_camera_get_preview_format(camera_h camera, camera_pixel_format_e *format);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_CAMERA_CAPABILITY_MODULE
+ * @{
+ */
+
+/**
+ * @brief Retrieves all supported camera preview formats by invoking the callback function once for each supported camera preview format.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[in] callback The callback function to be invoked
+ * @param[in] user_data        The user data to be passed to the callback function
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @post This function invokes legacy_camera_supported_preview_format_cb() repeatly to retrieve each supported preview format.
+ * @see        camera_set_preview_format()
+ * @see        camera_get_preview_format()
+ * @see        camera_supported_preview_format_cb()
+ */
+int legacy_camera_foreach_supported_preview_format(camera_h camera,
+        camera_supported_preview_format_cb callback, void *user_data);
+
+/**
+ * @ingroup CAPI_MEDIA_CAMERA_CAPABILITY_MODULE
+ * @brief Gets the face detection feature's supported state.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
+ * @param[in] camera The handle to the camera
+ * @return @c true if supported, otherwise @c false
+ * @see legacy_camera_start_face_detection()
+ * @see legacy_camera_stop_face_detection()
+ * @exception #CAMERA_ERROR_NONE Successful
+ * @exception #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @exception #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @exception #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ */
+bool legacy_camera_is_supported_face_detection(camera_h camera);
+
+/**
+ * @brief Gets the zero shutter lag feature's supported state.
+ * @ingroup CAPI_MEDIA_CAMERA_CAPABILITY_MODULE
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @remarks If supporting zero shutter lag, continuous shot can be done with full capture size. \n
+ *                The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
+ * @param[in] camera The handle to the camera
+ * @return @c true if supported, otherwise @c false
+ * @exception #CAMERA_ERROR_NONE Successful
+ * @exception #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @exception #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @exception #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ *
+ */
+bool legacy_camera_is_supported_zero_shutter_lag(camera_h camera);
+
+/**
+ * @ingroup CAPI_MEDIA_CAMERA_CAPABILITY_MODULE
+ * @brief Gets the camera device count.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @remarks If the device supports primary and secondary camera, this returns @c 2. If @c 1 is returned, the device only supports primary camera.
+ * @param[in] camera The handle to the camera
+ * @param[out] device_count The device count
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ *
+ */
+int legacy_camera_get_device_count(camera_h camera, int *device_count);
+
+/**
+ * @brief Gets the media packet preview callback feature's supported state.
+ * @ingroup CAPI_MEDIA_CAMERA_CAPABILITY_MODULE
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
+ * @param[in] camera The handle to the camera
+ * @return @c true if supported, otherwise @c false
+ * @exception #CAMERA_ERROR_NONE Successful
+ * @exception #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @exception #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @exception #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ *
+ */
+bool legacy_camera_is_supported_media_packet_preview_cb(camera_h camera);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_CAMERA_MODULE
+ * @{
+ */
+
+/**
+ * @brief Registers a callback function to be called once per frame when previewing.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @remarks This callback does not work in the video recorder mode.\n
+ *          This function should be called before previewing (see legacy_camera_start_preview()).\n
+ *          A registered callback is called on the internal thread of the camera.\n
+ *          A video frame can be retrieved using a registered callback.\n
+ *          The callback function holds the same buffer that will be drawn on the display device.\n
+ *          So if you change the buffer in a registerd callback, it will be displayed on the device\n
+ *          and the buffer is only available in a registerd callback.
+ * @param[in] camera The handle to the camera
+ * @param[in] callback The callback function to be registered
+ * @param[in] user_data The user data to be passed to the callback function
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @pre        The camera's state must be set to #CAMERA_STATE_CREATED.
+ * @see        camera_start_preview()
+ * @see legacy_camera_unset_preview_cb()
+ * @see        camera_preview_cb()
+ */
+int legacy_camera_set_preview_cb(camera_h camera, camera_preview_cb callback, void *user_data);
+
+/**
+ * @brief Unregisters the callback function.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_set_preview_cb()
+ */
+int legacy_camera_unset_preview_cb(camera_h camera);
+
+/**
+ * @brief Registers a media packet callback function to be called once per frame when previewing.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @remarks This callback does not work in video recorder mode.\n
+ *          This function should be called before previewing (see legacy_camera_start_preview())\n
+ *          A registered callback is called on the internal thread of the camera.\n
+ *          A video frame can be retrieved using a registered callback as a media packet.\n
+ *          The callback function holds the same buffer that will be drawn on the display device.\n
+ *          So if you change the media packet in a registerd callback, it will be displayed on the device\n
+ *          and the media packet is available until it's destroyed by media_packet_destroy().
+ * @param[in] camera The handle to the camera
+ * @param[in] callback The callback function to be registered
+ * @param[in] user_data The user data to be passed to the callback function
+ * @return 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @pre        The camera's state should be #CAMERA_STATE_CREATED.
+ * @see        camera_start_preview()
+ * @see        camera_unset_media_packet_preview_cb()
+ * @see        camera_media_packet_preview_cb()
+ */
+int legacy_camera_set_media_packet_preview_cb(camera_h camera, camera_media_packet_preview_cb callback, void *user_data);
+
+/**
+ * @brief Unregisters the media packet callback function.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see        camera_set_media_packet_preview_cb()
+ */
+int legacy_camera_unset_media_packet_preview_cb(camera_h camera);
+
+/**
+ * @brief Registers a callback function to be called when the camera state changes.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[in] callback The callback function to register
+ * @param[in] user_data The user data to be passed to the callback function
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @post This function will invoke legacy_camera_state_changed_cb() when the camera state changes.
+ * @see legacy_camera_unset_state_changed_cb()
+ * @see        camera_state_changed_cb()
+ */
+int legacy_camera_set_state_changed_cb(camera_h camera, camera_state_changed_cb callback,
+        void *user_data);
+
+/**
+ * @brief Unregisters the callback function.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_set_state_changed_cb()
+ */
+int legacy_camera_unset_state_changed_cb(camera_h camera);
+
+/**
+ * @brief Registers a callback function to be called when the camera is interrupted by policy.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[in] callback The callback function to register
+ * @param[in] user_data The user data to be passed to the callback function
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_unset_interrupted_cb()
+ * @see        camera_interrupted_cb()
+ */
+int legacy_camera_set_interrupted_cb(camera_h camera, camera_interrupted_cb callback,
+           void *user_data);
+
+/**
+ * @brief Unregisters the callback function.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_set_interrupted_cb()
+ */
+int legacy_camera_unset_interrupted_cb(camera_h camera);
+
+/**
+ * @brief Registers a callback function to be called when the auto-focus state changes.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[in] callback The callback function to register
+ * @param[in] user_data        The user data to be passed to the callback function
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @post This function will invoke legacy_camera_focus_changed_cb() when the auto-focus state changes.
+ * @see        camera_start_focusing()
+ * @see        camera_cancel_focusing()
+ * @see        camera_unset_focus_changed_cb()
+ * @see        camera_focus_changed_cb()
+ */
+int legacy_camera_set_focus_changed_cb(camera_h camera, camera_focus_changed_cb callback,
+        void *user_data);
+
+/**
+ * @brief Unregisters the callback function.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_set_focus_changed_cb()
+ */
+int legacy_camera_unset_focus_changed_cb(camera_h camera);
+
+/**
+ * @brief Registers a callback function to be called when an asynchronous operation error occurs.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @remarks This callback informs about a critical error situation.\n
+ *          When this callback is invoked, the user should release the resource and terminate the application.\n
+ *          In case of errors, one of the following codes will occur:\n
+ *          #CAMERA_ERROR_DEVICE,\n
+ *          #CAMERA_ERROR_INVALID_OPERATION,\n
+ *          #CAMERA_ERROR_OUT_OF_MEMORY.
+ * @param[in] camera The handle to the camera
+ * @param[in] callback The callback function to register
+ * @param[in] user_data The user data to be passed to the callback function
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @post This function will invoke legacy_camera_error_cb() when an asynchronous operation error occurs.
+
+ * @see legacy_camera_unset_error_cb()
+ * @see        camera_error_cb()
+ */
+int legacy_camera_set_error_cb(camera_h camera, camera_error_cb callback, void *user_data);
+
+/**
+ * @brief Unregisters the callback function.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_set_error_cb()
+ */
+int legacy_camera_unset_error_cb(camera_h camera);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_CAMERA_CAPABILITY_MODULE
+ * @{
+ */
+
+/**
+ * @brief Called to get each supported auto-focus mode.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] mode The supported auto-focus mode
+ * @param[in] user_data The user data passed from the foreach function
+ * @return @c true to continue with the next iteration of the loop, \n otherwise @c false to break out of the loop
+ * @pre        camera_attr_foreach_supported_af_mode() will invoke this callback.
+ * @see        camera_attr_foreach_supported_af_mode()
+ */
+typedef bool (*camera_attr_supported_af_mode_cb)(camera_attr_af_mode_e mode, void *user_data);
+
+/**
+ * @brief Called to get each supported exposure mode.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] mode The supported exposure mode
+ * @param[in] user_data The user data passed from the foreach function
+ * @return @c true to continue with the next iteration of the loop, \n otherwise @c false to break out of the loop
+ * @pre        camera_attr_foreach_supported_exposure_mode() will invoke this callback.
+ * @see        camera_attr_foreach_supported_exposure_mode()
+ * @see        #camera_attr_exposure_mode_e
+ */
+typedef bool (*camera_attr_supported_exposure_mode_cb)(camera_attr_exposure_mode_e mode,
+        void *user_data);
+
+/**
+ * @brief Called to get each supported ISO mode.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] iso The supported ISO mode
+ * @param[in] user_data The user data passed from the foreach function
+ * @return @c true to continue with the next iteration of the loop, \n otherwise @c false to break out of the loop
+ * @pre        camera_attr_foreach_supported_iso() will invoke this callback.
+ * @see        camera_attr_foreach_supported_iso()
+ */
+typedef bool (*camera_attr_supported_iso_cb)(camera_attr_iso_e iso, void *user_data);
+
+/**
+ * @brief Called to get each supported white balance.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] wb The supported white balance mode
+ * @param[in] user_data The user data passed from the foreach function
+ * @return @c true to continue with the next iteration of the loop, \n otherwise @c false to break out of the loop
+ * @pre        camera_attr_foreach_supported_whitebalance() will invoke this callback.
+ * @see        camera_attr_foreach_supported_whitebalance()
+ * @see        #camera_attr_whitebalance_e
+ */
+typedef bool (*camera_attr_supported_whitebalance_cb)(camera_attr_whitebalance_e wb,
+        void *user_data);
+
+/**
+ * @brief Called to get each supported effect mode.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] effect The supported effect mode
+ * @param[in] user_data The user data passed from the foreach function
+ * @return @c true to continue with the next iteration of the loop, \n otherwise @c false to break out of the loop
+ * @pre        camera_attr_foreach_supported_effect() will invoke this callback.
+ * @see        camera_attr_foreach_supported_effect()
+ */
+typedef bool (*camera_attr_supported_effect_cb)(camera_attr_effect_mode_e effect,
+        void *user_data);
+
+/**
+ * @brief Called to get each supported scene mode.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] mode The supported scene mode
+ * @param[in] user_data The user data passed from the foreach function
+ * @return @c true to continue with the next iteration of the loop, \n otherwise @c false to break out of the loop
+ * @pre        camera_attr_foreach_supported_scene_mode() will invoke this callback.
+ * @see        camera_attr_foreach_supported_scene_mode()
+ * @see        #camera_attr_scene_mode_e
+ */
+typedef bool (*camera_attr_supported_scene_mode_cb)(camera_attr_scene_mode_e mode,
+        void *user_data);
+
+/**
+ * @brief Called to get each supported flash mode.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] mode The supported flash mode
+ * @param[in] user_data The user data passed from the foreach function
+ * @return @c true to continue with the next iteration of the loop, \n otherwise @c false to break out of the loop
+ * @pre        camera_attr_foreach_supported_flash_mode() will invoke this callback.
+ * @see        camera_attr_foreach_supported_flash_mode()
+ */
+typedef bool (*camera_attr_supported_flash_mode_cb)(camera_attr_flash_mode_e mode,
+        void *user_data);
+
+/**
+ * @brief Called to get each supported FPS mode.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] mode The supported FPS mode
+ * @param[in] user_data The user data passed from the foreach function
+ * @return @c true to continue with the next iteration of the loop, \n otherwise @c false to break out of the loop
+ * @pre        camera_attr_foreach_supported_fps() will invoke this callback.
+ * @see        camera_attr_foreach_supported_fps()
+ */
+typedef bool (*camera_attr_supported_fps_cb)(camera_attr_fps_e fps, void *user_data);
+
+/**
+ * @brief Called to get each supported stream flip mode.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] mode The supported stream flip mode
+ * @param[in] user_data The user data passed from the foreach function
+ * @return @c true to continue with the next iteration of the loop, \n @c false to break out of the loop
+ * @pre        camera_attr_foreach_supported_stream_flip() will invoke this callback.
+ * @see        camera_attr_foreach_supported_stream_flip()
+ */
+typedef bool (*camera_attr_supported_stream_flip_cb)(camera_flip_e flip, void *user_data);
+
+/**
+ * @brief Called to get each supported stream rotation mode.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] mode The supported stream rotation mode
+ * @param[in] user_data The user data passed from the foreach function
+ * @return @c true to continue with the next iteration of the loop, \n @c false to break out of the loop
+ * @pre        camera_attr_foreach_supported_stream_rotation() will invoke this callback.
+ * @see        camera_attr_foreach_supported_stream_rotation()
+ */
+typedef bool (*camera_attr_supported_stream_rotation_cb)(camera_rotation_e rotation, void *user_data);
+
+/**
+ * @brief Called to get each supported theater mode.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] mode The supported theater mode
+ * @param[in] user_data The user data passed from the foreach function
+ * @return @c true to continue with the next iteration of the loop, \n @c false to break out of the loop
+ * @pre        camera_attr_foreach_supported_theater_mode() will invoke this callback.
+ * @see        camera_attr_foreach_supported_theater_mode()
+ */
+typedef bool (*camera_attr_supported_theater_mode_cb)(camera_attr_theater_mode_e mode, void *user_data);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_CAMERA_ATTRIBUTES_MODULE
+ * @{
+ */
+
+/**
+ * @brief Sets the preview frame rate.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @remarks This function should be called before previewing (see legacy_camera_start_preview()).
+ * @param[in] camera The handle to the camera
+ * @param[in] fps The frame rate
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_start_preview()
+ * @see        camera_attr_get_preview_fps()
+ * @see        camera_attr_foreach_supported_fps()
+ */
+int legacy_camera_attr_set_preview_fps(camera_h camera, camera_attr_fps_e fps);
+
+/**
+ * @brief Gets the frames per second of a preview video stream.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[out] fps The frames per second of the preview video stream
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see        camera_attr_set_preview_fps()
+ * @see        camera_attr_foreach_supported_fps()
+ */
+int legacy_camera_attr_get_preview_fps(camera_h camera, camera_attr_fps_e *fps);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_CAMERA_CAPABILITY_MODULE
+ * @{
+ */
+
+/**
+ * @brief Retrieves all supported FPS modes by invoking the callback function once for each supported FPS mode.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[in] callback The callback function to invoke
+ * @param[in] user_data The user data to be passed to the callback function
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @post This function invokes legacy_camera_attr_supported_fps_cb() repeatly to get each supported FPS mode.
+ * @see        camera_attr_set_preview_fps()
+ * @see        camera_attr_get_preview_fps()
+ * @see        camera_attr_supported_fps_cb()
+ */
+int legacy_camera_attr_foreach_supported_fps(camera_h camera, camera_attr_supported_fps_cb callback,
+        void *user_data);
+
+/**
+ * @brief Retrieves all supported FPS modes by invoking the callback function once for each supported FPS mode.
+ * @since_tizen 2.4
+ * @param[in] camera The handle to the camera
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/camera
+ * @param[in] width Required preview resolution's width
+ * @param[in] height Required preview resolution's height
+ * @param[in] callback The callback function to invoke
+ * @param[in] user_data The user data to be passed to the callback function
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @post This function invokes legacy_camera_attr_supported_fps_cb() repeatly to get each supported FPS mode.
+ * @see        camera_attr_set_preview_fps()
+ * @see        camera_attr_get_preview_fps()
+ * @see        camera_attr_supported_fps_cb()
+ */
+int legacy_camera_attr_foreach_supported_fps_by_resolution(camera_h camera,  int width, int height,
+       camera_attr_supported_fps_cb callback ,void *user_data);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_CAMERA_ATTRIBUTES_MODULE
+ * @{
+ */
+
+/**
+ * @brief Sets quality of the image.
+ * @details The range for image quality is 1 to 100. If @a quality is out of range, #CAMERA_ERROR_INVALID_PARAMETER error occurred.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/camera
+ * @param[in] camera The handle to the camera
+ * @param[in] quality The quality of image (1 ~ 100)
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @pre The camera state must be set to #CAMERA_STATE_CREATED or #CAMERA_STATE_PREVIEW.
+ * @see legacy_camera_start_preview()
+ * @see        camera_attr_get_image_quality()
+ */
+int legacy_camera_attr_set_image_quality(camera_h camera, int quality);
+
+/**
+ * @brief Gets the quality of a still image, which is captured.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[out] quality The quality of the image(1 ~ 100)
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_set_image_quality()
+ */
+int legacy_camera_attr_get_image_quality(camera_h camera, int *quality);
+
+/**
+ * @brief Sets the zoom level.
+ * @details The range for the zoom level is received from legacy_camera_attr_get_zoom_range(). If @a zoom is out of range, the #CAMERA_ERROR_INVALID_PARAMETER error occurs.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/camera
+ * @param[in] camera The handle to the camera
+ * @param[in] zoom The zoom level
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_get_zoom()
+ * @see legacy_camera_attr_get_zoom_range()
+ */
+int legacy_camera_attr_set_zoom(camera_h camera, int zoom);
+
+/**
+ * @brief Gets the zoom level.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[out] zoom The zoom level
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_set_zoom()
+ * @see legacy_camera_attr_get_zoom_range()
+ */
+int legacy_camera_attr_get_zoom(camera_h camera, int *zoom);
+
+/**
+ * @brief Gets the available zoom level.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @remarks If the min value is greater than the max value, it means that this feature is not supported.
+ * @param[in] camera The handle to the camera
+ * @param[out] min The minimum zoom level
+ * @param[out] max The maximum zoom level
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_set_zoom()
+ * @see legacy_camera_attr_get_zoom()
+ */
+int legacy_camera_attr_get_zoom_range(camera_h camera , int *min , int *max);
+
+
+/**
+ * @brief Sets the auto focus mode.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/camera
+ * @param[in] camera The handle to the camera
+ * @param[in] mode The auto focus mode
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see        camera_attr_get_af_mode()
+ * @see        camera_attr_foreach_supported_af_mode()
+ * @see        #camera_attr_af_mode_e
+ */
+int legacy_camera_attr_set_af_mode(camera_h camera, camera_attr_af_mode_e mode);
+
+/**
+ * @brief Gets the auto focus mode.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/camera
+ * @param[in] camera The handle to the camera
+ * @param[out] mode The auto focus mode
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_foreach_supported_af_mode()
+ * @see legacy_camera_attr_set_af_mode()
+ * @see        #camera_attr_af_mode_e
+ */
+int legacy_camera_attr_get_af_mode(camera_h camera, camera_attr_af_mode_e *mode);
+
+/**
+ * @brief Sets auto focus area.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/camera
+ * @remarks This API is invalid in the #CAMERA_ATTR_AF_NONE mode.\n
+ *          The coordinates are mapped to preview area.
+ * @param[in] camera The handle to the camera
+ * @param[in] x The x coordinates of the focus area
+ * @param[in] y The y coordinates of the focus area
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_set_af_mode()
+ * @see legacy_camera_attr_clear_af_area()
+ */
+int legacy_camera_attr_set_af_area(camera_h camera, int x, int y);
+
+/**
+ * @brief Clears the auto focus area.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/camera
+ * @remarks The focusing area is set to the center.
+ * @param[in] camera The handle to the camera
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_set_af_mode()
+ * @see legacy_camera_attr_set_af_area()
+ */
+int legacy_camera_attr_clear_af_area(camera_h camera);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_CAMERA_CAPABILITY_MODULE
+ * @{
+ */
+
+/**
+ * @brief Retrieves all supported auto focus modes by invoking the callback function once for each supported auto focus mode.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[in] callback The callback function to invoke
+ * @param[in] user_data The user data to be passed to the callback function
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @post This function invokes legacy_camera_attr_supported_af_mode_cb() to get all the supported auto focus modes.
+ * @see legacy_camera_attr_set_af_mode()
+ * @see legacy_camera_attr_get_af_mode()
+ * @see        camera_attr_supported_af_mode_cb()
+ */
+int legacy_camera_attr_foreach_supported_af_mode(camera_h camera,
+        camera_attr_supported_af_mode_cb callback, void *user_data);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_CAMERA_ATTRIBUTES_MODULE
+ * @{
+ */
+
+/**
+ * @brief Sets the exposure mode.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/camera
+ * @param[in] camera The handle to the camera
+ * @param[in] mode The exposure mode
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_get_exposure_mode()
+ * @see legacy_camera_attr_foreach_supported_exposure_mode()
+ */
+int legacy_camera_attr_set_exposure_mode(camera_h camera, camera_attr_exposure_mode_e mode);
+
+/**
+ * @brief Gets the exposure mode.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[out] mode The exposure mode
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_set_exposure_mode()
+ * @see legacy_camera_attr_foreach_supported_exposure_mode()
+ */
+int legacy_camera_attr_get_exposure_mode(camera_h camera, camera_attr_exposure_mode_e *mode);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_CAMERA_CAPABILITY_MODULE
+ * @{
+ */
+
+/**
+ * @brief Retrieves all supported exposure modes by invoking the callback function once for each supported exposure mode.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[in] callback The callback function to be invoked
+ * @param[in] user_data The user data to be passed to the callback function
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @post This function invokes legacy_camera_attr_supported_exposure_mode_cb() to get all the supported exposure modes.
+ * @see legacy_camera_attr_set_exposure_mode()
+ * @see legacy_camera_attr_get_exposure_mode()
+ * @see        camera_attr_supported_exposure_mode_cb()
+ */
+int legacy_camera_attr_foreach_supported_exposure_mode(camera_h camera,
+        camera_attr_supported_exposure_mode_cb callback, void *user_data);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_CAMERA_ATTRIBUTES_MODULE
+ * @{
+ */
+
+/**
+ * @brief Sets the exposure value.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/camera
+ * @param[in] camera The handle to the camera
+ * @param[in] value The exposure value
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see        camera_attr_get_exposure()
+ */
+int legacy_camera_attr_set_exposure(camera_h camera, int value);
+
+/**
+ * @brief Gets the exposure value.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[out] value The exposure value
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see        camera_attr_set_exposure()
+ */
+int legacy_camera_attr_get_exposure(camera_h camera, int *value);
+
+/**
+ * @brief Gets the available exposure value.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @remarks If the min value is greater than the max value, it means that this feature is not supported.
+ * @param[in] camera The handle to the camera
+ * @param[out] min The minimum exposure value
+ * @param[out] max The maximum exposure value
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see        camera_attr_set_exposure()
+ */
+int legacy_camera_attr_get_exposure_range(camera_h camera, int *min, int *max);
+
+/**
+ * @brief Sets the ISO level.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/camera
+ * @param[in] camera The handle to the camera
+ * @param[in] iso The ISO level
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see        camera_attr_get_iso()
+ * @see legacy_camera_attr_foreach_supported_iso()
+ */
+int legacy_camera_attr_set_iso(camera_h camera, camera_attr_iso_e iso);
+
+/**
+ * @brief Gets the ISO level.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[out] iso The ISO level
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see        camera_attr_set_iso()
+ * @see legacy_camera_attr_foreach_supported_iso()
+ */
+int legacy_camera_attr_get_iso(camera_h camera, camera_attr_iso_e *iso);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_CAMERA_CAPABILITY_MODULE
+ * @{
+ */
+
+/**
+ * @brief Retrieves all supported ISO levels by invoking the callback function once for each supported ISO level.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[in] callback The callback function to be invoked
+ * @param[in] user_data        The user data to be passed to the callback function
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @post This function invokes legacy_camera_attr_supported_iso_cb() to get all the supported ISO levels.
+ * @see        camera_attr_set_iso()
+ * @see legacy_camera_attr_get_iso()
+ * @see        camera_attr_supported_iso_cb()
+ */
+int legacy_camera_attr_foreach_supported_iso(camera_h camera, camera_attr_supported_iso_cb callback,
+        void *user_data);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_CAMERA_ATTRIBUTES_MODULE
+ * @{
+ */
+
+/**
+ * @brief Sets the theater mode.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/camera
+ * @remarks If you want to display the preview image on the external display with the full screen mode, use this function.
+ * @param[in] camera The handle to the camera
+ * @param[in] mode The mode to change
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @pre        This function is valid only when the external display is connected.
+ * @see        camera_attr_get_theater_mode()
+ */
+int legacy_camera_attr_set_theater_mode(camera_h camera, camera_attr_theater_mode_e mode);
+
+/**
+ * @brief Gets the theater mode.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[in] mode Currnet theater mode
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see        camera_attr_get_theater_mode()
+ */
+int legacy_camera_attr_get_theater_mode(camera_h camera, camera_attr_theater_mode_e *mode);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_CAMERA_CAPABILITY_MODULE
+ * @{
+ */
+
+/**
+ * @brief Retrieves all supported theater modes by invoking callback function once for each supported theater modes.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[in] callback The callback function to be invoked
+ * @param[in] user_data The user data to be passed to the callback function
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @post This function invokes legacy_camera_attr_supported_theater_mode_cb() to get all supported theater modes.
+ * @see legacy_camera_attr_set_theater_mode()
+ * @see legacy_camera_attr_get_theater_mode()
+ * @see        camera_attr_supported_theater_mode_cb()
+ */
+int legacy_camera_attr_foreach_supported_theater_mode(camera_h camera,
+        camera_attr_supported_theater_mode_cb callback, void *user_data);
+
+/**
+ * @}
+ */
+
+
+/**
+ * @addtogroup CAPI_MEDIA_CAMERA_ATTRIBUTES_MODULE
+ * @{
+ */
+
+/**
+ * @brief Sets the brightness level.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/camera
+ * @param[in] camera The handle to the camera
+ * @param[in] level The brightness level
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_get_brightness()
+ * @see legacy_camera_attr_get_brightness_range()
+ */
+int legacy_camera_attr_set_brightness(camera_h camera, int level);
+
+/**
+ * @brief Gets the brightness level.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[out] level The brightness level
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_set_brightness()
+ * @see legacy_camera_attr_get_brightness_range()
+ */
+int legacy_camera_attr_get_brightness(camera_h camera, int *level);
+
+/**
+ * @brief Gets the available brightness level.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @remarks If the min value is greater than the max value, it means that this feature is not supported.
+ * @param[in] camera The handle to the camera
+ * @param[out] min The minimum brightness level
+ * @param[out] max The maximum brightness level
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_set_brightness()
+ * @see legacy_camera_attr_get_brightness()
+ */
+int legacy_camera_attr_get_brightness_range(camera_h camera, int *min, int *max);
+
+/**
+ * @brief Sets the contrast level.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/camera
+ * @param[in] camera The handle to the camera
+ * @param[in] level The contrast level
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_get_contrast()
+ * @see legacy_camera_attr_get_contrast_range()
+ */
+int legacy_camera_attr_set_contrast(camera_h camera, int level);
+
+/**
+ * @brief Gets the contrast level.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[out] level The contrast level
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_set_contrast()
+ * @see legacy_camera_attr_get_contrast_range()
+ */
+int legacy_camera_attr_get_contrast(camera_h camera, int *level);
+
+/**
+ * @brief Gets the available contrast level.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @remarks If the min value is greater than the max value, it means that this feature is not supported.
+ * @param[in] camera The handle to the camera
+ * @param[out] min The minimum contrast level
+ * @param[out] max The maximum contrast level
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_set_contrast()
+ * @see legacy_camera_attr_get_contrast()
+ */
+int legacy_camera_attr_get_contrast_range(camera_h camera, int *min , int *max);
+
+/**
+ * @brief Sets the white balance mode.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/camera
+ * @param[in] camera The handle to the camera
+ * @param[in] whitebalance The white balance mode
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_foreach_supported_whitebalance()
+ * @see legacy_camera_attr_get_whitebalance()
+ */
+int legacy_camera_attr_set_whitebalance(camera_h camera, camera_attr_whitebalance_e whitebalance);
+
+/**
+ * @brief Gets the white balance mode.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[out] whitebalance The white balance mode
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_foreach_supported_whitebalance()
+ * @see legacy_camera_attr_set_whitebalance()
+ */
+int legacy_camera_attr_get_whitebalance(camera_h camera, camera_attr_whitebalance_e *whitebalance);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_CAMERA_CAPABILITY_MODULE
+ * @{
+ */
+
+/**
+ * @brief Retrieves all supported white balances by invoking the callback function once for each supported white balance.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[in] callback The callback function to be invoked
+ * @param[in] user_data The user data to be passed to the callback function
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @post This function invokes legacy_camera_attr_supported_whitebalance_cb() to get all the supported white balances.
+ * @see legacy_camera_attr_set_whitebalance()
+ * @see legacy_camera_attr_get_whitebalance()
+ * @see        camera_attr_supported_whitebalance_cb()
+ */
+int legacy_camera_attr_foreach_supported_whitebalance(camera_h camera,
+        camera_attr_supported_whitebalance_cb callback, void *user_data);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_CAMERA_ATTRIBUTES_MODULE
+ * @{
+ */
+
+/**
+ * @brief Sets the camera effect mode.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/camera
+ * @param[in] camera The handle to the camera
+ * @param[in] effect The camera effect mode
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_foreach_supported_effect()
+ * @see legacy_camera_attr_get_effect()
+ */
+int legacy_camera_attr_set_effect(camera_h camera, camera_attr_effect_mode_e effect);
+
+
+/**
+ * @brief Gets the camera effect mode.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[out] effect The camera effect mode
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_foreach_supported_effect()
+ * @see legacy_camera_attr_set_effect()
+ */
+int legacy_camera_attr_get_effect(camera_h camera, camera_attr_effect_mode_e *effect);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_CAMERA_CAPABILITY_MODULE
+ * @{
+ */
+
+/**
+ * @brief Retrieves all supported effect modes by invoking the callback function once for each supported effect mode.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[in] callback The callback function to invoke
+ * @param[in] user_data The user data to be passed to the callback function
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @post This function invokes legacy_camera_attr_supported_effect_cb() to get all the supported effect modes.
+ * @see legacy_camera_attr_set_effect()
+ * @see legacy_camera_attr_get_effect()
+ * @see        camera_attr_supported_effect_cb()
+ */
+int legacy_camera_attr_foreach_supported_effect(camera_h camera,
+        camera_attr_supported_effect_cb callback, void *user_data);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_CAMERA_ATTRIBUTES_MODULE
+ * @{
+ */
+
+/**
+ * @brief Sets the scene mode.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/camera
+ * @param[in] camera The handle to the camera
+ * @param[in] mode The scene mode
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_foreach_supported_scene_mode()
+ * @see legacy_camera_attr_get_scene_mode()
+ */
+int legacy_camera_attr_set_scene_mode(camera_h camera, camera_attr_scene_mode_e mode);
+
+/**
+ * @brief Gets the scene mode.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[out] mode The scene mode
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see        camera_attr_foreach_supported_scene_mode()
+ * @see legacy_camera_attr_set_scene_mode()
+ */
+int legacy_camera_attr_get_scene_mode(camera_h camera, camera_attr_scene_mode_e *mode);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_CAMERA_CAPABILITY_MODULE
+ * @{
+ */
+
+/**
+ * @brief Retrieves all supported scene modes by invoking the callback function once for each supported scene mode.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[in] callback The callback function to invoke
+ * @param[in] user_data The user data to be passed to the callback function
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @post This function invokes legacy_camera_attr_supported_scene_mode_cb() to get all the supported scene modes.
+ * @see        camera_attr_set_scene_mode()
+ * @see legacy_camera_attr_get_scene_mode()
+ * @see legacy_camera_attr_supported_scene_mode_cb()
+ */
+int legacy_camera_attr_foreach_supported_scene_mode(camera_h camera,
+        camera_attr_supported_scene_mode_cb callback, void *user_data);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_CAMERA_ATTRIBUTES_MODULE
+ * @{
+ */
+
+/**
+ * @brief Enables to write EXIF(Exchangeable image file format) tags in a JPEG file.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[in] enable If @c true writing EXIF tags in a JPEG file is enabled, otherwise @c false
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see         legacy_camera_attr_is_enabled_tag()
+ */
+int legacy_camera_attr_enable_tag(camera_h camera, bool enable);
+
+/**
+ * @brief Gets the value that indicates whether writing EXIF(Exchangeable image file format) tags in a JPEG file is enabled.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[out] enabled  If @c true camera information is enabled, otherwise @c false
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see         legacy_camera_attr_enable_tag()
+ */
+int legacy_camera_attr_is_enabled_tag(camera_h camera, bool *enabled);
+
+/**
+ * @brief Sets the camera image description in the EXIF(Exchangeable image file format) tag.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[in] description The string with description
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_get_tag_image_description()
+ */
+int legacy_camera_attr_set_tag_image_description(camera_h camera, const char *description);
+
+/**
+ * @brief Gets the camera image description in EXIF(Exchangeable image file format) tag.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @remarks You must release @a description using free().
+ * @param[in] camera The handle to the camera
+ * @param[out] description A pointer to a string
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_set_tag_image_description()
+ */
+int legacy_camera_attr_get_tag_image_description(camera_h camera, char **description);
+
+/**
+ * @brief Sets the camera orientation in the EXIF(Exchangeable image file format) tag.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[in] orientation The camera orientation
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see        camera_attr_get_tag_orientation()
+ */
+int legacy_camera_attr_set_tag_orientation(camera_h camera, camera_attr_tag_orientation_e orientation);
+
+/**
+ * @brief Gets the camera orientation in the EXIF(Exchangeable image file format) tag.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[out] orientation The camera orientation
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see        camera_attr_set_tag_orientation()
+ */
+int legacy_camera_attr_get_tag_orientation(camera_h camera, camera_attr_tag_orientation_e *orientation);
+
+/**
+ * @brief Sets the software information in the EXIF(Exchangeable image file format) tag.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[in] software The software information tag
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_get_tag_software()
+ */
+int legacy_camera_attr_set_tag_software(camera_h camera, const char *software);
+
+/**
+ * @brief Gets the software information in the EXIF(Exchangeable image file format) tag.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @remarks You must release @a software using free().
+ * @param[in] camera The handle to the camera
+ * @param[out] software A pointer to a string
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_set_tag_software()
+ */
+int legacy_camera_attr_get_tag_software(camera_h camera, char **software);
+
+/**
+ * @brief Sets the geotag(GPS data) in the EXIF(Exchangeable image file format) tag.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[in] latitude The latitude data
+ * @param[in] longitude The longitude data
+ * @param[in] altitude The altitude data
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_get_geotag()
+ * @see legacy_camera_attr_remove_geotag()
+ */
+int legacy_camera_attr_set_geotag(camera_h camera, double latitude , double longitude, double altitude);
+
+/**
+ * @brief Gets the geotag(GPS data) in the EXIF(Exchangeable image file format) tag.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[out] latitude The latitude data
+ * @param[out] longitude The longitude data
+ * @param[out] altitude The altitude data
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_set_geotag()
+ * @see legacy_camera_attr_remove_geotag()
+ */
+int legacy_camera_attr_get_geotag(camera_h camera, double *latitude , double *longitude, double *altitude);
+
+/**
+ * @brief Removes the geotag(GPS data) in the EXIF(Exchangeable image file format) tag.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_set_geotag()
+ * @see legacy_camera_attr_get_geotag()
+ */
+int legacy_camera_attr_remove_geotag(camera_h camera);
+
+/**
+ * @brief Sets the camera's flash mode.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/camera
+ * @remarks Since 2.4, while setting the flash mode, if the flash was preempted by other APIs,\n
+            then this function returns #CAMERA_ERROR_DEVICE_BUSY error.
+ * @param[in] camera The handle to the camera
+ * @param[in] mode The flash mode
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @retval #CAMERA_ERROR_DEVICE_BUSY The flash was preempted by other API
+ * @see        camera_attr_foreach_supported_flash_mode()
+ * @see legacy_camera_attr_get_flash_mode()
+ */
+int legacy_camera_attr_set_flash_mode(camera_h camera, camera_attr_flash_mode_e mode);
+
+/**
+ * @brief Gets the camera's flash mode.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[out] mode The flash mode
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_foreach_supported_flash_mode()
+ * @see legacy_camera_attr_set_flash_mode()
+ */
+int legacy_camera_attr_get_flash_mode(camera_h camera, camera_attr_flash_mode_e *mode);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_CAMERA_CAPABILITY_MODULE
+ * @{
+ */
+
+/**
+ * @brief Retrieves all supported flash modes by invoking the callback function once for each supported flash mode.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[in] callback The callback function to invoke
+ * @param[in] user_data The user data passed to the callback registration function
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @post This function invokes legacy_camera_attr_supported_flash_mode_cb() to get all supported flash modes.
+ * @see        camera_attr_set_flash_mode()
+ * @see legacy_camera_attr_get_flash_mode()
+ * @see        camera_attr_supported_flash_mode_cb()
+ */
+int legacy_camera_attr_foreach_supported_flash_mode(camera_h camera,
+        camera_attr_supported_flash_mode_cb callback, void *user_data);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_CAMERA_ATTRIBUTES_MODULE
+ * @{
+ */
+
+/**
+ * @brief Gets the camera len's orientation angle.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[out] angle The orientation angle
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_set_display_rotation()
+ */
+int legacy_camera_attr_get_lens_orientation(camera_h camera, int *angle);
+
+/**
+ * @brief Sets the stream rotation.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[in] rotation The stream rotation
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @pre        The camera state must be set to #CAMERA_STATE_CREATED.
+ * @see legacy_camera_attr_get_stream_rotation()
+ */
+int legacy_camera_attr_set_stream_rotation(camera_h camera , camera_rotation_e rotation);
+
+/**
+ * @brief Gets the stream rotation.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[out] rotation        The stream rotation
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @pre        The camera state must be set to #CAMERA_STATE_CREATED.
+ * @see legacy_camera_attr_set_stream_rotation()
+ */
+int legacy_camera_attr_get_stream_rotation(camera_h camera , camera_rotation_e *rotation);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_CAMERA_CAPABILITY_MODULE
+ * @{
+ */
+
+/**
+ * @brief Retrieves all supported stream rotation modes by invoking callback function once for each supported stream rotation mode.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[in] callback The callback function to invoke
+ * @param[in] user_data The user data to be passed to the callback function
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @post This function invokes legacy_camera_attr_supported_stream_rotation_cb() to get all supported stream rotation mode.
+ * @see legacy_camera_attr_set_stream_rotation()
+ * @see legacy_camera_attr_get_stream_rotation()
+ * @see legacy_camera_attr_supported_stream_rotation_cb()
+ */
+int legacy_camera_attr_foreach_supported_stream_rotation(camera_h camera,
+        camera_attr_supported_stream_rotation_cb callback, void *user_data);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_CAMERA_ATTRIBUTES_MODULE
+ * @{
+ */
+
+/**
+ * @brief Sets the stream flip.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[in] flip The stream flip
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @pre        The camera state must be set to #CAMERA_STATE_CREATED.
+ * @see legacy_camera_attr_set_stream_rotation()
+ */
+int legacy_camera_attr_set_stream_flip(camera_h camera , camera_flip_e flip);
+
+/**
+ * @brief Gets the stream flip.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[out] flip  The stream flip
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @pre        The camera state must be set to #CAMERA_STATE_CREATED.
+ * @see legacy_camera_attr_set_stream_rotation()
+ */
+int legacy_camera_attr_get_stream_flip(camera_h camera , camera_flip_e *flip);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_CAMERA_CAPABILITY_MODULE
+ * @{
+ */
+
+/**
+ * @brief Retrieves all supported stream flip modes by invoking callback function once for each supported stream flip mode.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[in] callback The callback function to invoke
+ * @param[in] user_data The user data to be passed to the callback function
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @post This function invokes legacy_camera_attr_supported_stream_flip_cb() to get all supported stream flip mode.
+ * @see legacy_camera_attr_set_stream_flip()
+ * @see legacy_camera_attr_get_stream_flip()
+ * @see legacy_camera_attr_supported_stream_flip_cb()
+ */
+int legacy_camera_attr_foreach_supported_stream_flip(camera_h camera,
+        camera_attr_supported_stream_flip_cb callback, void *user_data);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_CAMERA_ATTRIBUTES_MODULE
+ * @{
+ */
+
+/**
+ * @brief Called when the HDR capture process is updated.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] percent The progress percentage of HDR capture
+ * @param[in] user_data The user data passed from the callback registration function
+ * @pre legacy_camera_start_capture() will invoke this callback if you register it using legacy_camera_attr_set_hdr_capture_progress_cb().
+ * @see legacy_camera_attr_get_hdr_mode()
+ * @see legacy_camera_attr_set_hdr_capture_progress_cb()
+ * @see legacy_camera_attr_unset_hdr_capture_progress_cb()
+ * @see legacy_camera_attr_is_supported_hdr_capture()
+ */
+typedef void (*camera_attr_hdr_progress_cb)(int percent, void *user_data);
+
+/**
+ * @brief Sets the mode of HDR(High dynamic range) capture.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/camera
+ * @remarks Taking multiple pictures at different exposure levels and intelligently stitching them together so that we eventually arrive at a picture that is representative in both dark and bright areas.\n
+ *          If this attribute is set to @c true. legacy_camera_attr_hdr_progress_cb() is invoked during capture.\n
+ *          If you set #CAMERA_ATTR_HDR_MODE_KEEP_ORIGINAL, the capturing callback is invoked twice. The first callback is delivering origin image data. The second callback is delivering improved image data.
+ * @param[in] camera The handle to the camera
+ * @param[in] mode The mode of HDR capture
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_get_hdr_mode()
+ * @see legacy_camera_attr_set_hdr_capture_progress_cb()
+ * @see legacy_camera_attr_unset_hdr_capture_progress_cb()
+ * @see legacy_camera_attr_is_supported_hdr_capture()
+ *
+ */
+int legacy_camera_attr_set_hdr_mode(camera_h camera, camera_attr_hdr_mode_e mode);
+
+/**
+ * @brief Gets the mode of HDR(High dynamic range) capture.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[out] mode The mode of HDR capture
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_set_hdr_mode()
+ * @see legacy_camera_attr_set_hdr_capture_progress_cb()
+ * @see legacy_camera_attr_unset_hdr_capture_progress_cb()
+ * @see legacy_camera_attr_is_supported_hdr_capture()
+ */
+int legacy_camera_attr_get_hdr_mode(camera_h camera, camera_attr_hdr_mode_e *mode);
+
+/**
+ * @brief Registers a callback function to be called when HDR capture is progressing.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @remarks This callback notifies progress of the HDR process.
+ * @param[in] camera The handle to the camera
+ * @param[in] callback The callback function to invoke
+ * @param[in] user_data The user data passed to the callback registration function
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_set_hdr_mode()
+ * @see legacy_camera_attr_get_hdr_mode()
+ * @see legacy_camera_attr_unset_hdr_capture_progress_cb()
+ * @see legacy_camera_attr_is_supported_hdr_capture()
+ */
+int legacy_camera_attr_set_hdr_capture_progress_cb(camera_h camera, camera_attr_hdr_progress_cb callback, void* user_data);
+
+/**
+ * @brief Unregisters the callback function.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_set_hdr_mode()
+ * @see legacy_camera_attr_get_hdr_mode()
+ * @see legacy_camera_attr_set_hdr_capture_progress_cb()
+ * @see legacy_camera_attr_is_supported_hdr_capture()
+ */
+int legacy_camera_attr_unset_hdr_capture_progress_cb(camera_h camera);
+
+/**
+ * @ingroup CAPI_MEDIA_CAMERA_CAPABILITY_MODULE
+ * @brief Gets the support state of HDR capture.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
+ * @param[in] camera The handle to the camera
+ * @return @c true if supported, otherwise @c false
+ * @exception #CAMERA_ERROR_NONE Successful
+ * @exception #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @exception #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @exception #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_set_hdr_mode()
+ * @see legacy_camera_attr_get_hdr_mode()
+ * @see legacy_camera_attr_set_hdr_capture_progress_cb()
+ * @see legacy_camera_attr_unset_hdr_capture_progress_cb()
+ */
+bool legacy_camera_attr_is_supported_hdr_capture(camera_h camera);
+
+/**
+ * @brief Enables/Disables the anti-shake feature.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/camera
+ * @remarks This feature is used for image capture.
+ * @param[in] camera The handle to the camera
+ * @param[in] enable If @c true the anti-shake feature is enabled, otherwise @c false
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_is_enabled_anti_shake()
+ * @see legacy_camera_attr_is_supported_anti_shake()
+ *
+ */
+int legacy_camera_attr_enable_anti_shake(camera_h camera, bool enable);
+
+/**
+ * @brief Gets the state of the anti-shake feature.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[out] enabled The state of anti-shake
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_enable_anti_shake()
+ * @see legacy_camera_attr_is_supported_anti_shake()
+ */
+int legacy_camera_attr_is_enabled_anti_shake(camera_h camera , bool *enabled);
+
+/**
+ * @ingroup CAPI_MEDIA_CAMERA_CAPABILITY_MODULE
+ * @brief Gets the support state of the anti-shake feature.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
+ * @param[in] camera The handle to the camera
+ * @return @c true if supported, otherwise @c false
+ * @exception #CAMERA_ERROR_NONE Successful
+ * @exception #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @exception #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @exception #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_enable_anti_shake()
+ * @see legacy_camera_attr_is_enabled_anti_shake()
+ */
+bool legacy_camera_attr_is_supported_anti_shake(camera_h camera);
+
+/**
+ * @brief Enables/Disables the video stabilization feature.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/camera
+ * @remarks If video stabilization is enabled, zero shutter lag is disabled.\n
+ *          This feature is used to record a video.
+ * @param[in] camera The handle to the camera
+ * @param[in] enable If @c true video stabilization is enabled, otherwise @c false
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_is_enabled_video_stabilization()
+ * @see legacy_camera_attr_is_supported_video_stabilization()
+ *
+ */
+int legacy_camera_attr_enable_video_stabilization(camera_h camera, bool enable);
+
+/**
+ * @brief Gets the state of the video stabilization feature.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[out] enabled The state of video stabilization
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_enable_video_stabilization()
+ * @see legacy_camera_attr_is_supported_video_stabilization()
+ */
+int legacy_camera_attr_is_enabled_video_stabilization(camera_h camera, bool *enabled);
+
+/**
+ * @ingroup CAPI_MEDIA_CAMERA_CAPABILITY_MODULE
+ * @brief Gets the support state of the video stabilization feature.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
+ * @param[in] camera The handle to the camera
+ * @return @c true if supported, otherwise @c false
+ * @exception #CAMERA_ERROR_NONE Successful
+ * @exception #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @exception #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @exception #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_enable_video_stabilization()
+ * @see legacy_camera_attr_is_enabled_video_stabilization()
+ */
+bool legacy_camera_attr_is_supported_video_stabilization(camera_h camera);
+
+/**
+ * @brief Enables/Disables auto contrast.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/camera
+ * @param[in] camera The handle to the camera
+ * @param[in] enable If @c true auto contrast is enabled, otherwise @c false
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_is_enabled_auto_contrast()
+ */
+int legacy_camera_attr_enable_auto_contrast(camera_h camera, bool enable);
+
+/**
+ * @brief Gets the state of auto contrast.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @param[in] camera The handle to the camera
+ * @param[out] enabled The state of auto contrast
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_enable_auto_contrast()
+ */
+int legacy_camera_attr_is_enabled_auto_contrast(camera_h camera, bool *enabled);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_CAMERA_CAPABILITY_MODULE
+ * @{
+ */
+
+/**
+ * @brief Gets state of support of auto contrast feature.
+ * @ingroup CAPI_MEDIA_CAMERA_CAPABILITY_MODULE
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
+ * @param[in] camera The handle to the camera
+ * @return true on supported, otherwise false
+ * @exception #CAMERA_ERROR_NONE Successful
+ * @exception #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @exception #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @exception #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see legacy_camera_attr_enable_auto_contrast()
+ * @see legacy_camera_attr_is_enabled_auto_contrast()
+ */
+bool legacy_camera_attr_is_supported_auto_contrast(camera_h camera);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_CAMERA_ATTRIBUTES_MODULE
+ * @{
+ */
+
+/**
+ * @brief Disables shutter sound.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @remarks In some countries, this operation is not permitted.
+ * @param[in] camera The handle to the camera
+ * @param[in] disable If @c true shutter sound is disabled, otherwise @c false
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_INVALID_OPERATION Disabling shutter sound is not permitted
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ */
+int legacy_camera_attr_disable_shutter_sound(camera_h camera, bool disable);
+
+/**
+ * @}
+ */
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __TIZEN_MULTIMEDIA_CAMERA_H__ */
+
diff --git a/legacy/include/legacy_camera_internal.h b/legacy/include/legacy_camera_internal.h
new file mode 100755 (executable)
index 0000000..3e29547
--- /dev/null
@@ -0,0 +1,287 @@
+/*
+* Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* 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 __TIZEN_MULTIMEDIA_CAMERA_INTERNAL_H__
+#define        __TIZEN_MULTIMEDIA_CAMERA_INTERNAL_H__
+#include <legacy_camera.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+  * @file camera_internal.h
+  * @brief This file contains the Camera Product-internal API for framework, related structures and enumerations.
+  */
+
+/**
+ * @internal
+ * @addtogroup CAPI_MEDIA_CAMERA_X11_DISPLAY_MODULE
+ * @{
+ */
+
+/**
+ * @ingroup CAPI_MEDIA_CAMERA_X11_DISPLAY_MODULE
+ * @brief Called when the media camera needs updated xid.
+ * @remarks If current display type is not #CAMERA_DISPLAY_TYPE_OVERLAY, no operation is performed.
+ * @param[in] user_data The user data passed from the callback registration function
+ * @return The updated xid
+ * @pre It will be invoked when camera needs updated xid and if this callback is registered using camera_set_x11_display_pixmap().
+ * @see        camera_set_x11_display_pixmap()
+ */
+typedef unsigned int (*legacy_camera_x11_pixmap_updated_cb)(void *user_data);
+
+/**
+ * @ingroup CAPI_MEDIA_CAMERA_X11_DISPLAY_MODULE
+ * @brief Sets the display rotation.
+ *
+ * @since_tizen 2.3
+ * @privlevel platform
+ * @privilege %http://tizen.org/privilege/camera
+ * @remarks This function should be called before previewing (see camera_start_preview())\n
+ *          This function is valid only for #CAMERA_DISPLAY_TYPE_OVERLAY.
+ * @param[in] camera The handle to the camera
+ * @param[in] rotation The display rotation
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
+ * @retval #CAMERA_ERROR_INVALID_OPERATION Display type is not X11
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @see camera_start_preview()
+ * @see        camera_get_x11_display_rotation()
+ */
+int legacy_camera_set_x11_display_rotation(camera_h camera, camera_rotation_e rotation);
+
+/**
+ * @ingroup CAPI_MEDIA_CAMERA_X11_DISPLAY_MODULE
+ * @brief Gets the display rotation.
+ *
+ * @since_tizen 2.3
+ * @privlevel platform
+ * @privilege %http://tizen.org/privilege/camera
+ * @remarks This function is valid only for #CAMERA_DISPLAY_TYPE_OVERLAY.
+ * @param[in] camera The handle to the camera
+ * @param[out] rotation The display rotation
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @see camera_set_x11_display_rotation()
+ */
+int legacy_camera_get_x11_display_rotation(camera_h camera, camera_rotation_e *rotation);
+
+/**
+ * @ingroup CAPI_MEDIA_CAMERA_X11_DISPLAY_MODULE
+ * @brief Sets the display flip.
+ *
+ * @since_tizen 2.3
+ * @privlevel platform
+ * @privilege %http://tizen.org/privilege/camera
+ * @remarks This function is valid only for #CAMERA_DISPLAY_TYPE_OVERLAY.
+ * @param[in] camera The handle to the camera
+ * @param[in] flip The display flip
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
+ * @retval #CAMERA_ERROR_INVALID_OPERATION Display type is not X11
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @see        camera_get_x11_display_flip()
+ */
+int legacy_camera_set_x11_display_flip(camera_h camera, camera_flip_e flip);
+
+/**
+ * @ingroup CAPI_MEDIA_CAMERA_X11_DISPLAY_MODULE
+ * @brief Gets the display flip.
+ *
+ * @since_tizen 2.3
+ * @privlevel platform
+ * @privilege %http://tizen.org/privilege/camera
+ * @remarks This function is valid only for #CAMERA_DISPLAY_TYPE_OVERLAY.
+ * @param[in] camera The handle to the camera
+ * @param[out] flip The display flip
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @see camera_set_x11_display_flip()
+ */
+int legacy_camera_get_x11_display_flip(camera_h camera, camera_flip_e *flip);
+
+/**
+ * @ingroup CAPI_MEDIA_CAMERA_X11_DISPLAY_MODULE
+ * @brief Sets the visible property for X11 display.
+ *
+ * @since_tizen 2.3
+ * @privlevel platform
+ * @privilege %http://tizen.org/privilege/camera
+ * @remarks This function is valid only for #CAMERA_DISPLAY_TYPE_OVERLAY.
+ * @param[in] camera The handle to the camera
+ * @param[in] visible The display visibility property
+ *
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @see camera_is_x11_display_visible()
+ */
+int legacy_camera_set_x11_display_visible(camera_h camera, bool visible);
+
+/**
+ * @ingroup CAPI_MEDIA_CAMERA_X11_DISPLAY_MODULE
+ * @brief Gets the visible property of X11 display.
+ *
+ * @since_tizen 2.3
+ * @privlevel platform
+ * @privilege %http://tizen.org/privilege/camera
+ * @remarks This function is valid only for #CAMERA_DISPLAY_TYPE_OVERLAY.
+ * @param[in] camera The handle to the camera
+ * @param[out] visible If @c true the camera display is visible, otherwise @c false
+ *
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @see camera_set_x11_display_visible()
+ */
+int legacy_camera_is_x11_display_visible(camera_h camera, bool *visible);
+
+/**
+ * @ingroup CAPI_MEDIA_CAMERA_X11_DISPLAY_MODULE
+ * @brief Sets the X11 display mode.
+ *
+ * @since_tizen 2.3
+ * @privlevel platform
+ * @privilege %http://tizen.org/privilege/camera
+ * @remarks This function is valid only for #CAMERA_DISPLAY_TYPE_OVERLAY.
+ * @param[in] camera The handle to the camera
+ * @param[in] mode The display mode
+ *
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @see camera_get_x11_display_mode()
+ */
+int legacy_camera_set_x11_display_mode(camera_h camera , camera_display_mode_e mode);
+
+/**
+ * @ingroup CAPI_MEDIA_CAMERA_X11_DISPLAY_MODULE
+ * @brief Gets the X11 display mode.
+ *
+ * @since_tizen 2.3
+ * @privlevel platform
+ * @privilege %http://tizen.org/privilege/camera
+ * @remarks This function is valid only for #CAMERA_DISPLAY_TYPE_OVERLAY.
+ * @param[in] camera The handle to the camera
+ * @param[out] mode The display mode
+ *
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @see camera_set_x11_display_mode()
+ */
+int legacy_camera_get_x11_display_mode(camera_h camera, camera_display_mode_e *mode);
+
+/**
+ * @brief Registers a callback function to be invoked when camera needs updated xid.
+ * @ingroup CAPI_MEDIA_CAMERA_X11_DISPLAY_MODULE
+ * @remarks This function is valid only for #CAMERA_DISPLAY_TYPE_OVERLAY.
+ * @param[in] camera The handle to the camera
+ * @param[in] callback The callback function to register
+ * @param[in] user_data        The user data to be passed to the callback function
+ *
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
+ * @pre        The camera state must be #CAMERA_STATE_CREATED by camera_create().
+ * @post camera_set_x11_display_pixmap() will be invoked.
+ *
+ * @see camera_set_x11_display_pixmap()
+ */
+int legacy_camera_set_x11_display_pixmap(camera_h camera, legacy_camera_x11_pixmap_updated_cb callback, void *user_data);
+
+/**
+ * @brief Registers a callback function to be invoked when camera needs updated xid.
+ * @ingroup CAPI_MEDIA_CAMERA_MUSED_MODULE
+ * @remarks This function is valid only for #CAMERA_DISPLAY_TYPE_OVERLAY.
+ * @param[in] camera The handle to the camera
+ * @param[in] type The type of the display
+ * @param[in] display_handle The handle of the created display
+ *
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
+ * @pre        The camera state must be #CAMERA_STATE_CREATED by camera_create().
+ * @post camera_set_mused_display() will be invoked.
+ *
+ * @see camera_set_mused_display()
+ */
+int legacy_camera_set_mused_display(camera_h camera, camera_display_type_e type);
+
+/**
+ * @brief Registers a callback function to be invoked when camera needs updated xid.
+ * @ingroup CAPI_MEDIA_CAMERA_MUSED_MODULE
+ * @remarks This function is valid only for #CAMERA_DISPLAY_TYPE_OVERLAY.
+ * @param[in] camera The handle to the camera
+ * @param[in] caps The caps information of the server's video element
+ *
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
+ * @pre        The camera state must be #CAMERA_STATE_CREATED by camera_create().
+ * @post camera_get_video_caps() will be invoked.
+ *
+ * @see camera_get_video_caps()
+ */
+int legacy_camera_get_video_caps(camera_h camera, char **caps);
+
+/**
+ * @brief Registers a callback function to be invoked when camera needs updated xid.
+ * @ingroup CAPI_MEDIA_CAMERA_MUSED_MODULE
+ * @remarks This function is valid only for #CAMERA_DISPLAY_TYPE_OVERLAY.
+ * @param[in] camera The handle to the camera
+ * @param[in] socket_path The socket file path for the display data ipc
+ *
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
+ * @pre        The camera state must be #CAMERA_STATE_CREATED by camera_create().
+ * @post camera_set_shm_socket_path_for_mused() will be invoked.
+ *
+ * @see camera_set_shm_socket_path_for_mused()
+ */
+int legacy_camera_set_shm_socket_path_for_mused(camera_h camera, char *socket_path);
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif //__TIZEN_MULTIMEDIA_CAMERA_INTERNAL_H__
diff --git a/legacy/include/legacy_camera_private.h b/legacy/include/legacy_camera_private.h
new file mode 100755 (executable)
index 0000000..7f3e856
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* 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 __TIZEN_MULTIMEDIA_CAMERA_PRIVATE_H__
+#define        __TIZEN_MULTIMEDIA_CAMERA_PRIVATE_H__
+#include <legacy_camera.h>
+#include <mm_camcorder.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define MAX_DETECTED_FACE 20
+
+typedef enum {
+       _CAMERA_EVENT_TYPE_STATE_CHANGE,
+       _CAMERA_EVENT_TYPE_FOCUS_CHANGE,
+       _CAMERA_EVENT_TYPE_CAPTURE_COMPLETE,
+       _CAMERA_EVENT_TYPE_PREVIEW,
+       _CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW,
+       _CAMERA_EVENT_TYPE_CAPTURE,
+       _CAMERA_EVENT_TYPE_ERROR,
+       _CAMERA_EVENT_TYPE_HDR_PROGRESS,
+       _CAMERA_EVENT_TYPE_INTERRUPTED,
+       _CAMERA_EVENT_TYPE_FACE_DETECTION,
+       _CAMERA_EVENT_TYPE_VIDEO_FRAME_RENDER_ERROR,
+       _CAMERA_EVENT_TYPE_NUM
+}_camera_event_e;
+
+typedef struct _camera_cb_data {
+       int event_type;
+       void *handle;
+} camera_cb_data;
+
+typedef struct _camera_s{
+       MMHandleType mm_handle;
+
+       void* user_cb[_CAMERA_EVENT_TYPE_NUM];
+       void* user_data[_CAMERA_EVENT_TYPE_NUM];
+       void* display_handle;
+#ifdef HAVE_WAYLAND
+       MMCamWaylandInfo *wl_info;
+#endif /* #ifdef HAVE_WAYLAND */
+       camera_display_type_e display_type;
+       unsigned int state;
+
+       MMMessageCallback relay_message_callback;
+       void* relay_user_data;
+       int capture_count;
+       int capture_width;
+       int capture_height;
+       bool is_continuous_shot_break;
+       bool is_capture_completed;
+       int current_capture_count;
+       int current_capture_complete_count;
+       bool capture_resolution_modified;
+       camera_detected_face_s faceinfo[MAX_DETECTED_FACE];
+       int num_of_faces;
+       bool hdr_keep_mode;
+       bool focus_area_valid;
+       bool is_used_in_recorder;
+       bool on_continuous_focusing;
+       int cached_focus_mode;
+       media_format_h pkt_fmt;
+
+       GList *cb_data_list;
+       GMutex idle_cb_lock;
+} camera_s;
+
+int _camera_get_mm_handle(camera_h camera , MMHandleType *handle);
+int _camera_set_relay_mm_message_callback(camera_h camera, MMMessageCallback callback, void *user_data);
+int __camera_start_continuous_focusing(camera_h camera);
+int _camera_set_use(camera_h camera, bool used);
+bool _camera_is_used(camera_h camera);
+void _camera_remove_cb_message(camera_s *handle);
+int _camera_get_tbm_surface_format(int in_format, uint32_t *out_format);
+int _camera_get_media_packet_mimetype(int in_format, media_format_mimetype_e *mimetype);
+int _camera_media_packet_finalize(media_packet_h pkt, int error_code, void *user_data);
+int __convert_camera_error_code(const char* func, int code);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif //__TIZEN_MULTIMEDIA_CAMERA_PRIVATE_H__
+
diff --git a/legacy/src/legacy_camera.c b/legacy/src/legacy_camera.c
new file mode 100755 (executable)
index 0000000..f2e020b
--- /dev/null
@@ -0,0 +1,4381 @@
+/*
+* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* 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.
+*/
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <mm.h>
+#include <audio-session-manager-types.h>
+#include <mm_camcorder.h>
+#include <mm_types.h>
+#include <math.h>
+#include <legacy_camera.h>
+#include <legacy_camera_private.h>
+#include <glib.h>
+#include <dlog.h>
+#include <gst/gst.h>
+#include <tbm_bufmgr.h>
+#include <tbm_surface_internal.h>
+#include <Evas.h>
+#include <Ecore.h>
+#ifdef HAVE_WAYLAND
+#include <Ecore_Wayland.h>
+#endif /* HAVE_WAYLAND */
+#include <Elementary.h>
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "TIZEN_N_CAMERA"
+
+static gboolean __mm_videostream_callback(MMCamcorderVideoStreamDataType *stream, void *user_data);
+static gboolean __mm_capture_callback(MMCamcorderCaptureDataType *frame, MMCamcorderCaptureDataType *thumbnail, void *user_data);
+
+void _camera_remove_cb_message(camera_s *handle)
+{
+       int ret = 0;
+       GList *list = NULL;
+       camera_cb_data *cb_data = NULL;
+
+       if (handle == NULL) {
+               LOGE("handle is NULL");
+               return;
+       }
+
+       LOGI("start");
+
+       g_mutex_lock(&handle->idle_cb_lock);
+
+       if (handle->cb_data_list) {
+               list = handle->cb_data_list;
+
+               while (list) {
+                       cb_data = list->data;
+                       list =  g_list_next(list);
+
+                       if (!cb_data) {
+                               LOGW("cb_data is NULL");
+                       } else {
+                               ret = g_idle_remove_by_data (cb_data);
+                               LOGW("Remove cb_data[%p]. ret[%d]", cb_data, ret);
+
+                               handle->cb_data_list = g_list_remove(handle->cb_data_list, cb_data);
+                               free(cb_data);
+                               cb_data = NULL;
+                       }
+               }
+
+               g_list_free(handle->cb_data_list);
+               handle->cb_data_list = NULL;
+       } else {
+               LOGW("There is no remained callback");
+       }
+
+       g_mutex_unlock(&handle->idle_cb_lock);
+
+       LOGI("done");
+
+       return;
+}
+
+
+int __convert_camera_error_code(const char *func, int code)
+{
+       int ret = CAMERA_ERROR_NONE;
+       const char *errorstr = NULL;
+
+       switch (code) {
+       case MM_ERROR_NONE:
+               ret = CAMERA_ERROR_NONE;
+               errorstr = "ERROR_NONE";
+               break;
+       case MM_ERROR_CAMCORDER_INVALID_ARGUMENT:
+       case MM_ERROR_COMMON_INVALID_ATTRTYPE:
+               ret = CAMERA_ERROR_INVALID_PARAMETER;
+               errorstr = "INVALID_PARAMETER";
+               break;
+       case MM_ERROR_CAMCORDER_NOT_INITIALIZED:
+       case MM_ERROR_CAMCORDER_INVALID_STATE:
+               ret = CAMERA_ERROR_INVALID_STATE;
+               errorstr = "INVALID_STATE";
+               break;
+       case MM_ERROR_CAMCORDER_DEVICE_NOT_FOUND:
+               ret = CAMERA_ERROR_DEVICE_NOT_FOUND;
+               errorstr = "DEVICE_NOT_FOUND";
+               break;
+       case MM_ERROR_CAMCORDER_DEVICE_BUSY:
+       case MM_ERROR_CAMCORDER_DEVICE_OPEN:
+       case MM_ERROR_CAMCORDER_CMD_IS_RUNNING:
+               ret = CAMERA_ERROR_DEVICE_BUSY;
+               errorstr = "DEVICE_BUSY";
+               break;
+       case MM_ERROR_CAMCORDER_DEVICE:
+       case MM_ERROR_CAMCORDER_DEVICE_IO:
+       case MM_ERROR_CAMCORDER_DEVICE_TIMEOUT:
+       case MM_ERROR_CAMCORDER_DEVICE_WRONG_JPEG:
+       case MM_ERROR_CAMCORDER_DEVICE_LACK_BUFFER:
+               ret = CAMERA_ERROR_DEVICE;
+               errorstr = "ERROR_DEVICE";
+               break;
+       case MM_ERROR_CAMCORDER_GST_CORE:
+       case MM_ERROR_CAMCORDER_GST_LIBRARY:
+       case MM_ERROR_CAMCORDER_GST_RESOURCE:
+       case MM_ERROR_CAMCORDER_GST_STREAM:
+       case MM_ERROR_CAMCORDER_GST_STATECHANGE:
+       case MM_ERROR_CAMCORDER_GST_NEGOTIATION:
+       case MM_ERROR_CAMCORDER_GST_LINK:
+       case MM_ERROR_CAMCORDER_GST_FLOW_ERROR:
+       case MM_ERROR_CAMCORDER_ENCODER:
+       case MM_ERROR_CAMCORDER_ENCODER_BUFFER:
+       case MM_ERROR_CAMCORDER_ENCODER_WRONG_TYPE:
+       case MM_ERROR_CAMCORDER_ENCODER_WORKING:
+       case MM_ERROR_CAMCORDER_INTERNAL:
+       case MM_ERROR_CAMCORDER_RESPONSE_TIMEOUT:
+       case MM_ERROR_CAMCORDER_DSP_FAIL:
+       case MM_ERROR_CAMCORDER_AUDIO_EMPTY:
+       case MM_ERROR_CAMCORDER_CREATE_CONFIGURE:
+       case MM_ERROR_CAMCORDER_FILE_SIZE_OVER:
+       case MM_ERROR_CAMCORDER_DISPLAY_DEVICE_OFF:
+       case MM_ERROR_CAMCORDER_INVALID_CONDITION:
+               ret = CAMERA_ERROR_INVALID_OPERATION;
+               errorstr = "INVALID_OPERATION";
+               break;
+       case MM_ERROR_CAMCORDER_RESOURCE_CREATION:
+       case MM_ERROR_COMMON_OUT_OF_MEMORY:
+               ret = CAMERA_ERROR_OUT_OF_MEMORY;
+               errorstr = "OUT_OF_MEMORY";
+               break;
+       case MM_ERROR_POLICY_BLOCKED:
+               ret = CAMERA_ERROR_SOUND_POLICY;
+               errorstr = "ERROR_SOUND_POLICY";
+               break;
+       case MM_ERROR_POLICY_BLOCKED_BY_CALL:
+               ret = CAMERA_ERROR_SOUND_POLICY_BY_CALL;
+               errorstr = "ERROR_SOUND_POLICY_BY_CALL";
+               break;
+       case MM_ERROR_POLICY_BLOCKED_BY_ALARM:
+               ret = CAMERA_ERROR_SOUND_POLICY_BY_ALARM;
+               errorstr = "ERROR_SOUND_POLICY_BY_ALARM";
+               break;
+       case MM_ERROR_POLICY_RESTRICTED:
+               ret = CAMERA_ERROR_SECURITY_RESTRICTED;
+               errorstr = "ERROR_RESTRICTED";
+               break;
+       case MM_ERROR_CAMCORDER_DEVICE_REG_TROUBLE:
+               ret = CAMERA_ERROR_ESD;
+               errorstr = "ERROR_ESD";
+               break;
+       case MM_ERROR_COMMON_INVALID_PERMISSION:
+               ret = CAMERA_ERROR_PERMISSION_DENIED;
+               errorstr = "ERROR_PERMISSION_DENIED";
+               break;
+       case MM_ERROR_COMMON_OUT_OF_ARRAY:
+       case MM_ERROR_COMMON_OUT_OF_RANGE:
+       case MM_ERROR_COMMON_ATTR_NOT_EXIST:
+       case MM_ERROR_CAMCORDER_NOT_SUPPORTED:
+               ret = CAMERA_ERROR_NOT_SUPPORTED;
+               errorstr = "ERROR_NOT_SUPPORTED";
+               break;
+       default:
+               ret = CAMERA_ERROR_INVALID_OPERATION;
+               errorstr = "INVALID_OPERATION";
+       }
+
+       if (code != MM_ERROR_NONE) {
+               LOGE("[%s] %s(0x%08x) : core frameworks error code(0x%08x)", func ? func : "NULL_FUNC", errorstr, ret, code);
+       }
+
+       return ret;
+}
+
+
+static gboolean __mm_videostream_callback(MMCamcorderVideoStreamDataType *stream, void *user_data)
+{
+       if (user_data == NULL || stream == NULL) {
+               return 0;
+       }
+
+       camera_s *handle = (camera_s *)user_data;
+
+       if (handle->user_cb[_CAMERA_EVENT_TYPE_PREVIEW]) {
+               camera_preview_data_s frame;
+
+               if (stream->format == MM_PIXEL_FORMAT_ITLV_JPEG_UYVY) {
+                       frame.format  = MM_PIXEL_FORMAT_UYVY;
+               } else {
+                       frame.format = stream->format;
+               }
+               frame.width = stream->width;
+               frame.height = stream->height;
+               frame.timestamp = stream->timestamp;
+               frame.num_of_planes = stream->num_planes;
+
+               switch (stream->data_type) {
+               case MM_CAM_STREAM_DATA_YUV420:
+                       frame.data.single_plane.yuv = stream->data.yuv420.yuv;
+                       frame.data.single_plane.size = stream->data.yuv420.length_yuv;
+                       break;
+               case MM_CAM_STREAM_DATA_YUV422:
+                       frame.data.single_plane.yuv = stream->data.yuv422.yuv;
+                       frame.data.single_plane.size = stream->data.yuv422.length_yuv;
+                       break;
+               case MM_CAM_STREAM_DATA_YUV420SP:
+                       frame.data.double_plane.y = stream->data.yuv420sp.y;
+                       frame.data.double_plane.uv = stream->data.yuv420sp.uv;
+                       frame.data.double_plane.y_size = stream->data.yuv420sp.length_y;
+                       frame.data.double_plane.uv_size = stream->data.yuv420sp.length_uv;
+                       break;
+               case MM_CAM_STREAM_DATA_YUV420P:
+                       frame.data.triple_plane.y = stream->data.yuv420p.y;
+                       frame.data.triple_plane.u = stream->data.yuv420p.u;
+                       frame.data.triple_plane.v = stream->data.yuv420p.v;
+                       frame.data.triple_plane.y_size = stream->data.yuv420p.length_y;
+                       frame.data.triple_plane.u_size = stream->data.yuv420p.length_u;
+                       frame.data.triple_plane.v_size = stream->data.yuv420p.length_v;
+                       break;
+               case MM_CAM_STREAM_DATA_YUV422P:
+                       frame.data.triple_plane.y = stream->data.yuv422p.y;
+                       frame.data.triple_plane.u = stream->data.yuv422p.u;
+                       frame.data.triple_plane.v = stream->data.yuv422p.v;
+                       frame.data.triple_plane.y_size = stream->data.yuv422p.length_y;
+                       frame.data.triple_plane.u_size = stream->data.yuv422p.length_u;
+                       frame.data.triple_plane.v_size = stream->data.yuv422p.length_v;
+                       break;
+               default :
+                       break;
+               }
+
+               ((camera_preview_cb)handle->user_cb[_CAMERA_EVENT_TYPE_PREVIEW])(&frame, handle->user_data[_CAMERA_EVENT_TYPE_PREVIEW]);
+       }
+
+       if (handle->user_cb[_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW]) {
+               media_packet_h pkt = NULL;
+               tbm_surface_h tsurf = NULL;
+               uint32_t bo_format = 0;
+               int i;
+               int bo_num;
+               int ret = 0;
+               media_format_mimetype_e mimetype = MEDIA_FORMAT_NV12;
+               bool make_pkt_fmt = false;
+               tbm_surface_info_s tsurf_info;
+
+               memset(&tsurf_info, 0x0, sizeof(tbm_surface_info_s));
+
+               /* create tbm surface */
+               for (i = 0, bo_num = 0 ; i < BUFFER_MAX_PLANE_NUM ; i++) {
+                       if (stream->bo[i]) {
+                               bo_num++;
+                       }
+                       tsurf_info.planes[i].stride = stream->stride[i];
+               }
+
+               /* get tbm surface format */
+               ret = _camera_get_tbm_surface_format(stream->format, &bo_format);
+               ret |= _camera_get_media_packet_mimetype(stream->format, &mimetype);
+
+               if (bo_num > 0 && ret == CAMERA_ERROR_NONE) {
+                       tsurf_info.width = stream->width;
+                       tsurf_info.height = stream->height;
+                       tsurf_info.format = bo_format;
+                       tsurf_info.bpp = tbm_surface_internal_get_bpp(bo_format);
+                       tsurf_info.num_planes = tbm_surface_internal_get_num_planes(bo_format);
+
+                       switch (bo_format) {
+                       case TBM_FORMAT_NV12:
+                       case TBM_FORMAT_NV21:
+                               tsurf_info.planes[0].size = stream->stride[0] * stream->elevation[0];
+                               tsurf_info.planes[1].size = stream->stride[1] * stream->elevation[1];
+                               tsurf_info.planes[0].offset = 0;
+                               if (bo_num == 1) {
+                                       tsurf_info.planes[1].offset = tsurf_info.planes[0].size;
+                               }
+                               tsurf_info.size = tsurf_info.planes[0].size + tsurf_info.planes[1].size;
+                               break;
+                       case TBM_FORMAT_YUV420:
+                       case TBM_FORMAT_YVU420:
+                               tsurf_info.planes[0].size = stream->stride[0] * stream->elevation[0];
+                               tsurf_info.planes[1].size = stream->stride[1] * stream->elevation[1];
+                               tsurf_info.planes[2].size = stream->stride[2] * stream->elevation[2];
+                               tsurf_info.planes[0].offset = 0;
+                               if (bo_num == 1) {
+                                       tsurf_info.planes[1].offset = tsurf_info.planes[0].size;
+                                       tsurf_info.planes[2].offset = tsurf_info.planes[0].size + tsurf_info.planes[1].size;
+                               }
+                               tsurf_info.size = tsurf_info.planes[0].size + tsurf_info.planes[1].size + tsurf_info.planes[2].size;
+                               break;
+                       case TBM_FORMAT_UYVY:
+                       case TBM_FORMAT_YUYV:
+                               tsurf_info.planes[0].size = (stream->stride[0] * stream->elevation[0]) << 1;
+                               tsurf_info.planes[0].offset = 0;
+                               tsurf_info.size = tsurf_info.planes[0].size;
+                               break;
+                       default:
+                               break;
+                       }
+
+                       tsurf = tbm_surface_internal_create_with_bos(&tsurf_info, (tbm_bo *)stream->bo, bo_num);
+                       /*LOGD("tbm surface %p", tsurf);*/
+               }
+
+               if (tsurf) {
+                       /* check media packet format */
+                       if (handle->pkt_fmt) {
+                               int pkt_fmt_width = 0;
+                               int pkt_fmt_height = 0;
+                               media_format_mimetype_e pkt_fmt_mimetype = MEDIA_FORMAT_NV12;
+
+                               media_format_get_video_info(handle->pkt_fmt, &pkt_fmt_mimetype, &pkt_fmt_width, &pkt_fmt_height, NULL, NULL);
+                               if (pkt_fmt_mimetype != mimetype ||
+                                   pkt_fmt_width != stream->width ||
+                                   pkt_fmt_height != stream->height) {
+                                       LOGW("different format. current 0x%x, %dx%d, new 0x%x, %dx%d",
+                                            pkt_fmt_mimetype, pkt_fmt_width, pkt_fmt_height, mimetype, stream->width, stream->height);
+                                       media_format_unref(handle->pkt_fmt);
+                                       handle->pkt_fmt = NULL;
+                                       make_pkt_fmt = true;
+                               }
+                       } else {
+                               make_pkt_fmt = true;
+                       }
+
+                       /* create packet format */
+                       if (make_pkt_fmt) {
+                               LOGW("make new pkt_fmt - mimetype 0x%x, %dx%d", mimetype, stream->width, stream->height);
+                               ret = media_format_create(&handle->pkt_fmt);
+                               if (ret == MEDIA_FORMAT_ERROR_NONE) {
+                                       ret = media_format_set_video_mime(handle->pkt_fmt, mimetype);
+                                       ret |= media_format_set_video_width(handle->pkt_fmt, stream->width);
+                                       ret |= media_format_set_video_height(handle->pkt_fmt, stream->height);
+                                       LOGW("media_format_set_video_mime,width,height ret : 0x%x", ret);
+                               } else {
+                                       LOGW("media_format_create failed");
+                               }
+                       }
+
+                       /* create media packet */
+                       ret = media_packet_create_from_tbm_surface(handle->pkt_fmt, tsurf, (media_packet_finalize_cb)_camera_media_packet_finalize, (void *)handle, &pkt);
+                       if (ret != MEDIA_PACKET_ERROR_NONE) {
+                               LOGE("media_packet_create_from_tbm_surface failed");
+
+                               tbm_surface_destroy(tsurf);
+                               tsurf = NULL;
+                       }
+               } else {
+                       LOGE("failed to create tbm surface %dx%d, format %d, bo_num %d", stream->width, stream->height, stream->format, bo_num);
+               }
+
+               if (pkt) {
+                       /*LOGD("media packet %p, internal buffer %p", pkt, stream->internal_buffer);*/
+
+                       /* set internal buffer */
+                       ret = media_packet_set_extra(pkt, stream->internal_buffer);
+                       if (ret != MEDIA_PACKET_ERROR_NONE) {
+                               LOGE("media_packet_set_extra failed");
+
+                               media_packet_destroy(pkt);
+                               pkt = NULL;
+                       } else {
+                               /* set timestamp : msec -> nsec */
+                               if (media_packet_set_pts(pkt, (uint64_t)(stream->timestamp) * 1000000) != MEDIA_PACKET_ERROR_NONE) {
+                                       LOGW("media_packet_set_pts failed");
+                               }
+
+                               /* increase ref count of gst buffer */
+                               gst_buffer_ref((GstBuffer *)stream->internal_buffer);
+
+                               /* call media packet callback */
+                               ((camera_media_packet_preview_cb)handle->user_cb[_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW])(pkt, handle->user_data[_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW]);
+                       }
+               }
+       }
+
+       return 1;
+}
+
+
+static gboolean __mm_capture_callback(MMCamcorderCaptureDataType *frame, MMCamcorderCaptureDataType *thumbnail, void *user_data)
+{
+       if (user_data == NULL || frame == NULL) {
+               return 0;
+       }
+
+       camera_s *handle = (camera_s *)user_data;
+       int ret = MM_ERROR_NONE;
+       unsigned char *exif = NULL;
+       int exif_size = 0;
+       MMCamcorderCaptureDataType *scrnl = NULL;
+       int scrnl_size = 0;
+
+       handle->current_capture_count++;
+
+       if (handle->user_cb[_CAMERA_EVENT_TYPE_CAPTURE]) {
+               camera_image_data_s image = { NULL, 0, 0, 0, 0, NULL, 0 };
+               camera_image_data_s thumb = { NULL, 0, 0, 0, 0, NULL, 0 };
+               camera_image_data_s postview = { NULL, 0, 0, 0, 0, NULL, 0 };
+
+               if (frame) {
+                       image.data = frame->data;
+                       image.size = frame->length;
+                       image.width = frame->width;
+                       image.height = frame->height;
+                       image.format = frame->format;
+
+                       ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                                         "captured-exif-raw-data", &exif, &exif_size,
+                                                         NULL);
+                       if (ret == MM_ERROR_NONE) {
+                               image.exif = exif;
+                               image.exif_size = exif_size;
+                       }
+               }
+
+               if (thumbnail) {
+                       thumb.data = thumbnail->data;
+                       thumb.size = thumbnail->length;
+                       thumb.width = thumbnail->width;
+                       thumb.height = thumbnail->height;
+                       thumb.format = thumbnail->format;
+               }
+
+               ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                                 "captured-screennail", &scrnl, &scrnl_size,
+                                                 NULL);
+               if (ret == MM_ERROR_NONE && scrnl) {
+                       postview.data = scrnl->data;
+                       postview.size = scrnl->length;
+                       postview.width = scrnl->width;
+                       postview.height = scrnl->height;
+                       postview.format = scrnl->format;
+               }
+
+               ((camera_capturing_cb)handle->user_cb[_CAMERA_EVENT_TYPE_CAPTURE])(&image,
+                                                                                  scrnl ? &postview : NULL,
+                                                                                  thumbnail ? &thumb : NULL,
+                                                                                  handle->user_data[_CAMERA_EVENT_TYPE_CAPTURE]);
+       }
+
+       /* update captured state */
+       if (handle->capture_count == 1 && handle->hdr_keep_mode) {
+               if (handle->current_capture_count == 2) {
+                       handle->is_capture_completed = true;
+               }
+       } else if (handle->capture_count == handle->current_capture_count ||
+                  handle->is_continuous_shot_break) {
+               handle->is_capture_completed = true;
+       }
+
+       return 1;
+}
+
+
+static camera_state_e __camera_state_convert(MMCamcorderStateType mm_state)
+{
+       camera_state_e state = CAMERA_STATE_NONE;
+
+       switch (mm_state) {
+       case MM_CAMCORDER_STATE_NONE:
+               state = CAMERA_STATE_NONE;
+               break;
+       case MM_CAMCORDER_STATE_NULL:
+               state = CAMERA_STATE_CREATED;
+               break;
+       case MM_CAMCORDER_STATE_READY:
+               state = CAMERA_STATE_CREATED;
+               break;
+       case MM_CAMCORDER_STATE_PREPARE:
+               state = CAMERA_STATE_PREVIEW;
+               break;
+       case MM_CAMCORDER_STATE_CAPTURING:
+               state = CAMERA_STATE_CAPTURING;
+               break;
+       case MM_CAMCORDER_STATE_RECORDING:
+               state = CAMERA_STATE_PREVIEW;
+               break;
+       case MM_CAMCORDER_STATE_PAUSED:
+               state = CAMERA_STATE_PREVIEW;
+               break;
+       default:
+               state = CAMERA_STATE_NONE;
+               break;
+       }
+
+       return state;
+}
+
+
+static int __mm_camera_message_callback(int message, void *param, void *user_data)
+{
+       if (user_data == NULL || param == NULL) {
+               return 0;
+       }
+
+       int i = 0;
+       int camera_error = 0;
+       camera_s *handle = (camera_s *)user_data;
+       MMMessageParamType *m = (MMMessageParamType *)param;
+       camera_state_e previous_state;
+       camera_policy_e policy = CAMERA_POLICY_NONE;
+       MMCamFaceDetectInfo *cam_fd_info = NULL;
+
+       if (handle->relay_message_callback) {
+               handle->relay_message_callback(message, param, handle->relay_user_data);
+       }
+
+       switch (message) {
+       case MM_MESSAGE_CAMCORDER_STATE_CHANGED:
+       case MM_MESSAGE_CAMCORDER_STATE_CHANGED_BY_ASM:
+       case MM_MESSAGE_CAMCORDER_STATE_CHANGED_BY_SECURITY:
+               if (message == MM_MESSAGE_CAMCORDER_STATE_CHANGED &&
+                   (m->state.previous < MM_CAMCORDER_STATE_NONE ||
+                    m->state.previous > MM_CAMCORDER_STATE_PAUSED ||
+                    m->state.code != 0)) {
+                       LOGI( "Invalid state changed message");
+                       break;
+               }
+
+               previous_state = handle->state;
+               handle->state = __camera_state_convert(m->state.current );
+
+               if (message == MM_MESSAGE_CAMCORDER_STATE_CHANGED_BY_ASM) {
+                       switch (m->state.code) {
+                       case ASM_EVENT_SOURCE_CALL_START:
+                       case ASM_EVENT_SOURCE_CALL_END:
+                               policy = CAMERA_POLICY_SOUND_BY_CALL;
+                               LOGW("CAMERA_POLICY_SOUND_BY_CALL");
+                               break;
+                       case ASM_EVENT_SOURCE_ALARM_START:
+                       case ASM_EVENT_SOURCE_ALARM_END:
+                               policy = CAMERA_POLICY_SOUND_BY_ALARM;
+                               LOGW("CAMERA_POLICY_SOUND_BY_ALARM");
+                               break;
+                       default:
+                               policy = CAMERA_POLICY_SOUND;
+                               LOGW("CAMERA_POLICY_SOUND");
+                               break;
+                       }
+               } else if (message == MM_MESSAGE_CAMCORDER_STATE_CHANGED_BY_SECURITY) {
+                       policy = CAMERA_POLICY_SECURITY;
+                       LOGW("CAMERA_POLICY_SECURITY");
+               }
+
+               if (previous_state != handle->state && handle->user_cb[_CAMERA_EVENT_TYPE_STATE_CHANGE]) {
+                       ((camera_state_changed_cb)handle->user_cb[_CAMERA_EVENT_TYPE_STATE_CHANGE])(previous_state,
+                                                                                                   handle->state,
+                                                                                                   policy,
+                                                                                                   handle->user_data[_CAMERA_EVENT_TYPE_STATE_CHANGE]);
+               }
+
+               /* should change intermediate state MM_CAMCORDER_STATE_READY is not valid in capi , change to NULL state */
+               if (policy != CAMERA_POLICY_NONE &&
+                   m->state.current == MM_CAMCORDER_STATE_NULL) {
+                       if (handle->user_cb[_CAMERA_EVENT_TYPE_INTERRUPTED]) {
+                               ((camera_interrupted_cb)handle->user_cb[_CAMERA_EVENT_TYPE_INTERRUPTED])(policy,
+                                                                                                        previous_state,
+                                                                                                        handle->state,
+                                                                                                        handle->user_data[_CAMERA_EVENT_TYPE_INTERRUPTED]);
+                       } else {
+                               LOGW("_CAMERA_EVENT_TYPE_INTERRUPTED cb is NULL");
+                       }
+               }
+               break;
+       case MM_MESSAGE_CAMCORDER_FOCUS_CHANGED :
+               if (handle->user_cb[_CAMERA_EVENT_TYPE_FOCUS_CHANGE]) {
+                       ((camera_focus_changed_cb)handle->user_cb[_CAMERA_EVENT_TYPE_FOCUS_CHANGE])(m->code,
+                                                                                                   handle->user_data[_CAMERA_EVENT_TYPE_FOCUS_CHANGE]);
+               }
+               break;
+       case MM_MESSAGE_CAMCORDER_CAPTURED:
+               handle->current_capture_complete_count = m->code;
+               if (handle->capture_count == 1 ||
+                   m->code == handle->capture_count ||
+                   (handle->is_continuous_shot_break &&
+                    handle->state == CAMERA_STATE_CAPTURING)) {
+                       /* pseudo state change */
+                       previous_state = handle->state ;
+                       handle->state = CAMERA_STATE_CAPTURED;
+                       if (previous_state != handle->state &&
+                           handle->user_cb[_CAMERA_EVENT_TYPE_STATE_CHANGE]) {
+                               ((camera_state_changed_cb)handle->user_cb[_CAMERA_EVENT_TYPE_STATE_CHANGE])(previous_state,
+                                                                                                           handle->state,
+                                                                                                           0,
+                                                                                                           handle->user_data[_CAMERA_EVENT_TYPE_STATE_CHANGE]);
+                       }
+                       if (handle->user_cb[_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE]) {
+                               ((camera_capture_completed_cb)handle->user_cb[_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE])(handle->user_data[_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE]);
+                       }
+               }
+               break;
+       case MM_MESSAGE_CAMCORDER_VIDEO_SNAPSHOT_CAPTURED:
+               if (handle->user_cb[_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE]) {
+                       ((camera_capture_completed_cb)handle->user_cb[_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE])(handle->user_data[_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE]);
+               }
+               break;
+       case MM_MESSAGE_CAMCORDER_ERROR:
+               switch (m->code) {
+               case MM_ERROR_CAMCORDER_DEVICE :
+               case MM_ERROR_CAMCORDER_DEVICE_TIMEOUT:
+               case MM_ERROR_CAMCORDER_DEVICE_WRONG_JPEG:
+                       camera_error = CAMERA_ERROR_DEVICE;
+                       break;
+               case MM_ERROR_CAMCORDER_GST_CORE:
+               case MM_ERROR_CAMCORDER_GST_LIBRARY:
+               case MM_ERROR_CAMCORDER_GST_RESOURCE:
+               case MM_ERROR_CAMCORDER_GST_STREAM:
+               case MM_ERROR_CAMCORDER_GST_NEGOTIATION:
+               case MM_ERROR_CAMCORDER_GST_FLOW_ERROR:
+               case MM_ERROR_CAMCORDER_ENCODER:
+               case MM_ERROR_CAMCORDER_ENCODER_BUFFER:
+               case MM_ERROR_CAMCORDER_ENCODER_WORKING:
+               case MM_ERROR_CAMCORDER_MNOTE_CREATION:
+               case MM_ERROR_CAMCORDER_MNOTE_ADD_ENTRY:
+               case MM_ERROR_CAMCORDER_INTERNAL:
+               case MM_ERROR_FILE_NOT_FOUND:
+               case MM_ERROR_FILE_READ:
+                       camera_error = CAMERA_ERROR_INVALID_OPERATION;
+                       break;
+               case MM_ERROR_CAMCORDER_LOW_MEMORY:
+               case MM_ERROR_CAMCORDER_MNOTE_MALLOC:
+                       camera_error = CAMERA_ERROR_OUT_OF_MEMORY;
+                       break;
+               case MM_ERROR_CAMCORDER_DEVICE_REG_TROUBLE:
+                       camera_error = CAMERA_ERROR_ESD;
+                       break;
+               default :
+                       camera_error = CAMERA_ERROR_INVALID_OPERATION;
+                       break;
+               }
+
+               /* set capture completed flag as true to release camera handle */
+               handle->is_capture_completed = true;
+
+               if (camera_error != 0 && handle->user_cb[_CAMERA_EVENT_TYPE_ERROR]) {
+                       ((camera_error_cb)handle->user_cb[_CAMERA_EVENT_TYPE_ERROR])(camera_error,
+                                                                                    handle->state,
+                                                                                    handle->user_data[_CAMERA_EVENT_TYPE_ERROR]);
+               }
+
+               break;
+       case MM_MESSAGE_CAMCORDER_HDR_PROGRESS:
+               if (handle->user_cb[_CAMERA_EVENT_TYPE_HDR_PROGRESS]) {
+                       ((camera_attr_hdr_progress_cb)handle->user_cb[_CAMERA_EVENT_TYPE_HDR_PROGRESS])(m->code,
+                                                                                                       handle->user_data[_CAMERA_EVENT_TYPE_HDR_PROGRESS]);
+               }
+               break;
+       case MM_MESSAGE_CAMCORDER_FACE_DETECT_INFO:
+               cam_fd_info = (MMCamFaceDetectInfo *)(m->data);
+               if (cam_fd_info) {
+                       camera_detected_face_s faces[cam_fd_info->num_of_faces];
+                       handle->num_of_faces = cam_fd_info->num_of_faces > MAX_DETECTED_FACE ? MAX_DETECTED_FACE : cam_fd_info->num_of_faces;
+
+                       for (i = 0 ; i < handle->num_of_faces ; i++) {
+                               faces[i].id = cam_fd_info->face_info[i].id;
+                               faces[i].score = cam_fd_info->face_info[i].score;
+                               faces[i].x = cam_fd_info->face_info[i].rect.x;
+                               faces[i].y = cam_fd_info->face_info[i].rect.y;
+                               faces[i].width = cam_fd_info->face_info[i].rect.width;
+                               faces[i].height = cam_fd_info->face_info[i].rect.height;
+                               handle->faceinfo[i] = faces[i]; //cache face coordinate
+                       }
+
+                       if (handle->user_cb[_CAMERA_EVENT_TYPE_FACE_DETECTION]) {
+                               ((camera_face_detected_cb)handle->user_cb[_CAMERA_EVENT_TYPE_FACE_DETECTION])(faces,
+                                                                                                             handle->num_of_faces,
+                                                                                                             handle->user_data[_CAMERA_EVENT_TYPE_FACE_DETECTION]);
+                       }
+               } else {
+                       handle->num_of_faces = 0;
+               }
+               break;
+       default:
+               break;
+       }
+
+       return 1;
+}
+
+
+static int __capture_completed_event_cb(void *data)
+{
+       camera_s *handle = (camera_s *)data;
+       camera_state_e previous_state = CAMERA_STATE_NONE;
+
+       if (handle == NULL) {
+               LOGE("handle is NULL");
+               return false;
+       }
+
+       if (handle->current_capture_count > 0 &&
+           handle->current_capture_count == handle->current_capture_complete_count &&
+           handle->state == CAMERA_STATE_CAPTURING) {
+               /* pseudo state change */
+               previous_state = handle->state;
+               handle->state = CAMERA_STATE_CAPTURED;
+
+               if (previous_state != handle->state &&
+                   handle->user_cb[_CAMERA_EVENT_TYPE_STATE_CHANGE]) {
+                       ((camera_state_changed_cb)handle->user_cb[_CAMERA_EVENT_TYPE_STATE_CHANGE])(previous_state,
+                                                                                                   handle->state,
+                                                                                                   0,
+                                                                                                   handle->user_data[_CAMERA_EVENT_TYPE_STATE_CHANGE]);
+               }
+
+               if (handle->user_cb[_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE]) {
+                       ((camera_capture_completed_cb)handle->user_cb[_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE])(handle->user_data[_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE]);
+               }
+       }
+
+       return false;
+}
+
+int legacy_camera_create(camera_device_e device, camera_h* camera)
+{
+       if (camera == NULL){
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;;
+       MMCamPreset info;
+       int preview_format;
+       int rotation;
+       camera_s *handle = NULL;
+       char *error = NULL;
+
+       LOGW("device name = [%d]",device);
+
+       info.videodev_type = device;
+
+       handle = (camera_s*)malloc( sizeof(camera_s) );
+       if (handle == NULL) {
+               LOGE("malloc fail");
+               return CAMERA_ERROR_OUT_OF_MEMORY;
+       }
+
+       memset(handle, 0x0, sizeof(camera_s));
+
+       ret = mm_camcorder_create(&handle->mm_handle, &info);
+       if (ret != MM_ERROR_NONE) {
+               free(handle);
+               return __convert_camera_error_code(__func__,ret);
+       }
+
+       preview_format = MM_PIXEL_FORMAT_YUYV;
+       rotation = MM_DISPLAY_ROTATION_NONE;
+       ret = mm_camcorder_get_attributes(handle->mm_handle, &error,
+                                         MMCAM_RECOMMEND_PREVIEW_FORMAT_FOR_CAPTURE, &preview_format,
+                                         MMCAM_RECOMMEND_DISPLAY_ROTATION, &rotation,
+                                         MMCAM_CAPTURE_WIDTH, &handle->capture_width,
+                                         MMCAM_CAPTURE_HEIGHT, &handle->capture_height,
+                                         NULL);
+       if (ret != MM_ERROR_NONE) {
+               LOGE("mm_camcorder_get_attributes fail(%x)", ret);
+               if (error) {
+                       LOGE("failed attribute name %s", error);
+                       free(error);
+               }
+
+               mm_camcorder_destroy(handle->mm_handle);
+               free(handle);
+
+               return __convert_camera_error_code(__func__, ret);
+       }
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, &error,
+                                         MMCAM_MODE, MM_CAMCORDER_MODE_VIDEO_CAPTURE,
+                                         MMCAM_CAMERA_FORMAT,  preview_format,
+                                         MMCAM_IMAGE_ENCODER, MM_IMAGE_CODEC_JPEG,
+                                         MMCAM_CAPTURE_FORMAT,  MM_PIXEL_FORMAT_ENCODED,
+                                         MMCAM_DISPLAY_SURFACE, MM_DISPLAY_SURFACE_NULL,
+                                         MMCAM_DISPLAY_ROTATION, rotation,
+                                         MMCAM_CAPTURE_COUNT, 1,
+                                         NULL);
+
+       handle->display_type = CAMERA_DISPLAY_TYPE_NONE;
+
+       if (ret != MM_ERROR_NONE) {
+               LOGE("mm_camcorder_set_attributes fail(%x)", ret);
+               if (error) {
+                       LOGE("failed attribute name %s", error);
+                       free(error);
+               }
+
+               mm_camcorder_destroy(handle->mm_handle);
+               free(handle);
+
+               return __convert_camera_error_code(__func__, ret);
+       }
+
+       handle->state = CAMERA_STATE_CREATED;
+       handle->relay_message_callback = NULL;
+       handle->relay_user_data = NULL;
+       handle->capture_resolution_modified = false;
+       handle->hdr_keep_mode = false;
+       handle->focus_area_valid = false;
+       handle->is_used_in_recorder = false;
+       handle->on_continuous_focusing = false;
+       handle->cached_focus_mode = -1;
+
+       g_mutex_init(&handle->idle_cb_lock);
+
+       mm_camcorder_set_message_callback(handle->mm_handle,
+                                         __mm_camera_message_callback,
+                                         (void*)handle);
+
+       *camera = (camera_h)handle;
+
+       LOGW("camera handle %p", handle);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_destroy(camera_h camera)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       if (handle->is_used_in_recorder) {
+               LOGE("camera is using in another recorder.");
+               return CAMERA_ERROR_INVALID_OPERATION;
+       }
+
+       LOGW("camera handle %p", handle);
+
+       if (handle->pkt_fmt) {
+               media_format_unref(handle->pkt_fmt);
+               handle->pkt_fmt = NULL;
+       }
+
+       ret = mm_camcorder_destroy(handle->mm_handle);
+       if (ret == MM_ERROR_NONE) {
+               _camera_remove_cb_message(handle);
+               g_mutex_clear(&handle->idle_cb_lock);
+#ifdef HAVE_WAYLAND
+               if (handle->wl_info) {
+                       free(handle->wl_info);
+                       handle->wl_info = NULL;
+               }
+#endif /* HAVE_WAYLAND */
+               free(handle);
+       }
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_start_preview(camera_h camera)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+       camera_state_e capi_state = CAMERA_STATE_NONE;
+       MMCamcorderStateType mm_state = MM_CAMCORDER_STATE_NONE;
+
+       legacy_camera_get_state(camera, &capi_state);
+       if (capi_state == CAMERA_STATE_CAPTURED) {
+               ret = mm_camcorder_capture_stop(handle->mm_handle);
+               return __convert_camera_error_code(__func__, ret);
+       }
+
+       /* for receving MM_MESSAGE_CAMCORDER_CAPTURED evnet must be seted capture callback */
+       mm_camcorder_set_video_capture_callback(handle->mm_handle,
+                                               (mm_camcorder_video_capture_callback)__mm_capture_callback,
+                                               (void *)handle);
+
+       mm_camcorder_get_state(handle->mm_handle, &mm_state);
+       if (mm_state != MM_CAMCORDER_STATE_READY) {
+               ret = mm_camcorder_realize(handle->mm_handle);
+               if (ret != MM_ERROR_NONE) {
+                       LOGE("mm_camcorder_realize failed 0x%x", ret);
+                       return __convert_camera_error_code(__func__, ret);
+               }
+       }
+
+       ret = mm_camcorder_start(handle->mm_handle);
+       if (ret != MM_ERROR_NONE) {
+               LOGE("mm_camcorder_start failed 0x%x, call mm_camcorder_unrealize", ret);
+               mm_camcorder_unrealize(handle->mm_handle);
+       }
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_stop_preview(camera_h camera)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;;
+       camera_s *handle = (camera_s *)camera;
+       MMCamcorderStateType state = MM_CAMCORDER_STATE_NONE;
+
+       mm_camcorder_get_state(handle->mm_handle, &state);
+       if (state == MM_CAMCORDER_STATE_PREPARE) {
+               ret = mm_camcorder_stop(handle->mm_handle);
+               if (ret != MM_ERROR_NONE) {
+                       LOGE("mm_camcorder_stop failed 0x%x", ret);
+                       return __convert_camera_error_code(__func__, ret);
+               }
+       }
+
+       legacy_camera_stop_face_detection(camera);
+
+       ret = mm_camcorder_unrealize(handle->mm_handle);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_start_capture(camera_h camera, camera_capturing_cb capturing_cb, camera_capture_completed_cb completed_cb, void *user_data)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       camera_s *handle = (camera_s *)camera;
+       int ret = MM_ERROR_NONE;
+       MMCamcorderStateType state = MM_CAMCORDER_STATE_NONE;
+
+       mm_camcorder_get_state(handle->mm_handle, &state);
+       if (state != MM_CAMCORDER_STATE_PREPARE &&
+           state != MM_CAMCORDER_STATE_RECORDING &&
+           state != MM_CAMCORDER_STATE_PAUSED) {
+               LOGE("INVALID_STATE(0x%08x)", CAMERA_ERROR_INVALID_STATE);
+               return CAMERA_ERROR_INVALID_STATE;
+       }
+
+       if (handle->capture_resolution_modified) {
+               mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                           MMCAM_CAPTURE_WIDTH, handle->capture_width,
+                                           MMCAM_CAPTURE_HEIGHT, handle->capture_height,
+                                           NULL);
+
+               handle->capture_resolution_modified = false;
+       }
+
+       mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                   MMCAM_CAPTURE_COUNT, 1,
+                                   NULL);
+
+       handle->capture_count = 1;
+       handle->is_continuous_shot_break = false;
+       handle->current_capture_count = 0;
+       handle->current_capture_complete_count = 0;
+       handle->is_capture_completed = false;
+
+       handle->user_cb[_CAMERA_EVENT_TYPE_CAPTURE] = (void *)capturing_cb;
+       handle->user_data[_CAMERA_EVENT_TYPE_CAPTURE] = (void *)user_data;
+       handle->user_cb[_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE] = (void *)completed_cb;
+       handle->user_data[_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE] = (void *)user_data;
+
+       ret = mm_camcorder_capture_start(handle->mm_handle);
+       if (ret != MM_ERROR_NONE) {
+               handle->user_cb[_CAMERA_EVENT_TYPE_CAPTURE] = NULL;
+               handle->user_data[_CAMERA_EVENT_TYPE_CAPTURE] = NULL;
+               handle->user_cb[_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE] = NULL;
+               handle->user_data[_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE] = NULL;
+       }
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+bool legacy_camera_is_supported_continuous_capture(camera_h camera)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return false;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+       MMCamAttrsInfo info;
+
+       ret = mm_camcorder_get_attribute_info(handle->mm_handle, MMCAM_CAPTURE_COUNT, &info);
+       set_last_result(__convert_camera_error_code(__func__, ret));
+       if (ret != MM_ERROR_NONE) {
+               LOGE("MMCAM_CAPTURE_COUNT info get failed 0x%x", ret);
+               return false;
+       }
+
+       if (info.int_range.max > 1) {
+               return true;
+       } else {
+               return false;
+       }
+}
+
+
+int legacy_camera_start_continuous_capture(camera_h camera, int count, int interval, camera_capturing_cb capturing_cb, camera_capture_completed_cb completed_cb, void *user_data)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       if (legacy_camera_is_supported_continuous_capture(camera) == false) {
+               LOGE("NOT_SUPPORTED(0x%08x)", CAMERA_ERROR_NOT_SUPPORTED);
+               return CAMERA_ERROR_NOT_SUPPORTED;
+       }
+
+       if (count < 2 || interval < 0) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       camera_s *handle = (camera_s *)camera;
+       MMCamcorderStateType state = MM_CAMCORDER_STATE_NONE;
+       int supported_zsl = FALSE;
+       int ret = MM_ERROR_NONE;
+
+       mm_camcorder_get_state(handle->mm_handle, &state);
+       if (state != MM_CAMCORDER_STATE_PREPARE) {
+               LOGE("INVALID_STATE(0x%08x)", CAMERA_ERROR_INVALID_STATE);
+               return CAMERA_ERROR_INVALID_STATE;
+       }
+
+       supported_zsl = FALSE;
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         MMCAM_CAPTURE_COUNT, count,
+                                         MMCAM_CAPTURE_INTERVAL, interval,
+                                         NULL);
+       if (ret != MM_ERROR_NONE) {
+               LOGE("error set continuous shot attribute 0x%x", ret);
+               return __convert_camera_error_code(__func__, ret);
+       }
+
+       handle->capture_count = count;
+       handle->is_continuous_shot_break = false;
+       handle->current_capture_count = 0;
+       handle->current_capture_complete_count = 0;
+       handle->is_capture_completed = false;
+
+       ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                         MMCAM_SUPPORT_ZSL_CAPTURE, &supported_zsl,
+                                         NULL);
+       if (ret != MM_ERROR_NONE) {
+               LOGE("(%x) error get continuous shot attribute", ret);
+       }
+
+       if (!supported_zsl) {
+               int preview_width;
+               int preview_height;
+               int capture_width;
+               int capture_height;
+
+               mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                           MMCAM_CAMERA_WIDTH, &preview_width,
+                                           MMCAM_CAMERA_HEIGHT, &preview_height,
+                                           MMCAM_CAPTURE_WIDTH, &capture_width,
+                                           MMCAM_CAPTURE_HEIGHT, &capture_height,
+                                           NULL);
+
+               if (preview_width != capture_width || preview_height != capture_height) {
+                       mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                                   MMCAM_CAPTURE_WIDTH, preview_width,
+                                                   MMCAM_CAPTURE_HEIGHT, preview_height,
+                                                   NULL);
+
+                       handle->capture_resolution_modified = true;
+               }
+       }
+
+       handle->user_cb[_CAMERA_EVENT_TYPE_CAPTURE] = (void *)capturing_cb;
+       handle->user_data[_CAMERA_EVENT_TYPE_CAPTURE] = (void *)user_data;
+       handle->user_cb[_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE] = (void *)completed_cb;
+       handle->user_data[_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE] = (void *)user_data;
+
+       ret = mm_camcorder_capture_start(handle->mm_handle);
+       if(ret != MM_ERROR_NONE ){
+               LOGE("mm_camcorder_capture_start failed 0x%x", ret);
+               handle->user_cb[_CAMERA_EVENT_TYPE_CAPTURE] = NULL;
+               handle->user_data[_CAMERA_EVENT_TYPE_CAPTURE] = NULL;
+               handle->user_cb[_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE] = NULL;
+               handle->user_data[_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE] = NULL;
+       }
+
+       return __convert_camera_error_code(__func__, ret);
+
+}
+
+
+int legacy_camera_stop_continuous_capture(camera_h camera)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       if (legacy_camera_is_supported_continuous_capture(camera) == false) {
+               LOGE("NOT_SUPPORTED(0x%08x)", CAMERA_ERROR_NOT_SUPPORTED);
+               return CAMERA_ERROR_NOT_SUPPORTED;
+       }
+
+       camera_s *handle = (camera_s *)camera;
+       int ret = MM_ERROR_NONE;
+       camera_state_e state = CAMERA_STATE_NONE;
+
+       legacy_camera_get_state(camera, &state);
+       if (state != CAMERA_STATE_CAPTURING && handle->capture_count > 1) {
+               LOGE("INVALID_STATE(0x%08x)", CAMERA_ERROR_INVALID_STATE);
+               return CAMERA_ERROR_INVALID_STATE;
+       }
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         "capture-break-cont-shot", 1,
+                                         NULL);
+       if (ret == MM_ERROR_NONE) {
+               handle->is_continuous_shot_break = true;
+
+               if (handle->current_capture_count > 0) {
+                       handle->is_capture_completed = true;
+               }
+
+               g_idle_add_full(G_PRIORITY_DEFAULT_IDLE, __capture_completed_event_cb, handle, NULL);
+       }
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+bool legacy_camera_is_supported_face_detection(camera_h camera)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return false;
+       }
+
+       int i = 0;
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+       MMCamAttrsInfo info;
+
+       ret = mm_camcorder_get_attribute_info(handle->mm_handle, MMCAM_DETECT_MODE , &info);
+       set_last_result(__convert_camera_error_code(__func__, ret));
+       if (ret != MM_ERROR_NONE) {
+               LOGE("MMCAM_DETECT_MODE get attr info failed");
+               return false;
+       }
+
+       if (info.validity_type == MM_CAM_ATTRS_VALID_TYPE_INT_ARRAY) {
+               for (i = 0 ; i < info.int_array.count ; i++) {
+                       if (info.int_array.array[i] == MM_CAMCORDER_DETECT_MODE_ON) {
+                               LOGD("face detection supported");
+                               return true;
+                       }
+               }
+       }
+
+       LOGD("face detection NOT supported");
+
+       return false;
+}
+
+
+bool legacy_camera_is_supported_zero_shutter_lag(camera_h camera)
+{
+       int ret = MM_ERROR_NONE;
+       int supported_zsl = false;
+       camera_s *handle = (camera_s *)camera;
+
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return false;
+       }
+
+       ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                         MMCAM_SUPPORT_ZSL_CAPTURE, &supported_zsl,
+                                         NULL);
+       set_last_result(__convert_camera_error_code(__func__, ret));
+       if (ret != MM_ERROR_NONE) {
+               LOGE("MMCAM_SUPPORT_ZSL_CAPTURE get failed");
+               return false;
+       }
+
+       LOGD("support zero shutter lag : %d", supported_zsl);
+
+       return supported_zsl;
+}
+
+
+bool legacy_camera_is_supported_media_packet_preview_cb(camera_h camera)
+{
+       int ret = MM_ERROR_NONE;
+       int supported = false;
+       camera_s *handle = (camera_s *)camera;
+
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return false;
+       }
+
+       ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                         MMCAM_SUPPORT_MEDIA_PACKET_PREVIEW_CB, &supported,
+                                         NULL);
+       set_last_result(__convert_camera_error_code(__func__, ret));
+       if (ret != MM_ERROR_NONE) {
+               LOGE("MMCAM_SUPPORT_MEDIA_PACKET_PREVIEW_CB get failed");
+               return false;
+       }
+
+       LOGD("support media packet preview callback : %d", supported);
+
+       return supported;
+}
+
+
+int legacy_camera_get_device_count(camera_h camera, int *device_count)
+{
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       if (camera == NULL || device_count == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                         MMCAM_CAMERA_DEVICE_COUNT, device_count,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_start_face_detection(camera_h camera, camera_face_detected_cb callback, void *user_data)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       if (legacy_camera_is_supported_face_detection(camera) == false) {
+               LOGE("NOT_SUPPORTED(0x%08x)", CAMERA_ERROR_NOT_SUPPORTED);
+               return CAMERA_ERROR_NOT_SUPPORTED;
+       }
+
+       camera_s *handle = (camera_s *)camera;
+       camera_state_e state = CAMERA_STATE_NONE;
+       int ret = MM_ERROR_NONE;
+
+       legacy_camera_get_state(camera, &state);
+       if (state != CAMERA_STATE_PREVIEW) {
+               LOGE("INVALID_STATE(0x%08x)", CAMERA_ERROR_INVALID_STATE);
+               return CAMERA_ERROR_INVALID_STATE;
+       }
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         MMCAM_DETECT_MODE, MM_CAMCORDER_DETECT_MODE_ON,
+                                         NULL);
+       if (ret == MM_ERROR_NONE) {
+               handle->user_cb[_CAMERA_EVENT_TYPE_FACE_DETECTION] = (void *)callback;
+               handle->user_data[_CAMERA_EVENT_TYPE_FACE_DETECTION] = (void *)user_data;
+               handle->num_of_faces = 0;
+       }
+
+       return __convert_camera_error_code(__func__,ret);
+}
+
+
+int legacy_camera_stop_face_detection(camera_h camera)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       camera_s *handle = (camera_s *)camera;
+       int ret = MM_ERROR_NONE;
+
+       if (legacy_camera_is_supported_face_detection(camera) == false) {
+               LOGE("NOT_SUPPORTED(0x%08x)", CAMERA_ERROR_NOT_SUPPORTED);
+               return CAMERA_ERROR_NOT_SUPPORTED;
+       }
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         MMCAM_DETECT_MODE, MM_CAMCORDER_DETECT_MODE_OFF,
+                                         NULL);
+       if (ret == MM_ERROR_NONE) {
+               handle->user_cb[_CAMERA_EVENT_TYPE_FACE_DETECTION] = NULL;
+               handle->user_data[_CAMERA_EVENT_TYPE_FACE_DETECTION] = NULL;
+               handle->num_of_faces = 0;
+       }
+
+       return __convert_camera_error_code(__func__,ret);
+}
+
+
+int legacy_camera_get_state(camera_h camera, camera_state_e *state)
+{
+       if (camera == NULL || state == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       camera_s *handle = (camera_s *)camera;
+       camera_state_e capi_state = CAMERA_STATE_NONE;
+       MMCamcorderStateType mmstate = MM_CAMCORDER_STATE_NONE;
+
+       mm_camcorder_get_state(handle->mm_handle, &mmstate);
+       capi_state = __camera_state_convert(mmstate);
+
+       if ((handle->state == CAMERA_STATE_CAPTURED || handle->is_capture_completed) &&
+            (handle->current_capture_count > 0 || handle->is_capture_completed) &&
+           mmstate == MM_CAMCORDER_STATE_CAPTURING) {
+               capi_state = CAMERA_STATE_CAPTURED;
+       }
+
+       *state = capi_state;
+
+       return CAMERA_ERROR_NONE;
+}
+
+
+int legacy_camera_start_focusing(camera_h camera, bool continuous)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       camera_s *handle = (camera_s *)camera;
+
+       if (handle->cached_focus_mode != -1) {
+               LOGD("apply cached focus mode %d", handle->cached_focus_mode);
+
+               mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                           MMCAM_CAMERA_AF_SCAN_RANGE, handle->cached_focus_mode,
+                                           NULL);
+
+               handle->cached_focus_mode = -1;
+       }
+
+       if (continuous) {
+               return __camera_start_continuous_focusing(camera);
+       } else {
+               mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                           MMCAM_CAMERA_FOCUS_MODE, handle->focus_area_valid ? \
+                                                                    MM_CAMCORDER_FOCUS_MODE_TOUCH_AUTO : MM_CAMCORDER_FOCUS_MODE_AUTO,
+                                           NULL);
+
+               return __convert_camera_error_code(__func__, mm_camcorder_start_focusing(((camera_s *)camera)->mm_handle));
+       }
+}
+
+
+int __camera_start_continuous_focusing(camera_h camera)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       camera_s *handle = (camera_s *)camera;
+       int ret = MM_ERROR_NONE;
+       int mode = MM_CAMCORDER_FOCUS_MODE_NONE;
+
+       handle->on_continuous_focusing = true;
+       mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                   MMCAM_CAMERA_FOCUS_MODE, &mode,
+                                   NULL);
+
+       if (mode == MM_CAMCORDER_FOCUS_MODE_CONTINUOUS) {
+               ret = mm_camcorder_start_focusing(handle->mm_handle);
+       } else {
+               ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                                 MMCAM_CAMERA_FOCUS_MODE, MM_CAMCORDER_FOCUS_MODE_CONTINUOUS,
+                                                 NULL);
+       }
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_cancel_focusing(camera_h camera)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       camera_s *handle = (camera_s *)camera;
+
+       handle->on_continuous_focusing = false;
+
+       return __convert_camera_error_code(__func__, mm_camcorder_stop_focusing(handle->mm_handle));
+}
+
+
+int legacy_camera_set_display(camera_h camera, camera_display_type_e type, camera_display_h display)
+{
+       int ret = MM_ERROR_NONE;
+       int set_surface = MM_DISPLAY_SURFACE_X;
+       void *set_handle = NULL;
+       camera_s *handle = NULL;
+
+       Evas_Object *obj = NULL;
+       const char *object_type = NULL;
+
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       if (type != CAMERA_DISPLAY_TYPE_NONE && display == NULL) {
+               LOGE("display type[%d] is not NONE, but display handle is NULL", type);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       handle = (camera_s *)camera;
+       handle->display_type = type;
+
+       if (type == CAMERA_DISPLAY_TYPE_NONE) {
+               /* NULL surface */
+               set_surface = MM_DISPLAY_SURFACE_NULL;
+               handle->display_handle = 0;
+
+               LOGD("display type NONE");
+       } else {
+               obj = (Evas_Object *)display;
+               object_type = evas_object_type_get(obj);
+               if (object_type) {
+                       if (type == CAMERA_DISPLAY_TYPE_OVERLAY && !strcmp(object_type, "elm_win")) {
+#ifdef HAVE_WAYLAND
+                               MMCamWaylandInfo *wl_info = (MMCamWaylandInfo *)malloc(sizeof(MMCamWaylandInfo));
+
+                               if (wl_info == NULL) {
+                                       LOGE("wl_info alloc failed : %d", sizeof(MMCamWaylandInfo));
+                                       return __convert_camera_error_code(__func__, MM_ERROR_CAMCORDER_LOW_MEMORY);
+                               }
+
+                               memset(wl_info, 0x0, sizeof(MMCamWaylandInfo));
+
+                               wl_info->evas_obj = (void *)obj;
+                               wl_info->window = (void *)elm_win_wl_window_get(obj);
+                               wl_info->surface = (void *)ecore_wl_window_surface_get(wl_info->window);
+                               wl_info->display = (void *)ecore_wl_display_get();
+
+                               if (wl_info->window == NULL || wl_info->surface == NULL || wl_info->display == NULL) {
+                                       LOGE("something is NULL %p, %p, %p", wl_info->window, wl_info->surface, wl_info->display);
+                                       free(wl_info);
+                                       return __convert_camera_error_code(__func__, MM_ERROR_CAMCORDER_INTERNAL);
+                               }
+
+                               evas_object_geometry_get(obj, &wl_info->window_x, &wl_info->window_y,
+                                                             &wl_info->window_width, &wl_info->window_height);
+
+                               if (handle->wl_info) {
+                                       free(handle->wl_info);
+                                       handle->wl_info = NULL;
+                               }
+
+                               /* set wayland info */
+                               handle->wl_info = (void *)wl_info;
+                               set_surface = MM_DISPLAY_SURFACE_X;
+                               set_handle = (void *)wl_info;
+
+                               LOGD("wayland obj %p, window %p, surface %p, display %p, size %d,%d,%dx%d",
+                                    wl_info->evas_obj, wl_info->window, wl_info->surface, wl_info->display,
+                                    wl_info->window_x, wl_info->window_y, wl_info->window_width, wl_info->window_height);
+#else /* HAVE_WAYLAND */
+                               /* x window overlay surface */
+                               handle->display_handle = (void *)elm_win_xwindow_get(obj);
+                               set_surface = MM_DISPLAY_SURFACE_X;
+                               set_handle = &(handle->display_handle);
+
+                               LOGD("display type OVERLAY : handle %p, %d", set_handle, (int)handle->display_handle);
+#endif /* HAVE_WAYLAND */
+                       } else if (type == CAMERA_DISPLAY_TYPE_EVAS && !strcmp(object_type, "image")) {
+                               /* evas object surface */
+                               handle->display_handle = display;
+                               set_surface = MM_DISPLAY_SURFACE_EVAS;
+                               set_handle = display;
+
+                               LOGD("display type EVAS : handle %p", set_handle);
+                       } else {
+                               LOGE("unknown evas object [%p,%s] or type [%d] mismatch", obj, object_type, type);
+                               return CAMERA_ERROR_INVALID_PARAMETER;
+                       }
+               } else {
+                       LOGE("failed to get evas object type from %p", obj);
+                       return CAMERA_ERROR_INVALID_PARAMETER;
+               }
+       }
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         MMCAM_DISPLAY_DEVICE, MM_DISPLAY_DEVICE_MAINLCD,
+                                         MMCAM_DISPLAY_SURFACE, set_surface,
+                                         NULL);
+
+       if (ret == MM_ERROR_NONE && type != CAMERA_DISPLAY_TYPE_NONE) {
+               ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                                 MMCAM_DISPLAY_HANDLE, set_handle, sizeof(void *),
+                                                 NULL);
+       }
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_set_preview_resolution(camera_h camera, int width, int height)
+{
+       if( camera == NULL){
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+       MMCamAttrsInfo info;
+       int mm_fps = 0;
+       int i = 0;
+
+       mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                   MMCAM_CAMERA_FPS, &mm_fps,
+                                   NULL);
+
+       ret = mm_camcorder_get_fps_list_by_resolution(handle->mm_handle, width, height, &info);
+       if (ret != MM_ERROR_NONE) {
+               return __convert_camera_error_code(__func__, ret);
+       }
+
+       for (i = 0 ; i < info.int_array.count ; i++) {
+               if (info.int_array.array[i] == mm_fps) {
+                       break;
+               }
+               if (i == info.int_array.count - 1) {
+                       LOGE("Not supported resolution: Current set Resolution's FPS is not supported in wanted resolution.");
+                       return CAMERA_ERROR_NOT_SUPPORTED;
+               }
+       }
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         MMCAM_CAMERA_WIDTH, width,
+                                         MMCAM_CAMERA_HEIGHT, height,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_set_capture_resolution(camera_h camera,  int width, int height)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         MMCAM_CAPTURE_WIDTH, width,
+                                         MMCAM_CAPTURE_HEIGHT, height,
+                                         NULL);
+       if (ret == MM_ERROR_NONE) {
+               handle->capture_width = width;
+               handle->capture_height = height;
+       }
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_set_capture_format(camera_h camera, camera_pixel_format_e format)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         MMCAM_CAPTURE_FORMAT, format,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_set_preview_format(camera_h camera, camera_pixel_format_e format)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int i = 0;
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       if (format == CAMERA_PIXEL_FORMAT_UYVY) {
+               bool supported_ITLV_UYVY = false;
+               MMCamAttrsInfo supported_format;
+               ret = mm_camcorder_get_attribute_info(handle->mm_handle, MMCAM_CAMERA_FORMAT , &supported_format);
+               for (i = 0 ; i < supported_format.int_array.count ; i++) {
+                       if (supported_format.int_array.array[i] == MM_PIXEL_FORMAT_ITLV_JPEG_UYVY) {
+                               supported_ITLV_UYVY = true;
+                       }
+               }
+               ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                                 MMCAM_CAMERA_FORMAT, supported_ITLV_UYVY ? MM_PIXEL_FORMAT_ITLV_JPEG_UYVY : MM_PIXEL_FORMAT_UYVY,
+                                                 NULL);
+       } else {
+               ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                                 MMCAM_CAMERA_FORMAT, format,
+                                                 NULL);
+       }
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_get_preview_resolution(camera_h camera, int *width, int *height)
+{
+       if (camera == NULL || width == NULL || height == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                         MMCAM_CAMERA_WIDTH, width,
+                                         MMCAM_CAMERA_HEIGHT, height,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_set_display_rotation(camera_h camera, camera_rotation_e rotation)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       if (rotation > CAMERA_ROTATION_270) {
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         MMCAM_DISPLAY_ROTATION, rotation,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_get_display_rotation(camera_h camera, camera_rotation_e *rotation)
+{
+       if (camera == NULL || rotation == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                         MMCAM_DISPLAY_ROTATION, rotation,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_set_display_flip(camera_h camera, camera_flip_e flip)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       if (flip > CAMERA_FLIP_BOTH) {
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         MMCAM_DISPLAY_FLIP, flip,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_get_display_flip(camera_h camera, camera_flip_e *flip)
+{
+       if (camera == NULL || flip == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                         MMCAM_DISPLAY_FLIP, flip,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_set_display_visible(camera_h camera, bool visible)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         MMCAM_DISPLAY_VISIBLE, visible,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_is_display_visible(camera_h camera, bool* visible)
+{
+       if (camera == NULL || visible == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       int result = false;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                         MMCAM_DISPLAY_VISIBLE, &result,
+                                         NULL);
+
+       if (ret == MM_ERROR_NONE) {
+               *visible = result;
+       }
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_set_display_mode(camera_h camera, camera_display_mode_e mode)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       if (mode > CAMERA_DISPLAY_MODE_CROPPED_FULL) {
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         MMCAM_DISPLAY_GEOMETRY_METHOD, mode,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_get_display_mode(camera_h camera, camera_display_mode_e *mode)
+{
+       if (camera == NULL || mode == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                         MMCAM_DISPLAY_GEOMETRY_METHOD, mode,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_get_capture_resolution(camera_h camera, int *width, int *height)
+{
+       if (camera == NULL || width == NULL || height == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       camera_s *handle = (camera_s *)camera;
+
+       *width = handle->capture_width;
+       *height = handle->capture_height;
+
+       return CAMERA_ERROR_NONE;
+}
+
+
+int legacy_camera_get_capture_format(camera_h camera, camera_pixel_format_e *format)
+{
+       if (camera == NULL || format == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                         MMCAM_CAPTURE_FORMAT, format,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_get_preview_format(camera_h camera, camera_pixel_format_e *format)
+{
+       if (camera == NULL || format == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                         MMCAM_CAMERA_FORMAT, format,
+                                         NULL);
+
+       if ((MMPixelFormatType)*format == MM_PIXEL_FORMAT_ITLV_JPEG_UYVY) {
+               *format = CAMERA_PIXEL_FORMAT_UYVY;
+       }
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_set_preview_cb(camera_h camera, camera_preview_cb callback, void *user_data)
+{
+       if (camera == NULL || callback == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       camera_s *handle = (camera_s *)camera;
+       handle->user_cb[_CAMERA_EVENT_TYPE_PREVIEW] = (void *)callback;
+       handle->user_data[_CAMERA_EVENT_TYPE_PREVIEW] = (void *)user_data;
+
+       mm_camcorder_set_video_stream_callback(handle->mm_handle,
+                                              (mm_camcorder_video_stream_callback)__mm_videostream_callback,
+                                              (void *)handle);
+
+       return CAMERA_ERROR_NONE;
+}
+
+
+int legacy_camera_unset_preview_cb(camera_h camera)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       camera_s *handle = (camera_s *)camera;
+
+       if (handle->user_cb[_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW] == NULL) {
+               mm_camcorder_set_video_stream_callback(handle->mm_handle,
+                                                      (mm_camcorder_video_stream_callback)NULL,
+                                                      (void *)NULL);
+       }
+
+       handle->user_cb[_CAMERA_EVENT_TYPE_PREVIEW] = (void *)NULL;
+       handle->user_data[_CAMERA_EVENT_TYPE_PREVIEW] = (void *)NULL;
+
+       return CAMERA_ERROR_NONE;
+}
+
+
+int legacy_camera_set_media_packet_preview_cb(camera_h camera, camera_media_packet_preview_cb callback, void *user_data)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x) - handle", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       if (legacy_camera_is_supported_media_packet_preview_cb(camera) == false) {
+               LOGE("NOT SUPPORTED");
+               return CAMERA_ERROR_NOT_SUPPORTED;
+       }
+
+       if (callback == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x) - callback", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       camera_s *handle = (camera_s *)camera;
+       handle->user_cb[_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW] = (void *)callback;
+       handle->user_data[_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW] = (void *)user_data;
+
+       mm_camcorder_set_video_stream_callback(handle->mm_handle,
+                                              (mm_camcorder_video_stream_callback)__mm_videostream_callback,
+                                              (void *)handle);
+
+       return CAMERA_ERROR_NONE;
+}
+
+
+int legacy_camera_unset_media_packet_preview_cb(camera_h camera)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       if (legacy_camera_is_supported_media_packet_preview_cb(camera) == false) {
+               LOGE("NOT SUPPORTED");
+               return CAMERA_ERROR_NOT_SUPPORTED;
+       }
+
+       camera_s *handle = (camera_s *)camera;
+
+       if (handle->user_cb[_CAMERA_EVENT_TYPE_PREVIEW] == NULL) {
+               mm_camcorder_set_video_stream_callback(handle->mm_handle,
+                                                      (mm_camcorder_video_stream_callback)NULL,
+                                                      (void *)NULL);
+       }
+
+       handle->user_cb[_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW] = (void *)NULL;
+       handle->user_data[_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW] = (void *)NULL;
+
+       return CAMERA_ERROR_NONE;
+}
+
+
+int legacy_camera_set_state_changed_cb(camera_h camera, camera_state_changed_cb callback, void *user_data)
+{
+       if (camera == NULL || callback == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       camera_s *handle = (camera_s *)camera;
+       handle->user_cb[_CAMERA_EVENT_TYPE_STATE_CHANGE] = (void *)callback;
+       handle->user_data[_CAMERA_EVENT_TYPE_STATE_CHANGE] = (void *)user_data;
+
+       return CAMERA_ERROR_NONE;
+}
+
+
+int legacy_camera_unset_state_changed_cb(camera_h camera)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       camera_s *handle = (camera_s *)camera;
+       handle->user_cb[_CAMERA_EVENT_TYPE_STATE_CHANGE] = (void *)NULL;
+       handle->user_data[_CAMERA_EVENT_TYPE_STATE_CHANGE] = (void *)NULL;
+
+       return CAMERA_ERROR_NONE;
+}
+
+
+int legacy_camera_set_interrupted_cb(camera_h camera, camera_interrupted_cb callback, void *user_data)
+{
+       if (camera == NULL || callback == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       camera_s *handle = (camera_s *)camera;
+       handle->user_cb[_CAMERA_EVENT_TYPE_INTERRUPTED] = (void *)callback;
+       handle->user_data[_CAMERA_EVENT_TYPE_INTERRUPTED] = (void *)user_data;
+
+       return CAMERA_ERROR_NONE;
+}
+
+
+int legacy_camera_unset_interrupted_cb(camera_h camera)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       camera_s *handle = (camera_s *)camera;
+
+       handle->user_cb[_CAMERA_EVENT_TYPE_INTERRUPTED] = (void *)NULL;
+       handle->user_data[_CAMERA_EVENT_TYPE_INTERRUPTED] = (void *)NULL;
+
+       return CAMERA_ERROR_NONE;
+}
+
+
+int legacy_camera_set_focus_changed_cb(camera_h camera, camera_focus_changed_cb callback, void *user_data)
+{
+       if (camera == NULL || callback == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       camera_s *handle = (camera_s *)camera;
+
+       handle->user_cb[_CAMERA_EVENT_TYPE_FOCUS_CHANGE] = (void *)callback;
+       handle->user_data[_CAMERA_EVENT_TYPE_FOCUS_CHANGE] = (void *)user_data;
+
+       return CAMERA_ERROR_NONE;
+}
+
+
+int legacy_camera_unset_focus_changed_cb(camera_h camera)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       camera_s *handle = (camera_s *)camera;
+
+       handle->user_cb[_CAMERA_EVENT_TYPE_FOCUS_CHANGE] = (void *)NULL;
+       handle->user_data[_CAMERA_EVENT_TYPE_FOCUS_CHANGE] = (void *)NULL;
+
+       return CAMERA_ERROR_NONE;
+}
+
+
+int legacy_camera_set_error_cb(camera_h camera, camera_error_cb callback, void *user_data)
+{
+       if (camera == NULL || callback == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       camera_s *handle = (camera_s *)camera;
+
+       handle->user_cb[_CAMERA_EVENT_TYPE_ERROR] = (void *)callback;
+       handle->user_data[_CAMERA_EVENT_TYPE_ERROR] = (void *)user_data;
+
+       return CAMERA_ERROR_NONE;
+}
+
+
+int legacy_camera_unset_error_cb(camera_h camera)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       camera_s *handle = (camera_s *)camera;
+
+       handle->user_cb[_CAMERA_EVENT_TYPE_ERROR] = (void *)NULL;
+       handle->user_data[_CAMERA_EVENT_TYPE_ERROR] = (void *)NULL;
+
+       return CAMERA_ERROR_NONE;
+}
+
+
+int legacy_camera_foreach_supported_preview_resolution(camera_h camera, camera_supported_preview_resolution_cb foreach_cb, void *user_data)
+{
+       if (camera == NULL || foreach_cb == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int i = 0;
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+       MMCamAttrsInfo preview_width;
+       MMCamAttrsInfo preview_height;
+
+       ret = mm_camcorder_get_attribute_info(handle->mm_handle, MMCAM_CAMERA_WIDTH, &preview_width);
+       ret |= mm_camcorder_get_attribute_info(handle->mm_handle, MMCAM_CAMERA_HEIGHT, &preview_height);
+       if (ret != CAMERA_ERROR_NONE) {
+               return __convert_camera_error_code(__func__, ret);
+       }
+
+       for (i = 0 ; i < preview_width.int_array.count ; i++) {
+               if (!foreach_cb(preview_width.int_array.array[i], preview_height.int_array.array[i], user_data)) {
+                       break;
+               }
+       }
+
+       return CAMERA_ERROR_NONE;
+}
+
+
+int legacy_camera_foreach_supported_capture_resolution(camera_h camera, camera_supported_capture_resolution_cb foreach_cb, void *user_data)
+{
+       if (camera == NULL || foreach_cb == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int i = 0;
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+       MMCamAttrsInfo capture_width;
+       MMCamAttrsInfo capture_height;
+
+       ret = mm_camcorder_get_attribute_info(handle->mm_handle, MMCAM_CAPTURE_WIDTH, &capture_width);
+       ret |= mm_camcorder_get_attribute_info(handle->mm_handle, MMCAM_CAPTURE_HEIGHT, &capture_height);
+       if (ret != CAMERA_ERROR_NONE) {
+               return __convert_camera_error_code(__func__, ret);
+       }
+
+       for (i = 0 ; i < capture_width.int_array.count ; i++) {
+               if (!foreach_cb(capture_width.int_array.array[i], capture_height.int_array.array[i], user_data)) {
+                       break;
+               }
+       }
+
+       return CAMERA_ERROR_NONE;
+}
+
+
+int legacy_camera_foreach_supported_capture_format(camera_h camera, camera_supported_capture_format_cb foreach_cb, void *user_data)
+{
+       if (camera == NULL || foreach_cb == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int i = 0;
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+       MMCamAttrsInfo format;
+
+       ret = mm_camcorder_get_attribute_info(handle->mm_handle, MMCAM_CAPTURE_FORMAT, &format);
+       if (ret != CAMERA_ERROR_NONE) {
+               return __convert_camera_error_code(__func__, ret);
+       }
+
+       for (i = 0 ; i < format.int_array.count ; i++) {
+               if (format.int_array.array[i] != MM_PIXEL_FORMAT_ITLV_JPEG_UYVY) {
+                       if (!foreach_cb(format.int_array.array[i], user_data)) {
+                               break;
+                       }
+               }
+       }
+
+       return CAMERA_ERROR_NONE;
+}
+
+
+int legacy_camera_foreach_supported_preview_format(camera_h camera, camera_supported_preview_format_cb foreach_cb, void *user_data)
+{
+       if (camera == NULL || foreach_cb == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int i = 0;
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+       MMCamAttrsInfo format;
+
+       ret = mm_camcorder_get_attribute_info(handle->mm_handle, MMCAM_CAMERA_FORMAT, &format);
+       if (ret != CAMERA_ERROR_NONE) {
+               return __convert_camera_error_code(__func__, ret);
+       }
+
+       for (i = 0 ; i < format.int_array.count ; i++) {
+               if (format.int_array.array[i] != MM_PIXEL_FORMAT_ITLV_JPEG_UYVY) {
+                       if (!foreach_cb(format.int_array.array[i], user_data)) {
+                               break;
+                       }
+               }
+       }
+
+       return CAMERA_ERROR_NONE;
+}
+
+
+int legacy_camera_get_recommended_preview_resolution(camera_h camera, int *width, int *height)
+{
+       if (camera == NULL || width == NULL || height == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       enum MMCamcorderPreviewType wide = MM_CAMCORDER_PREVIEW_TYPE_NORMAL;
+       int capture_w = 0;
+       int capture_h = 0;
+       double ratio = 0.0;
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+       MMCamAttrsInfo width_info;
+       MMCamAttrsInfo height_info;
+
+       legacy_camera_get_capture_resolution(camera, &capture_w, &capture_h);
+       ratio = (double)capture_w / (double)capture_h;
+       if (ratio > 1.5) {
+               wide = MM_CAMCORDER_PREVIEW_TYPE_WIDE;
+       } else if (ratio == 1.0) {
+               wide = MM_CAMCORDER_PREVIEW_TYPE_SQUARE;
+       } else {
+               wide = MM_CAMCORDER_PREVIEW_TYPE_NORMAL;
+       }
+
+       ret = mm_camcorder_get_attribute_info(handle->mm_handle, MMCAM_RECOMMEND_CAMERA_WIDTH, &width_info);
+       ret |= mm_camcorder_get_attribute_info(handle->mm_handle, MMCAM_RECOMMEND_CAMERA_HEIGHT, &height_info);
+       if (ret != MM_ERROR_NONE) {
+               return __convert_camera_error_code(__func__, ret);
+       }
+
+       if (width && (unsigned int)width_info.int_array.count > wide) {
+               *width = width_info.int_array.array[wide];
+       } else {
+               LOGE("there is no width value for resolution %dx%d type %d", capture_w, capture_h, wide);
+               return CAMERA_ERROR_INVALID_OPERATION;
+       }
+
+       if (height && (unsigned int)height_info.int_array.count > wide) {
+               *height = height_info.int_array.array[wide];
+       } else {
+               LOGE("there is no height value for resolution %dx%d type %d", capture_w, capture_h, wide);
+               return CAMERA_ERROR_INVALID_OPERATION;
+       }
+
+       LOGI("recommend resolution %dx%d, type %d", *width, *height, wide);
+
+       return CAMERA_ERROR_NONE;
+}
+
+
+int legacy_camera_attr_get_lens_orientation(camera_h camera, int *angle)
+{
+       if (camera == NULL || angle == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+       int rotation = MM_DISPLAY_ROTATION_NONE;
+
+       ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                         MMCAM_RECOMMEND_DISPLAY_ROTATION, &rotation,
+                                         NULL);
+
+       if (ret == MM_ERROR_NONE) {
+               switch (rotation) {
+               case MM_DISPLAY_ROTATION_NONE:
+                       *angle = 0;
+                       break;
+               case MM_DISPLAY_ROTATION_90:
+                       *angle = 270;
+                       break;
+               case MM_DISPLAY_ROTATION_180:
+                       *angle = 180;
+                       break;
+               case MM_DISPLAY_ROTATION_270:
+                       *angle = 90;
+                       break;
+               default :
+                       *angle = 0;
+                       break;
+               }
+       }
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_set_theater_mode(camera_h camera, camera_attr_theater_mode_e mode)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         MMCAM_DISPLAY_MODE, mode,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_get_theater_mode(camera_h camera, camera_attr_theater_mode_e *mode)
+{
+       if (camera == NULL || mode == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                         MMCAM_DISPLAY_MODE, mode,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_foreach_supported_theater_mode(camera_h camera, camera_attr_supported_theater_mode_cb foreach_cb, void *user_data)
+{
+       if (camera == NULL || foreach_cb == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int i = 0;
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+       MMCamAttrsInfo info;
+
+       ret = mm_camcorder_get_attribute_info(handle->mm_handle, MMCAM_DISPLAY_MODE, &info);
+       if (ret != CAMERA_ERROR_NONE) {
+               return __convert_camera_error_code(__func__, ret);
+       }
+
+       for (i = 0 ; i < info.int_array.count ; i++) {
+               if (!foreach_cb(info.int_array.array[i], user_data)) {
+                       break;
+               }
+       }
+
+       return CAMERA_ERROR_NONE;
+}
+
+
+int legacy_camera_attr_set_preview_fps(camera_h camera,  camera_attr_fps_e fps)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       if (fps == CAMERA_ATTR_FPS_AUTO) {
+               ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                                 MMCAM_CAMERA_FPS_AUTO, true,
+                                                 NULL);
+       } else {
+               ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                                 MMCAM_CAMERA_FPS_AUTO, false,
+                                                 MMCAM_CAMERA_FPS, fps,
+                                                 NULL);
+       }
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_set_image_quality(camera_h camera, int quality)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         MMCAM_IMAGE_ENCODER_QUALITY, quality,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_get_preview_fps(camera_h camera, camera_attr_fps_e *fps)
+{
+       if (camera == NULL || fps == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       int mm_fps = 0;
+       int is_auto = false;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                         MMCAM_CAMERA_FPS, &mm_fps,
+                                         MMCAM_CAMERA_FPS_AUTO, &is_auto,
+                                         NULL);
+       if (ret == MM_ERROR_NONE) {
+               if (is_auto) {
+                       *fps = CAMERA_ATTR_FPS_AUTO;
+               } else {
+                       *fps = mm_fps;
+               }
+       }
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_get_image_quality(camera_h camera, int *quality)
+{
+       if (camera == NULL || quality == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                         MMCAM_IMAGE_ENCODER_QUALITY, quality,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_set_zoom(camera_h camera, int zoom)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         MMCAM_CAMERA_DIGITAL_ZOOM, zoom,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_set_af_mode(camera_h camera, camera_attr_af_mode_e mode)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+       int focus_mode;
+       bool should_change_focus_mode = false;
+
+       mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                   MMCAM_CAMERA_FOCUS_MODE, &focus_mode,
+                                   NULL);
+
+       if (focus_mode != MM_CAMCORDER_FOCUS_MODE_TOUCH_AUTO &&
+           focus_mode != MM_CAMCORDER_FOCUS_MODE_CONTINUOUS &&
+           focus_mode != MM_CAMCORDER_FOCUS_MODE_AUTO) {
+               should_change_focus_mode = true;
+       }
+
+       if (mode != CAMERA_ATTR_AF_NONE &&
+           focus_mode == MM_CAMCORDER_FOCUS_MODE_CONTINUOUS &&
+           !handle->on_continuous_focusing) {
+               handle->cached_focus_mode = mode;
+               LOGD("af mode will be set actually start focusing");
+               return __convert_camera_error_code(__func__, MM_ERROR_NONE);
+       } else {
+               handle->cached_focus_mode = -1;
+       }
+
+       if (mode != CAMERA_ATTR_AF_NONE && should_change_focus_mode) {
+               mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                           MMCAM_CAMERA_FOCUS_MODE, MM_CAMCORDER_FOCUS_MODE_AUTO,
+                                           NULL);
+       }
+
+       switch (mode) {
+       case CAMERA_ATTR_AF_NONE:
+               ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                                 MMCAM_CAMERA_FOCUS_MODE, MM_CAMCORDER_FOCUS_MODE_NONE,
+                                                 MMCAM_CAMERA_AF_SCAN_RANGE, MM_CAMCORDER_AUTO_FOCUS_NONE,
+                                                 NULL);
+               break;
+       case CAMERA_ATTR_AF_NORMAL:
+               ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                                 MMCAM_CAMERA_AF_SCAN_RANGE, MM_CAMCORDER_AUTO_FOCUS_NORMAL,
+                                                 NULL);
+               break;
+       case CAMERA_ATTR_AF_MACRO:
+               ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                                 MMCAM_CAMERA_AF_SCAN_RANGE, MM_CAMCORDER_AUTO_FOCUS_MACRO,
+                                                 NULL);
+               break;
+       case CAMERA_ATTR_AF_FULL:
+               ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                                 MMCAM_CAMERA_AF_SCAN_RANGE, MM_CAMCORDER_AUTO_FOCUS_FULL,
+                                                 NULL);
+               break;
+       default:
+               LOGE("invalid mode %d", mode);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_set_af_area(camera_h camera, int x, int y)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+       camera_attr_af_mode_e mode;
+
+       legacy_camera_attr_get_af_mode(camera, &mode);
+       if (mode == CAMERA_ATTR_AF_NONE) {
+               LOGE("INVALID_OPERATION(0x%08x) AF mode is CAMERA_ATTR_AF_NONE", CAMERA_ERROR_INVALID_OPERATION);
+               return CAMERA_ERROR_INVALID_OPERATION;
+       }
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         MMCAM_CAMERA_AF_TOUCH_X, x,
+                                         MMCAM_CAMERA_AF_TOUCH_Y, y,
+                                         NULL);
+       if (ret == MM_ERROR_NONE) {
+               handle->focus_area_valid = true;
+       }
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_clear_af_area(camera_h camera)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       camera_s *handle = (camera_s *)camera;
+
+       handle->focus_area_valid = false;
+
+       return 0;
+}
+
+
+int legacy_camera_attr_set_exposure_mode(camera_h camera, camera_attr_exposure_mode_e mode)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int maptable[] = {MM_CAMCORDER_AUTO_EXPOSURE_OFF,       /* CAMERA_ATTR_EXPOSURE_MODE_OFF */
+                         MM_CAMCORDER_AUTO_EXPOSURE_ALL,       /* CAMERA_ATTR_EXPOSURE_MODE_ALL */
+                         MM_CAMCORDER_AUTO_EXPOSURE_CENTER_1,  /* CAMERA_ATTR_EXPOSURE_MODE_CENTER */
+                         MM_CAMCORDER_AUTO_EXPOSURE_SPOT_1,    /* CAMERA_ATTR_EXPOSURE_MODE_SPOT */
+                         MM_CAMCORDER_AUTO_EXPOSURE_CUSTOM_1,  /* CAMERA_ATTR_EXPOSURE_MODE_CUSTOM */
+                        };
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       if (mode < CAMERA_ATTR_EXPOSURE_MODE_OFF || mode > CAMERA_ATTR_EXPOSURE_MODE_CUSTOM) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         MMCAM_CAMERA_EXPOSURE_MODE, maptable[mode],
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_set_exposure(camera_h camera, int value)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         MMCAM_CAMERA_EXPOSURE_VALUE, value,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_set_iso(camera_h camera, camera_attr_iso_e iso)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s*)camera;
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         MMCAM_CAMERA_ISO, iso,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_set_brightness(camera_h camera, int level)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         MMCAM_FILTER_BRIGHTNESS, level,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_set_contrast(camera_h camera, int level)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         MMCAM_FILTER_CONTRAST, level,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_set_whitebalance(camera_h camera, camera_attr_whitebalance_e wb)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         MMCAM_FILTER_WB, wb,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_set_effect(camera_h camera, camera_attr_effect_mode_e effect)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         MMCAM_FILTER_COLOR_TONE, effect,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_set_scene_mode(camera_h camera, camera_attr_scene_mode_e mode)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         MMCAM_FILTER_SCENE_MODE, mode,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_enable_tag(camera_h camera, bool enable)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         MMCAM_TAG_ENABLE, enable,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_set_tag_image_description(camera_h camera, const char *description)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         MMCAM_TAG_IMAGE_DESCRIPTION, description, strlen(description),
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_set_tag_orientation(camera_h camera, camera_attr_tag_orientation_e orientation)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         MMCAM_TAG_ORIENTATION, orientation,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_set_tag_software(camera_h camera, const char *software)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         MMCAM_TAG_SOFTWARE, software, strlen(software),
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_set_geotag(camera_h camera, double latitude , double longitude, double altitude)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         MMCAM_TAG_GPS_ENABLE, true,
+                                         MMCAM_TAG_LATITUDE, latitude,
+                                         MMCAM_TAG_LONGITUDE, longitude,
+                                         MMCAM_TAG_ALTITUDE, altitude,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_remove_geotag(camera_h camera)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         MMCAM_TAG_GPS_ENABLE, false,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_set_flash_mode(camera_h camera, camera_attr_flash_mode_e mode)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         MMCAM_STROBE_MODE, mode,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_get_zoom(camera_h camera, int *zoom)
+{
+       if (camera == NULL || zoom == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                         MMCAM_CAMERA_DIGITAL_ZOOM, zoom,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_get_zoom_range(camera_h camera, int *min, int *max)
+{
+       if (camera == NULL || min == NULL || max == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+       MMCamAttrsInfo ainfo;
+
+       ret = mm_camcorder_get_attribute_info(handle->mm_handle, MMCAM_CAMERA_DIGITAL_ZOOM, &ainfo);
+       if (ret == MM_ERROR_NONE) {
+               *min = ainfo.int_range.min;
+               *max = ainfo.int_range.max;
+       }
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_get_af_mode(camera_h camera, camera_attr_af_mode_e *mode)
+{
+       if (camera == NULL || mode == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       int focus_mode;
+       int af_range;
+       int detect_mode;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                         MMCAM_CAMERA_FOCUS_MODE, &focus_mode,
+                                         MMCAM_CAMERA_AF_SCAN_RANGE, &af_range,
+                                         MMCAM_DETECT_MODE, &detect_mode,
+                                         NULL);
+       if (ret == MM_ERROR_NONE) {
+               switch (focus_mode) {
+               case MM_CAMCORDER_FOCUS_MODE_NONE:
+               case MM_CAMCORDER_FOCUS_MODE_PAN:
+               case MM_CAMCORDER_FOCUS_MODE_MANUAL:
+                       *mode = CAMERA_ATTR_AF_NONE;
+                       break;
+               case MM_CAMCORDER_FOCUS_MODE_AUTO:
+               case MM_CAMCORDER_FOCUS_MODE_TOUCH_AUTO:
+               case MM_CAMCORDER_FOCUS_MODE_CONTINUOUS:
+                       switch (af_range) {
+                       case MM_CAMCORDER_AUTO_FOCUS_NONE:
+                               *mode = CAMERA_ATTR_AF_NORMAL;
+                               break;
+                       case MM_CAMCORDER_AUTO_FOCUS_NORMAL:
+                               *mode = CAMERA_ATTR_AF_NORMAL;
+                               break;
+                       case MM_CAMCORDER_AUTO_FOCUS_MACRO:
+                               *mode = CAMERA_ATTR_AF_MACRO;
+                               break;
+                       case MM_CAMCORDER_AUTO_FOCUS_FULL:
+                               *mode = CAMERA_ATTR_AF_FULL;
+                               break;
+                       default :
+                               *mode = CAMERA_ATTR_AF_NORMAL;
+                               break;
+                       }
+                       break;
+               default:
+                       *mode = CAMERA_ATTR_AF_NONE;
+                       break;
+               }
+       }
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_get_exposure_mode(camera_h camera, camera_attr_exposure_mode_e *mode)
+{
+       if (camera == NULL || mode == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int maptable[] = {CAMERA_ATTR_EXPOSURE_MODE_OFF,        /* MM_CAMCORDER_AUTO_EXPOSURE_OFF */
+                         CAMERA_ATTR_EXPOSURE_MODE_ALL,        /* MM_CAMCORDER_AUTO_EXPOSURE_ALL */
+                         CAMERA_ATTR_EXPOSURE_MODE_CENTER,     /* MM_CAMCORDER_AUTO_EXPOSURE_CENTER_1 */
+                         CAMERA_ATTR_EXPOSURE_MODE_CENTER,     /* MM_CAMCORDER_AUTO_EXPOSURE_CENTER_2 */
+                         CAMERA_ATTR_EXPOSURE_MODE_CENTER,     /* MM_CAMCORDER_AUTO_EXPOSURE_CENTER_3 */
+                         CAMERA_ATTR_EXPOSURE_MODE_SPOT,       /* MM_CAMCORDER_AUTO_EXPOSURE_SPOT_1 */
+                         CAMERA_ATTR_EXPOSURE_MODE_SPOT,       /* MM_CAMCORDER_AUTO_EXPOSURE_SPOT_2 */
+                         CAMERA_ATTR_EXPOSURE_MODE_CUSTOM,     /* MM_CAMCORDER_AUTO_EXPOSURE_CUSTOM_1 */
+                         CAMERA_ATTR_EXPOSURE_MODE_CUSTOM      /* MM_CAMCORDER_AUTO_EXPOSURE_CUSTOM_2 */
+                        };
+       int ret = MM_ERROR_NONE;
+       int exposure_mode;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                         MMCAM_CAMERA_EXPOSURE_MODE, &exposure_mode,
+                                         NULL);
+
+       if (ret == CAMERA_ERROR_NONE) {
+               *mode = maptable[abs(exposure_mode%9)];
+       }
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_get_exposure(camera_h camera, int *value)
+{
+       if (camera == NULL || value == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                         MMCAM_CAMERA_EXPOSURE_VALUE, value,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_get_exposure_range(camera_h camera, int *min, int *max)
+{
+       if (camera == NULL || min == NULL || max == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+       MMCamAttrsInfo ainfo;
+
+       ret = mm_camcorder_get_attribute_info(handle->mm_handle, MMCAM_CAMERA_EXPOSURE_VALUE, &ainfo);
+       if (ret == MM_ERROR_NONE) {
+               *min = ainfo.int_range.min;
+               *max = ainfo.int_range.max;
+       }
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_get_iso(camera_h camera, camera_attr_iso_e *iso)
+{
+       if (camera == NULL || iso == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                         MMCAM_CAMERA_ISO, iso,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_get_brightness(camera_h camera, int *level)
+{
+       if (camera == NULL || level == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                         MMCAM_FILTER_BRIGHTNESS, level,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_get_brightness_range(camera_h camera, int *min, int *max)
+{
+       if (camera == NULL || min == NULL || max == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+       MMCamAttrsInfo ainfo;
+
+       ret = mm_camcorder_get_attribute_info(handle->mm_handle, MMCAM_FILTER_BRIGHTNESS, &ainfo);
+       if (ret == MM_ERROR_NONE) {
+               *min = ainfo.int_range.min;
+               *max = ainfo.int_range.max;
+       }
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_get_contrast(camera_h camera, int *level)
+{
+       if (camera == NULL || level == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                         MMCAM_FILTER_CONTRAST, level,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_get_contrast_range(camera_h camera, int *min, int *max)
+{
+       if (camera == NULL || min == NULL || max == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+       MMCamAttrsInfo ainfo;
+
+       ret = mm_camcorder_get_attribute_info(handle->mm_handle, MMCAM_FILTER_CONTRAST, &ainfo);
+       if (ret == MM_ERROR_NONE) {
+               *min = ainfo.int_range.min;
+               *max = ainfo.int_range.max;
+       }
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_get_whitebalance(camera_h camera, camera_attr_whitebalance_e *wb)
+{
+       if (camera == NULL || wb == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                         MMCAM_FILTER_WB, wb,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_get_effect(camera_h camera, camera_attr_effect_mode_e *effect)
+{
+       if (camera == NULL || effect == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                         MMCAM_FILTER_COLOR_TONE, effect,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_get_scene_mode(camera_h camera, camera_attr_scene_mode_e *mode)
+{
+       if (camera == NULL || mode == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                         MMCAM_FILTER_SCENE_MODE, mode,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_is_enabled_tag(camera_h camera, bool *enable)
+{
+       if (camera == NULL || enable == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                         MMCAM_TAG_ENABLE, enable,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_get_tag_image_description(camera_h camera, char **description)
+{
+       if (camera == NULL || description == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+       char *ndescription = NULL;
+       int desc_size;
+
+       ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                         MMCAM_TAG_IMAGE_DESCRIPTION, &ndescription, &desc_size,
+                                         NULL);
+       if (ret == MM_ERROR_NONE) {
+               if (ndescription != NULL) {
+                       *description = strdup(ndescription);
+               } else {
+                       *description = strdup("");
+               }
+       }
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_get_tag_orientation(camera_h camera, camera_attr_tag_orientation_e *orientation)
+{
+       if (camera == NULL || orientation == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                         MMCAM_TAG_ORIENTATION, orientation,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_get_tag_software(camera_h camera, char **software)
+{
+       if (camera == NULL || software == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+       char *soft = NULL;
+       int soft_size;
+
+       ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                         MMCAM_TAG_SOFTWARE, &soft, &soft_size,
+                                         NULL);
+       if (ret == MM_ERROR_NONE) {
+               if (soft != NULL) {
+                       *software = strdup(soft);
+               } else {
+                       *software = strdup("");
+               }
+       }
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_get_geotag(camera_h camera, double *latitude , double *longitude, double *altitude)
+{
+       if (camera == NULL || latitude == NULL || longitude == NULL || altitude == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                         MMCAM_TAG_LATITUDE, latitude,
+                                         MMCAM_TAG_LONGITUDE, longitude,
+                                         MMCAM_TAG_ALTITUDE, altitude,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_get_flash_mode(camera_h camera, camera_attr_flash_mode_e *mode)
+{
+       if (camera == NULL || mode == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                         MMCAM_STROBE_MODE, mode,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_foreach_supported_af_mode(camera_h camera, camera_attr_supported_af_mode_cb foreach_cb, void *user_data)
+{
+       if (camera == NULL || foreach_cb == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       int i = 0;
+       camera_s *handle = (camera_s *)camera;
+       MMCamAttrsInfo af_range;
+       MMCamAttrsInfo focus_mode;
+
+       ret = mm_camcorder_get_attribute_info(handle->mm_handle, MMCAM_CAMERA_AF_SCAN_RANGE, &af_range);
+       ret |= mm_camcorder_get_attribute_info(handle->mm_handle, MMCAM_CAMERA_FOCUS_MODE, &focus_mode);
+       if (ret != MM_ERROR_NONE) {
+               return __convert_camera_error_code(__func__, ret);
+       }
+
+       for (i = 0 ; i < af_range.int_array.count ; i++) {
+               if (!foreach_cb(af_range.int_array.array[i], user_data)) {
+                       break;;
+               }
+       }
+
+       return CAMERA_ERROR_NONE;
+}
+
+
+int legacy_camera_attr_foreach_supported_exposure_mode(camera_h camera, camera_attr_supported_exposure_mode_cb foreach_cb, void *user_data)
+{
+       if (camera == NULL || foreach_cb == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int maptable[] = {CAMERA_ATTR_EXPOSURE_MODE_OFF,        /* MM_CAMCORDER_AUTO_EXPOSURE_OFF */
+                         CAMERA_ATTR_EXPOSURE_MODE_ALL,        /* MM_CAMCORDER_AUTO_EXPOSURE_ALL */
+                         CAMERA_ATTR_EXPOSURE_MODE_CENTER,     /* MM_CAMCORDER_AUTO_EXPOSURE_CENTER_1 */
+                         -1,                                   /* MM_CAMCORDER_AUTO_EXPOSURE_CENTER_2 */
+                         -1,                                   /* MM_CAMCORDER_AUTO_EXPOSURE_CENTER_3 */
+                         CAMERA_ATTR_EXPOSURE_MODE_SPOT,       /* MM_CAMCORDER_AUTO_EXPOSURE_SPOT_1 */
+                         -1,                                   /* MM_CAMCORDER_AUTO_EXPOSURE_SPOT_2 */
+                         CAMERA_ATTR_EXPOSURE_MODE_CUSTOM,     /* MM_CAMCORDER_AUTO_EXPOSURE_CUSTOM_1 */
+                         -1                                    /* MM_CAMCORDER_AUTO_EXPOSURE_CUSTOM_2 */
+                        };
+       int i = 0;
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+       MMCamAttrsInfo info;
+
+       ret = mm_camcorder_get_attribute_info(handle->mm_handle, MMCAM_CAMERA_EXPOSURE_MODE, &info);
+       if (ret != MM_ERROR_NONE) {
+               return __convert_camera_error_code(__func__, ret);
+       }
+
+       for (i = 0 ; i < info.int_array.count ; i++) {
+               if (info.int_array.array[i] >= MM_CAMCORDER_AUTO_EXPOSURE_OFF &&
+                   info.int_array.array[i] <= MM_CAMCORDER_AUTO_EXPOSURE_CUSTOM_2) {
+                       if (maptable[info.int_array.array[i]] != -1) {
+                               if (!foreach_cb(maptable[info.int_array.array[i]], user_data)) {
+                                       break;
+                               }
+                       }
+               } else {
+                       LOGW("unknown value %d", info.int_array.array[i]);
+               }
+       }
+
+       return CAMERA_ERROR_NONE;
+}
+
+
+int legacy_camera_attr_foreach_supported_iso(camera_h camera, camera_attr_supported_iso_cb foreach_cb, void *user_data)
+{
+       if (camera == NULL || foreach_cb == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int i = 0;
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+       MMCamAttrsInfo info;
+
+       ret = mm_camcorder_get_attribute_info(handle->mm_handle, MMCAM_CAMERA_ISO, &info);
+       if (ret != MM_ERROR_NONE) {
+               return __convert_camera_error_code(__func__, ret);
+       }
+
+       for (i = 0 ; i < info.int_array.count ; i++) {
+               if (!foreach_cb(info.int_array.array[i], user_data)) {
+                       break;
+               }
+       }
+
+       return CAMERA_ERROR_NONE;
+}
+
+
+int legacy_camera_attr_foreach_supported_whitebalance(camera_h camera, camera_attr_supported_whitebalance_cb foreach_cb, void *user_data)
+{
+       if (camera == NULL || foreach_cb == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int i = 0;
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+       MMCamAttrsInfo info;
+
+       ret = mm_camcorder_get_attribute_info(handle->mm_handle, MMCAM_FILTER_WB, &info);
+       if (ret != MM_ERROR_NONE) {
+               return __convert_camera_error_code(__func__, ret);
+       }
+
+       for (i = 0 ; i < info.int_array.count ; i++) {
+               if (!foreach_cb(info.int_array.array[i], user_data)) {
+                       break;
+               }
+       }
+
+       return CAMERA_ERROR_NONE;
+}
+
+
+int legacy_camera_attr_foreach_supported_effect(camera_h camera, camera_attr_supported_effect_cb foreach_cb, void *user_data)
+{
+       if (camera == NULL || foreach_cb == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int i = 0;
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+       MMCamAttrsInfo info;
+
+       ret = mm_camcorder_get_attribute_info(handle->mm_handle, MMCAM_FILTER_COLOR_TONE, &info);
+       if (ret != MM_ERROR_NONE) {
+               return __convert_camera_error_code(__func__, ret);
+       }
+
+       for (i = 0 ; i < info.int_array.count ; i++) {
+               if (!foreach_cb(info.int_array.array[i], user_data)) {
+                       break;
+               }
+       }
+
+       return CAMERA_ERROR_NONE;
+}
+
+
+int legacy_camera_attr_foreach_supported_scene_mode(camera_h camera, camera_attr_supported_scene_mode_cb foreach_cb, void *user_data)
+{
+       if (camera == NULL || foreach_cb == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int i = 0;
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+       MMCamAttrsInfo info;
+
+       ret = mm_camcorder_get_attribute_info(handle->mm_handle, MMCAM_FILTER_SCENE_MODE, &info);
+       if (ret != MM_ERROR_NONE) {
+               return __convert_camera_error_code(__func__, ret);
+       }
+
+       for (i = 0 ; i < info.int_array.count ; i++) {
+               if (!foreach_cb(info.int_array.array[i], user_data)) {
+                       break;
+               }
+       }
+
+       return CAMERA_ERROR_NONE;
+}
+
+
+int legacy_camera_attr_foreach_supported_flash_mode(camera_h camera, camera_attr_supported_flash_mode_cb foreach_cb, void *user_data)
+{
+       if (camera == NULL || foreach_cb == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int i = 0;
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+       MMCamAttrsInfo info;
+
+       ret = mm_camcorder_get_attribute_info(handle->mm_handle, MMCAM_STROBE_MODE, &info);
+       if (ret != MM_ERROR_NONE) {
+               return __convert_camera_error_code(__func__, ret);
+       }
+
+       for (i = 0 ; i < info.int_array.count ; i++) {
+               if (!foreach_cb(info.int_array.array[i], user_data)) {
+                       break;
+               }
+       }
+
+       return CAMERA_ERROR_NONE;
+}
+
+
+int legacy_camera_attr_foreach_supported_fps(camera_h camera, camera_attr_supported_fps_cb foreach_cb, void *user_data)
+{
+       if (camera == NULL || foreach_cb == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+       MMCamAttrsInfo info;
+       int width = 0;
+       int height = 0;
+       int i = 0;
+
+       ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                         MMCAM_CAMERA_WIDTH, &width,
+                                         MMCAM_CAMERA_HEIGHT, &height,
+                                         NULL);
+       if (ret != MM_ERROR_NONE) {
+               return __convert_camera_error_code(__func__, ret);
+       }
+
+       ret = mm_camcorder_get_fps_list_by_resolution(handle->mm_handle, width, height, &info);
+       if (ret != MM_ERROR_NONE) {
+               return __convert_camera_error_code(__func__, ret);
+       }
+
+       for (i = 0 ; i < info.int_array.count ; i++) {
+               if (!foreach_cb(info.int_array.array[i], user_data)) {
+                       break;
+               }
+       }
+
+       return CAMERA_ERROR_NONE;
+}
+
+
+int legacy_camera_attr_foreach_supported_fps_by_resolution(camera_h camera, int width, int height, camera_attr_supported_fps_cb foreach_cb, void *user_data)
+{
+       if (camera == NULL || foreach_cb == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+       MMCamAttrsInfo info;
+       int i = 0;
+
+       ret = mm_camcorder_get_fps_list_by_resolution(handle->mm_handle, width, height, &info);
+       if (ret != MM_ERROR_NONE) {
+               return __convert_camera_error_code(__func__, ret);
+       }
+
+       for (i = 0 ; i < info.int_array.count ; i++) {
+               if (!foreach_cb(info.int_array.array[i], user_data)) {
+                       break;
+               }
+       }
+
+       return CAMERA_ERROR_NONE;
+}
+
+
+int legacy_camera_attr_foreach_supported_stream_flip(camera_h camera, camera_attr_supported_stream_flip_cb foreach_cb, void *user_data)
+{
+       if (camera == NULL || foreach_cb == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int i = 0;
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+       MMCamAttrsInfo info;
+
+       ret = mm_camcorder_get_attribute_info(handle->mm_handle, MMCAM_CAMERA_FLIP, &info);
+       if (ret != MM_ERROR_NONE) {
+               return __convert_camera_error_code(__func__, ret);
+       }
+
+       for (i = 0 ; i < info.int_array.count ; i++) {
+               if (!foreach_cb(info.int_array.array[i], user_data)) {
+                       break;
+               }
+       }
+
+       return CAMERA_ERROR_NONE;
+}
+
+
+int legacy_camera_attr_foreach_supported_stream_rotation(camera_h camera, camera_attr_supported_stream_rotation_cb foreach_cb, void *user_data)
+{
+       if (camera == NULL || foreach_cb == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int i = 0;
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+       MMCamAttrsInfo info;
+
+       ret = mm_camcorder_get_attribute_info(handle->mm_handle, MMCAM_CAMERA_ROTATION, &info);
+       if (ret != MM_ERROR_NONE) {
+               return __convert_camera_error_code(__func__, ret);
+       }
+
+       for (i = 0 ; i < info.int_array.count ; i++) {
+               if (!foreach_cb(info.int_array.array[i], user_data)) {
+                       break;
+               }
+       }
+
+       return CAMERA_ERROR_NONE;
+}
+
+
+int legacy_camera_attr_set_stream_rotation(camera_h camera, camera_rotation_e rotation)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       if (rotation < CAMERA_ROTATION_NONE || rotation > CAMERA_ROTATION_270) {
+               LOGE("INVALID_PARAMETER - %d", rotation);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         MMCAM_CAMERA_ROTATION, rotation,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_get_stream_rotation(camera_h camera, camera_rotation_e *rotation)
+{
+       if (camera == NULL || rotation == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                         MMCAM_CAMERA_ROTATION, rotation,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_set_stream_flip(camera_h camera, camera_flip_e flip)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       if (flip < CAMERA_FLIP_NONE || flip > CAMERA_FLIP_BOTH) {
+               LOGE("INVALID_PARAMETER - %d", flip);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         MMCAM_CAMERA_FLIP, flip,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_get_stream_flip(camera_h camera, camera_flip_e *flip)
+{
+       if (camera == NULL || flip == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                         MMCAM_CAMERA_FLIP, flip,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int _camera_set_use(camera_h camera, bool used)
+{
+       camera_s *handle = (camera_s *)camera;
+
+       if (handle == NULL) {
+               LOGE("handle is NULL");
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       handle->is_used_in_recorder = used;
+
+       return CAMERA_ERROR_NONE;
+}
+
+
+bool _camera_is_used(camera_h camera)
+{
+       camera_s *handle = (camera_s *)camera;
+
+       if (handle == NULL) {
+               LOGE("handle is NULL");
+               return false;
+       }
+
+       return handle->is_used_in_recorder;
+}
+
+
+int _camera_get_mm_handle(camera_h camera, MMHandleType *handle)
+{
+       if (camera == NULL || handle == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       camera_s *camera_handle = (camera_s*)camera;
+
+       *handle =  camera_handle->mm_handle;
+
+       return CAMERA_ERROR_NONE;
+}
+
+
+int _camera_set_relay_mm_message_callback(camera_h camera, MMMessageCallback callback, void *user_data)
+{
+       if( camera == NULL ){
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       camera_s *handle = (camera_s *)camera;
+       handle->relay_message_callback = callback;
+       handle->relay_user_data = user_data;
+
+       return CAMERA_ERROR_NONE;
+}
+
+
+int _camera_get_tbm_surface_format(int in_format, uint32_t *out_format)
+{
+       if (in_format <= MM_PIXEL_FORMAT_INVALID ||
+           in_format >= MM_PIXEL_FORMAT_NUM ||
+           out_format == NULL) {
+               LOGE("INVALID_PARAMETER : in_format %d, out_format ptr %p", in_format, out_format);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       switch (in_format) {
+       case MM_PIXEL_FORMAT_NV12:
+       case MM_PIXEL_FORMAT_NV12T:
+               *out_format = TBM_FORMAT_NV12;
+               break;
+       case MM_PIXEL_FORMAT_NV16:
+               *out_format = TBM_FORMAT_NV16;
+               break;
+       case MM_PIXEL_FORMAT_NV21:
+               *out_format = TBM_FORMAT_NV21;
+               break;
+       case MM_PIXEL_FORMAT_YUYV:
+               *out_format = TBM_FORMAT_YUYV;
+               break;
+       case MM_PIXEL_FORMAT_UYVY:
+       case MM_PIXEL_FORMAT_ITLV_JPEG_UYVY:
+               *out_format = TBM_FORMAT_UYVY;
+               break;
+       case MM_PIXEL_FORMAT_422P:
+               *out_format = TBM_FORMAT_YUV422;
+               break;
+       case MM_PIXEL_FORMAT_I420:
+               *out_format = TBM_FORMAT_YUV420;
+               break;
+       case MM_PIXEL_FORMAT_YV12:
+               *out_format = TBM_FORMAT_YVU420;
+               break;
+       case MM_PIXEL_FORMAT_RGB565:
+               *out_format = TBM_FORMAT_RGB565;
+               break;
+       case MM_PIXEL_FORMAT_RGB888:
+               *out_format = TBM_FORMAT_RGB888;
+               break;
+       case MM_PIXEL_FORMAT_RGBA:
+               *out_format = TBM_FORMAT_RGBA8888;
+               break;
+       case MM_PIXEL_FORMAT_ARGB:
+               *out_format = TBM_FORMAT_ARGB8888;
+               break;
+       default:
+               LOGE("invalid in_format %d", in_format);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       return CAMERA_ERROR_NONE;
+}
+
+
+int _camera_get_media_packet_mimetype(int in_format, media_format_mimetype_e *mimetype)
+{
+       if (in_format <= MM_PIXEL_FORMAT_INVALID ||
+           in_format >= MM_PIXEL_FORMAT_NUM ||
+           mimetype == NULL) {
+               LOGE("INVALID_PARAMETER : in_format %d, mimetype ptr %p", in_format, mimetype);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       switch (in_format) {
+       case MM_PIXEL_FORMAT_NV12:
+       case MM_PIXEL_FORMAT_NV12T:
+               *mimetype = MEDIA_FORMAT_NV12;
+               break;
+       case MM_PIXEL_FORMAT_NV16:
+               *mimetype = MEDIA_FORMAT_NV16;
+               break;
+       case MM_PIXEL_FORMAT_NV21:
+               *mimetype = MEDIA_FORMAT_NV21;
+               break;
+       case MM_PIXEL_FORMAT_YUYV:
+               *mimetype = MEDIA_FORMAT_YUYV;
+               break;
+       case MM_PIXEL_FORMAT_UYVY:
+       case MM_PIXEL_FORMAT_ITLV_JPEG_UYVY:
+               *mimetype = MEDIA_FORMAT_UYVY;
+               break;
+       case MM_PIXEL_FORMAT_422P:
+               *mimetype = MEDIA_FORMAT_422P;
+               break;
+       case MM_PIXEL_FORMAT_I420:
+               *mimetype = MEDIA_FORMAT_I420;
+               break;
+       case MM_PIXEL_FORMAT_YV12:
+               *mimetype = MEDIA_FORMAT_YV12;
+               break;
+       case MM_PIXEL_FORMAT_RGB565:
+               *mimetype = MEDIA_FORMAT_RGB565;
+               break;
+       case MM_PIXEL_FORMAT_RGB888:
+               *mimetype = MEDIA_FORMAT_RGB888;
+               break;
+       case MM_PIXEL_FORMAT_RGBA:
+               *mimetype = MEDIA_FORMAT_RGBA;
+               break;
+       case MM_PIXEL_FORMAT_ARGB:
+               *mimetype = MEDIA_FORMAT_ARGB;
+               break;
+       default:
+               LOGE("invalid in_format %d", in_format);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       return CAMERA_ERROR_NONE;
+}
+
+
+int _camera_media_packet_finalize(media_packet_h pkt, int error_code, void *user_data)
+{
+       int ret = 0;
+       void *internal_buffer = NULL;
+       tbm_surface_h tsurf = NULL;
+
+       if (pkt == NULL || user_data == NULL) {
+               LOGE("invalid parameter buffer %p, user_data %p", pkt, user_data);
+               return MEDIA_PACKET_FINALIZE;
+       }
+
+       ret = media_packet_get_extra(pkt, &internal_buffer);
+       if (ret != MEDIA_PACKET_ERROR_NONE) {
+               LOGE("media_packet_get_extra failed 0x%x", ret);
+               return MEDIA_PACKET_FINALIZE;
+       }
+
+       /*LOGD("pointer gst buffer %p, ret 0x%x", internal_buffer, ret);*/
+
+       if (internal_buffer) {
+               gst_buffer_unref((GstBuffer *)internal_buffer);
+               internal_buffer = NULL;
+       }
+
+       ret = media_packet_get_tbm_surface(pkt, &tsurf);
+       if (ret != MEDIA_PACKET_ERROR_NONE) {
+               LOGE("media_packet_get_tbm_surface failed 0x%x", ret);
+               return MEDIA_PACKET_FINALIZE;
+       }
+
+       if (tsurf) {
+               tbm_surface_destroy(tsurf);
+               tsurf = NULL;
+       }
+
+       return MEDIA_PACKET_FINALIZE;
+}
+
+
+int legacy_camera_attr_set_hdr_mode(camera_h camera, camera_attr_hdr_mode_e mode)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       if (legacy_camera_attr_is_supported_hdr_capture(camera) == false) {
+               LOGE("NOT_SUPPORTED(0x%08x)", CAMERA_ERROR_NOT_SUPPORTED);
+               return CAMERA_ERROR_NOT_SUPPORTED;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         MMCAM_CAMERA_HDR_CAPTURE, mode,
+                                         NULL);
+
+       if (ret == MM_ERROR_NONE) {
+               if (mode == CAMERA_ATTR_HDR_MODE_KEEP_ORIGINAL) {
+                       handle->hdr_keep_mode = true;
+               } else {
+                       handle->hdr_keep_mode = false;
+               }
+       }
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_get_hdr_mode(camera_h camera, camera_attr_hdr_mode_e *mode)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x) - handle", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       if (legacy_camera_attr_is_supported_hdr_capture(camera) == false) {
+               LOGE("NOT_SUPPORTED(0x%08x)", CAMERA_ERROR_NOT_SUPPORTED);
+               return CAMERA_ERROR_NOT_SUPPORTED;
+       }
+
+       if (mode == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x) - mode", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                         MMCAM_CAMERA_HDR_CAPTURE, mode,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+bool legacy_camera_attr_is_supported_hdr_capture(camera_h camera)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return false;
+       }
+
+       int ret = MM_ERROR_NONE;
+       int i = 0;
+       camera_s *handle = (camera_s *)camera;
+       MMCamAttrsInfo hdr_info;
+
+       ret = mm_camcorder_get_attribute_info(handle->mm_handle, MMCAM_CAMERA_HDR_CAPTURE, &hdr_info);
+       set_last_result(__convert_camera_error_code(__func__, ret));
+       if (ret != MM_ERROR_NONE) {
+               LOGE("MMCAM_CAMERA_HDR_CAPTURE get attr info failed");
+               return false;
+       }
+
+       for (i = 0; i < hdr_info.int_array.count ; i++) {
+               if (hdr_info.int_array.array[i] >= MM_CAMCORDER_HDR_ON) {
+                       LOGD("HDR capture supported");
+                       return true;
+               }
+       }
+
+       LOGD("HDR capture NOT supported");
+
+       return false;
+}
+
+
+int legacy_camera_attr_set_hdr_capture_progress_cb(camera_h camera, camera_attr_hdr_progress_cb callback, void *user_data)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x) - handle", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       if (legacy_camera_attr_is_supported_hdr_capture(camera) == false) {
+               LOGE("NOT_SUPPORTED(0x%08x)", CAMERA_ERROR_NOT_SUPPORTED);
+               return CAMERA_ERROR_NOT_SUPPORTED;
+       }
+
+       if (callback == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x) - callback", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       camera_s *handle = (camera_s *)camera;
+
+       handle->user_cb[_CAMERA_EVENT_TYPE_HDR_PROGRESS] = (void *)callback;
+       handle->user_data[_CAMERA_EVENT_TYPE_HDR_PROGRESS] = (void *)user_data;
+
+       return CAMERA_ERROR_NONE;
+}
+
+
+int legacy_camera_attr_unset_hdr_capture_progress_cb(camera_h camera)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       if (legacy_camera_attr_is_supported_hdr_capture(camera) == false) {
+               LOGE("NOT_SUPPORTED(0x%08x)", CAMERA_ERROR_NOT_SUPPORTED);
+               return CAMERA_ERROR_NOT_SUPPORTED;
+       }
+
+       camera_s *handle = (camera_s *)camera;
+
+       handle->user_cb[_CAMERA_EVENT_TYPE_HDR_PROGRESS] = (void *)NULL;
+       handle->user_data[_CAMERA_EVENT_TYPE_HDR_PROGRESS] = (void *)NULL;
+
+       return CAMERA_ERROR_NONE;
+}
+
+
+int legacy_camera_attr_enable_anti_shake(camera_h camera, bool enable)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       if (legacy_camera_attr_is_supported_anti_shake(camera) == false) {
+               LOGE("NOT_SUPPORTED(0x%08x)", CAMERA_ERROR_NOT_SUPPORTED);
+               return CAMERA_ERROR_NOT_SUPPORTED;
+       }
+
+       int ret = MM_ERROR_NONE;
+       int mode = MM_CAMCORDER_AHS_OFF;
+       camera_s *handle = (camera_s *)camera;
+
+       if (enable) {
+               mode = MM_CAMCORDER_AHS_ON;
+       }
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         MMCAM_CAMERA_ANTI_HANDSHAKE, mode,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_is_enabled_anti_shake(camera_h camera, bool *enabled)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x) - handle", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       if (legacy_camera_attr_is_supported_anti_shake(camera) == false) {
+               LOGE("NOT_SUPPORTED(0x%08x)", CAMERA_ERROR_NOT_SUPPORTED);
+               return CAMERA_ERROR_NOT_SUPPORTED;
+       }
+
+       if (enabled == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x) - enabled", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                         MMCAM_CAMERA_ANTI_HANDSHAKE, enabled,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+bool legacy_camera_attr_is_supported_anti_shake(camera_h camera)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return false;
+       }
+
+       int i = 0;
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+       MMCamAttrsInfo ash_info;
+
+       ret = mm_camcorder_get_attribute_info(handle->mm_handle, MMCAM_CAMERA_ANTI_HANDSHAKE, &ash_info);
+       set_last_result(__convert_camera_error_code(__func__, ret));
+       if (ret != MM_ERROR_NONE) {
+               LOGE("MMCAM_CAMERA_ANTI_HANDSHAKE get attr info failed");
+               return false;
+       }
+
+       for (i = 0 ; i < ash_info.int_array.count ; i++) {
+               if (ash_info.int_array.array[i] == MM_CAMCORDER_AHS_ON) {
+                       return true;
+               }
+       }
+
+       return false;
+}
+
+
+int legacy_camera_attr_enable_video_stabilization(camera_h camera, bool enable)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       if (legacy_camera_attr_is_supported_video_stabilization(camera) == false) {
+               LOGE("NOT_SUPPORTED(0x%08x)", CAMERA_ERROR_NOT_SUPPORTED);
+               return CAMERA_ERROR_NOT_SUPPORTED;
+       }
+
+       int ret = MM_ERROR_NONE;
+       int mode = MM_CAMCORDER_VIDEO_STABILIZATION_OFF;
+       camera_s *handle = (camera_s*)camera;
+
+       if (enable) {
+               mode = MM_CAMCORDER_VIDEO_STABILIZATION_ON;
+       }
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         MMCAM_CAMERA_VIDEO_STABILIZATION, mode,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_is_enabled_video_stabilization(camera_h camera, bool *enabled)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x) - handle", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       if (legacy_camera_attr_is_supported_video_stabilization(camera) == false) {
+               LOGE("NOT_SUPPORTED(0x%08x)", CAMERA_ERROR_NOT_SUPPORTED);
+               return CAMERA_ERROR_NOT_SUPPORTED;
+       }
+
+       if (enabled == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x) - enabled", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       int mode = MM_CAMCORDER_VIDEO_STABILIZATION_OFF;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                         MMCAM_CAMERA_VIDEO_STABILIZATION, &mode,
+                                         NULL);
+       if (ret == MM_ERROR_NONE) {
+               *enabled = (mode == MM_CAMCORDER_VIDEO_STABILIZATION_ON);
+       }
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+bool legacy_camera_attr_is_supported_video_stabilization(camera_h camera)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return false;
+       }
+
+       int i = 0;
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+       MMCamAttrsInfo vs_info;
+
+       ret = mm_camcorder_get_attribute_info(handle->mm_handle, MMCAM_CAMERA_VIDEO_STABILIZATION, &vs_info);
+       set_last_result(__convert_camera_error_code(__func__, ret));
+       if (ret != MM_ERROR_NONE) {
+               LOGE("MMCAM_CAMERA_VIDEO_STABILIZATION get attr info failed");
+               return false;
+       }
+
+       for (i = 0 ; i < vs_info.int_array.count ; i++) {
+               if (vs_info.int_array.array[i] == MM_CAMCORDER_VIDEO_STABILIZATION_ON) {
+                       return true;
+               }
+       }
+
+       return false;
+}
+
+
+int legacy_camera_attr_enable_auto_contrast(camera_h camera, bool enable)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       if (legacy_camera_attr_is_supported_auto_contrast(camera) == false) {
+               LOGE("NOT_SUPPORTED(0x%08x)", CAMERA_ERROR_NOT_SUPPORTED);
+               return CAMERA_ERROR_NOT_SUPPORTED;
+       }
+
+       int ret = MM_ERROR_NONE;
+       int mode = MM_CAMCORDER_WDR_OFF;
+       camera_s *handle = (camera_s *)camera;
+
+       if (enable) {
+               mode = MM_CAMCORDER_WDR_ON;
+       }
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         MMCAM_CAMERA_WDR, mode,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_is_enabled_auto_contrast(camera_h camera, bool *enabled)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x) - handle", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       if (legacy_camera_attr_is_supported_auto_contrast(camera) == false) {
+               LOGE("NOT_SUPPORTED(0x%08x)", CAMERA_ERROR_NOT_SUPPORTED);
+               return CAMERA_ERROR_NOT_SUPPORTED;
+       }
+
+       if (enabled == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x) - enabled", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       int mode = MM_CAMCORDER_WDR_OFF;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+                                         MMCAM_CAMERA_WDR, &mode,
+                                         NULL);
+
+       if (ret == MM_ERROR_NONE) {
+               *enabled = mode;
+       }
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+
+bool legacy_camera_attr_is_supported_auto_contrast(camera_h camera)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return false;
+       }
+
+       int i = 0;
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+       MMCamAttrsInfo info;
+
+       ret = mm_camcorder_get_attribute_info(handle->mm_handle, MMCAM_CAMERA_WDR, &info);
+       set_last_result(__convert_camera_error_code(__func__, ret));
+       if (ret != MM_ERROR_NONE) {
+               LOGE("MMCAM_CAMERA_WDR get attr info failed");
+               return false;
+       }
+
+       for (i = 0 ; i < info.int_array.count ; i++) {
+               if (info.int_array.array[i] == MM_CAMCORDER_WDR_ON) {
+                       return true;
+               }
+       }
+
+       return false;
+}
+
+
+int legacy_camera_attr_disable_shutter_sound(camera_h camera, bool disable)
+{
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         "capture-sound-enable", !disable,
+                                         NULL);
+       if (ret != MM_ERROR_NONE) {
+               LOGE("CAMERA_ERROR_INVALID_OPERATION : not permitted disable shutter sound");
+               return CAMERA_ERROR_INVALID_OPERATION;
+       }
+
+       return CAMERA_ERROR_NONE;
+}
diff --git a/legacy/src/legacy_camera_internal.c b/legacy/src/legacy_camera_internal.c
new file mode 100755 (executable)
index 0000000..e841f0c
--- /dev/null
@@ -0,0 +1,178 @@
+/*
+* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* 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.
+*/
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <mm.h>
+#include <mm_camcorder.h>
+#include <mm_types.h>
+#include <legacy_camera.h>
+#include <legacy_camera_internal.h>
+#include <legacy_camera_private.h>
+#include <glib.h>
+#include <dlog.h>
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "TIZEN_N_CAMERA"
+
+
+int legacy_camera_set_x11_display_rotation(camera_h camera, camera_rotation_e rotation)
+{
+       return legacy_camera_set_display_rotation(camera, rotation);
+}
+
+
+int legacy_camera_get_x11_display_rotation(camera_h camera, camera_rotation_e *rotation)
+{
+       return legacy_camera_get_display_rotation(camera, rotation);
+}
+
+
+int legacy_camera_set_x11_display_flip(camera_h camera, camera_flip_e flip)
+{
+       return legacy_camera_set_display_flip(camera, flip);
+}
+
+
+int legacy_camera_get_x11_display_flip(camera_h camera, camera_flip_e *flip)
+{
+       return legacy_camera_get_display_flip(camera, flip);
+}
+
+
+int legacy_camera_set_x11_display_visible(camera_h camera, bool visible)
+{
+       return legacy_camera_set_display_visible(camera, visible);
+}
+
+
+int legacy_camera_is_x11_display_visible(camera_h camera, bool *visible)
+{
+       return legacy_camera_is_display_visible(camera, visible);
+}
+
+
+int legacy_camera_set_x11_display_mode(camera_h camera, camera_display_mode_e mode)
+{
+       return legacy_camera_set_display_mode(camera, mode);
+}
+
+
+int legacy_camera_get_x11_display_mode(camera_h camera, camera_display_mode_e *mode)
+{
+       return legacy_camera_get_display_mode(camera, mode);
+}
+
+
+int legacy_camera_set_x11_display_pixmap(camera_h camera, legacy_camera_x11_pixmap_updated_cb callback, void *user_data)
+{
+       int ret = MM_ERROR_NONE;
+       camera_s *handle = (camera_s *)camera;
+       camera_state_e capi_state = CAMERA_STATE_NONE;
+
+       if (handle == NULL || callback == NULL) {
+               LOGE("INVALID_PARAMETER(handle:%p,callback:%p,user_data:%p)", handle, callback, user_data);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       legacy_camera_get_state(camera, &capi_state);
+       if (capi_state > CAMERA_STATE_CREATED) {
+               LOGE("INVALID STATE(state:%d)", capi_state);
+               return CAMERA_ERROR_INVALID_STATE;
+       }
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         MMCAM_DISPLAY_SURFACE, MM_DISPLAY_SURFACE_X_EXT,
+                                         MMCAM_DISPLAY_HANDLE, callback, sizeof(void *),
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+int legacy_camera_set_mused_display(camera_h camera, camera_display_type_e type)
+{
+       int ret = MM_ERROR_NONE;
+       int set_surface = MM_DISPLAY_SURFACE_X;
+       camera_s *handle = NULL;
+
+       if (camera == NULL) {
+               LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+               return CAMERA_ERROR_INVALID_PARAMETER;
+       }
+
+       handle = (camera_s *)camera;
+       handle->display_type = type;
+
+       switch(type) {
+               case CAMERA_DISPLAY_TYPE_OVERLAY:
+                       set_surface = MM_DISPLAY_SURFACE_X;
+                       LOGD("display type OVERLAY : set_surface : 0x%x", set_surface);
+                       break;
+               case CAMERA_DISPLAY_TYPE_EVAS:
+                       set_surface = MM_DISPLAY_SURFACE_EVAS;
+                       break;
+               case CAMERA_DISPLAY_TYPE_NONE:
+               default:
+                       set_surface = MM_DISPLAY_SURFACE_NULL;
+                       break;
+       }
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         MMCAM_DISPLAY_DEVICE, MM_DISPLAY_DEVICE_MAINLCD,
+                                         MMCAM_DISPLAY_SURFACE, set_surface,
+                                         NULL);
+
+       return __convert_camera_error_code(__func__, ret);
+}
+
+int legacy_camera_get_video_caps(camera_h camera, char **caps)
+{
+       int ret;
+       camera_s *handle = (camera_s *)camera;
+
+#ifdef HAVE_WAYLAND
+       ret = mm_camcorder_get_video_caps(handle->mm_handle, caps);
+       if(ret != MM_ERROR_NONE) {
+               return __convert_camera_error_code(__func__, ret);
+       }
+#endif /* HAVE_WAYLAND */
+
+       return CAMERA_ERROR_NONE;
+}
+
+int legacy_camera_set_shm_socket_path_for_mused(camera_h camera, char *socket_path)
+{
+       int ret;
+       camera_s *handle = (camera_s *)camera;
+
+       LOGE("var : %s", socket_path);
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                   MMCAM_DISPLAY_SHM_SOCKET_PATH, socket_path, strlen(socket_path),
+                                   NULL);
+
+       if (ret != MM_ERROR_NONE) {
+               LOGE("error set shm socket path attribute 0x%x", ret);
+               return __convert_camera_error_code(__func__, ret);
+       }
+
+       return CAMERA_ERROR_NONE;
+}
+
+
diff --git a/mmsvc-camera.manifest b/mmsvc-camera.manifest
new file mode 100644 (file)
index 0000000..a76fdba
--- /dev/null
@@ -0,0 +1,5 @@
+<manifest>
+       <request>
+               <domain name="_" />
+       </request>
+</manifest>
diff --git a/mmsvc-camera.pc.in b/mmsvc-camera.pc.in
new file mode 100644 (file)
index 0000000..1508489
--- /dev/null
@@ -0,0 +1,15 @@
+
+# Package Information for pkg-config
+
+prefix=@PREFIX@
+exec_prefix=/usr
+libdir=@LIB_INSTALL_DIR@
+includedir=/usr/include/media
+
+Name: @PC_NAME@
+Description: @PACKAGE_DESCRIPTION@
+Version: @VERSION@
+Requires: @PC_REQUIRED@
+Libs: -L${libdir} @PC_LDFLAGS@
+Cflags: -I${includedir}
+
diff --git a/muse/CMakeLists.txt b/muse/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..de31329
--- /dev/null
@@ -0,0 +1,67 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+SET(service "muse")
+SET(submodule "camera")
+
+SET(dependents "dlog glib-2.0 mused mm-common libtbm")
+SET(pc_dependents "dlog mm-common mused")
+SET(fw_name "${service}-${submodule}")
+PROJECT(${fw_name})
+
+SET(CMAKE_INSTALL_PREFIX /usr)
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+
+SET(INC_DIR include)
+INCLUDE_DIRECTORIES(${INC_DIR})
+
+
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(${fw_name} REQUIRED ${dependents})
+FOREACH(flag ${${fw_name}_CFLAGS})
+    SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(CMAKE_C_FLAGS "-I./include ${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Wextra -Wno-array-bounds -Wno-empty-body -Wno-ignored-qualifiers -Wno-unused-parameter -Wshadow -Wwrite-strings -Wswitch-default -Wno-unused-but-set-parameter -Wno-unused-but-set-variable")
+SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
+
+IF("${ARCH}" STREQUAL "arm")
+    ADD_DEFINITIONS("-DTARGET")
+ENDIF("${ARCH}" STREQUAL "arm")
+
+IF(WAYLAND_SUPPORT)
+    ADD_DEFINITIONS("-DHAVE_WAYLAND")
+ENDIF(WAYLAND_SUPPORT)
+IF(X11_SUPPORT)
+    ADD_DEFINITIONS("-DHAVE_X11")
+ENDIF(X11_SUPPORT)
+
+ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
+ADD_DEFINITIONS("-DTIZEN_DEBUG")
+
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIB_INSTALL_DIR}")
+
+aux_source_directory(src MUSED_SOURCES)
+ADD_LIBRARY(${fw_name} SHARED ${MUSED_SOURCES})
+
+
+TARGET_LINK_LIBRARIES(${fw_name} legacy-camera ${${fw_name}_LDFLAGS})
+
+SET_TARGET_PROPERTIES(${fw_name}
+     PROPERTIES
+     VERSION ${FULLVER}
+     SOVERSION ${MAJORVER}
+     CLEAN_DIRECT_OUTPUT 1
+)
+
+INSTALL(TARGETS ${fw_name} DESTINATION ${LIB_INSTALL_DIR})
+INSTALL(
+        DIRECTORY ${INC_DIR}/ DESTINATION include/media
+        FILES_MATCHING
+        PATTERN "*_private.h" EXCLUDE
+        PATTERN "${INC_DIR}/*.h"
+        )
+
+SET(PC_NAME ${fw_name})
+SET(PC_REQUIRED ${pc_dependents})
+SET(PC_LDFLAGS -l${fw_name})
+SET(PC_CFLAGS -I\${includedir}/media)
diff --git a/muse/include/muse_camera.h b/muse/include/muse_camera.h
new file mode 100644 (file)
index 0000000..74c7a41
--- /dev/null
@@ -0,0 +1,243 @@
+/*
+* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* 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 __MUSE_CAMERA_H__
+#define __MUSE_CAMERA_H__
+
+#ifdef _cplusplus
+extern "C" {
+#endif
+
+#include "tbm_bufmgr.h"
+#include <stdbool.h>
+#include <glib.h>
+#include <stdio.h>
+
+typedef enum {
+       MUSE_CAMERA_API_CREATE, //0
+       MUSE_CAMERA_API_DESTROY,
+       MUSE_CAMERA_API_START_PREVIEW,
+       MUSE_CAMERA_API_STOP_PREVIEW,
+       MUSE_CAMERA_API_START_CAPTURE,
+       MUSE_CAMERA_API_SUPPORT_CONTINUOUS_CAPTURE, //5
+       MUSE_CAMERA_API_START_CONTINUOUS_CAPTURE,
+       MUSE_CAMERA_API_STOP_CONTINUOUS_CAPTURE,
+       MUSE_CAMERA_API_SUPPORT_FACE_DETECTION,
+       MUSE_CAMERA_API_SUPPORT_ZERO_SHUTTER_LAG,
+       MUSE_CAMERA_API_SUPPORT_MEDIA_PACKET_PREVIEW_CB, //10
+       MUSE_CAMERA_API_GET_DEVICE_COUNT,
+       MUSE_CAMERA_API_START_FACE_DETECTION,
+       MUSE_CAMERA_API_STOP_FACE_DETECTION,
+       MUSE_CAMERA_API_GET_STATE,
+       MUSE_CAMERA_API_START_FOCUSING, //15
+       MUSE_CAMERA_API_CANCEL_FOCUSING,
+       MUSE_CAMERA_API_SET_DISPLAY,
+       MUSE_CAMERA_API_SET_PREVIEW_RESOLUTION,
+       MUSE_CAMERA_API_SET_CAPTURE_RESOLUTION,
+       MUSE_CAMERA_API_SET_CAPTURE_FORMAT, //20
+       MUSE_CAMERA_API_SET_PREVIEW_FORMAT,
+       MUSE_CAMERA_API_GET_PREVIEW_RESOLUTION,
+       MUSE_CAMERA_API_SET_DISPLAY_ROTATION,
+       MUSE_CAMERA_API_GET_DISPLAY_ROTATION,
+       MUSE_CAMERA_API_SET_DISPLAY_FLIP, //25
+       MUSE_CAMERA_API_GET_DISPLAY_FLIP,
+       MUSE_CAMERA_API_SET_DISPLAY_VISIBLE,
+       MUSE_CAMERA_API_IS_DISPLAY_VISIBLE,
+       MUSE_CAMERA_API_SET_DISPLAY_MODE,
+       MUSE_CAMERA_API_GET_DISPLAY_MODE, //30
+       MUSE_CAMERA_API_GET_CAPTURE_RESOLUTION,
+       MUSE_CAMERA_API_GET_CAPTURE_FORMAT,
+       MUSE_CAMERA_API_GET_PREVIEW_FORMAT,
+       MUSE_CAMERA_API_SET_PREVIEW_CB,
+       MUSE_CAMERA_API_UNSET_PREVIEW_CB, //35
+       MUSE_CAMERA_API_SET_MEDIA_PACKET_PREVIEW_CB,
+       MUSE_CAMERA_API_UNSET_MEDIA_PACKET_PREVIEW_CB,
+       MUSE_CAMERA_API_SET_STATE_CHANGED_CB,
+       MUSE_CAMERA_API_UNSET_STATE_CHANGED_CB,
+       MUSE_CAMERA_API_SET_INTERRUPTED_CB, //40
+       MUSE_CAMERA_API_UNSET_INTERRUPTED_CB,
+       MUSE_CAMERA_API_SET_FOCUS_CHANGED_CB,
+       MUSE_CAMERA_API_UNSET_FOCUS_CHANGED_CB,
+       MUSE_CAMERA_API_SET_ERROR_CB,
+       MUSE_CAMERA_API_UNSET_ERROR_CB, //45
+       MUSE_CAMERA_API_SET_FOREACH_SUPPORTED_PREVIEW_RESOLUTION,
+       MUSE_CAMERA_API_SET_FOREACH_SUPPORTED_CAPTURE_RESOLUTION,
+       MUSE_CAMERA_API_SET_FOREACH_SUPPORTED_CAPTURE_FORMAT,
+       MUSE_CAMERA_API_SET_FOREACH_SUPPORTED_PREVIEW_FORMAT,
+       MUSE_CAMERA_API_GET_RECOMMENDED_PREVIEW_RESOLUTION, //50
+       MUSE_CAMERA_API_ATTR_GET_LENS_ORIENTATION,
+       MUSE_CAMERA_API_ATTR_SET_THEATER_MODE,
+       MUSE_CAMERA_API_ATTR_GET_THEATER_MODE,
+       MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_THEATER_MODE,
+       MUSE_CAMERA_API_ATTR_SET_PREVIEW_FPS, //55
+       MUSE_CAMERA_API_ATTR_SET_IMAGE_QUALITY,
+       MUSE_CAMERA_API_ATTR_GET_PREVIEW_FPS,
+       MUSE_CAMERA_API_ATTR_GET_IMAGE_QUALITY,
+       MUSE_CAMERA_API_ATTR_SET_ZOOM,
+       MUSE_CAMERA_API_ATTR_SET_AF_MODE, //60
+       MUSE_CAMERA_API_ATTR_SET_AF_AREA,
+       MUSE_CAMERA_API_ATTR_CLEAR_AF_AREA,
+       MUSE_CAMERA_API_ATTR_SET_EXPOSURE_MODE,
+       MUSE_CAMERA_API_ATTR_SET_EXPOSURE,
+       MUSE_CAMERA_API_ATTR_SET_ISO, //65
+       MUSE_CAMERA_API_ATTR_SET_BRIGHTNESS,
+       MUSE_CAMERA_API_ATTR_SET_CONTRAST,
+       MUSE_CAMERA_API_ATTR_SET_WHITEBALANCE,
+       MUSE_CAMERA_API_ATTR_SET_EFFECT,
+       MUSE_CAMERA_API_ATTR_SET_SCENE_MODE, //70
+       MUSE_CAMERA_API_ATTR_ENABLE_TAG,
+       MUSE_CAMERA_API_ATTR_SET_TAG_IMAGE_DESCRIPTION,
+       MUSE_CAMERA_API_ATTR_SET_TAG_ORIENTATION,
+       MUSE_CAMERA_API_ATTR_SET_TAG_SOFTWARE,
+       MUSE_CAMERA_API_ATTR_SET_GEOTAG, //75
+       MUSE_CAMERA_API_ATTR_REMOVE_GEOTAG,
+       MUSE_CAMERA_API_ATTR_SET_FLASH_MODE,
+       MUSE_CAMERA_API_ATTR_GET_ZOOM,
+       MUSE_CAMERA_API_ATTR_GET_ZOOM_RANGE,
+       MUSE_CAMERA_API_ATTR_GET_AF_MODE, //80
+       MUSE_CAMERA_API_ATTR_GET_EXPOSURE_MODE,
+       MUSE_CAMERA_API_ATTR_GET_EXPOSURE,
+       MUSE_CAMERA_API_ATTR_GET_EXPOSURE_RANGE,
+       MUSE_CAMERA_API_ATTR_GET_ISO,
+       MUSE_CAMERA_API_ATTR_GET_BRIGHTNESS, //85
+       MUSE_CAMERA_API_ATTR_GET_BRIGHTNESS_RANGE,
+       MUSE_CAMERA_API_ATTR_GET_CONTRAST,
+       MUSE_CAMERA_API_ATTR_GET_CONTRAST_RANGE,
+       MUSE_CAMERA_API_ATTR_GET_WHITEBALANCE,
+       MUSE_CAMERA_API_ATTR_GET_EFFECT, //90
+       MUSE_CAMERA_API_ATTR_GET_SCENE_MODE,
+       MUSE_CAMERA_API_ATTR_IS_ENABLED_TAG,
+       MUSE_CAMERA_API_ATTR_GET_TAG_IMAGE_DESCRIPTION,
+       MUSE_CAMERA_API_ATTR_GET_TAG_ORIENTATION,
+       MUSE_CAMERA_API_ATTR_GET_TAG_SOFTWARE, //95
+       MUSE_CAMERA_API_ATTR_GET_GEOTAG,
+       MUSE_CAMERA_API_ATTR_GET_FLASH_MODE,
+       MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_AF_MODE,
+       MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_EXPOSURE_MODE,
+       MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_ISO, //100
+       MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_WHITEBALANCE,
+       MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_EFFECT,
+       MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_SCENE_MODE,
+       MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_FLASH_MODE,
+       MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_FPS, //105
+       MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_FPS_BY_RESOLUTION,
+       MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_STREAM_FLIP,
+       MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_STREAM_ROTATION,
+       MUSE_CAMERA_API_ATTR_SET_STREAM_ROTATION,
+       MUSE_CAMERA_API_ATTR_GET_STREAM_ROTATION, //110
+       MUSE_CAMERA_API_ATTR_SET_STREAM_FLIP,
+       MUSE_CAMERA_API_ATTR_GET_STREAM_FLIP,
+       MUSE_CAMERA_API_ATTR_SET_HDR_MODE,
+       MUSE_CAMERA_API_ATTR_GET_HDR_MODE,
+       MUSE_CAMERA_API_ATTR_IS_SUPPORTED_HDR_CAPTURE, //115
+       MUSE_CAMERA_API_ATTR_SET_HDR_CAPTURE_PROGRESS_CB,
+       MUSE_CAMERA_API_ATTR_UNSET_HDR_CAPTURE_PROGRESS_CB,
+       MUSE_CAMERA_API_ATTR_ENABLE_ANTI_SHAKE,
+       MUSE_CAMERA_API_ATTR_IS_ENABLED_ANTI_SHAKE,
+       MUSE_CAMERA_API_ATTR_IS_SUPPORTED_ANTI_SHAKE, //120
+       MUSE_CAMERA_API_ATTR_ENABLE_VIDEO_STABILIZATION,
+       MUSE_CAMERA_API_ATTR_IS_ENABLED_VIDEO_STABILIZATION,
+       MUSE_CAMERA_API_ATTR_IS_SUPPORTED_VIDEO_STABILIZATION,
+       MUSE_CAMERA_API_ATTR_ENABLE_AUTO_CONTRAST,
+       MUSE_CAMERA_API_ATTR_IS_ENABLED_AUTO_CONTRAST, //125
+       MUSE_CAMERA_API_ATTR_IS_SUPPORTED_AUTO_CONTRAST,
+       MUSE_CAMERA_API_ATTR_DISABLE_SHUTTER_SOUND,
+       MUSE_CAMERA_API_MAX
+} muse_camera_api_e;
+
+typedef enum {
+       MUSE_CAMERA_EVENT_TYPE_STATE_CHANGE, //0
+       MUSE_CAMERA_EVENT_TYPE_FOCUS_CHANGE,
+       MUSE_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE,
+       MUSE_CAMERA_EVENT_TYPE_PREVIEW,
+       MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW,
+       MUSE_CAMERA_EVENT_TYPE_CAPTURE, //5
+       MUSE_CAMERA_EVENT_TYPE_ERROR,
+       MUSE_CAMERA_EVENT_TYPE_HDR_PROGRESS,
+       MUSE_CAMERA_EVENT_TYPE_INTERRUPTED,
+       MUSE_CAMERA_EVENT_TYPE_FACE_DETECTION,
+       MUSE_CAMERA_EVENT_TYPE_VIDEO_FRAME_RENDER_ERROR, //10
+       MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_RESOLUTION,
+       MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_RESOLUTION,
+       MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_FORMAT,
+       MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_FORMAT,
+       MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_THEATER_MODE, //15
+       MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_AF_MODE,
+       MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EXPOSURE_MODE,
+       MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_ISO,
+       MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_WHITEBALANCE,
+       MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EFFECT, //20
+       MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_SCENE_MODE,
+       MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FLASH_MODE,
+       MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS,
+       MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS_BY_RESOLUTION,
+       MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_FLIP, //25
+       MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_ROTATION,
+       MUSE_CAMERA_EVENT_TYPE_NUM //27
+}muse_camera_event_e;
+
+/**
+ * @brief The structure type for data transport
+ */
+typedef struct {
+       int data_size;
+       int tbm_key;
+       tbm_bo bo;
+       tbm_bo_handle bo_handle;
+       tbm_bufmgr bufmgr;
+} muse_camera_transport_info_s;
+
+typedef struct {
+       tbm_bufmgr bufmgr;
+} muse_camera_info_s;
+
+typedef enum {
+       MUSE_CAMERA_ERROR_INVALID = -1,
+       MUSE_CAMERA_ERROR_NONE = 1,
+} muse_camera_error_e;
+
+#define MUSE_CAMERA_CB_EVENT   MUSE_CAMERA_API_MAX + 1 //129
+#define MUSE_CAMERA_MSG_MAX_LENGTH             256
+#define MUSE_CAMERA_PARSE_STRING_SIZE  200
+#define KEY_HOUSE      0x8000
+//#define FD_SHARE
+
+#ifdef USE_SHARED_MEMORY
+int camera_ipc_create_shm(int key_num, int size, void *shm_addr);
+int camera_ipc_get_shm(int key_num, int size, void *shm_addr);
+int camera_ipc_dt_shm(void *shm_addr);
+
+typedef struct _camera_shm_info{
+        int written;
+        char data[4];
+}camera_shm_info;
+#endif
+
+#define SOCKET_PATH_LENGTH 32
+#define SOCKET_PATH_BASE "/tmp/mused_gst.%d"
+#define CALLBACK_TIME_OUT 3
+#define CALLBACK_TIME_OUT_LONG 8
+
+bool muse_camera_ipc_make_tbm(muse_camera_transport_info_s *transport_info);
+int muse_camera_ipc_export_tbm(muse_camera_transport_info_s transport_info);
+bool muse_camera_ipc_init_tbm(muse_camera_transport_info_s *transport_info);
+int muse_camera_ipc_import_tbm(muse_camera_transport_info_s *transport_info);
+void muse_camera_unref_tbm(muse_camera_transport_info_s *transport_info);
+
+#ifdef __cplusplus
+}
+#endif
+#endif                         /* __MUSE_CAMERA_H__ */
diff --git a/muse/include/muse_camera_msg.h b/muse/include/muse_camera_msg.h
new file mode 100755 (executable)
index 0000000..2c148a8
--- /dev/null
@@ -0,0 +1,502 @@
+/*
+* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* 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 __CAMERA_MSG_PRIVATE_H__
+#define __CAMERA_MSG_PRIVATE_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "muse_core_msg_json.h"
+
+/**
+ * @file muse_camera_msg.h
+ * @brief This file contains the muse_camera message APIs, related structures, defines and macros.
+ */
+
+/**
+ * @brief Definition for the handle parameter.
+ */
+#define PARAM_HANDLE                   "handle"
+
+/**
+ * @brief Definition for the ret parameter.
+ */
+#define PARAM_RET                              "ret"
+
+/**
+ * @brief Definition for the event parameter.
+ */
+#define PARAM_EVENT                    "event"
+
+/**
+ * @brief Definition for the error parameter.
+ */
+#define PARAM_ERROR                    "error"
+
+/**
+ * @brief Definition for the tbm key parameter.
+ */
+#define PARAM_TBM_KEY                  "t_key"
+
+/**
+ * @brief Definition for the display mode parameter.
+ */
+#define PARAM_DISPLAY_MODE     "display_mode"
+
+/**
+ * @brief Definition for the device type parameter.
+ */
+#define PARAM_DEVICE_TYPE              "device_type"
+
+/**
+ * @brief Definition for the INTEGER type.
+ */
+typedef int32_t INT;
+
+/**
+ * @brief Definition for the 64 bit INTEGER type.
+ */
+typedef int64_t INT64;
+
+/**
+ * @brief Definition for the 64 bit integer pointer type.
+ */
+typedef intptr_t POINTER;
+
+/**
+ * @brief Definition for the 64 bit DOUBLE type.
+ */
+typedef double DOUBLE;
+
+/**
+ * @brief Definition for the 64 bit STRING type.
+ */
+typedef const char* STRING;
+
+/**
+ * @brief Query the specific value from the input message via ipc.
+ * @param[in] param The key to query, the variable name should be matched to the message's one.
+ * @param[out] buf The string of message buffer.
+ */
+#define muse_camera_msg_get(param, buf) \
+       muse_core_msg_json_deserialize(#param, buf, NULL, &param, NULL, MUSE_TYPE_ANY)
+
+/**
+ * @brief Query the specific string type value from the input message via ipc.
+ * @param[in] param The key to query, the variable name should be matched to the message's one.
+ * @param[out] buf The string of message buffer.
+ */
+#define muse_camera_msg_get_string(param, buf) \
+       muse_core_msg_json_deserialize(#param, buf, NULL, param, NULL, MUSE_TYPE_STRING)
+
+/**
+ * @brief Query the specific array type value from the input message via ipc.
+ * @param[in] param The key to query, the variable name should be matched to the message's one.
+ * @param[out] buf The string of message buffer.
+ */
+#define muse_camera_msg_get_array(param, buf) \
+       muse_core_msg_json_deserialize(#param, buf, NULL, param, NULL, MUSE_TYPE_ARRAY)
+
+/**
+ * @brief Query the specific pointer type value from the input message via ipc.
+ * @param[in] param The key to query, the variable name should be matched to the message's one.
+ * @param[out] buf The string of message buffer.
+ */
+#define muse_camera_msg_get_pointer(param, buf) \
+       muse_core_msg_json_deserialize(#param, buf, NULL, &param, NULL, MUSE_TYPE_POINTER)
+
+/**
+ * @brief Query the specific 64bit integer type value from the input message via ipc.
+ * @param[in] param The key to query, the variable name should be matched to the message's one.
+ * @param[out] buf The string of message buffer.
+ */
+#define muse_camera_msg_get_64bit(param, buf) \
+       muse_core_msg_json_deserialize(#param, buf, NULL, &param, NULL, MUSE_TYPE_INT64)
+
+/**
+ * @brief Query the specific value with error return from the input message via ipc.
+ * @param[in] param The key to query, the variable name should be matched to the message's one.
+ * @param[out] buf The string of message buffer.
+ * @param[out] e The error return from the core api.
+ */
+#define muse_camera_msg_get_error_e(param, buf, e) \
+       muse_core_msg_json_deserialize(#param, buf, NULL, &param, &e, MUSE_TYPE_ANY)
+
+/**
+ * @brief Send the message from proxy to module via ipc.
+ * @param[in] param The key to query, the variable name should be matched to the message's one.
+ * @param[out] buf The string of message buffer.
+ */
+#define muse_camera_msg_send(api, fd, cb_info, ret) \
+       do{     \
+               char *__sndMsg__; \
+               int __len__; \
+               __sndMsg__ = muse_core_msg_json_factory_new(api,        0); \
+               __len__ = muse_core_ipc_send_msg(fd, __sndMsg__); \
+               if (__len__ <= 0) { \
+                       LOGE("sending message failed"); \
+                       ret = CAMERA_ERROR_INVALID_OPERATION; \
+               } else \
+                       ret = client_wait_for_cb_return(api, cb_info, CALLBACK_TIME_OUT); \
+               muse_core_msg_json_factory_free(__sndMsg__); \
+       }while(0)
+
+#define muse_camera_msg_send_longtime(api, fd, cb_info, ret) \
+       do{     \
+               char *__sndMsg__; \
+               int __len__; \
+               __sndMsg__ = muse_core_msg_json_factory_new(api,        0); \
+               __len__ = muse_core_ipc_send_msg(fd, __sndMsg__); \
+               if (__len__ <= 0) { \
+                       LOGE("sending message failed"); \
+                       ret = CAMERA_ERROR_INVALID_OPERATION; \
+               } else \
+                       ret = client_wait_for_cb_return(api, cb_info, CALLBACK_TIME_OUT_LONG); \
+               muse_core_msg_json_factory_free(__sndMsg__); \
+       }while(0)
+
+#define muse_camera_msg_send1(api, fd, cb_info, ret, type, param) \
+       do{     \
+               char *__sndMsg__; \
+               int __len__; \
+               type __value__ = (type)param; \
+               __sndMsg__ = muse_core_msg_json_factory_new(api, \
+                               MUSE_TYPE_##type, #param, __value__, \
+                               0); \
+               __len__ = muse_core_ipc_send_msg(fd, __sndMsg__); \
+               if (__len__ <= 0) { \
+                       LOGE("sending message failed"); \
+                       ret = CAMERA_ERROR_INVALID_OPERATION; \
+               } else \
+                       ret = client_wait_for_cb_return(api, cb_info, CALLBACK_TIME_OUT); \
+               muse_core_msg_json_factory_free(__sndMsg__); \
+       }while(0)
+
+#define muse_camera_msg_send2(api, fd, cb_info, ret, type1, param1, type2, param2) \
+       do{     \
+               char *__sndMsg__; \
+               int __len__; \
+               type1 __value1__ = (type1)param1; \
+               type2 __value2__ = (type2)param2; \
+               __sndMsg__ = muse_core_msg_json_factory_new(api, \
+                               MUSE_TYPE_##type1, #param1, __value1__, \
+                               MUSE_TYPE_##type2, #param2, __value2__, \
+                               0); \
+               __len__ = muse_core_ipc_send_msg(fd, __sndMsg__); \
+               if (__len__ <= 0) { \
+                       LOGE("sending message failed"); \
+                       ret = CAMERA_ERROR_INVALID_OPERATION; \
+               } else \
+                       ret = client_wait_for_cb_return(api, cb_info, CALLBACK_TIME_OUT); \
+               muse_core_msg_json_factory_free(__sndMsg__); \
+       }while(0)
+
+#define muse_camera_msg_send3(api, fd, cb_info, ret, type1, param1, type2, param2, type3, param3) \
+       do{     \
+               char *__sndMsg__; \
+               int __len__; \
+               type1 __value1__ = (type1)param1; \
+               type2 __value2__ = (type2)param2; \
+               type3 __value3__ = (type3)param3; \
+               __sndMsg__ = muse_core_msg_json_factory_new(api, \
+                               MUSE_TYPE_##type1, #param1, __value1__, \
+                               MUSE_TYPE_##type2, #param2, __value2__, \
+                               MUSE_TYPE_##type3, #param3, __value3__, \
+                               0); \
+               __len__ = muse_core_ipc_send_msg(fd, __sndMsg__); \
+               if (__len__ <= 0) { \
+                       LOGE("sending message failed"); \
+                       ret = CAMERA_ERROR_INVALID_OPERATION; \
+               } else \
+                       ret = client_wait_for_cb_return(api, cb_info, CALLBACK_TIME_OUT); \
+               muse_core_msg_json_factory_free(__sndMsg__); \
+       }while(0)
+
+#define muse_camera_msg_send_array(api, fd, cb_info, ret, param, length, datum_size) \
+       do{     \
+               char *__sndMsg__; \
+               int __len__; \
+               int *__value__ = (int *)param; \
+               __sndMsg__ = muse_core_msg_json_factory_new(api, \
+                                       MUSE_TYPE_INT, #length, length, \
+                                       MUSE_TYPE_ARRAY, #param, \
+                                       datum_size == sizeof(int)? length :  \
+                                       length / sizeof(int) + (length % sizeof(int)?1:0), \
+                                       __value__, \
+                                       0); \
+               __len__ = muse_core_ipc_send_msg(fd, __sndMsg__); \
+               if (__len__ <= 0) { \
+                       LOGE("sending message failed"); \
+                       ret = CAMERA_ERROR_INVALID_OPERATION; \
+               } else \
+                       ret = client_wait_for_cb_return(api, cb_info, CALLBACK_TIME_OUT); \
+               muse_core_msg_json_factory_free(__sndMsg__); \
+       }while(0)
+
+#define muse_camera_msg_send1_async(api, camera, fd, type, param) \
+       do{     \
+               char *__sndMsg__; \
+               int __len__; \
+               type __value__ = (type)param; \
+               __sndMsg__ = muse_core_msg_json_factory_new(api, \
+                               MUSE_TYPE_##type, #param, __value__, \
+                               0); \
+               __len__ = muse_core_ipc_send_msg(fd, __sndMsg__); \
+               muse_core_msg_json_factory_free(__sndMsg__); \
+               if (__len__ <= 0) { \
+                       LOGE("sending message failed"); \
+                       return CAMERA_ERROR_INVALID_OPERATION; \
+               } \
+       }while(0)
+
+#define muse_camera_msg_send2_async(api, camera, fd, type1, param1, type2, param2) \
+       do{     \
+               char *__sndMsg__; \
+               int __len__; \
+               type1 __value1__ = (type1)param1; \
+               type2 __value2__ = (type2)param2; \
+               __sndMsg__ = muse_core_msg_json_factory_new(api, \
+                               MUSE_TYPE_##type1, #param1, __value1__, \
+                               MUSE_TYPE_##type2, #param2, __value2__, \
+                               0); \
+               __len__ = muse_core_ipc_send_msg(fd, __sndMsg__); \
+               muse_core_msg_json_factory_free(__sndMsg__); \
+               if (__len__ <= 0) { \
+                       LOGE("sending message failed"); \
+                       return CAMERA_ERROR_INVALID_OPERATION; \
+               } \
+       }while(0)
+
+#define muse_camera_msg_return(api, ret, module) \
+       do{     \
+               char *__sndMsg__; \
+               int __len__; \
+               __sndMsg__ = muse_core_msg_json_factory_new(api, \
+                               MUSE_TYPE_INT, PARAM_RET, ret, \
+                               0); \
+               __len__ = muse_core_ipc_send_msg(muse_core_client_get_msg_fd(module), __sndMsg__); \
+               if (__len__ <= 0) { \
+                       LOGE("sending message failed"); \
+                       ret = CAMERA_ERROR_INVALID_OPERATION; \
+               } \
+               muse_core_msg_json_factory_free(__sndMsg__); \
+       }while(0)
+
+#define muse_camera_msg_return1(api, ret, module, type, param) \
+       do{     \
+               char *__sndMsg__; \
+               int __len__; \
+               type __value__ = (type)param; \
+               __sndMsg__ = muse_core_msg_json_factory_new(api, \
+                               MUSE_TYPE_INT, PARAM_RET, ret, \
+                               MUSE_TYPE_##type, #param, __value__, \
+                               0); \
+               __len__ = muse_core_ipc_send_msg(muse_core_client_get_msg_fd(module), __sndMsg__); \
+               if (__len__ <= 0) { \
+                       LOGE("sending message failed"); \
+                       ret = CAMERA_ERROR_INVALID_OPERATION; \
+               } \
+               muse_core_msg_json_factory_free(__sndMsg__); \
+       }while(0)
+
+#define muse_camera_msg_return2(api, ret, module, type1, param1, type2, param2) \
+       do{     \
+               char *__sndMsg__; \
+               int __len__; \
+               type1 __value1__ = (type1)param1; \
+               type2 __value2__ = (type2)param2; \
+               __sndMsg__ = muse_core_msg_json_factory_new(api, \
+                               MUSE_TYPE_INT, PARAM_RET, ret, \
+                               MUSE_TYPE_##type1, #param1, __value1__, \
+                               MUSE_TYPE_##type2, #param2, __value2__, \
+                               0); \
+               __len__ = muse_core_ipc_send_msg(muse_core_client_get_msg_fd(module), __sndMsg__); \
+               if (__len__ <= 0) { \
+                       LOGE("sending message failed"); \
+                       ret = CAMERA_ERROR_INVALID_OPERATION; \
+               } \
+               muse_core_msg_json_factory_free(__sndMsg__); \
+       }while(0)
+
+#define muse_camera_msg_return3(api, ret, module, type1, param1, type2, param2, type3, param3) \
+       do{     \
+               char *__sndMsg__; \
+               int __len__; \
+               type1 __value1__ = (type1)param1; \
+               type2 __value2__ = (type2)param2; \
+               type3 __value3__ = (type3)param3; \
+               __sndMsg__ = muse_core_msg_json_factory_new(api, \
+                               MUSE_TYPE_INT, PARAM_RET, ret, \
+                               MUSE_TYPE_##type1, #param1, __value1__, \
+                               MUSE_TYPE_##type2, #param2, __value2__, \
+                               MUSE_TYPE_##type3, #param3, __value3__, \
+                               0); \
+               __len__ = muse_core_ipc_send_msg(muse_core_client_get_msg_fd(module), __sndMsg__); \
+               if (__len__ <= 0) { \
+                       LOGE("sending message failed"); \
+                       ret = CAMERA_ERROR_INVALID_OPERATION; \
+               } \
+               muse_core_msg_json_factory_free(__sndMsg__); \
+       }while(0)
+
+#define muse_camera_msg_return_array(api, ret, module, param, length, datum_size) \
+       do{     \
+               char *__sndMsg__; \
+               int __len__; \
+               int *__value__ = (int *)param; \
+               __sndMsg__ = muse_core_msg_json_factory_new(api, \
+                               MUSE_TYPE_INT, PARAM_RET, ret, \
+                               MUSE_TYPE_INT, #length, length, \
+                               MUSE_TYPE_ARRAY, #param, \
+                                       datum_size == sizeof(int)? length :  \
+                                       length / sizeof(int) + (length % sizeof(int)?1:0), \
+                                       __value__, \
+                               0); \
+               __len__ = muse_core_ipc_send_msg(muse_core_client_get_msg_fd(module), __sndMsg__); \
+               if (__len__ <= 0) { \
+                       LOGE("sending message failed"); \
+                       ret = CAMERA_ERROR_INVALID_OPERATION; \
+               } \
+               muse_core_msg_json_factory_free(__sndMsg__); \
+       }while(0)
+
+#define muse_camera_msg_event(api, event, module) \
+       do{     \
+               char *__sndMsg__; \
+               __sndMsg__ = muse_core_msg_json_factory_new(api, \
+                               MUSE_TYPE_INT, PARAM_EVENT, event, \
+                               0); \
+               muse_core_ipc_send_msg(muse_core_client_get_msg_fd(module), __sndMsg__); \
+               muse_core_msg_json_factory_free(__sndMsg__); \
+       }while(0)
+
+#define muse_camera_msg_event1(api, event, module, type, param) \
+       do{     \
+               char *__sndMsg__; \
+               type __value__ = (type)param; \
+               __sndMsg__ = muse_core_msg_json_factory_new(api, \
+                               MUSE_TYPE_INT, PARAM_EVENT, event, \
+                               MUSE_TYPE_##type, #param, __value__, \
+                               0); \
+               muse_core_ipc_send_msg(muse_core_client_get_msg_fd(module), __sndMsg__); \
+               muse_core_msg_json_factory_free(__sndMsg__); \
+       }while(0)
+
+#define muse_camera_msg_event2(api, event, module, type1, param1, type2, param2) \
+       do{     \
+               char *__sndMsg__; \
+               type1 __value1__ = (type1)param1; \
+               type2 __value2__ = (type2)param2; \
+               __sndMsg__ = muse_core_msg_json_factory_new(api, \
+                               MUSE_TYPE_INT, PARAM_EVENT, event, \
+                               MUSE_TYPE_##type1, #param1, __value1__, \
+                               MUSE_TYPE_##type2, #param2, __value2__, \
+                               0); \
+               muse_core_ipc_send_msg(muse_core_client_get_msg_fd(module), __sndMsg__); \
+               muse_core_msg_json_factory_free(__sndMsg__); \
+       }while(0)
+
+#define muse_camera_msg_event3(api, event, module, type1, param1, type2, param2, type3, param3) \
+       do{     \
+               char *__sndMsg__; \
+               type1 __value1__ = (type1)param1; \
+               type2 __value2__ = (type2)param2; \
+               type3 __value3__ = (type3)param3; \
+               __sndMsg__ = muse_core_msg_json_factory_new(api, \
+                               MUSE_TYPE_INT, PARAM_EVENT, event, \
+                               MUSE_TYPE_##type1, #param1, __value1__, \
+                               MUSE_TYPE_##type2, #param2, __value2__, \
+                               MUSE_TYPE_##type3, #param3, __value3__, \
+                               0); \
+               muse_core_ipc_send_msg(muse_core_client_get_msg_fd(module), __sndMsg__); \
+               muse_core_msg_json_factory_free(__sndMsg__); \
+       }while(0)
+
+#define muse_camera_msg_event4(api, event, module, type1, param1, type2, param2, type3, param3, type4, param4) \
+       do{     \
+               char *__sndMsg__; \
+               type1 __value1__ = (type1)param1; \
+               type2 __value2__ = (type2)param2; \
+               type3 __value3__ = (type3)param3; \
+               type4 __value4__ = (type4)param4; \
+               __sndMsg__ = muse_core_msg_json_factory_new(api, \
+                               MUSE_TYPE_INT, PARAM_EVENT, event, \
+                               MUSE_TYPE_##type1, #param1, __value1__, \
+                               MUSE_TYPE_##type2, #param2, __value2__, \
+                               MUSE_TYPE_##type3, #param3, __value3__, \
+                               MUSE_TYPE_##type4, #param4, __value4__, \
+                               0); \
+               muse_core_ipc_send_msg(muse_core_client_get_msg_fd(module), __sndMsg__); \
+               muse_core_msg_json_factory_free(__sndMsg__); \
+       }while(0)
+
+#define muse_camera_msg_event2_array(api, event, module, type1, param1, type2, param2, arr_param, length, datum_size) \
+       do{     \
+               char *__sndMsg__; \
+               type1 __value1__ = (type1)param1; \
+               type2 __value2__ = (type2)param2; \
+               int *__arr_value__ = (int *)arr_param; \
+               __sndMsg__ = muse_core_msg_json_factory_new(api, \
+                               MUSE_TYPE_INT, PARAM_EVENT, event, \
+                               MUSE_TYPE_##type1, #param1, __value1__, \
+                               MUSE_TYPE_##type2, #param2, __value2__, \
+                               MUSE_TYPE_INT, #length, length, \
+                               MUSE_TYPE_ARRAY, #arr_param, \
+                                       datum_size == sizeof(int)? length :  \
+                                       length / sizeof(int) + (length % sizeof(int)?1:0), \
+                                       __arr_value__, \
+                               0); \
+               muse_core_ipc_send_msg(muse_core_client_get_msg_fd(module), __sndMsg__); \
+               muse_core_msg_json_factory_free(__sndMsg__); \
+       }while(0)
+
+#define muse_camera_msg_event6_array(api, event, module, type1, param1, type2, param2, type3, param3, type4, param4, type5, param5, type6, param6, arr_param, length, datum_size) \
+       do{     \
+               char *__sndMsg__; \
+               type1 __value1__ = (type1)param1; \
+               type2 __value2__ = (type2)param2; \
+               type3 __value3__ = (type3)param3; \
+               type4 __value4__ = (type4)param4; \
+               type5 __value5__ = (type5)param5; \
+               type6 __value6__ = (type6)param6; \
+               int *__arr_value__ = (int *)arr_param; \
+               __sndMsg__ = muse_core_msg_json_factory_new(api, \
+                               MUSE_TYPE_INT, PARAM_EVENT, event, \
+                               MUSE_TYPE_##type1, #param1, __value1__, \
+                               MUSE_TYPE_##type2, #param2, __value2__, \
+                               MUSE_TYPE_##type3, #param3, __value3__, \
+                               MUSE_TYPE_##type4, #param4, __value4__, \
+                               MUSE_TYPE_##type5, #param5, __value5__, \
+                               MUSE_TYPE_##type6, #param6, __value6__, \
+                               MUSE_TYPE_INT, #length, length, \
+                               MUSE_TYPE_ARRAY, #arr_param, \
+                                       datum_size == sizeof(int)? length :  \
+                                       length / sizeof(int) + (length % sizeof(int)?1:0), \
+                                       __arr_value__, \
+                               0); \
+               muse_core_ipc_send_msg(muse_core_client_get_msg_fd(module), __sndMsg__); \
+               muse_core_msg_json_factory_free(__sndMsg__); \
+       }while(0)
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*__CAMERA_MSG_PRIVATE_H__*/
diff --git a/muse/src/muse_camera_dispatcher.c b/muse/src/muse_camera_dispatcher.c
new file mode 100755 (executable)
index 0000000..45a2240
--- /dev/null
@@ -0,0 +1,2780 @@
+/*
+* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* 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.
+*/
+
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <stdio.h>
+#include <dlog.h>
+#include "legacy_camera.h"
+#include "muse_camera_msg.h"
+#include "muse_camera.h"
+#include "muse_core.h"
+#include "muse_core_ipc.h"
+#include "mm_types.h"
+#include "legacy_camera_internal.h"
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "MUSED_CAMERA"
+#define KEY_NUM 9527
+
+
+void _camera_dispatcher_callback_supported_theater_mode(int param, void *user_data)
+{
+       muse_module_h module = (muse_module_h)user_data;
+       int event;
+       event = MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_THEATER_MODE;
+       LOGD("Enter!! param : %d", param);
+       muse_camera_msg_event1(MUSE_CAMERA_CB_EVENT,
+                                                               event,
+                                                               module,
+                                                               INT, param);
+}
+
+void _camera_dispatcher_callback_supported_af_mode(int param, void *user_data)
+{
+       muse_module_h module = (muse_module_h)user_data;
+       int event;
+       event = MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_AF_MODE;
+       LOGD("Enter!! param : %d", param);
+       muse_camera_msg_event1(MUSE_CAMERA_CB_EVENT,
+                                                               event,
+                                                               module,
+                                                               INT, param);
+}
+
+void _camera_dispatcher_callback_supported_exposure_mode(int param, void *user_data)
+{
+       muse_module_h module = (muse_module_h)user_data;
+       int event;
+       event = MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EXPOSURE_MODE;
+       LOGD("Enter!! param : %d", param);
+       muse_camera_msg_event1(MUSE_CAMERA_CB_EVENT,
+                                                               event,
+                                                               module,
+                                                               INT, param);
+}
+
+void _camera_dispatcher_callback_supported_iso_mode(int param, void *user_data)
+{
+       muse_module_h module = (muse_module_h)user_data;
+       int event;
+       event = MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_ISO;
+       LOGD("Enter!! param : %d", param);
+       muse_camera_msg_event1(MUSE_CAMERA_CB_EVENT,
+                                                               event,
+                                                               module,
+                                                               INT, param);
+}
+
+void _camera_dispatcher_callback_supported_whitebalance(int param, void *user_data)
+{
+       muse_module_h module = (muse_module_h)user_data;
+       int event;
+       event = MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_WHITEBALANCE;
+       LOGD("Enter!! param : %d", param);
+       muse_camera_msg_event1(MUSE_CAMERA_CB_EVENT,
+                                                               event,
+                                                               module,
+                                                               INT, param);
+}
+
+void _camera_dispatcher_callback_supported_effect(int param, void *user_data)
+{
+       muse_module_h module = (muse_module_h)user_data;
+       int event;
+       event = MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EFFECT;
+       LOGD("Enter!! param : %d", param);
+       muse_camera_msg_event1(MUSE_CAMERA_CB_EVENT,
+                                                               event,
+                                                               module,
+                                                               INT, param);
+}
+
+void _camera_dispatcher_callback_supported_scene_mode(int param, void *user_data)
+{
+       muse_module_h module = (muse_module_h)user_data;
+       int event;
+       event = MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_SCENE_MODE;
+       LOGD("Enter!! param : %d", param);
+       muse_camera_msg_event1(MUSE_CAMERA_CB_EVENT,
+                                                               event,
+                                                               module,
+                                                               INT, param);
+}
+
+void _camera_dispatcher_callback_supported_flash_mode(int param, void *user_data)
+{
+       muse_module_h module = (muse_module_h)user_data;
+       int event;
+       event = MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FLASH_MODE;
+       LOGD("Enter!! param : %d", param);
+       muse_camera_msg_event1(MUSE_CAMERA_CB_EVENT,
+                                                               event,
+                                                               module,
+                                                               INT, param);
+}
+
+void _camera_dispatcher_callback_supported_fps(int param, void *user_data)
+{
+       muse_module_h module = (muse_module_h)user_data;
+       int event;
+       event = MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS;
+       LOGD("Enter!! param : %d", param);
+       muse_camera_msg_event1(MUSE_CAMERA_CB_EVENT,
+                                                               event,
+                                                               module,
+                                                               INT, param);
+}
+
+void _camera_dispatcher_callback_supported_fps_by_resolution(int param, void *user_data)
+{
+       muse_module_h module = (muse_module_h)user_data;
+       int event;
+       event = MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS_BY_RESOLUTION;
+       LOGD("Enter!! param : %d", param);
+       muse_camera_msg_event1(MUSE_CAMERA_CB_EVENT,
+                                                               event,
+                                                               module,
+                                                               INT, param);
+}
+
+void _camera_dispatcher_callback_supported_stream_flip(int param, void *user_data)
+{
+       muse_module_h module = (muse_module_h)user_data;
+       int event;
+       event = MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_FLIP;
+       LOGD("Enter!! param : %d", param);
+       muse_camera_msg_event1(MUSE_CAMERA_CB_EVENT,
+                                                               event,
+                                                               module,
+                                                               INT, param);
+}
+
+void _camera_dispatcher_callback_supported_stream_rotation(int param, void *user_data)
+{
+       muse_module_h module = (muse_module_h)user_data;
+       int event;
+       event = MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_ROTATION;
+       LOGD("Enter!! param : %d", param);
+       muse_camera_msg_event1(MUSE_CAMERA_CB_EVENT,
+                                                               event,
+                                                               module,
+                                                               INT, param);
+}
+
+void _camera_dispatcher_callback_supported_capture_format(int param, void *user_data)
+{
+       muse_module_h module = (muse_module_h)user_data;
+       int event;
+       event = MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_FORMAT;
+       LOGD("Enter!! param : %d", param);
+       muse_camera_msg_event1(MUSE_CAMERA_CB_EVENT,
+                                                               event,
+                                                               module,
+                                                               INT, param);
+}
+
+void _camera_dispatcher_callback_supported_preview_format(int param, void *user_data)
+{
+       muse_module_h module = (muse_module_h)user_data;
+       int event;
+       event = MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_FORMAT;
+       LOGD("Enter!! param : %d", param);
+       muse_camera_msg_event1(MUSE_CAMERA_CB_EVENT,
+                                                               event,
+                                                               module,
+                                                               INT, param);
+}
+
+void _camera_dispatcher_callback_supported_preview_resolution(int param1, int param2, void *user_data)
+{
+       muse_module_h module = (muse_module_h)user_data;
+       int event;
+       event = MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_RESOLUTION;
+       LOGD("Enter!! param1 : %d, param2 : %d", param1, param2);
+       muse_camera_msg_event2(MUSE_CAMERA_CB_EVENT,
+                                                               event,
+                                                               module,
+                                                               INT, param1,
+                                                               INT, param2);
+}
+
+void _camera_dispatcher_callback_supported_capture_resolution(int param1, int param2, void *user_data)
+{
+       muse_module_h module = (muse_module_h)user_data;
+       int event;
+       event = MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_RESOLUTION;
+       LOGD("Enter!! param1 : %d, param2 : %d", param1, param2);
+       muse_camera_msg_event2(MUSE_CAMERA_CB_EVENT,
+                                                               event,
+                                                               module,
+                                                               INT, param1,
+                                                               INT, param2);
+}
+
+void _camera_dispatcher_capturing_cb(camera_image_data_s* image, camera_image_data_s* postview, camera_image_data_s* thumbnail, void *user_data)
+{
+       muse_camera_transport_info_s transport_info;
+       int tKey = 0;
+       muse_module_h module = (muse_module_h)user_data;
+       unsigned char *buf_pos = NULL;
+       int is_postview = 0;
+       int is_thumbnail = 0;
+       muse_camera_info_s *camera_data;
+       LOGD("Enter!!");
+       transport_info.data_size = 0;
+
+       if (image != NULL) {
+               if (image->size > 0) {
+                       transport_info.data_size += (sizeof(camera_image_data_s) + image->size);
+               }
+       }
+       if (postview != NULL) {
+               if (postview->size > 0) {
+                       transport_info.data_size += (sizeof(camera_image_data_s) + postview->size);
+                       is_postview = 1;
+               }
+       }
+       if (thumbnail != NULL) {
+               if (thumbnail->size > 0) {
+                       transport_info.data_size += (sizeof(camera_image_data_s) + thumbnail->size);
+                       is_thumbnail = 1;
+               }
+       }
+
+       camera_data = (muse_camera_info_s *)muse_core_client_get_cust_data(module);
+       transport_info.bufmgr = camera_data->bufmgr;
+       LOGD("transport_info.bufmgr: 0x%x", transport_info.bufmgr);
+       //muse_camera_ipc_init_tbm(&transport_info);
+       LOGD("Reinitialed transport_info.bufmgr: 0x%x", transport_info.bufmgr);
+       if (muse_camera_ipc_make_tbm(&transport_info) == FALSE) {
+               LOGE("TBM Init failed");
+               return;
+       }
+       LOGD("bohandle_ptr : 0x%x, export_bo : 0x%x, tSize : %d", transport_info.bo_handle.ptr,
+                                                                                                       transport_info.bo,
+                                                                                                       transport_info.data_size);
+
+       buf_pos = (unsigned char *)transport_info.bo_handle.ptr;
+       if (image != NULL) {
+               if (image->size > 0) {
+                       memcpy(buf_pos, image, sizeof(camera_image_data_s));
+                       buf_pos += sizeof(camera_image_data_s);
+                       memcpy(buf_pos, image->data, image->size);
+                       buf_pos += image->size;
+               }
+       }
+
+       if (is_postview) {
+               memcpy(buf_pos, postview, sizeof(camera_image_data_s));
+               buf_pos += sizeof(camera_image_data_s);
+               memcpy(buf_pos + sizeof(camera_image_data_s), postview->data, postview->size);
+               buf_pos += postview->size;
+       }
+
+       if (is_thumbnail) {
+               memcpy(buf_pos, thumbnail, sizeof(camera_image_data_s));
+               buf_pos += sizeof(camera_image_data_s);
+               memcpy(buf_pos + sizeof(camera_image_data_s), image->data, thumbnail->size);
+       }
+
+       tKey = muse_camera_ipc_export_tbm(transport_info);
+
+       tbm_bo_unmap(transport_info.bo);
+
+       if(tKey == 0) {
+               LOGE("Create key_info ERROR!!");
+               return;
+       }
+
+       LOGD("Create tKey : %d", tKey);
+
+       muse_camera_msg_event3(MUSE_CAMERA_CB_EVENT,
+                                                             MUSE_CAMERA_EVENT_TYPE_CAPTURE,
+                                                             module,
+                                                             INT, tKey,
+                                                             INT, is_postview,
+                                                             INT, is_thumbnail);
+
+       return;
+}
+
+void _camera_dispatcher_state_changed_cb(camera_state_e previous, camera_state_e current, bool by_policy, void *user_data)
+{
+       muse_module_h module = (muse_module_h)user_data;
+
+       LOGD("Enter");
+       int cb_previous = (int)previous;
+       int cb_current = (int)current;
+       int cb_by_policy = (int)by_policy;
+       muse_camera_msg_event3(MUSE_CAMERA_CB_EVENT,
+                                                               MUSE_CAMERA_EVENT_TYPE_STATE_CHANGE,
+                                                               module,
+                                                               INT, cb_previous,
+                                                               INT, cb_current,
+                                                               INT, cb_by_policy);
+       return;
+}
+
+void _camera_dispatcher_interrupted_cb(camera_policy_e policy, camera_state_e previous, camera_state_e current, void *user_data)
+{
+       muse_module_h module = (muse_module_h)user_data;
+
+       LOGD("Enter");
+       int cb_policy = (int)policy;
+       int cb_previous = (int)previous;
+       int cb_current = (int)current;
+       muse_camera_msg_event3(MUSE_CAMERA_CB_EVENT,
+                                                               MUSE_CAMERA_EVENT_TYPE_INTERRUPTED,
+                                                               module,
+                                                               INT, cb_policy,
+                                                               INT, cb_previous,
+                                                               INT, cb_current);
+       return;
+}
+
+void _camera_dispatcher_preview_cb(camera_preview_data_s *frame, void *user_data)
+{
+       muse_module_h module = (muse_module_h)user_data;
+
+       LOGD("Enter");
+
+       muse_camera_msg_event(MUSE_CAMERA_CB_EVENT,
+                                                           MUSE_CAMERA_EVENT_TYPE_PREVIEW,
+                                                           module);
+       return;
+}
+
+void _camera_dispatcher_media_packet_preview_cb(media_packet_h pkt, void *user_data)
+{
+       muse_module_h module = (muse_module_h)user_data;
+
+       LOGD("Enter");
+
+       muse_camera_msg_event(MUSE_CAMERA_CB_EVENT,
+                                                           MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW,
+                                                           module);
+       return;
+}
+
+void _camera_dispatcher_capture_completed_cb(void *user_data)
+{
+       muse_module_h module = (muse_module_h)user_data;
+
+       LOGD("Enter");
+
+       muse_camera_msg_event(MUSE_CAMERA_CB_EVENT,
+                                                           MUSE_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE,
+                                                           module);
+       return;
+}
+
+void _camera_dispatcher_face_detected_cb(camera_detected_face_s *faces, int count, void *user_data)
+{
+       muse_module_h module = (muse_module_h)user_data;
+
+       LOGD("Enter");
+
+       muse_camera_msg_event1(MUSE_CAMERA_CB_EVENT,
+                                                           MUSE_CAMERA_EVENT_TYPE_FACE_DETECTION,
+                                                           module,
+                                                           INT, count);
+       return;
+}
+
+void _camera_dispatcher_focus_changed_cb(camera_focus_state_e state, void *user_data)
+{
+       muse_module_h module = (muse_module_h)user_data;
+       int cb_state = (int)state;
+       LOGD("Enter");
+
+       muse_camera_msg_event1(MUSE_CAMERA_CB_EVENT,
+                                                           MUSE_CAMERA_EVENT_TYPE_FOCUS_CHANGE,
+                                                           module,
+                                                           INT, cb_state);
+       return;
+}
+
+void _camera_dispatcher_error_cb(camera_error_e error, camera_state_e current_state, void *user_data)
+{
+       muse_module_h module = (muse_module_h)user_data;
+       int cb_error = (int)error;
+       int cb_current_state = (int)current_state;
+       LOGD("Enter");
+
+       muse_camera_msg_event2(MUSE_CAMERA_CB_EVENT,
+                                                           MUSE_CAMERA_EVENT_TYPE_ERROR,
+                                                           module,
+                                                           INT, cb_error,
+                                                           INT, cb_current_state);
+       return;
+}
+
+void _camera_dispatcher_hdr_progress_cb(int percent, void *user_data)
+{
+       muse_module_h module = (muse_module_h)user_data;
+       LOGD("Enter");
+
+       muse_camera_msg_event1(MUSE_CAMERA_CB_EVENT,
+                                                           MUSE_CAMERA_EVENT_TYPE_HDR_PROGRESS,
+                                                           module,
+                                                           INT, percent);
+       return;
+}
+
+int camera_dispatcher_create(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       int device_type;
+       intptr_t handle;
+       muse_camera_info_s *camera_data;
+       tbm_bufmgr bufmgr;
+       camera_h camera;
+       muse_camera_api_e api = MUSE_CAMERA_API_CREATE;
+       muse_camera_msg_get(device_type, muse_core_client_get_msg(module));
+       ret = legacy_camera_create((camera_device_e)device_type, &camera);
+       handle = (intptr_t)camera;
+       LOGD("device_type : %d, handle : 0x%x, ret : 0x%x", device_type, handle, ret);
+
+       if (ret == CAMERA_ERROR_NONE) {
+               muse_core_ipc_set_handle(module, handle);
+               camera_data = (muse_camera_info_s *)g_new(muse_camera_info_s, sizeof(muse_camera_info_s));
+               muse_core_ipc_get_bufmgr(&bufmgr);
+               LOGD("bufmgr: 0x%x", bufmgr);
+               if (bufmgr != NULL) {
+                       camera_data->bufmgr = bufmgr;
+                       LOGD("camera_data->bufmgr: 0x%x", camera_data->bufmgr);
+                       muse_core_client_set_cust_data(module, (void *)camera_data);
+               } else {
+                       LOGE("TBM bufmgr is NULL => check the legacy_core.");
+               }
+               muse_camera_msg_return1(api, ret, module, POINTER, handle);
+       } else {
+               muse_camera_msg_return(api, ret, module);
+       }
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_destroy(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_DESTROY;
+       muse_camera_info_s *camera_data;
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("Enter, handle : 0x%x", handle);
+       ret = legacy_camera_destroy((camera_h)handle);
+       muse_camera_msg_return(api, ret, module);
+
+       camera_data = (muse_camera_info_s *)muse_core_client_get_cust_data(module);
+       if (camera_data != NULL) {
+               g_free(camera_data);
+               camera_data = NULL;
+       }
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_start_preview(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_START_PREVIEW;
+       char *caps = NULL;
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_start_preview((camera_h)handle);
+       LOGD("enter ret : 0x%x", ret);
+       if(ret == CAMERA_ERROR_NONE) {
+               LOGD("enter");
+               ret = legacy_camera_get_video_caps((camera_h)handle, &caps);
+               LOGD("ret : 0x%x", ret);
+               if((ret == CAMERA_ERROR_NONE) && caps) {
+                       LOGD("caps : %s", caps);
+                       muse_camera_msg_return1(api, ret, module, STRING, caps);
+                       g_free(caps);
+                       return MUSE_CAMERA_ERROR_NONE;
+               } else {
+                       LOGD("Failed to get server's video caps");
+                       muse_camera_msg_return(api, ret, module);
+                       return ret;
+               }
+       } else {
+               LOGD("start preview failed");
+               muse_camera_msg_return(api, ret, module);
+               return ret;
+       }
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_stop_preview(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_STOP_PREVIEW;
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_stop_preview((camera_h)handle);
+       muse_camera_msg_return(api, ret, module);
+       return MUSE_CAMERA_ERROR_NONE;
+
+}
+
+int camera_dispatcher_start_capture(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int is_capturing_cb = 0;
+       int is_completed_cb = 0;
+       void *capturing_cb = NULL;
+       void *completed_cb = NULL;
+       muse_camera_api_e api = MUSE_CAMERA_API_START_CAPTURE;
+       handle = muse_core_ipc_get_handle(module);
+       muse_camera_msg_get(is_capturing_cb, muse_core_client_get_msg(module));
+       muse_camera_msg_get(is_completed_cb, muse_core_client_get_msg(module));
+       LOGD("Enter, handle : 0x%x, module : %d", handle, module);
+
+       if (is_capturing_cb)
+               capturing_cb = _camera_dispatcher_capturing_cb;
+       if (is_completed_cb)
+               completed_cb = _camera_dispatcher_capture_completed_cb;
+
+       LOGD("is_capturing_cb :%d, is_completed_cb : %d", is_capturing_cb, is_completed_cb);
+       ret = legacy_camera_start_capture((camera_h)handle,
+                                                       (camera_capturing_cb)capturing_cb,
+                                                       (camera_capture_completed_cb)completed_cb,
+                                                       (void *)module);
+
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_is_supported_continuous_capture(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_SUPPORT_CONTINUOUS_CAPTURE;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_is_supported_continuous_capture((camera_h)handle);
+       LOGD("is supported ret : %d", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_start_continuous_capture(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int count;
+       int interval;
+       muse_camera_api_e api = MUSE_CAMERA_API_START_CONTINUOUS_CAPTURE;
+       handle = muse_core_ipc_get_handle(module);
+       muse_camera_msg_get(count, muse_core_client_get_msg(module));
+       muse_camera_msg_get(interval, muse_core_client_get_msg(module));
+       LOGD("Enter, handle : 0x%x, module : %d", handle, module);
+       ret = legacy_camera_start_continuous_capture((camera_h)handle,
+                                                                               count,
+                                                                               interval,
+                                                                               (camera_capturing_cb)_camera_dispatcher_capturing_cb,
+                                                                               NULL,
+                                                                               (void *)module);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_stop_continuous_capture(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_STOP_CONTINUOUS_CAPTURE;
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_stop_continuous_capture((camera_h)handle);
+       muse_camera_msg_return(api, ret, module);
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_is_supported_face_detection(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_SUPPORT_FACE_DETECTION;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_is_supported_face_detection((camera_h)handle);
+       LOGD("is supported ret : %d", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_is_supported_zero_shutter_lag(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_SUPPORT_ZERO_SHUTTER_LAG;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_is_supported_zero_shutter_lag((camera_h)handle);
+       LOGD("is supported ret : %d", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_is_supported_media_packet_preview_cb(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_SUPPORT_MEDIA_PACKET_PREVIEW_CB;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_is_supported_media_packet_preview_cb((camera_h)handle);
+       LOGD("is supported ret : %d", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_get_device_count(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int get_device_count;
+       muse_camera_api_e api = MUSE_CAMERA_API_GET_DEVICE_COUNT;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_get_device_count((camera_h)handle, &get_device_count);
+       LOGD("ret : %d, device count : %d", ret, get_device_count);
+       muse_camera_msg_return1(api, ret, module, INT, get_device_count);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_start_face_detection(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_START_FACE_DETECTION;
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("Enter, handle : 0x%x, module : %d", handle, module);
+
+       /*
+        * TODO : set callback handler.
+        */
+       ret = legacy_camera_start_face_detection((camera_h)handle, NULL, NULL);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_stop_face_detection(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_STOP_FACE_DETECTION;
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_stop_face_detection((camera_h)handle);
+       muse_camera_msg_return(api, ret, module);
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_get_state(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int get_state;
+       camera_state_e state;
+       muse_camera_api_e api = MUSE_CAMERA_API_GET_STATE;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_get_state((camera_h)handle, &state);
+       LOGD("ret : %d, state : %d", ret, state);
+       get_state = (int)state;
+       muse_camera_msg_return1(api, ret, module, INT, get_state);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_start_focusing(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int is_continuous;
+       muse_camera_api_e api = MUSE_CAMERA_API_START_FOCUSING;
+       handle = muse_core_ipc_get_handle(module);
+       muse_camera_msg_get(is_continuous, muse_core_client_get_msg(module));
+       LOGD("Enter, handle : 0x%x, module : %d", handle, module);
+       ret = legacy_camera_start_focusing((camera_h)handle, (bool)is_continuous);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_stop_focusing(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_CANCEL_FOCUSING;
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_cancel_focusing((camera_h)handle);
+       muse_camera_msg_return(api, ret, module);
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_set_display(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int display_type;
+       int display_surface;
+       muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY;
+       static guint stream_id = 0;
+       char socket_path[SOCKET_PATH_LENGTH] = {0,};
+       camera_h camera;
+
+       handle = muse_core_ipc_get_handle(module);
+       muse_camera_msg_get(display_type, muse_core_client_get_msg(module));
+       muse_camera_msg_get(display_surface, muse_core_client_get_msg(module));
+       LOGD("handle : 0x%x, display_type : %d", handle, display_type);
+
+       camera = (camera_h)handle;
+       stream_id = muse_core_get_atomic_uint();
+       snprintf(socket_path, SOCKET_PATH_LENGTH, SOCKET_PATH_BASE, stream_id);
+       LOGD("socket_path : %s", socket_path);
+       ret = legacy_camera_set_shm_socket_path_for_mused(camera, socket_path);
+
+       ret |= legacy_camera_set_mused_display((camera_h)handle, (camera_display_type_e)display_type);
+
+       if (ret != CAMERA_ERROR_NONE) {
+               muse_camera_msg_return(api, ret, module);
+       } else {
+               muse_camera_msg_return1(api, ret, module,
+                                                               STRING, socket_path);
+       }
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_set_preview_resolution(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int width;
+       int height;
+       muse_camera_api_e api = MUSE_CAMERA_API_SET_PREVIEW_RESOLUTION;
+
+       handle = muse_core_ipc_get_handle(module);
+       muse_camera_msg_get(width, muse_core_client_get_msg(module));
+       muse_camera_msg_get(height, muse_core_client_get_msg(module));
+       LOGD("handle : 0x%x, set_width : %d, set_height : 0x%x", handle, width, height);
+       ret = legacy_camera_set_preview_resolution((camera_h)handle, width, height);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_set_capture_resolution(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int width;
+       int height;
+       muse_camera_api_e api = MUSE_CAMERA_API_SET_CAPTURE_RESOLUTION;
+
+       handle = muse_core_ipc_get_handle(module);
+       muse_camera_msg_get(width, muse_core_client_get_msg(module));
+       muse_camera_msg_get(height, muse_core_client_get_msg(module));
+       LOGD("handle : 0x%x, set_width : %d, set_height : %d", handle, width, height);
+       ret = legacy_camera_set_capture_resolution((camera_h)handle, width, height);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_set_capture_format(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int set_format;
+       muse_camera_api_e api = MUSE_CAMERA_API_SET_CAPTURE_FORMAT;
+
+       handle = muse_core_ipc_get_handle(module);
+       muse_camera_msg_get(set_format, muse_core_client_get_msg(module));
+       LOGD("handle : 0x%x, set_format : %d", handle, set_format);
+       ret = legacy_camera_set_capture_format((camera_h)handle, (camera_pixel_format_e)set_format);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_set_preview_format(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int set_format;
+       muse_camera_api_e api = MUSE_CAMERA_API_SET_PREVIEW_FORMAT;
+
+       handle = muse_core_ipc_get_handle(module);
+       muse_camera_msg_get(set_format, muse_core_client_get_msg(module));
+       LOGD("handle : 0x%x, set_format : %d", handle, set_format);
+       ret = legacy_camera_set_preview_format((camera_h)handle, (camera_pixel_format_e)set_format);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_get_preview_resolution(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int get_width;
+       int get_height;
+       muse_camera_api_e api = MUSE_CAMERA_API_GET_PREVIEW_RESOLUTION;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_get_preview_resolution((camera_h)handle, &get_width, &get_height);
+       muse_camera_msg_return2(api, ret, module, INT, get_width, INT, get_height);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_set_display_rotation(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int set_rotation;
+       muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY_ROTATION;
+
+       handle = muse_core_ipc_get_handle(module);
+       muse_camera_msg_get(set_rotation, muse_core_client_get_msg(module));
+       LOGD("handle : 0x%x, set_rotation : %d", handle, set_rotation);
+       ret = legacy_camera_set_display_rotation((camera_h)handle, (camera_rotation_e)set_rotation);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_get_display_rotation(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       camera_rotation_e rotation;
+       int get_rotation;
+       muse_camera_api_e api = MUSE_CAMERA_API_GET_DISPLAY_ROTATION;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_get_display_rotation((camera_h)handle, &rotation);
+       get_rotation = (int)rotation;
+       muse_camera_msg_return1(api, ret, module, INT, get_rotation);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_set_display_flip(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int set_flip;
+       muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY_FLIP;
+
+       handle = muse_core_ipc_get_handle(module);
+       muse_camera_msg_get(set_flip, muse_core_client_get_msg(module));
+       LOGD("handle : 0x%x, set_flip : %d", handle, set_flip);
+       ret = legacy_camera_set_display_flip((camera_h)handle, (camera_flip_e)set_flip);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_get_display_flip(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int get_flip;
+       camera_flip_e flip;
+       muse_camera_api_e api = MUSE_CAMERA_API_GET_DISPLAY_FLIP;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_get_display_flip((camera_h)handle, &flip);
+       get_flip = (int)flip;
+       muse_camera_msg_return1(api, ret, module, INT, get_flip);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_set_display_visible(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int set_visible;
+       muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY_VISIBLE;
+
+       handle = muse_core_ipc_get_handle(module);
+       muse_camera_msg_get(set_visible, muse_core_client_get_msg(module));
+       LOGD("handle : 0x%x, set_visible : %d", handle, set_visible);
+       ret = legacy_camera_set_display_visible((camera_h)handle, (bool)set_visible);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_is_display_visible(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int get_visible;
+       bool visible;
+       muse_camera_api_e api = MUSE_CAMERA_API_IS_DISPLAY_VISIBLE;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_is_display_visible((camera_h)handle, &visible);
+       get_visible = (int)visible;
+       muse_camera_msg_return1(api, ret, module, INT, get_visible);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_set_display_mode(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int set_mode;
+       muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY_MODE;
+
+       handle = muse_core_ipc_get_handle(module);
+       muse_camera_msg_get(set_mode, muse_core_client_get_msg(module));
+       LOGD("handle : 0x%x, display_mode : %d", handle, set_mode);
+       ret = legacy_camera_set_display_mode((camera_h)handle, (camera_display_mode_e)set_mode);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_get_display_mode(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int get_mode;
+       camera_display_mode_e mode;
+       muse_camera_api_e api = MUSE_CAMERA_API_GET_DISPLAY_MODE;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_get_display_mode((camera_h)handle, &mode);
+       get_mode = (int)mode;
+       muse_camera_msg_return1(api, ret, module, INT, get_mode);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_get_capture_resolution(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int get_width;
+       int get_height;
+       muse_camera_api_e api = MUSE_CAMERA_API_GET_CAPTURE_RESOLUTION;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_get_capture_resolution((camera_h)handle, &get_width, &get_height);
+       muse_camera_msg_return2(api, ret, module, INT, get_width, INT, get_height);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_get_capture_format(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int get_format;
+       camera_pixel_format_e format;
+       muse_camera_api_e api = MUSE_CAMERA_API_GET_CAPTURE_FORMAT;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_get_capture_format((camera_h)handle, &format);
+       get_format = (int)format;
+       muse_camera_msg_return1(api, ret, module, INT, get_format);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_get_preview_format(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int get_format;
+       camera_pixel_format_e format;
+       muse_camera_api_e api = MUSE_CAMERA_API_GET_PREVIEW_FORMAT;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_get_preview_format((camera_h)handle, &format);
+       get_format = (int)format;
+       muse_camera_msg_return1(api, ret, module, INT, get_format);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_set_preview_cb(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_SET_PREVIEW_CB;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+
+       ret = legacy_camera_set_preview_cb((camera_h)handle,
+                                                               (camera_preview_cb)_camera_dispatcher_preview_cb,
+                                                               (void *)module);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_unset_preview_cb(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_UNSET_PREVIEW_CB;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_unset_preview_cb((camera_h)handle);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_set_media_packet_preview_cb(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_SET_MEDIA_PACKET_PREVIEW_CB;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+
+       ret = legacy_camera_set_media_packet_preview_cb((camera_h)handle,
+                                               (camera_media_packet_preview_cb)_camera_dispatcher_media_packet_preview_cb,
+                                               (void *)module);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_unset_media_packet_preview_cb(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_UNSET_MEDIA_PACKET_PREVIEW_CB;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_unset_media_packet_preview_cb((camera_h)handle);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_set_state_changed_cb(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_SET_STATE_CHANGED_CB;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+
+       ret = legacy_camera_set_state_changed_cb((camera_h)handle,
+                                                                       (camera_state_changed_cb)_camera_dispatcher_state_changed_cb,
+                                                                       (void *)module);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_unset_state_changed_cb(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_UNSET_STATE_CHANGED_CB;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_unset_state_changed_cb((camera_h)handle);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_set_interrupted_cb(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_SET_INTERRUPTED_CB;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+
+       ret = legacy_camera_set_interrupted_cb((camera_h)handle,
+                                                               (camera_interrupted_cb)_camera_dispatcher_interrupted_cb,
+                                                               (void *)module);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_unset_interrupted_cb(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_UNSET_INTERRUPTED_CB;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_unset_interrupted_cb((camera_h)handle);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_set_focus_changed_cb(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_SET_FOCUS_CHANGED_CB;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_set_focus_changed_cb((camera_h)handle,
+                                                               (camera_focus_changed_cb)_camera_dispatcher_focus_changed_cb,
+                                                               (void *)module);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_unset_focus_changed_cb(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_UNSET_FOCUS_CHANGED_CB;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_unset_focus_changed_cb((camera_h)handle);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_set_error_cb(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_SET_ERROR_CB;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+
+       ret = legacy_camera_set_error_cb((camera_h)handle,
+                                                       (camera_error_cb)_camera_dispatcher_error_cb,
+                                                       (void *)module);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_unset_error_cb(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_UNSET_ERROR_CB;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_unset_error_cb((camera_h)handle);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_foreach_supported_preview_resolution(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_SET_FOREACH_SUPPORTED_PREVIEW_RESOLUTION;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+
+       ret = legacy_camera_foreach_supported_preview_resolution((camera_h)handle,
+                                               (camera_supported_preview_resolution_cb)_camera_dispatcher_callback_supported_preview_resolution,
+                                               (void *)module);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_foreach_supported_capture_resolution(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_SET_FOREACH_SUPPORTED_CAPTURE_RESOLUTION;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+
+       ret = legacy_camera_foreach_supported_capture_resolution((camera_h)handle,
+                                               (camera_supported_capture_resolution_cb)_camera_dispatcher_callback_supported_capture_resolution,
+                                               (void *)module);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_foreach_supported_capture_format(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_SET_FOREACH_SUPPORTED_CAPTURE_FORMAT;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+
+       ret = legacy_camera_foreach_supported_capture_format((camera_h)handle,
+                                               (camera_supported_capture_format_cb)_camera_dispatcher_callback_supported_capture_format,
+                                               (void *)module);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_foreach_supported_preview_format(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_SET_FOREACH_SUPPORTED_PREVIEW_FORMAT;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+
+       ret = legacy_camera_foreach_supported_preview_format((camera_h)handle,
+                                               (camera_supported_preview_format_cb)_camera_dispatcher_callback_supported_preview_format,
+                                               (void *)module);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_get_recommended_preview_resolution(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int get_width;
+       int get_height;
+       muse_camera_api_e api = MUSE_CAMERA_API_GET_RECOMMENDED_PREVIEW_RESOLUTION;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_get_recommended_preview_resolution((camera_h)handle, &get_width, &get_height);
+       muse_camera_msg_return2(api, ret, module, INT, get_width, INT, get_height);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_get_lens_orientation(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int get_angle;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_LENS_ORIENTATION;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_get_lens_orientation((camera_h)handle, &get_angle);
+       muse_camera_msg_return1(api, ret, module, INT, get_angle);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_set_theater_mode(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int set_mode;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_THEATER_MODE;
+
+       handle = muse_core_ipc_get_handle(module);
+       muse_camera_msg_get(set_mode, muse_core_client_get_msg(module));
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_set_theater_mode((camera_h)handle, (camera_attr_theater_mode_e)set_mode);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_get_theater_mode(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int get_mode;
+       camera_attr_theater_mode_e mode;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_THEATER_MODE;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_get_theater_mode((camera_h)handle, &mode);
+       get_mode = (int)mode;
+       muse_camera_msg_return1(api, ret, module, INT, get_mode);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_foreach_supported_theater_mode(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_THEATER_MODE;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+
+       ret = legacy_camera_attr_foreach_supported_theater_mode((camera_h)handle,
+                                               (camera_attr_supported_theater_mode_cb)_camera_dispatcher_callback_supported_theater_mode,
+                                               (void *)module);
+
+       muse_camera_msg_return(api, ret, module);
+
+       LOGD("ret : 0x%x!!!!!!!!!!", ret);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_set_preview_fps(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int set_fps;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_PREVIEW_FPS;
+
+       handle = muse_core_ipc_get_handle(module);
+       muse_camera_msg_get(set_fps, muse_core_client_get_msg(module));
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_set_preview_fps((camera_h)handle, (camera_attr_fps_e)set_fps);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_set_image_quality(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int quality;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_IMAGE_QUALITY;
+
+       handle = muse_core_ipc_get_handle(module);
+       muse_camera_msg_get(quality, muse_core_client_get_msg(module));
+       LOGD("handle : 0x%x, image_quality : %d", handle, quality);
+       ret = legacy_camera_attr_set_image_quality((camera_h)handle, quality);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_get_preview_fps(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       camera_attr_fps_e fps;
+       int get_fps;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_PREVIEW_FPS;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_get_preview_fps((camera_h)handle, &fps);
+       get_fps = (int)fps;
+       muse_camera_msg_return1(api, ret, module, INT, get_fps);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_get_image_quality(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int get_quality;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_IMAGE_QUALITY;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_get_image_quality((camera_h)handle, &get_quality);
+       muse_camera_msg_return1(api, ret, module, INT, get_quality);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_set_zoom(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int zoom;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_ZOOM;
+
+       handle = muse_core_ipc_get_handle(module);
+       muse_camera_msg_get(zoom, muse_core_client_get_msg(module));
+       LOGD("handle : 0x%x, zoom : %d", handle, zoom);
+       ret = legacy_camera_attr_set_zoom((camera_h)handle, zoom);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_set_af_mode(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int set_mode;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_AF_MODE;
+
+       handle = muse_core_ipc_get_handle(module);
+       muse_camera_msg_get(set_mode, muse_core_client_get_msg(module));
+       LOGD("handle : 0x%x, set_mode : %d", handle, set_mode);
+       ret = legacy_camera_attr_set_af_mode((camera_h)handle, (camera_attr_af_mode_e)set_mode);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_set_af_area(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int x;
+       int y;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_AF_AREA;
+
+       handle = muse_core_ipc_get_handle(module);
+       muse_camera_msg_get(x, muse_core_client_get_msg(module));
+       muse_camera_msg_get(y, muse_core_client_get_msg(module));
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_set_af_area((camera_h)handle, x, y);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_clear_af_area(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_CLEAR_AF_AREA;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_clear_af_area((camera_h)handle);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_set_exposure_mode(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int set_mode;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_EXPOSURE_MODE;
+
+       handle = muse_core_ipc_get_handle(module);
+       muse_camera_msg_get(set_mode, muse_core_client_get_msg(module));
+       LOGD("handle : 0x%x, set_mode : %d", handle, set_mode);
+       ret = legacy_camera_attr_set_exposure_mode((camera_h)handle, (camera_attr_exposure_mode_e)set_mode);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_set_exposure(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int value;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_EXPOSURE;
+
+       handle = muse_core_ipc_get_handle(module);
+       muse_camera_msg_get(value, muse_core_client_get_msg(module));
+       LOGD("handle : 0x%x, value : %d", handle, value);
+       ret = legacy_camera_attr_set_exposure((camera_h)handle, value);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_set_iso(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int set_iso;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_ISO;
+
+       handle = muse_core_ipc_get_handle(module);
+       muse_camera_msg_get(set_iso, muse_core_client_get_msg(module));
+       LOGD("handle : 0x%x, set_iso : %d", handle, set_iso);
+       ret = legacy_camera_attr_set_iso((camera_h)handle, (camera_attr_iso_e)set_iso);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_set_brightness(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int level;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_BRIGHTNESS;
+
+       handle = muse_core_ipc_get_handle(module);
+       muse_camera_msg_get(level, muse_core_client_get_msg(module));
+       LOGD("handle : 0x%x, level : %d", handle, level);
+       ret = legacy_camera_attr_set_brightness((camera_h)handle, level);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_set_contrast(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int level;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_CONTRAST;
+
+       handle = muse_core_ipc_get_handle(module);
+       muse_camera_msg_get(level, muse_core_client_get_msg(module));
+       LOGD("handle : 0x%x, level : %d", handle, level);
+       ret = legacy_camera_attr_set_contrast((camera_h)handle, level);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_set_whitebalance(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int set_whitebalance;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_WHITEBALANCE;
+
+       handle = muse_core_ipc_get_handle(module);
+       muse_camera_msg_get(set_whitebalance, muse_core_client_get_msg(module));
+       LOGD("handle : 0x%x, set_whitebalance : %d", handle, set_whitebalance);
+       ret = legacy_camera_attr_set_whitebalance((camera_h)handle, (camera_attr_whitebalance_e)set_whitebalance);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_set_effect(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int set_effect;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_EFFECT;
+
+       handle = muse_core_ipc_get_handle(module);
+       muse_camera_msg_get(set_effect, muse_core_client_get_msg(module));
+       LOGD("handle : 0x%x, set_effect : %d", handle, set_effect);
+       ret = legacy_camera_attr_set_effect((camera_h)handle, (camera_attr_effect_mode_e)set_effect);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_set_scene_mode(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int set_mode;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_SCENE_MODE;
+
+       handle = muse_core_ipc_get_handle(module);
+       muse_camera_msg_get(set_mode, muse_core_client_get_msg(module));
+       LOGD("handle : 0x%x, set_mode : %d", handle, set_mode);
+       ret = legacy_camera_attr_set_scene_mode((camera_h)handle, (camera_attr_scene_mode_e)set_mode);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_enable_tag(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int set_enable;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_ENABLE_TAG;
+
+       handle = muse_core_ipc_get_handle(module);
+       muse_camera_msg_get(set_enable, muse_core_client_get_msg(module));
+       LOGD("handle : 0x%x, set_enable : %d", handle, set_enable);
+       ret = legacy_camera_attr_enable_tag((camera_h)handle, (bool)set_enable);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_set_tag_image_description(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_TAG_IMAGE_DESCRIPTION;
+       char description[MUSE_MSG_MAX_LENGTH] = {0,};
+
+       handle = muse_core_ipc_get_handle(module);
+       muse_camera_msg_get_string(description, muse_core_client_get_msg(module));
+       LOGD("handle : 0x%x, description : %s", handle, description);
+       ret = legacy_camera_attr_set_tag_image_description((camera_h)handle, description);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_set_tag_orientation(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int set_orientation;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_TAG_ORIENTATION;
+
+       handle = muse_core_ipc_get_handle(module);
+       muse_camera_msg_get(set_orientation, muse_core_client_get_msg(module));
+       LOGD("handle : 0x%x, set_orientation : %d", handle, set_orientation);
+       ret = legacy_camera_attr_set_tag_orientation((camera_h)handle, (camera_attr_tag_orientation_e)set_orientation);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_set_tag_software(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_TAG_SOFTWARE;
+       char software[MUSE_MSG_MAX_LENGTH] = {0,};
+
+       handle = muse_core_ipc_get_handle(module);
+       muse_camera_msg_get_string(software, muse_core_client_get_msg(module));
+       LOGD("handle : 0x%x, software : %s", handle, software);
+       ret = legacy_camera_attr_set_tag_software((camera_h)handle, software);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_set_geotag(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_GEOTAG;
+       double set_geotag[3] = {0,};
+
+       handle = muse_core_ipc_get_handle(module);
+       muse_camera_msg_get_array(set_geotag, muse_core_client_get_msg(module));
+       LOGD("handle : 0x%x, set_geotag1 : %d, set_geotag2 : %d, set_geotag3 : %d", handle, set_geotag[0], set_geotag[1], set_geotag[2]);
+       ret = legacy_camera_attr_set_geotag((camera_h)handle, set_geotag[0], set_geotag[1], set_geotag[2]);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_remove_geotag(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_REMOVE_GEOTAG;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_remove_geotag((camera_h)handle);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_set_flash_mode(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int set_mode;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_FLASH_MODE;
+
+       handle = muse_core_ipc_get_handle(module);
+       muse_camera_msg_get(set_mode, muse_core_client_get_msg(module));
+       LOGD("handle : 0x%x, set_mode : %d", handle, set_mode);
+       ret = legacy_camera_attr_set_flash_mode((camera_h)handle, (camera_attr_flash_mode_e)set_mode);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_get_zoom(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int get_zoom;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_ZOOM;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_get_zoom((camera_h)handle, &get_zoom);
+       muse_camera_msg_return1(api, ret, module, INT, get_zoom);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_get_zoom_range(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int get_min;
+       int get_max;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_ZOOM_RANGE;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_get_zoom_range((camera_h)handle, &get_min, &get_max);
+       muse_camera_msg_return2(api, ret, module, INT, get_min, INT, get_max);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_get_af_mode(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       camera_attr_af_mode_e mode;
+       int get_mode;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_AF_MODE;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_get_af_mode((camera_h)handle, &mode);
+       get_mode = (int)mode;
+       muse_camera_msg_return1(api, ret, module, INT, get_mode);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_get_exposure_mode(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       camera_attr_exposure_mode_e mode;
+       int get_mode;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_EXPOSURE_MODE;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_get_exposure_mode((camera_h)handle, &mode);
+       get_mode = (int)mode;
+       muse_camera_msg_return1(api, ret, module, INT, get_mode);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_get_exposure(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int get_value;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_EXPOSURE;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_get_exposure((camera_h)handle, &get_value);
+       muse_camera_msg_return1(api, ret, module, INT, get_value);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_get_exposure_range(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int get_min;
+       int get_max;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_EXPOSURE_RANGE;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_get_exposure_range((camera_h)handle, &get_min, &get_max);
+       muse_camera_msg_return2(api, ret, module, INT, get_min, INT, get_max);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_get_iso(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       camera_attr_iso_e iso;
+       int get_iso;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_ISO;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_get_iso((camera_h)handle, &iso);
+       get_iso = (int)iso;
+       muse_camera_msg_return1(api, ret, module, INT, get_iso);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_get_brightness(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int get_level;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_BRIGHTNESS;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_get_brightness((camera_h)handle, &get_level);
+       muse_camera_msg_return1(api, ret, module, INT, get_level);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_get_brightness_range(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int get_min;
+       int get_max;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_BRIGHTNESS_RANGE;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_get_brightness_range((camera_h)handle, &get_min, &get_max);
+       muse_camera_msg_return2(api, ret, module, INT, get_min, INT, get_max);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_get_contrast(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int get_level;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_CONTRAST;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_get_contrast((camera_h)handle, &get_level);
+       muse_camera_msg_return1(api, ret, module, INT, get_level);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_get_contrast_range(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       int get_min;
+       int get_max;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_CONTRAST_RANGE;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_get_contrast_range((camera_h)handle, &get_min, &get_max);
+       muse_camera_msg_return2(api, ret, module, INT, get_min, INT, get_max);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_get_whitebalance(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       camera_attr_whitebalance_e wb;
+       int get_wb;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_WHITEBALANCE;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_get_whitebalance((camera_h)handle, &wb);
+       get_wb = (int)wb;
+       muse_camera_msg_return1(api, ret, module, INT, get_wb);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_get_effect(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       camera_attr_effect_mode_e effect;
+       int get_effect;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_EFFECT;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_get_effect((camera_h)handle, &effect);
+       get_effect = (int)effect;
+       muse_camera_msg_return1(api, ret, module, INT, get_effect);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_get_scene_mode(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       camera_attr_scene_mode_e mode;
+       int get_mode;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_SCENE_MODE;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_get_scene_mode((camera_h)handle, &mode);
+       get_mode = (int)mode;
+       muse_camera_msg_return1(api, ret, module, INT, get_mode);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_is_enabled_tag(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       bool enable;
+       int get_enable;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_ENABLED_TAG;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_is_enabled_tag((camera_h)handle, &enable);
+       get_enable = (int)enable;
+       muse_camera_msg_return1(api, ret, module, INT, get_enable);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_get_tag_image_description(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_TAG_IMAGE_DESCRIPTION;
+       char *get_description;
+       handle = muse_core_ipc_get_handle(module);
+       ret = legacy_camera_attr_get_tag_image_description((camera_h)handle, &get_description);
+       LOGD("handle : 0x%x, get_description : %s", handle, get_description);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return1(api, ret, module, STRING, get_description);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_get_tag_orientation(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       camera_attr_tag_orientation_e orientation;
+       int get_orientation;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_TAG_ORIENTATION;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_get_tag_orientation((camera_h)handle, &orientation);
+       get_orientation = (int)orientation;
+       muse_camera_msg_return1(api, ret, module, INT, get_orientation);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_get_tag_software(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_TAG_SOFTWARE;
+       char *get_software;
+
+       handle = muse_core_ipc_get_handle(module);
+
+       ret = legacy_camera_attr_get_tag_software((camera_h)handle, &get_software);
+       LOGD("handle : 0x%x, get_software : %s", handle, get_software);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return1(api, ret, module, STRING, get_software);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_get_geotag(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_GEOTAG;
+       double latitude;
+       double longitude;
+       double altitude;
+       double get_geotag[3] = {0,};
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_get_geotag((camera_h)handle, &latitude, &longitude, &altitude);
+       get_geotag[0] = latitude;
+       get_geotag[1] = longitude;
+       get_geotag[2] = altitude;
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return_array(api, ret, module, get_geotag, sizeof(get_geotag), sizeof(double));
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_get_flash_mode(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       camera_attr_flash_mode_e mode;
+       int get_mode;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_FLASH_MODE;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_get_flash_mode((camera_h)handle, &mode);
+       get_mode = (int)mode;
+       muse_camera_msg_return1(api, ret, module, INT, get_mode);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_foreach_supported_af_mode(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_AF_MODE;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+
+       ret = legacy_camera_attr_foreach_supported_af_mode((camera_h)handle,
+                                               (camera_attr_supported_af_mode_cb)_camera_dispatcher_callback_supported_af_mode,
+                                               (void *)module);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_foreach_supported_exposure_mode(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_EXPOSURE_MODE;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x, api : %d", handle, api);
+
+       ret = legacy_camera_attr_foreach_supported_exposure_mode((camera_h)handle,
+                                               (camera_attr_supported_exposure_mode_cb)_camera_dispatcher_callback_supported_exposure_mode,
+                                               (void *)module);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_foreach_supported_iso(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_ISO;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+
+       ret = legacy_camera_attr_foreach_supported_iso((camera_h)handle,
+                                               (camera_attr_supported_iso_cb)_camera_dispatcher_callback_supported_iso_mode,
+                                               (void *)module);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_foreach_supported_whitebalance(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_WHITEBALANCE;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+
+       ret = legacy_camera_attr_foreach_supported_whitebalance((camera_h)handle,
+                                               (camera_attr_supported_whitebalance_cb)_camera_dispatcher_callback_supported_whitebalance,
+                                               (void *)module);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_foreach_supported_effect(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_EFFECT;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+
+       ret = legacy_camera_attr_foreach_supported_effect((camera_h)handle,
+                                               (camera_attr_supported_effect_cb)_camera_dispatcher_callback_supported_effect,
+                                               (void *)module);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_foreach_supported_scene_mode(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_SCENE_MODE;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+
+       ret = legacy_camera_attr_foreach_supported_scene_mode((camera_h)handle,
+                                               (camera_attr_supported_scene_mode_cb)_camera_dispatcher_callback_supported_scene_mode,
+                                               (void *)module);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_foreach_supported_flash_mode(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_FLASH_MODE;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+
+       ret = legacy_camera_attr_foreach_supported_flash_mode((camera_h)handle,
+                                               (camera_attr_supported_flash_mode_cb)_camera_dispatcher_callback_supported_flash_mode,
+                                               (void *)module);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_foreach_supported_fps(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_FPS;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+
+       ret = legacy_camera_attr_foreach_supported_fps((camera_h)handle,
+                                               (camera_attr_supported_fps_cb)_camera_dispatcher_callback_supported_fps,
+                                               (void *)module);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_foreach_supported_fps_by_resolution(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_FPS_BY_RESOLUTION;
+       int width;
+       int height;
+
+       handle = muse_core_ipc_get_handle(module);
+       muse_camera_msg_get(width, muse_core_client_get_msg(module));
+       muse_camera_msg_get(height, muse_core_client_get_msg(module));
+       LOGD("handle : 0x%x", handle);
+
+       ret = legacy_camera_attr_foreach_supported_fps_by_resolution((camera_h)handle,
+                                               width, height,
+                                               (camera_attr_supported_fps_cb)_camera_dispatcher_callback_supported_fps_by_resolution,
+                                               (void *)module);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_foreach_supported_stream_flip(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_STREAM_FLIP;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+
+       ret = legacy_camera_attr_foreach_supported_stream_flip((camera_h)handle,
+                                               (camera_attr_supported_stream_flip_cb)_camera_dispatcher_callback_supported_stream_flip,
+                                               (void *)module);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_foreach_supported_stream_rotation(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_STREAM_ROTATION;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+
+       ret = legacy_camera_attr_foreach_supported_stream_rotation((camera_h)handle,
+                                               (camera_attr_supported_stream_rotation_cb)_camera_dispatcher_callback_supported_stream_rotation,
+                                               (void *)module);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_set_stream_rotation(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_STREAM_ROTATION;
+       int set_rotation;
+
+       handle = muse_core_ipc_get_handle(module);
+       muse_camera_msg_get(set_rotation, muse_core_client_get_msg(module));
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_set_stream_rotation((camera_h)handle, (camera_rotation_e)set_rotation);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_get_stream_rotation(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_STREAM_ROTATION;
+       camera_rotation_e rotation;
+       int get_rotation;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_get_stream_rotation((camera_h)handle, &rotation);
+       LOGD("ret : 0x%x", ret);
+       get_rotation = (int)rotation;
+       muse_camera_msg_return1(api, ret, module, INT, get_rotation);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_set_stream_flip(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_STREAM_FLIP;
+       int set_flip;
+
+       handle = muse_core_ipc_get_handle(module);
+       muse_camera_msg_get(set_flip, muse_core_client_get_msg(module));
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_set_stream_flip((camera_h)handle, (camera_flip_e)set_flip);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_get_stream_flip(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_STREAM_FLIP;
+       camera_flip_e flip;
+       int get_flip;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_get_stream_flip((camera_h)handle, &flip);
+       LOGD("ret : 0x%x", ret);
+       get_flip = (int)flip;
+       muse_camera_msg_return1(api, ret, module, INT, get_flip);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_set_hdr_mode(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_HDR_MODE;
+       int set_mode;
+
+       handle = muse_core_ipc_get_handle(module);
+       muse_camera_msg_get(set_mode, muse_core_client_get_msg(module));
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_set_hdr_mode((camera_h)handle, (camera_attr_hdr_mode_e)set_mode);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_get_hdr_mode(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_HDR_MODE;
+       camera_attr_hdr_mode_e mode;
+       int get_mode;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_get_hdr_mode((camera_h)handle, &mode);
+       LOGD("ret : 0x%x", ret);
+       get_mode = (int)mode;
+       muse_camera_msg_return1(api, ret, module, INT, get_mode);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_is_supported_hdr_capture(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_SUPPORTED_HDR_CAPTURE;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_is_supported_hdr_capture((camera_h)handle);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_set_hdr_capture_progress_cb(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_HDR_CAPTURE_PROGRESS_CB;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       /*
+        *      TODO : set the cb function here.
+        */
+       ret = legacy_camera_attr_set_hdr_capture_progress_cb((camera_h)handle, NULL, NULL);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_unset_hdr_capture_progress_cb(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_UNSET_HDR_CAPTURE_PROGRESS_CB;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_unset_hdr_capture_progress_cb((camera_h)handle);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_enable_anti_shake(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_ENABLE_ANTI_SHAKE;
+       int set_enable;
+
+       handle = muse_core_ipc_get_handle(module);
+       muse_camera_msg_get(set_enable, muse_core_client_get_msg(module));
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_enable_anti_shake((camera_h)handle, (bool)set_enable);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_is_enabled_anti_shake(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_ENABLED_ANTI_SHAKE;
+       bool enabled;
+       int get_enabled;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_is_enabled_anti_shake((camera_h)handle, &enabled);
+       LOGD("ret : 0x%x", ret);
+       get_enabled = (int)enabled;
+       muse_camera_msg_return1(api, ret, module, INT, get_enabled);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_is_supported_anti_shake(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_SUPPORTED_ANTI_SHAKE;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_is_supported_anti_shake((camera_h)handle);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_enable_video_stabilization(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_ENABLE_VIDEO_STABILIZATION;
+       int set_enable;
+
+       handle = muse_core_ipc_get_handle(module);
+       muse_camera_msg_get(set_enable, muse_core_client_get_msg(module));
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_enable_video_stabilization((camera_h)handle, (bool)set_enable);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_is_enabled_video_stabilization(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_ENABLED_VIDEO_STABILIZATION;
+       bool enabled;
+       int get_enabled;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_is_enabled_video_stabilization((camera_h)handle, &enabled);
+       LOGD("ret : 0x%x", ret);
+       get_enabled = (int)enabled;
+       muse_camera_msg_return1(api, ret, module, INT, get_enabled);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_is_supported_video_stabilization(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_SUPPORTED_VIDEO_STABILIZATION;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_is_supported_video_stabilization((camera_h)handle);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_enable_auto_contrast(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_ENABLE_AUTO_CONTRAST;
+       int set_enable;
+
+       handle = muse_core_ipc_get_handle(module);
+       muse_camera_msg_get(set_enable, muse_core_client_get_msg(module));
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_enable_auto_contrast((camera_h)handle, (bool)set_enable);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_is_enabled_auto_contrast(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_ENABLED_AUTO_CONTRAST;
+       bool enabled;
+       int get_enabled;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_is_enabled_auto_contrast((camera_h)handle, &enabled);
+       LOGD("ret : 0x%x", ret);
+       get_enabled = (int)enabled;
+       muse_camera_msg_return1(api, ret, module, INT, get_enabled);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_is_supported_auto_contrast(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_SUPPORTED_AUTO_CONTRAST;
+
+       handle = muse_core_ipc_get_handle(module);
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_is_supported_auto_contrast((camera_h)handle);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_disable_shutter_sound(muse_module_h module)
+{
+       int ret = CAMERA_ERROR_NONE;
+       intptr_t handle;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_DISABLE_SHUTTER_SOUND;
+       int set_disable;
+
+       handle = muse_core_ipc_get_handle(module);
+       muse_camera_msg_get(set_disable, muse_core_client_get_msg(module));
+       LOGD("handle : 0x%x", handle);
+       ret = legacy_camera_attr_disable_shutter_sound((camera_h)handle, (bool)set_disable);
+       LOGD("ret : 0x%x", ret);
+       muse_camera_msg_return(api, ret, module);
+
+       return MUSE_CAMERA_ERROR_NONE;
+}
+
+int (*dispatcher[MUSE_CAMERA_API_MAX]) (muse_module_h module) = {
+       camera_dispatcher_create,                               /* MUSE_CAMERA_API_CREATE */
+       camera_dispatcher_destroy,                      /* MUSE_CAMERA_API_DESTROY */
+       camera_dispatcher_start_preview,                /* MUSE_CAMERA_START_PREVIEW */
+       camera_dispatcher_stop_preview,         /* MUSE_CAMERA_API_START_PREVIEW */
+       camera_dispatcher_start_capture,                /* MUSE_CAMERA_START_CAPTURE */
+       camera_dispatcher_is_supported_continuous_capture,      /* MUSE_CAMERA_API_SUPPORT_CONTINUOUS_CAPTURE */
+       camera_dispatcher_start_continuous_capture,                     /* MUSE_CAMERA_API_START_CONTINUOUS_CAPTURE, */
+       camera_dispatcher_stop_continuous_capture,                      /* MUSE_CAMERA_API_STOP_CONTINUOUS_CAPTURE, */
+       camera_dispatcher_is_supported_face_detection,          /* MUSE_CAMERA_API_SUPPORT_FACE_DETECTION, */
+       camera_dispatcher_is_supported_zero_shutter_lag,                /* MUSE_CAMERA_API_SUPPORT_ZERO_SHUTTER_LAG, */
+       camera_dispatcher_is_supported_media_packet_preview_cb,         /* MUSE_CAMERA_API_SUPPORT_MEDIA_PACKET_PREVIEW_CB, */
+       camera_dispatcher_get_device_count,                                     /* MUSE_CAMERA_API_GET_DEVICE_COUNT, */
+       camera_dispatcher_start_face_detection,                                 /* MUSE_CAMERA_API_START_FACE_DETECTION, */
+       camera_dispatcher_stop_face_detection,                          /* MUSE_CAMERA_API_STOP_FACE_DETECTION, */
+       camera_dispatcher_get_state,                                    /* MUSE_CAMERA_API_GET_STATE, */
+       camera_dispatcher_start_focusing,                               /* MUSE_CAMERA_API_START_FOCUSING, */
+       camera_dispatcher_stop_focusing,                                /* MUSE_CAMERA_API_CANCEL_FOCUSING, */
+       camera_dispatcher_set_display,                          /* MUSE_CAMERA_API_SET_DISPLAY, */
+       camera_dispatcher_set_preview_resolution,       /* MUSE_CAMERA_API_SET_PREVIEW_RESOLUTION, */
+       camera_dispatcher_set_capture_resolution,               /* MUSE_CAMERA_API_SET_CAPTURE_RESOLUTION, */
+       camera_dispatcher_set_capture_format,           /* MUSE_CAMERA_API_SET_CAPTURE_FORMAT, */
+       camera_dispatcher_set_preview_format,           /* MUSE_CAMERA_API_SET_PREVIEW_FORMAT, */
+       camera_dispatcher_get_preview_resolution,       /* MUSE_CAMERA_API_GET_PREVIEW_RESOLUTION, */
+       camera_dispatcher_set_display_rotation,                 /* MUSE_CAMERA_API_SET_DISPLAY_ROTATION, */
+       camera_dispatcher_get_display_rotation,         /* MUSE_CAMERA_API_GET_DISPLAY_ROTATION, */
+       camera_dispatcher_set_display_flip,                     /* MUSE_CAMERA_API_SET_DISPLAY_FLIP, */
+       camera_dispatcher_get_display_flip,                     /* MUSE_CAMERA_API_GET_DISPLAY_FLIP, */
+       camera_dispatcher_set_display_visible,          /* MUSE_CAMERA_API_SET_DISPLAY_VISIBLE, */
+       camera_dispatcher_is_display_visible, /* MUSE_CAMERA_API_IS_DISPLAY_VISIBLE, */
+       camera_dispatcher_set_display_mode, /* MUSE_CAMERA_API_SET_DISPLAY_MODE, */
+       camera_dispatcher_get_display_mode, /* MUSE_CAMERA_API_GET_DISPLAY_MODE, */
+       camera_dispatcher_get_capture_resolution, /* MUSE_CAMERA_API_GET_CAPTURE_RESOLUTION, */
+       camera_dispatcher_get_capture_format, /* MUSE_CAMERA_API_GET_CAPTURE_FORMAT, */
+       camera_dispatcher_get_preview_format, /* MUSE_CAMERA_API_GET_PREVIEW_FORMAT, */
+       camera_dispatcher_set_preview_cb, /* MUSE_CAMERA_API_SET_PREVIEW_CB, */
+       camera_dispatcher_unset_preview_cb, /* MUSE_CAMERA_API_UNSET_PREVIEW_CB, */
+       camera_dispatcher_set_media_packet_preview_cb, /* MUSE_CAMERA_API_SET_MEDIA_PACKET_PREVIEW_CB, */
+       camera_dispatcher_unset_media_packet_preview_cb, /* MUSE_CAMERA_API_UNSET_MEDIA_PACKET_PREVIEW_CB, */
+       camera_dispatcher_set_state_changed_cb, /* MUSE_CAMERA_API_SET_STATE_CHANGED_CB, */
+       camera_dispatcher_unset_state_changed_cb, /* MUSE_CAMERA_API_UNSET_STATE_CHANGED_CB, */
+       camera_dispatcher_set_interrupted_cb, /* MUSE_CAMERA_API_SET_INTERRUPTED_CB, */
+       camera_dispatcher_unset_interrupted_cb, /* MUSE_CAMERA_API_UNSET_INTERRUPTED_CB, */
+       camera_dispatcher_set_focus_changed_cb, /* MUSE_CAMERA_API_SET_FOCUS_CHANGED_CB, */
+       camera_dispatcher_unset_focus_changed_cb, /* MUSE_CAMERA_API_UNSET_FOCUS_CHANGED_CB, */
+       camera_dispatcher_set_error_cb, /* MUSE_CAMERA_API_SET_ERROR_CB, */
+       camera_dispatcher_unset_error_cb, /* MUSE_CAMERA_API_UNSET_ERROR_CB, */
+       camera_dispatcher_foreach_supported_preview_resolution, /* MUSE_CAMERA_API_SET_FOREACH_SUPPORTED_PREVIEW_RESOLUTION, */
+       camera_dispatcher_foreach_supported_capture_resolution, /* MUSE_CAMERA_API_SET_FOREACH_SUPPORTED_CAPTURE_RESOLUTION, */
+       camera_dispatcher_foreach_supported_capture_format, /* MUSE_CAMERA_API_SET_FOREACH_SUPPORTED_CAPTURE_FORMAT, */
+       camera_dispatcher_foreach_supported_preview_format, /* MUSE_CAMERA_API_SET_FOREACH_SUPPORTED_PREVIEW_FORMAT, */
+       camera_dispatcher_get_recommended_preview_resolution, /* MUSE_CAMERA_API_GET_RECOMMENDED_PREVIEW_RESOLUTION, */
+       camera_dispatcher_attr_get_lens_orientation, /* MUSE_CAMERA_API_ATTR_GET_LENS_ORIENTATION, */
+       camera_dispatcher_attr_set_theater_mode, /* MUSE_CAMERA_API_ATTR_SET_THEATER_MODE, */
+       camera_dispatcher_attr_get_theater_mode, /* MUSE_CAMERA_API_ATTR_GET_THEATER_MODE, */
+       camera_dispatcher_attr_foreach_supported_theater_mode, /* MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_THEATER_MODE, */
+       camera_dispatcher_attr_set_preview_fps, /* MUSE_CAMERA_API_ATTR_SET_PREVIEW_FPS, */
+       camera_dispatcher_attr_set_image_quality, /* MUSE_CAMERA_API_ATTR_SET_IMAGE_QUALITY, */
+       camera_dispatcher_attr_get_preview_fps, /* MUSE_CAMERA_API_ATTR_GET_PREVIEW_FPS, */
+       camera_dispatcher_attr_get_image_quality, /* MUSE_CAMERA_API_ATTR_GET_IMAGE_QUALITY, */
+       camera_dispatcher_attr_set_zoom, /* MUSE_CAMERA_API_ATTR_SET_ZOOM, */
+       camera_dispatcher_attr_set_af_mode, /* MUSE_CAMERA_API_ATTR_SET_AF_MODE, */
+       camera_dispatcher_attr_set_af_area, /* MUSE_CAMERA_API_ATTR_SET_AF_AREA, */
+       camera_dispatcher_attr_clear_af_area, /* MUSE_CAMERA_API_ATTR_CLEAR_AF_AREA, */
+       camera_dispatcher_attr_set_exposure_mode, /* MUSE_CAMERA_API_ATTR_SET_EXPOSURE_MODE, */
+       camera_dispatcher_attr_set_exposure, /* MUSE_CAMERA_API_ATTR_SET_EXPOSURE, */
+       camera_dispatcher_attr_set_iso, /* MUSE_CAMERA_API_ATTR_SET_ISO, */
+       camera_dispatcher_attr_set_brightness, /* MUSE_CAMERA_API_ATTR_SET_BRIGHTNESS, */
+       camera_dispatcher_attr_set_contrast, /* MUSE_CAMERA_API_ATTR_SET_CONTRAST, */
+       camera_dispatcher_attr_set_whitebalance, /* MUSE_CAMERA_API_ATTR_SET_WHITEBALANCE, */
+       camera_dispatcher_attr_set_effect, /* MUSE_CAMERA_API_ATTR_SET_EFFECT, */
+       camera_dispatcher_attr_set_scene_mode, /* MUSE_CAMERA_API_ATTR_SET_SCENE_MODE, */
+       camera_dispatcher_attr_enable_tag, /* MUSE_CAMERA_API_ATTR_ENABLE_TAG, */
+       camera_dispatcher_attr_set_tag_image_description, /* MUSE_CAMERA_API_ATTR_SET_TAG_IMAGE_DESCRIPTION, */
+       camera_dispatcher_attr_set_tag_orientation, /* MUSE_CAMERA_API_ATTR_SET_TAG_ORIENTATION, */
+       camera_dispatcher_attr_set_tag_software, /* MUSE_CAMERA_API_ATTR_SET_TAG_SOFTWARE, */
+       camera_dispatcher_attr_set_geotag, /* MUSE_CAMERA_API_ATTR_SET_GEOTAG, */
+       camera_dispatcher_attr_remove_geotag, /* MUSE_CAMERA_API_ATTR_REMOVE_GEOTAG, */
+       camera_dispatcher_attr_set_flash_mode, /* MUSE_CAMERA_API_ATTR_SET_FLASH_MODE, */
+       camera_dispatcher_attr_get_zoom, /* MUSE_CAMERA_API_ATTR_GET_ZOOM, */
+       camera_dispatcher_attr_get_zoom_range, /* MUSE_CAMERA_API_ATTR_GET_ZOOM_RANGE, */
+       camera_dispatcher_attr_get_af_mode, /* MUSE_CAMERA_API_ATTR_GET_AF_MODE, */
+       camera_dispatcher_attr_get_exposure_mode, /* MUSE_CAMERA_API_ATTR_GET_EXPOSURE_MODE, */
+       camera_dispatcher_attr_get_exposure, /* MUSE_CAMERA_API_ATTR_GET_EXPOSURE, */
+       camera_dispatcher_attr_get_exposure_range, /* MUSE_CAMERA_API_ATTR_GET_EXPOSURE_RANGE, */
+       camera_dispatcher_attr_get_iso, /* MUSE_CAMERA_API_ATTR_GET_ISO, */
+       camera_dispatcher_attr_get_brightness, /* MUSE_CAMERA_API_ATTR_GET_BRIGHTNESS, */
+       camera_dispatcher_attr_get_brightness_range, /* MUSE_CAMERA_API_ATTR_GET_BRIGHTNESS_RANGE, */
+       camera_dispatcher_attr_get_contrast, /* MUSE_CAMERA_API_ATTR_GET_CONTRAST, */
+       camera_dispatcher_attr_get_contrast_range, /* MUSE_CAMERA_API_ATTR_GET_CONTRAST_RANGE, */
+       camera_dispatcher_attr_get_whitebalance, /* MUSE_CAMERA_API_ATTR_GET_WHITEBALANCE, */
+       camera_dispatcher_attr_get_effect, /* MUSE_CAMERA_API_ATTR_GET_EFFECT, */
+       camera_dispatcher_attr_get_scene_mode, /* MUSE_CAMERA_API_ATTR_GET_SCENE_MODE, */
+       camera_dispatcher_attr_is_enabled_tag, /* MUSE_CAMERA_API_ATTR_IS_ENABLED_TAG, */
+       camera_dispatcher_attr_get_tag_image_description, /* MUSE_CAMERA_API_ATTR_GET_TAG_IMAGE_DESCRIPTION, */
+       camera_dispatcher_attr_get_tag_orientation, /* MUSE_CAMERA_API_ATTR_GET_TAG_ORIENTATION, */
+       camera_dispatcher_attr_get_tag_software, /* MUSE_CAMERA_API_ATTR_GET_TAG_SOFTWARE, */
+       camera_dispatcher_attr_get_geotag, /* MUSE_CAMERA_API_ATTR_GET_GEOTAG, */
+       camera_dispatcher_attr_get_flash_mode, /* MUSE_CAMERA_API_ATTR_GET_FLASH_MODE, */
+       camera_dispatcher_attr_foreach_supported_af_mode, /* MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_AF_MODE, */
+       camera_dispatcher_attr_foreach_supported_exposure_mode, /* MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_EXPOSURE_MODE, */
+       camera_dispatcher_attr_foreach_supported_iso, /* MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_ISO, */
+       camera_dispatcher_attr_foreach_supported_whitebalance, /* MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_WHITEBALANCE, */
+       camera_dispatcher_attr_foreach_supported_effect, /* MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_EFFECT, */
+       camera_dispatcher_attr_foreach_supported_scene_mode, /* MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_SCENE_MODE, */
+       camera_dispatcher_attr_foreach_supported_flash_mode, /* MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_FLASH_MODE, */
+       camera_dispatcher_attr_foreach_supported_fps, /* MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_FPS, */
+       camera_dispatcher_attr_foreach_supported_fps_by_resolution, /* MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_FPS_BY_RESOLUTION, */
+       camera_dispatcher_attr_foreach_supported_stream_flip, /* MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_STREAM_FLIP, */
+       camera_dispatcher_attr_foreach_supported_stream_rotation, /* MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_STREAM_ROTATION, */
+       camera_dispatcher_attr_set_stream_rotation, /* MUSE_CAMERA_API_ATTR_SET_STREAM_ROTATION, */
+       camera_dispatcher_attr_get_stream_rotation, /* MUSE_CAMERA_API_ATTR_GET_STREAM_ROTATION, */
+       camera_dispatcher_attr_set_stream_flip, /* MUSE_CAMERA_API_ATTR_SET_STREAM_FLIP, */
+       camera_dispatcher_attr_get_stream_flip, /* MUSE_CAMERA_API_ATTR_GET_STREAM_FLIP, */
+       camera_dispatcher_attr_set_hdr_mode, /* MUSE_CAMERA_API_ATTR_SET_HDR_MODE, */
+       camera_dispatcher_attr_get_hdr_mode, /* MUSE_CAMERA_API_ATTR_GET_HDR_MODE, */
+       camera_dispatcher_attr_is_supported_hdr_capture, /* MUSE_CAMERA_API_ATTR_IS_SUPPORTED_HDR_CAPTURE, */
+       camera_dispatcher_attr_set_hdr_capture_progress_cb, /* MUSE_CAMERA_API_ATTR_SET_HDR_CAPTURE_PROGRESS_CB, */
+       camera_dispatcher_attr_unset_hdr_capture_progress_cb, /* MUSE_CAMERA_API_ATTR_UNSET_HDR_CAPTURE_PROGRESS_CB, */
+       camera_dispatcher_attr_enable_anti_shake, /* MUSE_CAMERA_API_ATTR_ENABLE_ANTI_SHAKE, */
+       camera_dispatcher_attr_is_enabled_anti_shake, /* MUSE_CAMERA_API_ATTR_IS_ENABLED_ANTI_SHAKE, */
+       camera_dispatcher_attr_is_supported_anti_shake, /* MUSE_CAMERA_API_ATTR_IS_SUPPORTED_ANTI_SHAKE, */
+       camera_dispatcher_attr_enable_video_stabilization, /* MUSE_CAMERA_API_ATTR_ENABLE_VIDEO_STABILIZATION, */
+       camera_dispatcher_attr_is_enabled_video_stabilization, /* MUSE_CAMERA_API_ATTR_IS_ENABLED_VIDEO_STABILIZATION, */
+       camera_dispatcher_attr_is_supported_video_stabilization, /* MUSE_CAMERA_API_ATTR_IS_SUPPORTED_VIDEO_STABILIZATION, */
+       camera_dispatcher_attr_enable_auto_contrast, /* MUSE_CAMERA_API_ATTR_ENABLE_AUTO_CONTRAST, */
+       camera_dispatcher_attr_is_enabled_auto_contrast, /* MUSE_CAMERA_API_ATTR_IS_ENABLED_AUTO_CONTRAST, */
+       camera_dispatcher_attr_is_supported_auto_contrast, /* MUSE_CAMERA_API_ATTR_IS_SUPPORTED_AUTO_CONTRAST, */
+       camera_dispatcher_attr_disable_shutter_sound, /* MUSE_CAMERA_API_ATTR_DISABLE_SHUTTER_SOUND, */
+};
diff --git a/muse/src/muse_camera_ipc.c b/muse/src/muse_camera_ipc.c
new file mode 100644 (file)
index 0000000..4747023
--- /dev/null
@@ -0,0 +1,127 @@
+/*
+* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* 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.
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <limits.h>
+#include <errno.h>
+#include <err.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <glib.h>
+#include "muse_core.h"
+#include "muse_core_workqueue.h"
+#include "muse_camera.h"
+#include "mm_types.h"
+#include "mm_debug.h"
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "MUSE_CAMERA_IPC"
+
+bool muse_camera_ipc_make_tbm(muse_camera_transport_info_s *transport_info)
+{
+       if(transport_info == NULL) {
+               LOGE("transport_info is NULL!");
+               return FALSE;
+       }
+
+       tbm_bufmgr bufmgr = transport_info->bufmgr;
+
+       bufmgr = transport_info->bufmgr;
+       LOGD("Enter!bufmgr : 0x%x", bufmgr);
+
+       if(bufmgr == NULL) {
+               LOGE("tbm_bufmgr is NULL!");
+               return FALSE;
+       }
+
+       transport_info->bo = NULL;
+       transport_info->bo = tbm_bo_alloc(bufmgr, transport_info->data_size, TBM_BO_DEFAULT);
+
+       if(transport_info->bo == NULL) {
+               LOGE("tbm_bo_alloc Error!");
+               tbm_bufmgr_deinit(bufmgr);
+               return FALSE;
+       }
+
+       transport_info->bo_handle = tbm_bo_map(transport_info->bo, TBM_DEVICE_CPU, TBM_OPTION_WRITE);
+
+       if(transport_info->bo_handle.ptr == NULL) {
+               if (transport_info->bo != NULL) {
+                       tbm_bo_unref(transport_info->bo);
+               }
+               LOGE("tbm_bo_map Error!");
+               return FALSE;
+       }
+
+       return TRUE;
+}
+
+int muse_camera_ipc_export_tbm(muse_camera_transport_info_s transport_info)
+{
+       LOGD("muse_camera_ipc_export_tbm_bo!");
+       return tbm_bo_export(transport_info.bo);
+}
+
+
+bool muse_camera_ipc_init_tbm(muse_camera_transport_info_s *transport_info)
+{
+       int drm_fd = -1;
+
+       LOGE("muse_camera_ipc_import_tbm enter!!");
+
+       transport_info->bufmgr = tbm_bufmgr_init(drm_fd);
+       if (transport_info->bufmgr == NULL) {
+               LOGE("tbm_bufmgr_init error!!");
+               return FALSE;
+       }
+       return TRUE;
+}
+
+int muse_camera_ipc_import_tbm(muse_camera_transport_info_s *transport_info)
+{
+       LOGD("muse_camera_ipc_import_tbm enter!!");
+
+       transport_info->bo = tbm_bo_import(transport_info->bufmgr, transport_info->tbm_key);
+       if (transport_info->bo == NULL) {
+               goto IMPORT_FAIL;
+       }
+
+       transport_info->bo_handle = tbm_bo_map(transport_info->bo, TBM_DEVICE_CPU, TBM_OPTION_READ);
+
+       LOGE("tbm_bo_map passed!!!!!!!bo_handle.ptr : 0x%x", transport_info->bo_handle.ptr);
+
+       return TRUE;
+
+IMPORT_FAIL:
+       return FALSE;
+}
+
+void muse_camera_unref_tbm(muse_camera_transport_info_s *transport_info)
+{
+       LOGD("Enter");
+       if (transport_info->bo) {
+               LOGD("Unref bo");
+               tbm_bo_unmap(transport_info->bo);
+               tbm_bo_unref(transport_info->bo);
+       }
+       return;
+}
diff --git a/packaging/mmsvc-camera.spec b/packaging/mmsvc-camera.spec
new file mode 100644 (file)
index 0000000..6f2afe8
--- /dev/null
@@ -0,0 +1,99 @@
+%bcond_with wayland
+%bcond_with x
+
+Name:       mmsvc-camera
+Summary:    A Camera library in Tizen C API
+Version:    0.2.4
+Release:    0
+Group:      Multimedia/API
+License:    Apache-2.0
+Source0:    %{name}-%{version}.tar.gz
+BuildRequires:  cmake
+BuildRequires:  pkgconfig(gstreamer-1.0)
+BuildRequires:  pkgconfig(dlog)
+BuildRequires:  pkgconfig(mused)
+BuildRequires:  pkgconfig(mm-camcorder)
+BuildRequires:  pkgconfig(audio-session-mgr)
+BuildRequires:  pkgconfig(capi-base-common)
+BuildRequires:  pkgconfig(capi-media-tool)
+%if %{with x}
+BuildRequires:  pkgconfig(ecore-x)
+%endif
+%if %{with wayland}
+BuildRequires:  pkgconfig(ecore-wayland)
+%endif
+BuildRequires:  pkgconfig(json)
+BuildRequires:  pkgconfig(libtbm)
+BuildRequires:  pkgconfig(evas)
+BuildRequires:  pkgconfig(ecore)
+BuildRequires:  pkgconfig(elementary)
+BuildRequires:  pkgconfig(vconf)
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+
+
+%description
+A Camera library in Tizen C API.
+
+
+%package devel
+Summary:  A Camera library in Tizen C API (Development)
+Requires: %{name} = %{version}-%{release}
+Requires: pkgconfig(libtbm)
+Requires: pkgconfig(capi-media-tool)
+
+
+%description devel
+A Camera library in Tizen C API.
+
+Development related files.
+
+
+%prep
+%setup -q
+
+
+%build
+%if 0%{?sec_build_binary_debug_enable}
+export CFLAGS+=" -DTIZEN_DEBUG_ENABLE"
+%endif
+MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
+%cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DFULLVER=%{version} -DMAJORVER=${MAJORVER} \
+%if %{with wayland}
+       -DWAYLAND_SUPPORT=On \
+%else
+       -DWAYLAND_SUPPORT=Off \
+%endif
+%if %{with x}
+       -DX11_SUPPORT=On
+%else
+       -DX11_SUPPORT=Off
+%endif
+
+make %{?jobs:-j%jobs}
+
+
+%install
+rm -rf %{buildroot}
+%make_install
+mkdir -p %{buildroot}%{_datadir}/license
+cp LICENSE.APLv2 %{buildroot}%{_datadir}/license/%{name}
+
+
+%post -p /sbin/ldconfig
+
+
+%postun -p /sbin/ldconfig
+
+%files
+%manifest mmsvc-camera.manifest
+%{_libdir}/liblegacy-camera.so*
+%{_libdir}/libmuse-camera.so*
+%{_datadir}/license/%{name}
+%{_includedir}/media/legacy_camera.h
+%{_includedir}/media/legacy_camera_internal.h
+
+%files devel
+%{_includedir}/media/muse_camera.h
+%{_includedir}/media/muse_camera_msg.h
+%{_libdir}/pkgconfig/*.pc