Make include directory and move header files to it. 88/172488/1
authorJeongmo Yang <jm80.yang@samsung.com>
Wed, 14 Mar 2018 07:05:36 +0000 (16:05 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Wed, 14 Mar 2018 07:06:34 +0000 (16:06 +0900)
[Version] 0.0.3-1
[Profile] Common
[Issue Type] Update
[Dependency module] N/A

Change-Id: Icbfdebb8d2b6e2194714f985ac4253d093c43065
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
audio/tizen-audio.h [deleted file]
camera/tizen-camera.h [deleted file]
include/audio/tizen-audio.h [new file with mode: 0644]
include/camera/tizen-camera.h [new file with mode: 0644]
include/radio/tizen-radio.h [new file with mode: 0644]
packaging/mm-hal-interface.spec
radio/tizen-radio.h [deleted file]

diff --git a/audio/tizen-audio.h b/audio/tizen-audio.h
deleted file mode 100644 (file)
index 5d733ce..0000000
+++ /dev/null
@@ -1,530 +0,0 @@
-/*
- * audio-hal
- *
- * Copyright (c) 2015 - 2016 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 footizenaudiofoo
-#define footizenaudiofoo
-
-#include <stdint.h>
-
-/**
- * @file tizen-audio.h
- * @brief This file contains the Audio Hardware Abstraction Layer Interfaces.
- */
-
-/**
- * @addtogroup TIZEN_AUDIO_HAL_MODULE
- * @{
- */
-
-/**
- * @brief Enumeration for return codes.
- * @since_tizen 3.0
- */
-typedef enum audio_return {
-    AUDIO_RET_OK                        = 0,
-    AUDIO_ERR_UNDEFINED                 = (int32_t)0x80001000,
-    AUDIO_ERR_RESOURCE                  = (int32_t)0x80001001,
-    AUDIO_ERR_PARAMETER                 = (int32_t)0x80001002,
-    AUDIO_ERR_IOCTL                     = (int32_t)0x80001003,
-    AUDIO_ERR_INVALID_STATE             = (int32_t)0x80001004,
-    AUDIO_ERR_INTERNAL                  = (int32_t)0x80001005,
-    /* add new enemerator here */
-    AUDIO_ERR_NOT_IMPLEMENTED           = (int32_t)0x80001100,
-} audio_return_t ;
-
-/**
- * @brief Enumeration for audio direction.
- * @since_tizen 3.0
- */
-typedef enum audio_direction {
-    AUDIO_DIRECTION_IN,                 /**< Capture */
-    AUDIO_DIRECTION_OUT,                /**< Playback */
-} audio_direction_t;
-
-/**
- * @brief Device information including type, direction and id.
- * @since_tizen 3.0
- */
-typedef struct device_info {
-    const char *type;
-    uint32_t direction;
-    uint32_t id;
-} device_info_t;
-
-/**
- * @brief Volume information including type, gain and direction.
- * @since_tizen 3.0
- */
-typedef struct audio_volume_info {
-    const char *type;
-    const char *gain;
-    uint32_t direction;
-} audio_volume_info_t ;
-
-/**
- * @brief Route information including role and device.
- * @since_tizen 3.0
- */
-typedef struct audio_route_info {
-    const char *role;
-    device_info_t *device_infos;
-    uint32_t num_of_devices;
-} audio_route_info_t;
-
-/**
- * @brief Route option including role, name and value.
- * @since_tizen 3.0
- */
-typedef struct audio_route_option {
-    const char *role;
-    const char *name;
-    int32_t value;
-} audio_route_option_t;
-
-/**
- * @brief Stream information including role, direction and index.
- * @since_tizen 3.0
- */
-typedef struct audio_stream_info {
-    const char *role;
-    uint32_t direction;
-    uint32_t idx;
-} audio_stream_info_t ;
-
-/**
- * @brief Called when audio hal implementation needs to send a message. (optional)
- * @since_tizen 3.0
- * @param[in] name The message name
- * @param[in] value The message value
- * @param[in] user_data The user data passed from the callback registration function
- *
- * @remarks Some audio hal implementation may not have these functions.\n
- * (@c message_cb, @c audio_add_message_cb and @c audio_remove_message_cb)
- *
- * @see audio_add_message_cb()
- * @see audio_remove_message_cb()
- */
-typedef void (*message_cb)(const char *name, int value, void *user_data);
-
-/* Overall */
-typedef struct audio_interface {
-    /* Initialization & de-initialization */
-    audio_return_t (*init)(void **audio_handle);
-    audio_return_t (*deinit)(void *audio_handle);
-    /* Volume */
-    audio_return_t (*get_volume_level_max)(void *audio_handle, audio_volume_info_t *info, uint32_t *level);
-    audio_return_t (*get_volume_level)(void *audio_handle, audio_volume_info_t *info, uint32_t *level);
-    audio_return_t (*set_volume_level)(void *audio_handle, audio_volume_info_t *info, uint32_t level);
-    audio_return_t (*get_volume_value)(void *audio_handle, audio_volume_info_t *info, uint32_t level, double *value);
-    audio_return_t (*get_volume_mute)(void *audio_handle, audio_volume_info_t *info, uint32_t *mute);
-    audio_return_t (*set_volume_mute)(void *audio_handle, audio_volume_info_t *info, uint32_t mute);
-    /* Routing */
-    audio_return_t (*update_route)(void *audio_handle, audio_route_info_t *info);
-    audio_return_t (*update_route_option)(void *audio_handle, audio_route_option_t *option);
-    /* Stream */
-    audio_return_t (*notify_stream_connection_changed)(void *audio_handle, audio_stream_info_t *info, uint32_t is_connected);
-    /* PCM */
-    audio_return_t (*pcm_open)(void *audio_handle, void **pcm_handle, uint32_t direction, void *sample_spec, uint32_t period_size, uint32_t periods);
-    audio_return_t (*pcm_start)(void *audio_handle, void *pcm_handle);
-    audio_return_t (*pcm_stop)(void *audio_handle, void *pcm_handle);
-    audio_return_t (*pcm_close)(void *audio_handle, void *pcm_handle);
-    audio_return_t (*pcm_avail)(void *audio_handle, void *pcm_handle, uint32_t *avail);
-    audio_return_t (*pcm_write)(void *audio_handle, void *pcm_handle, const void *buffer, uint32_t frames);
-    audio_return_t (*pcm_read)(void *audio_handle, void *pcm_handle, void *buffer, uint32_t frames);
-    audio_return_t (*pcm_get_fd)(void *audio_handle, void *pcm_handle, int *fd);
-    audio_return_t (*pcm_recover)(void *audio_handle, void *pcm_handle, int revents);
-    audio_return_t (*pcm_get_params)(void *audio_handle, void *pcm_handle, uint32_t direction, void **sample_spec, uint32_t *period_size, uint32_t *periods);
-    audio_return_t (*pcm_set_params)(void *audio_handle, void *pcm_handle, uint32_t direction, void *sample_spec, uint32_t period_size, uint32_t periods);
-    /* Message callback (optional) */
-    audio_return_t (*add_message_cb)(void *audio_handle, message_cb callback, void *user_data);
-    audio_return_t (*remove_message_cb)(void *audio_handle, message_cb callback);
-} audio_interface_t;
-
-/**
- * @brief Initializes audio hal.
- * @since_tizen 3.0
- * @param[out] audio_handle The audio hal handle
- *
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #AUDIO_RET_OK Success
- * @see audio_deinit()
- */
-audio_return_t audio_init(void **audio_handle);
-
-/**
- * @brief De-initializes audio hal.
- * @since_tizen 3.0
- * @param[in] audio_handle The audio hal handle
- *
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #AUDIO_RET_OK Success
- * @see audio_init()
- */
-audio_return_t audio_deinit(void *audio_handle);
-
-/**
- * @brief Gets the maximum volume level supported for a particular volume information.
- * @since_tizen 3.0
- * @param[in] audio_handle The audio hal handle
- * @param[in] info The audio volume information
- * @param[out] level The maximum volume level
- *
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #AUDIO_RET_OK Success
- * @see audio_set_volume_level()
- * @see audio_get_volume_level()
- * @see audio_get_volume_value()
- */
-audio_return_t audio_get_volume_level_max(void *audio_handle, audio_volume_info_t *info, uint32_t *level);
-
-/**
- * @brief Gets the volume level specified for a particular volume information.
- * @since_tizen 3.0
- * @param[in] audio_handle The audio hal handle
- * @param[in] info The audio volume information
- * @param[out] level The current volume level
- *
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #AUDIO_RET_OK Success
- * @see audio_set_volume_level()
- * @see audio_get_volume_level_max()
- * @see audio_get_volume_value()
- */
-audio_return_t audio_get_volume_level(void *audio_handle, audio_volume_info_t *info, uint32_t *level);
-
-/**
- * @brief Sets the volume level specified for a particular volume information.
- * @since_tizen 3.0
- * @param[in] audio_handle The audio hal handle
- * @param[in] info The audio volume information
- * @param[in] level The volume level to be set
- *
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #AUDIO_RET_OK Success
- * @see audio_get_volume_level()
- * @see audio_get_volume_level_max()
- * @see audio_get_volume_value()
- */
-audio_return_t audio_set_volume_level(void *audio_handle, audio_volume_info_t *info, uint32_t level);
-
-/**
- * @brief Gets the volume value specified for a particular volume information and level.
- * @since_tizen 3.0
- * @param[in] audio_handle The audio hal handle
- * @param[in] info The audio volume information
- * @param[in] level The volume level
- * @param[out] value The volume value (range is from 0.0 to 1.0 inclusive, 1.0 = 100%)
- *
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #AUDIO_RET_OK Success
- * @see audio_set_volume_level()
- * @see audio_get_volume_level()
- * @see audio_get_volume_level_max()
- */
-audio_return_t audio_get_volume_value(void *audio_handle, audio_volume_info_t *info, uint32_t level, double *value);
-
-/**
- * @brief Gets the volume mute specified for a particular volume information.
- * @since_tizen 3.0
- * @param[in] audio_handle The audio hal handle
- * @param[in] info The audio volume information
- * @param[out] mute The volume mute state : (@c 0 = unmute, @c 1 = mute)
- *
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #AUDIO_RET_OK Success
- * @see audio_set_volume_mute()
- */
-audio_return_t audio_get_volume_mute(void *audio_handle, audio_volume_info_t *info, uint32_t *mute);
-
-/**
- * @brief Sets the volume mute specified for a particular volume information.
- * @since_tizen 3.0
- * @param[in] audio_handle The audio hal handle
- * @param[in] info The audio volume information
- * @param[in] mute The volume mute state to be set : (@c 0 = unmute, @c 1 = mute)
- *
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #AUDIO_RET_OK Success
- * @see audio_get_volume_mute()
- */
-audio_return_t audio_set_volume_mute(void *audio_handle, audio_volume_info_t *info, uint32_t mute);
-
-/**
- * @brief Updates the audio routing according to audio route information.
- * @since_tizen 3.0
- * @param[in] audio_handle The audio hal handle
- * @param[in] info The audio route information including role and devices
- *
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #AUDIO_RET_OK Success
- * @see audio_update_route_option()
- */
-audio_return_t audio_update_route(void *audio_handle, audio_route_info_t *info);
-
-/**
- * @brief Updates audio routing option according to audio route option.
- * @since_tizen 3.0
- * @param[in] audio_handle The audio hal handle
- * @param[in] option The option that can be used for audio routing including role, name and value
- *
- * @remarks This option can be used for audio routing.\n
- * It is recommended to apply this option for routing per each role.
- *
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #AUDIO_RET_OK Success
- * @see audio_update_route()
- */
-audio_return_t audio_update_route_option(void *audio_handle, audio_route_option_t *option);
-
-/**
- * @brief Gets notified when a stream is connected and disconnected.
- * @since_tizen 3.0
- * @param[in] audio_handle The audio hal handle
- * @param[in] info The stream information including role, direction, index
- * @param[in] is_connected The connection state of this stream (@c true = connected, @c false = disconnected)
- *
- * @remarks This information can be used for audio routing, volume controls and so on.
- *
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #AUDIO_RET_OK Success
- */
-audio_return_t audio_notify_stream_connection_changed(void *audio_handle, audio_stream_info_t *info, uint32_t is_connected);
-
-/**
- * @brief Opens a PCM device.
- * @since_tizen 3.0
- * @param[in] audio_handle The audio hal handle
- * @param[out] pcm_handle The PCM handle
- * @param[in] direction The direction of PCM
- * @param[in] sample_spec The sample specification
- * @param[in] period_size The period size
- * @param[in] periods The periods
- *
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #AUDIO_RET_OK Success
- * @see audio_pcm_close()
- */
-audio_return_t audio_pcm_open(void *audio_handle, void **pcm_handle, uint32_t direction, void *sample_spec, uint32_t period_size, uint32_t periods);
-
-/**
- * @brief Starts a PCM device.
- * @since_tizen 3.0
- * @param[in] audio_handle The audio hal handle
- * @param[in] pcm_handle The PCM handle to be started
- *
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #AUDIO_RET_OK Success
- * @see audio_pcm_avail()
- * @see audio_pcm_write()
- * @see audio_pcm_read()
- * @see audio_pcm_stop()
- * @see audio_pcm_recover()
- */
-audio_return_t audio_pcm_start(void *audio_handle, void *pcm_handle);
-
-/**
- * @brief Stops a PCM device.
- * @since_tizen 3.0
- * @param[in] audio_handle The audio hal handle
- * @param[in] pcm_handle The PCM handle to be stopped
- *
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #AUDIO_RET_OK Success
- * @see audio_pcm_start()
- */
-audio_return_t audio_pcm_stop(void *audio_handle, void *pcm_handle);
-
-/**
- * @brief Closes a PCM device.
- * @since_tizen 3.0
- * @param[in] audio_handle The audio hal handle
- * @param[in] pcm_handle The PCM handle to be closed
- *
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #AUDIO_RET_OK Success
- * @see audio_pcm_open()
- */
-audio_return_t audio_pcm_close(void *audio_handle, void *pcm_handle);
-
-/**
- * @brief Gets available number of frames.
- * @since_tizen 3.0
- * @param[in] audio_handle The audio hal handle
- * @param[in] pcm_handle The PCM handle
- * @param[out] avail The available number of frames
- *
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #AUDIO_RET_OK Success
- * @see audio_pcm_write()
- * @see audio_pcm_read()
- */
-audio_return_t audio_pcm_avail(void *audio_handle, void *pcm_handle, uint32_t *avail);
-
-/**
- * @brief Writes frames to a PCM device.
- * @since_tizen 3.0
- * @param[in] audio_handle The audio hal handle
- * @param[in] pcm_handle The PCM handle
- * @param[in] buffer The buffer containing frames
- * @param[in] frames The number of frames to be written
- *
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #AUDIO_RET_OK Success
- * @see audio_pcm_avail()
- * @see audio_pcm_recover()
- */
-audio_return_t audio_pcm_write(void *audio_handle, void *pcm_handle, const void *buffer, uint32_t frames);
-
-/**
- * @brief Reads frames from a PCM device.
- * @since_tizen 3.0
- * @param[in] audio_handle The audio hal handle
- * @param[in] pcm_handle The PCM handle
- * @param[out] buffer The buffer containing frames
- * @param[in] frames The number of frames to be read
- *
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #AUDIO_RET_OK Success
- * @see audio_pcm_avail()
- * @see audio_pcm_recover()
- */
-audio_return_t audio_pcm_read(void *audio_handle, void *pcm_handle, void *buffer, uint32_t frames);
-
-/**
- * @brief Gets poll descriptor for a PCM handle.
- * @since_tizen 3.0
- * @param[in] audio_handle The audio hal handle
- * @param[in] pcm_handle The PCM handle
- * @param[out] fd The poll descriptor
- *
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #AUDIO_RET_OK Success
- * @see audio_pcm_open()
- * @see audio_pcm_recover()
- */
-audio_return_t audio_pcm_get_fd(void *audio_handle, void *pcm_handle, int *fd);
-
-/**
- * @brief Recovers the PCM state.
- * @since_tizen 3.0
- * @param[in] audio_handle The audio hal handle
- * @param[in] pcm_handle The PCM handle
- * @param[in] revents The returned event from pollfd
- *
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #AUDIO_RET_OK Success
- * @see audio_pcm_start()
- * @see audio_pcm_write()
- * @see audio_pcm_read()
- * @see audio_pcm_get_fd()
- */
-audio_return_t audio_pcm_recover(void *audio_handle, void *pcm_handle, int revents);
-
-/**
- * @brief Gets parameters of a PCM device.
- * @since_tizen 3.0
- * @param[in] audio_handle The audio hal handle
- * @param[in] pcm_handle The PCM handle
- * @param[in] direction The direction of PCM
- * @param[out] sample_spec The sample specification
- * @param[out] period_size The period size
- * @param[out] periods The periods
- *
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #AUDIO_RET_OK Success
- * @see audio_pcm_set_params()
- */
-audio_return_t audio_pcm_get_params(void *audio_handle, void *pcm_handle, uint32_t direction, void **sample_spec, uint32_t *period_size, uint32_t *periods);
-
-/**
- * @brief Sets hardware and software parameters of a PCM device.
- * @since_tizen 3.0
- * @param[in] audio_handle The audio hal handle
- * @param[in] pcm_handle The PCM handle
- * @param[in] direction The direction of PCM
- * @param[in] sample_spec The sample specification
- * @param[in] period_size The period size
- * @param[in] periods The periods
- *
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #AUDIO_RET_OK Success
- * @see audio_pcm_set_params()
- */
-audio_return_t audio_pcm_set_params(void *audio_handle, void *pcm_handle, uint32_t direction, void *sample_spec, uint32_t period_size, uint32_t periods);
-
-/**
- * @brief Adds the message callback function. (optional)
- * @since_tizen 3.0
- * @param[in] audio_handle The audio hal handle
- * @param[in] message_cb The message callback function
- * @param[in] user_data The user data passed to the callback function
- *
- * @remarks Some audio hal implementation may not have these functions.\n
- * (@c message_cb, @c audio_add_message_cb and @c audio_remove_message_cb)
- *
- * @see message_cb()
- * @see audio_remove_message_cb()
- */
-audio_return_t audio_add_message_cb(void *audio_handle, message_cb callback, void *user_data);
-
-/**
- * @brief Removes the message callback function. (optional)
- * @since_tizen 3.0
- * @param[in] audio_handle The audio hal handle
- * @param[in] message_cb The message callback function to be removed
- *
- * @remarks Some audio hal implementation may not have these functions.\n
- * (@c message_cb, @c audio_add_message_cb and @c audio_remove_message_cb)
- *
- * @see message_cb()
- * @see audio_add_message_cb()
- */
-audio_return_t audio_remove_message_cb(void *audio_handle, message_cb callback);
-
-/**
-* @}
-*/
-
-/**
-* @}
-*/
-
-#endif
diff --git a/camera/tizen-camera.h b/camera/tizen-camera.h
deleted file mode 100644 (file)
index f44d3df..0000000
+++ /dev/null
@@ -1,988 +0,0 @@
-/*
- * tizen-camera.h
- *
- * Copyright (c) 2016 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_CAMERA_HAL_H__
-#define __TIZEN_CAMERA_HAL_H__
-
-#include <stdint.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-/**
- * @file tizen-camera.h
- * @brief This file contains the Tizen camera HAL API, related structures and enumerations.
- * @since_tizen 3.0
- */
-
-#define BUFFER_PLANE_MAX                    4
-#define DEVICE_COUNT_MAX                    16
-#define DEVICE_NAME_LENGTH_MAX              32
-#define RESOLUTION_COUNT_MAX                10
-
-/**
- * @addtogroup TIZEN_CAMERA_HAL_MODULE
- * @{
- */
-
-/**
- * @brief Enumeration for the camera error.
- * @since_tizen 3.0
- */
-typedef enum camera_error {
-       CAMERA_ERROR_NONE                   = 0x00000000,
-       CAMERA_ERROR_INVALID_PARAMETER      = 0x80002001,
-       CAMERA_ERROR_INVALID_STATE          = 0x80002002,
-       CAMERA_ERROR_PERMISSION_DENIED      = 0x80002003,
-       CAMERA_ERROR_OUT_OF_MEMORY          = 0x80002004,
-       CAMERA_ERROR_DEVICE_OPEN            = 0x80002005,
-       CAMERA_ERROR_DEVICE_NOT_FOUND       = 0x80002006,
-       CAMERA_ERROR_DEVICE_UNAVAILABLE     = 0x80002007,
-       CAMERA_ERROR_DEVICE_NOT_SUPPORTED   = 0x80002008,
-       CAMERA_ERROR_DEVICE_READ            = 0x80002009,
-       CAMERA_ERROR_DEVICE_WRITE           = 0x8000200a,
-       CAMERA_ERROR_DEVICE_BUSY            = 0x8000200b,
-       CAMERA_ERROR_DEVICE_TIME_OUT        = 0x8000200c,
-       CAMERA_ERROR_DEVICE_ESD             = 0x8000200d,
-       CAMERA_ERROR_INTERNAL               = 0x8000200e,
-
-       CAMERA_ERROR_NOT_IMPLEMENTED        = 0x80002ffe,
-       CAMERA_ERROR_UNKNOWN                = 0x80002fff
-} camera_error_t;
-
-/**
- * @brief Enumeration for the camera state.
- * @since_tizen 3.0
- */
-typedef enum camera_state {
-       CAMERA_STATE_INITIALIZED,
-       CAMERA_STATE_OPENED,
-       CAMERA_STATE_PREVIEWING,
-       CAMERA_STATE_CAPTURING,
-       CAMERA_STATE_RECORDING,
-       CAMERA_STATE_RECORDING_SNAPSHOT
-} camera_state_t;
-
-/**
- * @brief The structure type of the resolution.
- * @since_tizen 3.0
- */
-typedef struct camera_resolution {
-       uint32_t width;
-       uint32_t height;
-} camera_resolution_t;
-
-/**
- * @brief The structure type of the fraction.
- * @since_tizen 3.0
- */
-typedef struct camera_fraction {
-       int numerator;
-       int denominator;
-} camera_fraction_t;
-
-/**
- * @brief The structure type of the rectangle.
- * @since_tizen 3.0
- */
-typedef struct camera_rectangle {
-       int x;
-       int y;
-       uint32_t width;
-       uint32_t height;
-} camera_rectangle_t;
-
-/**
- * @brief Enumeration for the camera pixel format.
- * @since_tizen 3.0
- */
-typedef enum camera_pixel_format {
-       /* YUV */
-       CAMERA_PIXEL_FORMAT_NV12 = 0x0000,
-       CAMERA_PIXEL_FORMAT_NV21,
-       CAMERA_PIXEL_FORMAT_I420,
-       CAMERA_PIXEL_FORMAT_YV12,
-       CAMERA_PIXEL_FORMAT_YUYV,
-       CAMERA_PIXEL_FORMAT_UYVY,
-
-       /* RGB */
-       CAMERA_PIXEL_FORMAT_BGRA8888,
-       CAMERA_PIXEL_FORMAT_ARGB8888,
-
-       /* ENCODED */
-       CAMERA_PIXEL_FORMAT_ENCODED_JPEG,
-       CAMERA_PIXEL_FORMAT_ENCODED_H264,
-
-       /* MAX */
-       CAMERA_PIXEL_FORMAT_MAX
-} camera_pixel_format_t;
-
-/**
- * @brief The structure type of the camera plane.
- * @since_tizen 3.0
- */
-typedef struct camera_plane {
-       unsigned char *data;
-       uint32_t align_width;
-       uint32_t align_height;
-       uint32_t size;
-} camera_plane_t;
-
-/**
- * @brief The structure type of the camera buffer.
- * @since_tizen 3.0
- */
-typedef struct camera_buffer {
-       int index;
-       camera_pixel_format_t format;
-       camera_resolution_t resolution;
-       uint32_t total_size;
-       uint32_t num_planes;
-       camera_plane_t planes[BUFFER_PLANE_MAX];
-       uint32_t num_bos;
-       void *bos[BUFFER_PLANE_MAX];
-} camera_buffer_t;
-
-/**
- * @brief The structure type of the camera metadata.
- * @since_tizen 3.0
- */
-typedef struct camera_metadata {
-       int is_flashed;
-       camera_fraction_t focal_length;
-       camera_fraction_t aperture_f_number;
-       camera_fraction_t shutter_speed;
-       camera_fraction_t exposure_time;
-       camera_fraction_t brightness;
-       camera_resolution_t exif_image;
-       int iso;
-       int metering_mode;
-       int color_space;
-       int component_configuration;
-       int aperture_in_apex;
-} camera_metadata_t;
-
-/**
- * @brief Enumeration for the focus state.
- * @since_tizen 3.0
- */
-typedef enum camera_focus_state {
-       CAMERA_FOCUS_STATE_RELEASED,
-       CAMERA_FOCUS_STATE_ONGOING,
-       CAMERA_FOCUS_STATE_FOCUSED,
-       CAMERA_FOCUS_STATE_FAILED
-} camera_focus_state_t;
-
-/**
- * @brief Enumeration for the facing direction of camera device.
- * @since_tizen 3.0
- */
-typedef enum camera_facing_direction {
-       CAMERA_FACING_DIRECTION_REAR,
-       CAMERA_FACING_DIRECTION_FRONT,
-       CAMERA_FACING_DIRECTION_EXTERNAL
-} camera_facing_direction_t;
-
-/**
- * @brief Enumeration for the camera rotation.
- * @since_tizen 3.0
- */
-typedef enum camera_rotation {
-       CAMERA_ROTATION_0,
-       CAMERA_ROTATION_90,
-       CAMERA_ROTATION_180,
-       CAMERA_ROTATION_270
-} camera_rotation_t;
-
-/**
- * @brief Enumeration for the camera flip.
- * @since_tizen 3.0
- */
-typedef enum camera_flip {
-       CAMERA_FLIP_NONE,
-       CAMERA_FLIP_HORIZONTAL,
-       CAMERA_FLIP_VERTICAL,
-       CAMERA_FLIP_BOTH
-} camera_flip_t;
-
-/**
- * @brief The structure type of the camera format.
- * @since_tizen 3.0
- */
-typedef struct camera_format {
-       camera_pixel_format_t stream_format;
-       camera_resolution_t stream_resolution;
-       uint32_t stream_fps;
-       camera_rotation_t stream_rotation;
-       camera_pixel_format_t capture_format;
-       camera_resolution_t capture_resolution;
-       uint32_t capture_quality;
-} camera_format_t;
-
-/**
- * @brief Enumeration for the focus mode.
- * @since_tizen 3.0
- */
-typedef enum camera_focus_mode {
-       CAMERA_FOCUS_MODE_NONE,
-       CAMERA_FOCUS_MODE_PAN,
-       CAMERA_FOCUS_MODE_AUTO,
-       CAMERA_FOCUS_MODE_CONTINUOUS_AUTO
-} camera_focus_mode_t;
-
-/**
- * @brief Enumeration for the focus range.
- * @since_tizen 3.0
- */
-typedef enum camera_focus_range {
-       CAMERA_FOCUS_RANGE_NONE,
-       CAMERA_FOCUS_RANGE_NORMAL,
-       CAMERA_FOCUS_RANGE_MACRO,
-       CAMERA_FOCUS_RANGE_FULL
-} camera_focus_range_t;
-
-/**
- * @brief Enumeration for the white balance.
- * @since_tizen 3.0
- */
-typedef enum camera_white_balance {
-       CAMERA_WHITE_BALANCE_AUTO,          /**< Automatic */
-       CAMERA_WHITE_BALANCE_DAYLIGHT,      /**< Daylight */
-       CAMERA_WHITE_BALANCE_CLOUDY,        /**< Cloudy */
-       CAMERA_WHITE_BALANCE_FLUORESCENT,   /**< Fluorescent */
-       CAMERA_WHITE_BALANCE_INCANDESCENT,  /**< Incandescent */
-       CAMERA_WHITE_BALANCE_SHADE,         /**< Shade */
-       CAMERA_WHITE_BALANCE_HORIZON,       /**< Horizon */
-       CAMERA_WHITE_BALANCE_FLASH          /**< Flash */
-} camera_white_balance_t;
-
-/**
- * @brief Enumeration for the effect.
- * @since_tizen 3.0
- */
-typedef enum camera_effect {
-       CAMERA_EFFECT_NONE,                 /**< None */
-       CAMERA_EFFECT_MONO,                 /**< Mono */
-       CAMERA_EFFECT_SEPIA,                /**< Sepia */
-       CAMERA_EFFECT_NEGATIVE,             /**< Negative */
-       CAMERA_EFFECT_RED,                  /**< Red */
-       CAMERA_EFFECT_GREEN,                /**< Green */
-       CAMERA_EFFECT_BLUE,                 /**< Blue */
-       CAMERA_EFFECT_AQUA,                 /**< Aqua */
-       CAMERA_EFFECT_ANTIQUE,              /**< Antique */
-       CAMERA_EFFECT_WARM,                 /**< Warm */
-       CAMERA_EFFECT_EMBOSS,               /**< Emboss */
-       CAMERA_EFFECT_SKETCH,               /**< Sketch */
-       CAMERA_EFFECT_SOLARIZATION,         /**< Solarization */
-       CAMERA_EFFECT_POSTERIZATION,        /**< Posterization */
-       CAMERA_EFFECT_CARTOON               /**< Cartoon */
-} camera_effect_t;
-
-/**
- * @brief Enumeration for the scene mode.
- * @since_tizen 3.0
- */
-typedef enum camera_scene_mode {
-       CAMERA_SCENE_MODE_NORMAL,           /**< Normal */
-       CAMERA_SCENE_MODE_PORTRAIT,         /**< Portrait */
-       CAMERA_SCENE_MODE_LANDSCAPE,        /**< Landscape */
-       CAMERA_SCENE_MODE_SPORTS,           /**< Sports */
-       CAMERA_SCENE_MODE_PARTY_N_INDOOR,   /**< Party & indoor */
-       CAMERA_SCENE_MODE_BEACH_N_INDOOR,   /**< Beach & indoor */
-       CAMERA_SCENE_MODE_SUNSET,           /**< Sunset */
-       CAMERA_SCENE_MODE_DUSK_N_DAWN,      /**< Dusk & dawn */
-       CAMERA_SCENE_MODE_FALL_COLOR,       /**< Fall */
-       CAMERA_SCENE_MODE_NIGHT_SCENE,      /**< Night scene */
-       CAMERA_SCENE_MODE_FIREWORK,         /**< Firework */
-       CAMERA_SCENE_MODE_TEXT,             /**< Text */
-       CAMERA_SCENE_MODE_SHOW_WINDOW,      /**< Show window */
-       CAMERA_SCENE_MODE_CANDLE_LIGHT,     /**< Candle light */
-       CAMERA_SCENE_MODE_BACKLIGHT,        /**< Backlight */
-       CAMERA_SCENE_MODE_AQUA              /**< Aqua */
-} camera_scene_mode_t;
-
-/**
- * @brief Enumeration for the exposure mode.
- * @since_tizen 3.0
- */
-typedef enum camera_exposure_mode {
-       CAMERA_EXPOSURE_MODE_OFF = 0,       /**< Off */
-       CAMERA_EXPOSURE_MODE_ALL,           /**< All mode */
-       CAMERA_EXPOSURE_MODE_CENTER,        /**< Center mode */
-       CAMERA_EXPOSURE_MODE_SPOT,          /**< Spot mode */
-       CAMERA_EXPOSURE_MODE_CUSTOM         /**< Custom mode */
-} camera_exposure_mode_t;
-
-/**
- * @brief Enumeration for the shot mode.
- * @since_tizen 3.0
- */
-typedef enum camera_shot_mode {
-       CAMERA_SHOT_MODE_NORMAL = 0,        /**< Normal */
-       CAMERA_SHOT_MODE_CONTINUOUS,        /**< Continuous */
-       CAMERA_SHOT_MODE_HDR,               /**< HDR */
-       CAMERA_SHOT_MODE_NIGHT              /**< Night */
-} camera_shot_mode_t;
-
-/**
- * @brief Enumeration for the flash mode.
- * @since_tizen 3.0
- */
-typedef enum camera_flash_mode {
-       CAMERA_FLASH_MODE_OFF = 0,          /**< Always off */
-       CAMERA_FLASH_MODE_ON,               /**< Always splashes */
-       CAMERA_FLASH_MODE_AUTO,             /**< Depending on intensity of light, strobe starts to flash */
-       CAMERA_FLASH_MODE_REDEYE_REDUCTION, /**< Red eye reduction. Multiple flash before capturing */
-       CAMERA_FLASH_MODE_SLOW_SYNC,        /**< Slow sync curtain synchronization */
-       CAMERA_FLASH_MODE_FRONT_CURTAIN,    /**< Front curtain synchronization */
-       CAMERA_FLASH_MODE_REAR_CURTAIN,     /**< Rear curtain synchronization */
-       CAMERA_FLASH_MODE_PERMANENT,        /**< Keep turned on until turning off */
-} camera_flash_mode_t;
-
-/**
- * @brief Enumeration for the face detection.
- * @since_tizen 3.0
- */
-typedef enum camera_face_detection {
-       CAMERA_FACE_DETECTION_OFF = 0,      /**< Face detection off */
-       CAMERA_FACE_DETECTION_ON            /**< Face detection on */
-} camera_face_detection_t;
-
-/**
- * @brief Definitions for the camera command.
- * @since_tizen 3.0
- */
-#define CAMERA_COMMAND_BASE                     ((int64_t)1)
-#define CAMERA_COMMAND_WHITE_BALANCE            ((int64_t)(CAMERA_COMMAND_BASE << 1))
-#define CAMERA_COMMAND_ISO                      ((int64_t)(CAMERA_COMMAND_BASE << 2))
-#define CAMERA_COMMAND_CONTRAST                 ((int64_t)(CAMERA_COMMAND_BASE << 3))
-#define CAMERA_COMMAND_SATURATION               ((int64_t)(CAMERA_COMMAND_BASE << 4))
-#define CAMERA_COMMAND_HUE                      ((int64_t)(CAMERA_COMMAND_BASE << 5))
-#define CAMERA_COMMAND_SHARPNESS                ((int64_t)(CAMERA_COMMAND_BASE << 6))
-#define CAMERA_COMMAND_EFFECT                   ((int64_t)(CAMERA_COMMAND_BASE << 7))
-#define CAMERA_COMMAND_SCENE_MODE               ((int64_t)(CAMERA_COMMAND_BASE << 8))
-#define CAMERA_COMMAND_EXPOSURE_MODE            ((int64_t)(CAMERA_COMMAND_BASE << 9))
-#define CAMERA_COMMAND_EXPOSURE                 ((int64_t)(CAMERA_COMMAND_BASE << 10))
-#define CAMERA_COMMAND_ROTATION                 ((int64_t)(CAMERA_COMMAND_BASE << 11))
-#define CAMERA_COMMAND_FLIP                     ((int64_t)(CAMERA_COMMAND_BASE << 12))
-#define CAMERA_COMMAND_FOCUS_MODE               ((int64_t)(CAMERA_COMMAND_BASE << 13))
-#define CAMERA_COMMAND_FOCUS_RANGE              ((int64_t)(CAMERA_COMMAND_BASE << 14))
-#define CAMERA_COMMAND_SHOT_MODE                ((int64_t)(CAMERA_COMMAND_BASE << 15))
-#define CAMERA_COMMAND_ANTI_SHAKE               ((int64_t)(CAMERA_COMMAND_BASE << 16))
-#define CAMERA_COMMAND_FOCUS_AREA               ((int64_t)(CAMERA_COMMAND_BASE << 17))
-#define CAMERA_COMMAND_DIGITAL_ZOOM             ((int64_t)(CAMERA_COMMAND_BASE << 18))
-#define CAMERA_COMMAND_OPTICAL_ZOOM             ((int64_t)(CAMERA_COMMAND_BASE << 19))
-#define CAMERA_COMMAND_RECORDING_HINT           ((int64_t)(CAMERA_COMMAND_BASE << 20))
-#define CAMERA_COMMAND_WDR                      ((int64_t)(CAMERA_COMMAND_BASE << 21))
-#define CAMERA_COMMAND_SHUTTER_SPEED            ((int64_t)(CAMERA_COMMAND_BASE << 22))
-#define CAMERA_COMMAND_FLASH_MODE               ((int64_t)(CAMERA_COMMAND_BASE << 23))
-#define CAMERA_COMMAND_FACE_DETECTION           ((int64_t)(CAMERA_COMMAND_BASE << 24))
-
-
-typedef struct camera_batch_command_control {
-       /* flag for modified command */
-       int64_t command_set_flag;
-
-       /* value list */
-       camera_white_balance_t white_balance;
-       int iso;
-       int contrast;
-       int saturation;
-       int hue;
-       int sharpness;
-       camera_effect_t effect;
-       camera_scene_mode_t scene_mode;
-       camera_exposure_mode_t exposure_mode;
-       int exposure;
-       camera_rotation_t rotation;
-       camera_flip_t flip;
-       camera_focus_mode_t focus_mode;
-       camera_focus_range_t focus_range;
-       camera_exposure_mode_t shot_mode;
-       int anti_shake;
-       camera_rectangle_t focus_area;
-       int digital_zoom;
-       int optical_zoom;
-       int recording_hint;
-       int wdr;
-       camera_flash_mode_t flash_mode;
-       camera_face_detection_t face_detection;
-} camera_batch_command_control_t;
-
-/**
- * @brief The structure type of the format list.
- * @since_tizen 3.0
- */
-typedef struct camera_pixel_format_list {
-       uint32_t count;
-       camera_pixel_format_t formats[CAMERA_PIXEL_FORMAT_MAX];
-} camera_format_list_t;
-
-/**
- * @brief The structure type of the resolution list.
- * @since_tizen 3.0
- */
-typedef struct camera_resolution_list {
-       uint32_t count;
-       camera_resolution_t resolutions[RESOLUTION_COUNT_MAX];
-} camera_resolution_list_t;
-
-/**
- * @brief The structure type of the camera device information.
- * @since_tizen 3.0
- */
-typedef struct camera_device_info {
-       uint32_t index;
-       const char *name;
-       camera_facing_direction_t facing_direction;
-       camera_format_list_t format_list;
-       camera_resolution_list_t preview_list;
-       camera_resolution_list_t capture_list;
-       camera_resolution_list_t video_list;
-} camera_device_info_t;
-
-/**
- * @brief The structure type of the camera device list.
- * @since_tizen 3.0
- */
-typedef struct camera_device_list {
-       uint32_t count;
-       camera_device_info_t device_info[DEVICE_COUNT_MAX];
-} camera_device_list_t;
-
-/**
- * @brief Enumeration for the camera message type.
- * @since_tizen 3.0
- */
-typedef enum camera_message_type {
-       CAMERA_MESSAGE_TYPE_FOCUS_CHANGED,
-       CAMERA_MESSAGE_TYPE_CAPTURED,
-       CAMERA_MESSAGE_TYPE_HDR_PROGRESS,
-       CAMERA_MESSAGE_TYPE_ERROR
-} camera_message_type_t;
-
-/**
- * @brief The structure type of the camera message.
- * @since_tizen 3.0
- */
-typedef struct camera_message {
-       camera_message_type_t type;
-       union {
-               camera_focus_state_t focus_state;
-               uint32_t hdr_progress;
-               camera_error_t error_code;
-       };
-} camera_message_t;
-
-/**
- * @brief Callback function for notification from camera HAL.
- * @since_tizen 3.0
- * @param[in] message The message from camera HAL
- * @param[in] user_data The user data for callback
- * @see camera_add_message_callback()
- * @see camera_remove_message_callback()
- */
-typedef int (*camera_message_cb)(camera_message_t *message, void *user_data);
-
-/**
- * @brief Callback function for captured preview frame from camera device.
- * @since_tizen 3.0
- * @param[in] buffer The preview buffer
- * @param[in] meta The meta data for the preview frame
- * @param[in] user_data The user data for callback
- * @pre       camera_start_preview() will invoke this callback.
- * @see camera_start_preview()
- * @see camera_stop_preview()
- */
-typedef int (*camera_preview_frame_cb)(camera_buffer_t *buffer, camera_metadata_t *meta, void *user_data);
-
-/**
- * @brief Callback function for captured video frame from camera device.
- * @since_tizen 3.0
- * @param[in] buffer The video buffer
- * @param[in] meta The meta data for the video frame
- * @param[in] user_data The user data for callback
- * @pre       camera_start_record() will invoke this callback.
- * @see camera_start_record()
- * @see camera_stop_record()
- */
-typedef int (*camera_video_frame_cb)(camera_buffer_t *buffer, camera_metadata_t *meta, void *user_data);
-
-/**
- * @brief Callback function for captured still image from camera device.
- * @since_tizen 3.0
- * @param[in] main The main image data
- * @param[in] postview The image data of the postview (it could be @c NULL if the available data does not exist)
- * @param[in] thumbnail The image data of the thumbnail (it could be @c NULL if the available data does not exist)
- * @param[in] user_data The user data passed from the callback registration function
- * @pre       camera_start_capture() will invoke this callback function.
- * @see camera_start_capture()
- * @see camera_stop_capture()
- */
-typedef int (*camera_capture_cb)(camera_buffer_t *main, camera_buffer_t *postview, camera_buffer_t *thumbnail, void *user_data);
-
-/**
- * @brief The structure type of the camera interface.
- * @since_tizen 3.0
- */
-typedef struct camera_interface {
-       int (*init)(void **camera_handle);
-       int (*deinit)(void *camera_handle);
-       int (*get_device_list)(void *camera_handle, camera_device_list_t *device_list);
-       int (*open_device)(void *camera_handle, int device_index);
-       int (*close_device)(void *camera_handle);
-       int (*add_message_callback)(void *camera_handle, camera_message_cb callback, void *user_data, uint32_t *cb_id);
-       int (*remove_message_callback)(void *camera_handle, uint32_t cb_id);
-       int (*set_preview_stream_format)(void *camera_handle, camera_format_t *format);
-       int (*get_preview_stream_format)(void *camera_handle, camera_format_t *format);
-       int (*start_preview)(void *camera_handle, camera_preview_frame_cb callback, void *user_data);
-       int (*release_preview_buffer)(void *camera_handle, int buffer_index);
-       int (*stop_preview)(void *camera_handle);
-       int (*start_auto_focus)(void *camera_handle);
-       int (*stop_auto_focus)(void *camera_handle);
-       int (*start_capture)(void *camera_handle, camera_capture_cb callback, void *user_data);
-       int (*stop_capture)(void *camera_handle);
-       int (*set_video_stream_format)(void *camera_handle, camera_format_t *format);
-       int (*get_video_stream_format)(void *camera_handle, camera_format_t *format);
-       int (*start_record)(void *camera_handle, camera_video_frame_cb callback, void *user_data);
-       int (*release_video_buffer)(void *camera_handle, int buffer_index);
-       int (*stop_record)(void *camera_handle);
-       int (*set_command)(void *camera_handle, int command, void *value);
-       int (*get_command)(void *camera_handle, int command, void *value);
-       int (*set_batch_command)(void *camera_handle, camera_batch_command_control_t *batch_command, int64_t *error_command);
-} camera_interface_t;
-
-
-/**
- * @brief Initializes new handle of camera HAL.
- * @since_tizen 3.0
- * @param[out] camera_handle A newly returned handle to the camera HAL
- * @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_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_INITIALIZED.
- *
- * @see camera_deinit()
- */
-int camera_init(void **camera_handle);
-
-/**
- * @brief Deinitializes handle of camera HAL.
- * @since_tizen 3.0
- * @param[in] camera_handle The handle to the camera HAL
- * @return @c 0 on success, otherwise a negative error value
- * @retval #CAMERA_ERROR_NONE Successful
- * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
- * @see camera_init()
- */
-int camera_deinit(void *camera_handle);
-
-/**
- * @brief Gets the device list of camera.
- * @since_tizen 3.0
- * @param[in] camera_handle The handle to the camera HAL
- * @param[out] device_list The device list 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_NOT_SUPPORTED The feature is not supported
- */
-int camera_get_device_list(void *camera_handle, camera_device_list_t *device_list);
-
-/**
- * @brief Opens camera device.
- * @since_tizen 3.0
- * @param[in] camera_handle The handle to the camera HAL
- * @param[in] device_index The device index 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_INVALID_STATE Invalid state
- * @retval #CAMERA_ERROR_OUT_OF_MEMORY Out of memory
- * @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_NOT_FOUND Failed to find camera device
- * @retval #CAMERA_ERROR_DEVICE_UNAVAILABLE The camera device is unavailable
- * @pre    The camera state must be set to #CAMERA_STATE_INITIALIZED.
- * @post   If it succeeds, the camera state will be #CAMERA_STATE_OPENED.
- * @see camera_close_device()
- */
-int camera_open_device(void *camera_handle, int device_index);
-
-/**
- * @brief Closes camera device.
- * @since_tizen 3.0
- * @param[in] camera_handle The handle to the camera HAL
- * @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
- * @pre    The camera state must be set to #CAMERA_STATE_OPENED.
- * @post   If it succeeds, the camera state will be #CAMERA_STATE_INITIALIZED.
- * @see camera_open_device()
- */
-int camera_close_device(void *camera_handle);
-
-/**
- * @brief Registers a callback function to be called to send a message by camera HAL.
- * @since_tizen 3.0
- * @param[in] camera_handle The handle to the camera HAL
- * @param[in] callback The callback function to be registered
- * @param[in] user_data The user data to be passed to the callback function
- * @param[out] cb_id The callback id
- * @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
- * @see camera_remove_message_callback()
- */
-int camera_add_message_callback(void *camera_handle, camera_message_cb callback, void *user_data, uint32_t *cb_id);
-
-/**
- * @brief Unregisters a callback function.
- * @since_tizen 3.0
- * @param[in] camera_handle The handle to the camera HAL
- * @param[in] cb_id The callback id
- * @return @c 0 on success, otherwise a negative error value
- * @retval #CAMERA_ERROR_NONE Successful
- * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
- * @see camera_remove_message_callback()
- */
-int camera_remove_message_callback(void *camera_handle, uint32_t cb_id);
-
-/**
- * @brief Sets the format of the preview stream.
- * @since_tizen 3.0
- * @remarks This function should be called before previewing (see camera_start_preview()).
- * @param[in] camera_handle The handle to the camera HAL
- * @param[in] format The format of the preview 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_INVALID_STATE Invalid state
- * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
- * @pre    The camera state must be set to #CAMERA_STATE_OPENED.
- * @see camera_start_preview()
- * @see camera_start_capture()
- * @see camera_get_preview_stream_format()
- */
-int camera_set_preview_stream_format(void *camera_handle, camera_format_t *format);
-
-/**
- * @brief Gets the format of the preview stream.
- * @since_tizen 3.0
- * @param[in] camera_handle The handle to the camera HAL
- * @param[out] format The format of the preview 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_INVALID_STATE Invalid state
- * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
- * @see camera_start_preview()
- * @see camera_start_capture()
- * @see camera_set_preview_stream_format()
- * @see camera_foreach_supported_preview_format()
- */
-int camera_get_preview_stream_format(void *camera_handle, camera_format_t *format);
-
-/**
- * @brief Starts preview frames on the screen.
- * @since_tizen 3.0
- * @param[in] camera_handle The handle to the camera HAL
- * @param[in] callback The callback for preview frame
- * @param[in] user_data The user data for callback
- * @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_DEVICE_BUSY The device is being used in another application or is performing other operations
- * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
- * @pre    The camera state must be set to #CAMERA_STATE_OPENED.
- * @post   If it succeeds, the camera state will be #CAMERA_STATE_PREVIEWING.
- * @see camera_stop_preview()
- */
-int camera_start_preview(void *camera_handle, camera_preview_frame_cb callback, void *user_data);
-
-/**
- * @brief Release the preview buffer.
- * @since_tizen 3.0
- * @remarks The preview buffer should be released with this function after use it.
- * @param[in] camera_handle The handle to the camera HAL
- * @param[in] buffer_index The index of preview buffer
- * @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
- * @see camera_start_preview()
- */
-int camera_release_preview_buffer(void *camera_handle, int buffer_index);
-
-/**
- * @brief Stops preview frames.
- * @since_tizen 3.0
- * @param[in] camera_handle The handle to the camera HAL
- * @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
- * @pre    The camera state must be set to #CAMERA_STATE_PREVIEWING.
- * @post   The camera state will be #CAMERA_STATE_OPENED.
- * @see camera_start_preview()
- */
-int camera_stop_preview(void *camera_handle);
-
-/**
- * @brief Starts camera auto focusing operation.
- * @since_tizen 3.0
- * @param[in] camera_handle The handle to the camera HAL
- * @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_NOT_SUPPORTED The feature is not supported
- * @pre    The camera state must be set to #CAMERA_STATE_PREVIEWING or #CAMERA_STATE_RECORDING.
- * @post   The camera focus state will be #CAMERA_FOCUS_STATE_ONGOING.
- * @see camera_stop_auto_focus()
- * @see camera_add_message_callback()
- * @see camera_message_cb()
- * @see camera_set_command()
- */
-int camera_start_auto_focus(void *camera_handle);
-
-/**
- * @brief Stops camera auto focusing operation.
- * @since_tizen 3.0
- * @param[in] camera_handle The handle to the camera HAL
- * @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_NOT_SUPPORTED The feature is not supported
- * @pre    The camera state must be set to #CAMERA_STATE_PREVIEWING or #CAMERA_STATE_RECORDING.
- * @post   The camera focus state will be #CAMERA_FOCUS_STATE_ONGOING.
- * @see camera_start_auto_focus()
- * @see camera_add_message_callback()
- * @see camera_message_cb()
- */
-int camera_stop_auto_focus(void *camera_handle);
-
-/**
- * @brief Starts capturing of still images.
- * @since_tizen 3.0
- * @remarks In case of zero shutter lag capture, preview frame won't be stopped while capturing.
- * @param[in] camera_handle The handle to the camera HAL
- * @param[in] callback The callback for captured data
- * @param[in] user_data The user data for callback
- * @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
- * @pre    The camera state must be set to #CAMERA_STATE_PREVIEWING or #CAMERA_STATE_RECORDING.
- * @post   If it succeeds the camera state will be #CAMERA_STATE_CAPTURING or #CAMERA_STATE_RECORDING_SNAPSHOT.
- * @see camera_start_preview()
- * @see camera_start_record()
- * @see camera_set_preview_stream_format()
- * @see camera_get_preview_stream_format()
- */
-int camera_start_capture(void *camera_handle, camera_capture_cb callback, void *user_data);
-
-/**
- * @brief Stops capturing of still images.
- * @since_tizen 3.0
- * @remarks In case of zero shutter lag, this function will changes only the state of camera HAL \n
- *          from #CAMERA_STATE_PREVIEWING or #CAMERA_STATE_RECORDING to #CAMERA_STATE_PREVIEWING or #CAMERA_STATE_RECORDING.\n
- *          Otherwise, preview frame will be restarted.
- * @param[in] camera_handle The handle to the camera HAL
- * @param[in] callback The callback for captured data
- * @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
- * @pre    The camera state must be set to #CAMERA_STATE_CAPTURING or #CAMERA_STATE_RECORDING_SNAPSHOT.
- * @post   If it succeeds the camera state will be #CAMERA_STATE_PREVIEWING or #CAMERA_STATE_RECORDING.
- * @see camera_start_capture()
- * @see camera_start_record()
- * @see camera_set_preview_stream_format()
- * @see camera_get_preview_stream_format()
- * @see camera_set_video_stream_format()
- * @see camera_get_video_stream_format()
- */
-int camera_stop_capture(void *camera_handle);
-
-/**
- * @brief Sets the format of the video stream for recording.
- * @since_tizen 3.0
- * @remarks This function should be called before recording (see camera_start_record()).
- * @param[in] camera_handle The handle to the camera HAL
- * @param[in] format The format of the 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_INVALID_STATE Invalid state
- * @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
- * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
- * @pre    The camera state must be set to #CAMERA_STATE_OPENED.
- * @see camera_start_record()
- * @see camera_start_capture()
- * @see camera_get_video_stream_format()
- */
-int camera_set_video_stream_format(void *camera_handle, camera_format_t *format);
-
-/**
- * @brief Gets the format of the video stream for recording.
- * @since_tizen 3.0
- * @param[in] camera_handle The handle to the camera HAL
- * @param[out] format The format of the 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_INVALID_STATE Invalid state
- * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
- * @see camera_start_preview()
- * @see camera_start_capture()
- * @see camera_set_preview_stream_format()
- * @see camera_foreach_supported_preview_format()
- */
-int camera_get_video_stream_format(void *camera_handle, camera_format_t *format);
-
-/**
- * @brief Starts the video frame for recording.
- * @since_tizen 3.0
- * @param[in] camera_handle The handle to the camera HAL
- * @param[in] callback The callback for video frame
- * @param[in] user_data The user data for callback
- * @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
- * @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_PREVIEWING.
- * @post The camera state will be #CAMERA_STATE_RECORDING.
- * @see camera_set_video_stream_format()
- * @see camera_get_video_stream_format()
- * @see camera_stop_record()
- */
-int camera_start_record(void *camera_handle, camera_video_frame_cb callback, void *user_data);
-
-/**
- * @brief Release the video buffer.
- * @remarks The video buffer should be released with this function after use it.
- * @since_tizen 3.0
- * @param[in] camera_handle The handle to the camera HAL
- * @param[in] buffer_index The index of video buffer
- * @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
- * @pre    The camera state must be set to #CAMERA_STATE_PREVIEWING.
- * @see camera_start_record()
- */
-int camera_release_video_buffer(void *camera_handle, int buffer_index);
-
-/**
- * @brief Stops the video frame.
- * @since_tizen 3.0
- * @param[in] camera_handle The handle to the camera HAL
- * @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_RECORDING.
- * @post The camera state will be #CAMERA_STATE_PREVIEWING.
- * @see camera_set_video_stream_format()
- * @see camera_get_video_stream_format()
- * @see camera_start_record()
- */
-int camera_stop_record(void *camera_handle);
-
-/**
- * @brief Sets the various command and value to control camera device.
- * @since_tizen 3.0
- * @param[in] camera_handle The handle to the camera HAL
- * @param[in] command The command to control the camera device
- * @param[in] value The value to set
- * @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
- * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
- * @see camera_get_command()
- */
-int camera_set_command(void *camera_handle, int64_t command, void *value);
-
-/**
- * @brief Gets the current value of command.
- * @since_tizen 3.0
- * @param[in] camera_handle The handle to the camera HAL
- * @param[in] command The command to control the camera device
- * @param[out] value The value to get
- * @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
- * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
- * @see camera_get_command()
- */
-int camera_get_command(void *camera_handle, int64_t command, void *value);
-
-/**
- * @brief Sets a set of commands.
- * @since_tizen 3.0
- * @remarks error_command will be set if error is returned from the function.
- * @param[in] camera_handle The handle to the camera HAL
- * @param[in] batch_command The batch command to set
- * @param[out] error_command The error command
- * @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
- * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
- * @see camera_set_command()
- * @see camera_get_command()
- */
-int camera_set_batch_command(void *camera_handle, camera_batch_command_control_t *batch_command, int64_t *error_command);
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __TIZEN_CAMERA_HAL_H__ */
diff --git a/include/audio/tizen-audio.h b/include/audio/tizen-audio.h
new file mode 100644 (file)
index 0000000..5d733ce
--- /dev/null
@@ -0,0 +1,530 @@
+/*
+ * audio-hal
+ *
+ * Copyright (c) 2015 - 2016 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 footizenaudiofoo
+#define footizenaudiofoo
+
+#include <stdint.h>
+
+/**
+ * @file tizen-audio.h
+ * @brief This file contains the Audio Hardware Abstraction Layer Interfaces.
+ */
+
+/**
+ * @addtogroup TIZEN_AUDIO_HAL_MODULE
+ * @{
+ */
+
+/**
+ * @brief Enumeration for return codes.
+ * @since_tizen 3.0
+ */
+typedef enum audio_return {
+    AUDIO_RET_OK                        = 0,
+    AUDIO_ERR_UNDEFINED                 = (int32_t)0x80001000,
+    AUDIO_ERR_RESOURCE                  = (int32_t)0x80001001,
+    AUDIO_ERR_PARAMETER                 = (int32_t)0x80001002,
+    AUDIO_ERR_IOCTL                     = (int32_t)0x80001003,
+    AUDIO_ERR_INVALID_STATE             = (int32_t)0x80001004,
+    AUDIO_ERR_INTERNAL                  = (int32_t)0x80001005,
+    /* add new enemerator here */
+    AUDIO_ERR_NOT_IMPLEMENTED           = (int32_t)0x80001100,
+} audio_return_t ;
+
+/**
+ * @brief Enumeration for audio direction.
+ * @since_tizen 3.0
+ */
+typedef enum audio_direction {
+    AUDIO_DIRECTION_IN,                 /**< Capture */
+    AUDIO_DIRECTION_OUT,                /**< Playback */
+} audio_direction_t;
+
+/**
+ * @brief Device information including type, direction and id.
+ * @since_tizen 3.0
+ */
+typedef struct device_info {
+    const char *type;
+    uint32_t direction;
+    uint32_t id;
+} device_info_t;
+
+/**
+ * @brief Volume information including type, gain and direction.
+ * @since_tizen 3.0
+ */
+typedef struct audio_volume_info {
+    const char *type;
+    const char *gain;
+    uint32_t direction;
+} audio_volume_info_t ;
+
+/**
+ * @brief Route information including role and device.
+ * @since_tizen 3.0
+ */
+typedef struct audio_route_info {
+    const char *role;
+    device_info_t *device_infos;
+    uint32_t num_of_devices;
+} audio_route_info_t;
+
+/**
+ * @brief Route option including role, name and value.
+ * @since_tizen 3.0
+ */
+typedef struct audio_route_option {
+    const char *role;
+    const char *name;
+    int32_t value;
+} audio_route_option_t;
+
+/**
+ * @brief Stream information including role, direction and index.
+ * @since_tizen 3.0
+ */
+typedef struct audio_stream_info {
+    const char *role;
+    uint32_t direction;
+    uint32_t idx;
+} audio_stream_info_t ;
+
+/**
+ * @brief Called when audio hal implementation needs to send a message. (optional)
+ * @since_tizen 3.0
+ * @param[in] name The message name
+ * @param[in] value The message value
+ * @param[in] user_data The user data passed from the callback registration function
+ *
+ * @remarks Some audio hal implementation may not have these functions.\n
+ * (@c message_cb, @c audio_add_message_cb and @c audio_remove_message_cb)
+ *
+ * @see audio_add_message_cb()
+ * @see audio_remove_message_cb()
+ */
+typedef void (*message_cb)(const char *name, int value, void *user_data);
+
+/* Overall */
+typedef struct audio_interface {
+    /* Initialization & de-initialization */
+    audio_return_t (*init)(void **audio_handle);
+    audio_return_t (*deinit)(void *audio_handle);
+    /* Volume */
+    audio_return_t (*get_volume_level_max)(void *audio_handle, audio_volume_info_t *info, uint32_t *level);
+    audio_return_t (*get_volume_level)(void *audio_handle, audio_volume_info_t *info, uint32_t *level);
+    audio_return_t (*set_volume_level)(void *audio_handle, audio_volume_info_t *info, uint32_t level);
+    audio_return_t (*get_volume_value)(void *audio_handle, audio_volume_info_t *info, uint32_t level, double *value);
+    audio_return_t (*get_volume_mute)(void *audio_handle, audio_volume_info_t *info, uint32_t *mute);
+    audio_return_t (*set_volume_mute)(void *audio_handle, audio_volume_info_t *info, uint32_t mute);
+    /* Routing */
+    audio_return_t (*update_route)(void *audio_handle, audio_route_info_t *info);
+    audio_return_t (*update_route_option)(void *audio_handle, audio_route_option_t *option);
+    /* Stream */
+    audio_return_t (*notify_stream_connection_changed)(void *audio_handle, audio_stream_info_t *info, uint32_t is_connected);
+    /* PCM */
+    audio_return_t (*pcm_open)(void *audio_handle, void **pcm_handle, uint32_t direction, void *sample_spec, uint32_t period_size, uint32_t periods);
+    audio_return_t (*pcm_start)(void *audio_handle, void *pcm_handle);
+    audio_return_t (*pcm_stop)(void *audio_handle, void *pcm_handle);
+    audio_return_t (*pcm_close)(void *audio_handle, void *pcm_handle);
+    audio_return_t (*pcm_avail)(void *audio_handle, void *pcm_handle, uint32_t *avail);
+    audio_return_t (*pcm_write)(void *audio_handle, void *pcm_handle, const void *buffer, uint32_t frames);
+    audio_return_t (*pcm_read)(void *audio_handle, void *pcm_handle, void *buffer, uint32_t frames);
+    audio_return_t (*pcm_get_fd)(void *audio_handle, void *pcm_handle, int *fd);
+    audio_return_t (*pcm_recover)(void *audio_handle, void *pcm_handle, int revents);
+    audio_return_t (*pcm_get_params)(void *audio_handle, void *pcm_handle, uint32_t direction, void **sample_spec, uint32_t *period_size, uint32_t *periods);
+    audio_return_t (*pcm_set_params)(void *audio_handle, void *pcm_handle, uint32_t direction, void *sample_spec, uint32_t period_size, uint32_t periods);
+    /* Message callback (optional) */
+    audio_return_t (*add_message_cb)(void *audio_handle, message_cb callback, void *user_data);
+    audio_return_t (*remove_message_cb)(void *audio_handle, message_cb callback);
+} audio_interface_t;
+
+/**
+ * @brief Initializes audio hal.
+ * @since_tizen 3.0
+ * @param[out] audio_handle The audio hal handle
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #AUDIO_RET_OK Success
+ * @see audio_deinit()
+ */
+audio_return_t audio_init(void **audio_handle);
+
+/**
+ * @brief De-initializes audio hal.
+ * @since_tizen 3.0
+ * @param[in] audio_handle The audio hal handle
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #AUDIO_RET_OK Success
+ * @see audio_init()
+ */
+audio_return_t audio_deinit(void *audio_handle);
+
+/**
+ * @brief Gets the maximum volume level supported for a particular volume information.
+ * @since_tizen 3.0
+ * @param[in] audio_handle The audio hal handle
+ * @param[in] info The audio volume information
+ * @param[out] level The maximum volume level
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #AUDIO_RET_OK Success
+ * @see audio_set_volume_level()
+ * @see audio_get_volume_level()
+ * @see audio_get_volume_value()
+ */
+audio_return_t audio_get_volume_level_max(void *audio_handle, audio_volume_info_t *info, uint32_t *level);
+
+/**
+ * @brief Gets the volume level specified for a particular volume information.
+ * @since_tizen 3.0
+ * @param[in] audio_handle The audio hal handle
+ * @param[in] info The audio volume information
+ * @param[out] level The current volume level
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #AUDIO_RET_OK Success
+ * @see audio_set_volume_level()
+ * @see audio_get_volume_level_max()
+ * @see audio_get_volume_value()
+ */
+audio_return_t audio_get_volume_level(void *audio_handle, audio_volume_info_t *info, uint32_t *level);
+
+/**
+ * @brief Sets the volume level specified for a particular volume information.
+ * @since_tizen 3.0
+ * @param[in] audio_handle The audio hal handle
+ * @param[in] info The audio volume information
+ * @param[in] level The volume level to be set
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #AUDIO_RET_OK Success
+ * @see audio_get_volume_level()
+ * @see audio_get_volume_level_max()
+ * @see audio_get_volume_value()
+ */
+audio_return_t audio_set_volume_level(void *audio_handle, audio_volume_info_t *info, uint32_t level);
+
+/**
+ * @brief Gets the volume value specified for a particular volume information and level.
+ * @since_tizen 3.0
+ * @param[in] audio_handle The audio hal handle
+ * @param[in] info The audio volume information
+ * @param[in] level The volume level
+ * @param[out] value The volume value (range is from 0.0 to 1.0 inclusive, 1.0 = 100%)
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #AUDIO_RET_OK Success
+ * @see audio_set_volume_level()
+ * @see audio_get_volume_level()
+ * @see audio_get_volume_level_max()
+ */
+audio_return_t audio_get_volume_value(void *audio_handle, audio_volume_info_t *info, uint32_t level, double *value);
+
+/**
+ * @brief Gets the volume mute specified for a particular volume information.
+ * @since_tizen 3.0
+ * @param[in] audio_handle The audio hal handle
+ * @param[in] info The audio volume information
+ * @param[out] mute The volume mute state : (@c 0 = unmute, @c 1 = mute)
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #AUDIO_RET_OK Success
+ * @see audio_set_volume_mute()
+ */
+audio_return_t audio_get_volume_mute(void *audio_handle, audio_volume_info_t *info, uint32_t *mute);
+
+/**
+ * @brief Sets the volume mute specified for a particular volume information.
+ * @since_tizen 3.0
+ * @param[in] audio_handle The audio hal handle
+ * @param[in] info The audio volume information
+ * @param[in] mute The volume mute state to be set : (@c 0 = unmute, @c 1 = mute)
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #AUDIO_RET_OK Success
+ * @see audio_get_volume_mute()
+ */
+audio_return_t audio_set_volume_mute(void *audio_handle, audio_volume_info_t *info, uint32_t mute);
+
+/**
+ * @brief Updates the audio routing according to audio route information.
+ * @since_tizen 3.0
+ * @param[in] audio_handle The audio hal handle
+ * @param[in] info The audio route information including role and devices
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #AUDIO_RET_OK Success
+ * @see audio_update_route_option()
+ */
+audio_return_t audio_update_route(void *audio_handle, audio_route_info_t *info);
+
+/**
+ * @brief Updates audio routing option according to audio route option.
+ * @since_tizen 3.0
+ * @param[in] audio_handle The audio hal handle
+ * @param[in] option The option that can be used for audio routing including role, name and value
+ *
+ * @remarks This option can be used for audio routing.\n
+ * It is recommended to apply this option for routing per each role.
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #AUDIO_RET_OK Success
+ * @see audio_update_route()
+ */
+audio_return_t audio_update_route_option(void *audio_handle, audio_route_option_t *option);
+
+/**
+ * @brief Gets notified when a stream is connected and disconnected.
+ * @since_tizen 3.0
+ * @param[in] audio_handle The audio hal handle
+ * @param[in] info The stream information including role, direction, index
+ * @param[in] is_connected The connection state of this stream (@c true = connected, @c false = disconnected)
+ *
+ * @remarks This information can be used for audio routing, volume controls and so on.
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #AUDIO_RET_OK Success
+ */
+audio_return_t audio_notify_stream_connection_changed(void *audio_handle, audio_stream_info_t *info, uint32_t is_connected);
+
+/**
+ * @brief Opens a PCM device.
+ * @since_tizen 3.0
+ * @param[in] audio_handle The audio hal handle
+ * @param[out] pcm_handle The PCM handle
+ * @param[in] direction The direction of PCM
+ * @param[in] sample_spec The sample specification
+ * @param[in] period_size The period size
+ * @param[in] periods The periods
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #AUDIO_RET_OK Success
+ * @see audio_pcm_close()
+ */
+audio_return_t audio_pcm_open(void *audio_handle, void **pcm_handle, uint32_t direction, void *sample_spec, uint32_t period_size, uint32_t periods);
+
+/**
+ * @brief Starts a PCM device.
+ * @since_tizen 3.0
+ * @param[in] audio_handle The audio hal handle
+ * @param[in] pcm_handle The PCM handle to be started
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #AUDIO_RET_OK Success
+ * @see audio_pcm_avail()
+ * @see audio_pcm_write()
+ * @see audio_pcm_read()
+ * @see audio_pcm_stop()
+ * @see audio_pcm_recover()
+ */
+audio_return_t audio_pcm_start(void *audio_handle, void *pcm_handle);
+
+/**
+ * @brief Stops a PCM device.
+ * @since_tizen 3.0
+ * @param[in] audio_handle The audio hal handle
+ * @param[in] pcm_handle The PCM handle to be stopped
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #AUDIO_RET_OK Success
+ * @see audio_pcm_start()
+ */
+audio_return_t audio_pcm_stop(void *audio_handle, void *pcm_handle);
+
+/**
+ * @brief Closes a PCM device.
+ * @since_tizen 3.0
+ * @param[in] audio_handle The audio hal handle
+ * @param[in] pcm_handle The PCM handle to be closed
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #AUDIO_RET_OK Success
+ * @see audio_pcm_open()
+ */
+audio_return_t audio_pcm_close(void *audio_handle, void *pcm_handle);
+
+/**
+ * @brief Gets available number of frames.
+ * @since_tizen 3.0
+ * @param[in] audio_handle The audio hal handle
+ * @param[in] pcm_handle The PCM handle
+ * @param[out] avail The available number of frames
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #AUDIO_RET_OK Success
+ * @see audio_pcm_write()
+ * @see audio_pcm_read()
+ */
+audio_return_t audio_pcm_avail(void *audio_handle, void *pcm_handle, uint32_t *avail);
+
+/**
+ * @brief Writes frames to a PCM device.
+ * @since_tizen 3.0
+ * @param[in] audio_handle The audio hal handle
+ * @param[in] pcm_handle The PCM handle
+ * @param[in] buffer The buffer containing frames
+ * @param[in] frames The number of frames to be written
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #AUDIO_RET_OK Success
+ * @see audio_pcm_avail()
+ * @see audio_pcm_recover()
+ */
+audio_return_t audio_pcm_write(void *audio_handle, void *pcm_handle, const void *buffer, uint32_t frames);
+
+/**
+ * @brief Reads frames from a PCM device.
+ * @since_tizen 3.0
+ * @param[in] audio_handle The audio hal handle
+ * @param[in] pcm_handle The PCM handle
+ * @param[out] buffer The buffer containing frames
+ * @param[in] frames The number of frames to be read
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #AUDIO_RET_OK Success
+ * @see audio_pcm_avail()
+ * @see audio_pcm_recover()
+ */
+audio_return_t audio_pcm_read(void *audio_handle, void *pcm_handle, void *buffer, uint32_t frames);
+
+/**
+ * @brief Gets poll descriptor for a PCM handle.
+ * @since_tizen 3.0
+ * @param[in] audio_handle The audio hal handle
+ * @param[in] pcm_handle The PCM handle
+ * @param[out] fd The poll descriptor
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #AUDIO_RET_OK Success
+ * @see audio_pcm_open()
+ * @see audio_pcm_recover()
+ */
+audio_return_t audio_pcm_get_fd(void *audio_handle, void *pcm_handle, int *fd);
+
+/**
+ * @brief Recovers the PCM state.
+ * @since_tizen 3.0
+ * @param[in] audio_handle The audio hal handle
+ * @param[in] pcm_handle The PCM handle
+ * @param[in] revents The returned event from pollfd
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #AUDIO_RET_OK Success
+ * @see audio_pcm_start()
+ * @see audio_pcm_write()
+ * @see audio_pcm_read()
+ * @see audio_pcm_get_fd()
+ */
+audio_return_t audio_pcm_recover(void *audio_handle, void *pcm_handle, int revents);
+
+/**
+ * @brief Gets parameters of a PCM device.
+ * @since_tizen 3.0
+ * @param[in] audio_handle The audio hal handle
+ * @param[in] pcm_handle The PCM handle
+ * @param[in] direction The direction of PCM
+ * @param[out] sample_spec The sample specification
+ * @param[out] period_size The period size
+ * @param[out] periods The periods
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #AUDIO_RET_OK Success
+ * @see audio_pcm_set_params()
+ */
+audio_return_t audio_pcm_get_params(void *audio_handle, void *pcm_handle, uint32_t direction, void **sample_spec, uint32_t *period_size, uint32_t *periods);
+
+/**
+ * @brief Sets hardware and software parameters of a PCM device.
+ * @since_tizen 3.0
+ * @param[in] audio_handle The audio hal handle
+ * @param[in] pcm_handle The PCM handle
+ * @param[in] direction The direction of PCM
+ * @param[in] sample_spec The sample specification
+ * @param[in] period_size The period size
+ * @param[in] periods The periods
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #AUDIO_RET_OK Success
+ * @see audio_pcm_set_params()
+ */
+audio_return_t audio_pcm_set_params(void *audio_handle, void *pcm_handle, uint32_t direction, void *sample_spec, uint32_t period_size, uint32_t periods);
+
+/**
+ * @brief Adds the message callback function. (optional)
+ * @since_tizen 3.0
+ * @param[in] audio_handle The audio hal handle
+ * @param[in] message_cb The message callback function
+ * @param[in] user_data The user data passed to the callback function
+ *
+ * @remarks Some audio hal implementation may not have these functions.\n
+ * (@c message_cb, @c audio_add_message_cb and @c audio_remove_message_cb)
+ *
+ * @see message_cb()
+ * @see audio_remove_message_cb()
+ */
+audio_return_t audio_add_message_cb(void *audio_handle, message_cb callback, void *user_data);
+
+/**
+ * @brief Removes the message callback function. (optional)
+ * @since_tizen 3.0
+ * @param[in] audio_handle The audio hal handle
+ * @param[in] message_cb The message callback function to be removed
+ *
+ * @remarks Some audio hal implementation may not have these functions.\n
+ * (@c message_cb, @c audio_add_message_cb and @c audio_remove_message_cb)
+ *
+ * @see message_cb()
+ * @see audio_add_message_cb()
+ */
+audio_return_t audio_remove_message_cb(void *audio_handle, message_cb callback);
+
+/**
+* @}
+*/
+
+/**
+* @}
+*/
+
+#endif
diff --git a/include/camera/tizen-camera.h b/include/camera/tizen-camera.h
new file mode 100644 (file)
index 0000000..f44d3df
--- /dev/null
@@ -0,0 +1,988 @@
+/*
+ * tizen-camera.h
+ *
+ * Copyright (c) 2016 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_CAMERA_HAL_H__
+#define __TIZEN_CAMERA_HAL_H__
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/**
+ * @file tizen-camera.h
+ * @brief This file contains the Tizen camera HAL API, related structures and enumerations.
+ * @since_tizen 3.0
+ */
+
+#define BUFFER_PLANE_MAX                    4
+#define DEVICE_COUNT_MAX                    16
+#define DEVICE_NAME_LENGTH_MAX              32
+#define RESOLUTION_COUNT_MAX                10
+
+/**
+ * @addtogroup TIZEN_CAMERA_HAL_MODULE
+ * @{
+ */
+
+/**
+ * @brief Enumeration for the camera error.
+ * @since_tizen 3.0
+ */
+typedef enum camera_error {
+       CAMERA_ERROR_NONE                   = 0x00000000,
+       CAMERA_ERROR_INVALID_PARAMETER      = 0x80002001,
+       CAMERA_ERROR_INVALID_STATE          = 0x80002002,
+       CAMERA_ERROR_PERMISSION_DENIED      = 0x80002003,
+       CAMERA_ERROR_OUT_OF_MEMORY          = 0x80002004,
+       CAMERA_ERROR_DEVICE_OPEN            = 0x80002005,
+       CAMERA_ERROR_DEVICE_NOT_FOUND       = 0x80002006,
+       CAMERA_ERROR_DEVICE_UNAVAILABLE     = 0x80002007,
+       CAMERA_ERROR_DEVICE_NOT_SUPPORTED   = 0x80002008,
+       CAMERA_ERROR_DEVICE_READ            = 0x80002009,
+       CAMERA_ERROR_DEVICE_WRITE           = 0x8000200a,
+       CAMERA_ERROR_DEVICE_BUSY            = 0x8000200b,
+       CAMERA_ERROR_DEVICE_TIME_OUT        = 0x8000200c,
+       CAMERA_ERROR_DEVICE_ESD             = 0x8000200d,
+       CAMERA_ERROR_INTERNAL               = 0x8000200e,
+
+       CAMERA_ERROR_NOT_IMPLEMENTED        = 0x80002ffe,
+       CAMERA_ERROR_UNKNOWN                = 0x80002fff
+} camera_error_t;
+
+/**
+ * @brief Enumeration for the camera state.
+ * @since_tizen 3.0
+ */
+typedef enum camera_state {
+       CAMERA_STATE_INITIALIZED,
+       CAMERA_STATE_OPENED,
+       CAMERA_STATE_PREVIEWING,
+       CAMERA_STATE_CAPTURING,
+       CAMERA_STATE_RECORDING,
+       CAMERA_STATE_RECORDING_SNAPSHOT
+} camera_state_t;
+
+/**
+ * @brief The structure type of the resolution.
+ * @since_tizen 3.0
+ */
+typedef struct camera_resolution {
+       uint32_t width;
+       uint32_t height;
+} camera_resolution_t;
+
+/**
+ * @brief The structure type of the fraction.
+ * @since_tizen 3.0
+ */
+typedef struct camera_fraction {
+       int numerator;
+       int denominator;
+} camera_fraction_t;
+
+/**
+ * @brief The structure type of the rectangle.
+ * @since_tizen 3.0
+ */
+typedef struct camera_rectangle {
+       int x;
+       int y;
+       uint32_t width;
+       uint32_t height;
+} camera_rectangle_t;
+
+/**
+ * @brief Enumeration for the camera pixel format.
+ * @since_tizen 3.0
+ */
+typedef enum camera_pixel_format {
+       /* YUV */
+       CAMERA_PIXEL_FORMAT_NV12 = 0x0000,
+       CAMERA_PIXEL_FORMAT_NV21,
+       CAMERA_PIXEL_FORMAT_I420,
+       CAMERA_PIXEL_FORMAT_YV12,
+       CAMERA_PIXEL_FORMAT_YUYV,
+       CAMERA_PIXEL_FORMAT_UYVY,
+
+       /* RGB */
+       CAMERA_PIXEL_FORMAT_BGRA8888,
+       CAMERA_PIXEL_FORMAT_ARGB8888,
+
+       /* ENCODED */
+       CAMERA_PIXEL_FORMAT_ENCODED_JPEG,
+       CAMERA_PIXEL_FORMAT_ENCODED_H264,
+
+       /* MAX */
+       CAMERA_PIXEL_FORMAT_MAX
+} camera_pixel_format_t;
+
+/**
+ * @brief The structure type of the camera plane.
+ * @since_tizen 3.0
+ */
+typedef struct camera_plane {
+       unsigned char *data;
+       uint32_t align_width;
+       uint32_t align_height;
+       uint32_t size;
+} camera_plane_t;
+
+/**
+ * @brief The structure type of the camera buffer.
+ * @since_tizen 3.0
+ */
+typedef struct camera_buffer {
+       int index;
+       camera_pixel_format_t format;
+       camera_resolution_t resolution;
+       uint32_t total_size;
+       uint32_t num_planes;
+       camera_plane_t planes[BUFFER_PLANE_MAX];
+       uint32_t num_bos;
+       void *bos[BUFFER_PLANE_MAX];
+} camera_buffer_t;
+
+/**
+ * @brief The structure type of the camera metadata.
+ * @since_tizen 3.0
+ */
+typedef struct camera_metadata {
+       int is_flashed;
+       camera_fraction_t focal_length;
+       camera_fraction_t aperture_f_number;
+       camera_fraction_t shutter_speed;
+       camera_fraction_t exposure_time;
+       camera_fraction_t brightness;
+       camera_resolution_t exif_image;
+       int iso;
+       int metering_mode;
+       int color_space;
+       int component_configuration;
+       int aperture_in_apex;
+} camera_metadata_t;
+
+/**
+ * @brief Enumeration for the focus state.
+ * @since_tizen 3.0
+ */
+typedef enum camera_focus_state {
+       CAMERA_FOCUS_STATE_RELEASED,
+       CAMERA_FOCUS_STATE_ONGOING,
+       CAMERA_FOCUS_STATE_FOCUSED,
+       CAMERA_FOCUS_STATE_FAILED
+} camera_focus_state_t;
+
+/**
+ * @brief Enumeration for the facing direction of camera device.
+ * @since_tizen 3.0
+ */
+typedef enum camera_facing_direction {
+       CAMERA_FACING_DIRECTION_REAR,
+       CAMERA_FACING_DIRECTION_FRONT,
+       CAMERA_FACING_DIRECTION_EXTERNAL
+} camera_facing_direction_t;
+
+/**
+ * @brief Enumeration for the camera rotation.
+ * @since_tizen 3.0
+ */
+typedef enum camera_rotation {
+       CAMERA_ROTATION_0,
+       CAMERA_ROTATION_90,
+       CAMERA_ROTATION_180,
+       CAMERA_ROTATION_270
+} camera_rotation_t;
+
+/**
+ * @brief Enumeration for the camera flip.
+ * @since_tizen 3.0
+ */
+typedef enum camera_flip {
+       CAMERA_FLIP_NONE,
+       CAMERA_FLIP_HORIZONTAL,
+       CAMERA_FLIP_VERTICAL,
+       CAMERA_FLIP_BOTH
+} camera_flip_t;
+
+/**
+ * @brief The structure type of the camera format.
+ * @since_tizen 3.0
+ */
+typedef struct camera_format {
+       camera_pixel_format_t stream_format;
+       camera_resolution_t stream_resolution;
+       uint32_t stream_fps;
+       camera_rotation_t stream_rotation;
+       camera_pixel_format_t capture_format;
+       camera_resolution_t capture_resolution;
+       uint32_t capture_quality;
+} camera_format_t;
+
+/**
+ * @brief Enumeration for the focus mode.
+ * @since_tizen 3.0
+ */
+typedef enum camera_focus_mode {
+       CAMERA_FOCUS_MODE_NONE,
+       CAMERA_FOCUS_MODE_PAN,
+       CAMERA_FOCUS_MODE_AUTO,
+       CAMERA_FOCUS_MODE_CONTINUOUS_AUTO
+} camera_focus_mode_t;
+
+/**
+ * @brief Enumeration for the focus range.
+ * @since_tizen 3.0
+ */
+typedef enum camera_focus_range {
+       CAMERA_FOCUS_RANGE_NONE,
+       CAMERA_FOCUS_RANGE_NORMAL,
+       CAMERA_FOCUS_RANGE_MACRO,
+       CAMERA_FOCUS_RANGE_FULL
+} camera_focus_range_t;
+
+/**
+ * @brief Enumeration for the white balance.
+ * @since_tizen 3.0
+ */
+typedef enum camera_white_balance {
+       CAMERA_WHITE_BALANCE_AUTO,          /**< Automatic */
+       CAMERA_WHITE_BALANCE_DAYLIGHT,      /**< Daylight */
+       CAMERA_WHITE_BALANCE_CLOUDY,        /**< Cloudy */
+       CAMERA_WHITE_BALANCE_FLUORESCENT,   /**< Fluorescent */
+       CAMERA_WHITE_BALANCE_INCANDESCENT,  /**< Incandescent */
+       CAMERA_WHITE_BALANCE_SHADE,         /**< Shade */
+       CAMERA_WHITE_BALANCE_HORIZON,       /**< Horizon */
+       CAMERA_WHITE_BALANCE_FLASH          /**< Flash */
+} camera_white_balance_t;
+
+/**
+ * @brief Enumeration for the effect.
+ * @since_tizen 3.0
+ */
+typedef enum camera_effect {
+       CAMERA_EFFECT_NONE,                 /**< None */
+       CAMERA_EFFECT_MONO,                 /**< Mono */
+       CAMERA_EFFECT_SEPIA,                /**< Sepia */
+       CAMERA_EFFECT_NEGATIVE,             /**< Negative */
+       CAMERA_EFFECT_RED,                  /**< Red */
+       CAMERA_EFFECT_GREEN,                /**< Green */
+       CAMERA_EFFECT_BLUE,                 /**< Blue */
+       CAMERA_EFFECT_AQUA,                 /**< Aqua */
+       CAMERA_EFFECT_ANTIQUE,              /**< Antique */
+       CAMERA_EFFECT_WARM,                 /**< Warm */
+       CAMERA_EFFECT_EMBOSS,               /**< Emboss */
+       CAMERA_EFFECT_SKETCH,               /**< Sketch */
+       CAMERA_EFFECT_SOLARIZATION,         /**< Solarization */
+       CAMERA_EFFECT_POSTERIZATION,        /**< Posterization */
+       CAMERA_EFFECT_CARTOON               /**< Cartoon */
+} camera_effect_t;
+
+/**
+ * @brief Enumeration for the scene mode.
+ * @since_tizen 3.0
+ */
+typedef enum camera_scene_mode {
+       CAMERA_SCENE_MODE_NORMAL,           /**< Normal */
+       CAMERA_SCENE_MODE_PORTRAIT,         /**< Portrait */
+       CAMERA_SCENE_MODE_LANDSCAPE,        /**< Landscape */
+       CAMERA_SCENE_MODE_SPORTS,           /**< Sports */
+       CAMERA_SCENE_MODE_PARTY_N_INDOOR,   /**< Party & indoor */
+       CAMERA_SCENE_MODE_BEACH_N_INDOOR,   /**< Beach & indoor */
+       CAMERA_SCENE_MODE_SUNSET,           /**< Sunset */
+       CAMERA_SCENE_MODE_DUSK_N_DAWN,      /**< Dusk & dawn */
+       CAMERA_SCENE_MODE_FALL_COLOR,       /**< Fall */
+       CAMERA_SCENE_MODE_NIGHT_SCENE,      /**< Night scene */
+       CAMERA_SCENE_MODE_FIREWORK,         /**< Firework */
+       CAMERA_SCENE_MODE_TEXT,             /**< Text */
+       CAMERA_SCENE_MODE_SHOW_WINDOW,      /**< Show window */
+       CAMERA_SCENE_MODE_CANDLE_LIGHT,     /**< Candle light */
+       CAMERA_SCENE_MODE_BACKLIGHT,        /**< Backlight */
+       CAMERA_SCENE_MODE_AQUA              /**< Aqua */
+} camera_scene_mode_t;
+
+/**
+ * @brief Enumeration for the exposure mode.
+ * @since_tizen 3.0
+ */
+typedef enum camera_exposure_mode {
+       CAMERA_EXPOSURE_MODE_OFF = 0,       /**< Off */
+       CAMERA_EXPOSURE_MODE_ALL,           /**< All mode */
+       CAMERA_EXPOSURE_MODE_CENTER,        /**< Center mode */
+       CAMERA_EXPOSURE_MODE_SPOT,          /**< Spot mode */
+       CAMERA_EXPOSURE_MODE_CUSTOM         /**< Custom mode */
+} camera_exposure_mode_t;
+
+/**
+ * @brief Enumeration for the shot mode.
+ * @since_tizen 3.0
+ */
+typedef enum camera_shot_mode {
+       CAMERA_SHOT_MODE_NORMAL = 0,        /**< Normal */
+       CAMERA_SHOT_MODE_CONTINUOUS,        /**< Continuous */
+       CAMERA_SHOT_MODE_HDR,               /**< HDR */
+       CAMERA_SHOT_MODE_NIGHT              /**< Night */
+} camera_shot_mode_t;
+
+/**
+ * @brief Enumeration for the flash mode.
+ * @since_tizen 3.0
+ */
+typedef enum camera_flash_mode {
+       CAMERA_FLASH_MODE_OFF = 0,          /**< Always off */
+       CAMERA_FLASH_MODE_ON,               /**< Always splashes */
+       CAMERA_FLASH_MODE_AUTO,             /**< Depending on intensity of light, strobe starts to flash */
+       CAMERA_FLASH_MODE_REDEYE_REDUCTION, /**< Red eye reduction. Multiple flash before capturing */
+       CAMERA_FLASH_MODE_SLOW_SYNC,        /**< Slow sync curtain synchronization */
+       CAMERA_FLASH_MODE_FRONT_CURTAIN,    /**< Front curtain synchronization */
+       CAMERA_FLASH_MODE_REAR_CURTAIN,     /**< Rear curtain synchronization */
+       CAMERA_FLASH_MODE_PERMANENT,        /**< Keep turned on until turning off */
+} camera_flash_mode_t;
+
+/**
+ * @brief Enumeration for the face detection.
+ * @since_tizen 3.0
+ */
+typedef enum camera_face_detection {
+       CAMERA_FACE_DETECTION_OFF = 0,      /**< Face detection off */
+       CAMERA_FACE_DETECTION_ON            /**< Face detection on */
+} camera_face_detection_t;
+
+/**
+ * @brief Definitions for the camera command.
+ * @since_tizen 3.0
+ */
+#define CAMERA_COMMAND_BASE                     ((int64_t)1)
+#define CAMERA_COMMAND_WHITE_BALANCE            ((int64_t)(CAMERA_COMMAND_BASE << 1))
+#define CAMERA_COMMAND_ISO                      ((int64_t)(CAMERA_COMMAND_BASE << 2))
+#define CAMERA_COMMAND_CONTRAST                 ((int64_t)(CAMERA_COMMAND_BASE << 3))
+#define CAMERA_COMMAND_SATURATION               ((int64_t)(CAMERA_COMMAND_BASE << 4))
+#define CAMERA_COMMAND_HUE                      ((int64_t)(CAMERA_COMMAND_BASE << 5))
+#define CAMERA_COMMAND_SHARPNESS                ((int64_t)(CAMERA_COMMAND_BASE << 6))
+#define CAMERA_COMMAND_EFFECT                   ((int64_t)(CAMERA_COMMAND_BASE << 7))
+#define CAMERA_COMMAND_SCENE_MODE               ((int64_t)(CAMERA_COMMAND_BASE << 8))
+#define CAMERA_COMMAND_EXPOSURE_MODE            ((int64_t)(CAMERA_COMMAND_BASE << 9))
+#define CAMERA_COMMAND_EXPOSURE                 ((int64_t)(CAMERA_COMMAND_BASE << 10))
+#define CAMERA_COMMAND_ROTATION                 ((int64_t)(CAMERA_COMMAND_BASE << 11))
+#define CAMERA_COMMAND_FLIP                     ((int64_t)(CAMERA_COMMAND_BASE << 12))
+#define CAMERA_COMMAND_FOCUS_MODE               ((int64_t)(CAMERA_COMMAND_BASE << 13))
+#define CAMERA_COMMAND_FOCUS_RANGE              ((int64_t)(CAMERA_COMMAND_BASE << 14))
+#define CAMERA_COMMAND_SHOT_MODE                ((int64_t)(CAMERA_COMMAND_BASE << 15))
+#define CAMERA_COMMAND_ANTI_SHAKE               ((int64_t)(CAMERA_COMMAND_BASE << 16))
+#define CAMERA_COMMAND_FOCUS_AREA               ((int64_t)(CAMERA_COMMAND_BASE << 17))
+#define CAMERA_COMMAND_DIGITAL_ZOOM             ((int64_t)(CAMERA_COMMAND_BASE << 18))
+#define CAMERA_COMMAND_OPTICAL_ZOOM             ((int64_t)(CAMERA_COMMAND_BASE << 19))
+#define CAMERA_COMMAND_RECORDING_HINT           ((int64_t)(CAMERA_COMMAND_BASE << 20))
+#define CAMERA_COMMAND_WDR                      ((int64_t)(CAMERA_COMMAND_BASE << 21))
+#define CAMERA_COMMAND_SHUTTER_SPEED            ((int64_t)(CAMERA_COMMAND_BASE << 22))
+#define CAMERA_COMMAND_FLASH_MODE               ((int64_t)(CAMERA_COMMAND_BASE << 23))
+#define CAMERA_COMMAND_FACE_DETECTION           ((int64_t)(CAMERA_COMMAND_BASE << 24))
+
+
+typedef struct camera_batch_command_control {
+       /* flag for modified command */
+       int64_t command_set_flag;
+
+       /* value list */
+       camera_white_balance_t white_balance;
+       int iso;
+       int contrast;
+       int saturation;
+       int hue;
+       int sharpness;
+       camera_effect_t effect;
+       camera_scene_mode_t scene_mode;
+       camera_exposure_mode_t exposure_mode;
+       int exposure;
+       camera_rotation_t rotation;
+       camera_flip_t flip;
+       camera_focus_mode_t focus_mode;
+       camera_focus_range_t focus_range;
+       camera_exposure_mode_t shot_mode;
+       int anti_shake;
+       camera_rectangle_t focus_area;
+       int digital_zoom;
+       int optical_zoom;
+       int recording_hint;
+       int wdr;
+       camera_flash_mode_t flash_mode;
+       camera_face_detection_t face_detection;
+} camera_batch_command_control_t;
+
+/**
+ * @brief The structure type of the format list.
+ * @since_tizen 3.0
+ */
+typedef struct camera_pixel_format_list {
+       uint32_t count;
+       camera_pixel_format_t formats[CAMERA_PIXEL_FORMAT_MAX];
+} camera_format_list_t;
+
+/**
+ * @brief The structure type of the resolution list.
+ * @since_tizen 3.0
+ */
+typedef struct camera_resolution_list {
+       uint32_t count;
+       camera_resolution_t resolutions[RESOLUTION_COUNT_MAX];
+} camera_resolution_list_t;
+
+/**
+ * @brief The structure type of the camera device information.
+ * @since_tizen 3.0
+ */
+typedef struct camera_device_info {
+       uint32_t index;
+       const char *name;
+       camera_facing_direction_t facing_direction;
+       camera_format_list_t format_list;
+       camera_resolution_list_t preview_list;
+       camera_resolution_list_t capture_list;
+       camera_resolution_list_t video_list;
+} camera_device_info_t;
+
+/**
+ * @brief The structure type of the camera device list.
+ * @since_tizen 3.0
+ */
+typedef struct camera_device_list {
+       uint32_t count;
+       camera_device_info_t device_info[DEVICE_COUNT_MAX];
+} camera_device_list_t;
+
+/**
+ * @brief Enumeration for the camera message type.
+ * @since_tizen 3.0
+ */
+typedef enum camera_message_type {
+       CAMERA_MESSAGE_TYPE_FOCUS_CHANGED,
+       CAMERA_MESSAGE_TYPE_CAPTURED,
+       CAMERA_MESSAGE_TYPE_HDR_PROGRESS,
+       CAMERA_MESSAGE_TYPE_ERROR
+} camera_message_type_t;
+
+/**
+ * @brief The structure type of the camera message.
+ * @since_tizen 3.0
+ */
+typedef struct camera_message {
+       camera_message_type_t type;
+       union {
+               camera_focus_state_t focus_state;
+               uint32_t hdr_progress;
+               camera_error_t error_code;
+       };
+} camera_message_t;
+
+/**
+ * @brief Callback function for notification from camera HAL.
+ * @since_tizen 3.0
+ * @param[in] message The message from camera HAL
+ * @param[in] user_data The user data for callback
+ * @see camera_add_message_callback()
+ * @see camera_remove_message_callback()
+ */
+typedef int (*camera_message_cb)(camera_message_t *message, void *user_data);
+
+/**
+ * @brief Callback function for captured preview frame from camera device.
+ * @since_tizen 3.0
+ * @param[in] buffer The preview buffer
+ * @param[in] meta The meta data for the preview frame
+ * @param[in] user_data The user data for callback
+ * @pre       camera_start_preview() will invoke this callback.
+ * @see camera_start_preview()
+ * @see camera_stop_preview()
+ */
+typedef int (*camera_preview_frame_cb)(camera_buffer_t *buffer, camera_metadata_t *meta, void *user_data);
+
+/**
+ * @brief Callback function for captured video frame from camera device.
+ * @since_tizen 3.0
+ * @param[in] buffer The video buffer
+ * @param[in] meta The meta data for the video frame
+ * @param[in] user_data The user data for callback
+ * @pre       camera_start_record() will invoke this callback.
+ * @see camera_start_record()
+ * @see camera_stop_record()
+ */
+typedef int (*camera_video_frame_cb)(camera_buffer_t *buffer, camera_metadata_t *meta, void *user_data);
+
+/**
+ * @brief Callback function for captured still image from camera device.
+ * @since_tizen 3.0
+ * @param[in] main The main image data
+ * @param[in] postview The image data of the postview (it could be @c NULL if the available data does not exist)
+ * @param[in] thumbnail The image data of the thumbnail (it could be @c NULL if the available data does not exist)
+ * @param[in] user_data The user data passed from the callback registration function
+ * @pre       camera_start_capture() will invoke this callback function.
+ * @see camera_start_capture()
+ * @see camera_stop_capture()
+ */
+typedef int (*camera_capture_cb)(camera_buffer_t *main, camera_buffer_t *postview, camera_buffer_t *thumbnail, void *user_data);
+
+/**
+ * @brief The structure type of the camera interface.
+ * @since_tizen 3.0
+ */
+typedef struct camera_interface {
+       int (*init)(void **camera_handle);
+       int (*deinit)(void *camera_handle);
+       int (*get_device_list)(void *camera_handle, camera_device_list_t *device_list);
+       int (*open_device)(void *camera_handle, int device_index);
+       int (*close_device)(void *camera_handle);
+       int (*add_message_callback)(void *camera_handle, camera_message_cb callback, void *user_data, uint32_t *cb_id);
+       int (*remove_message_callback)(void *camera_handle, uint32_t cb_id);
+       int (*set_preview_stream_format)(void *camera_handle, camera_format_t *format);
+       int (*get_preview_stream_format)(void *camera_handle, camera_format_t *format);
+       int (*start_preview)(void *camera_handle, camera_preview_frame_cb callback, void *user_data);
+       int (*release_preview_buffer)(void *camera_handle, int buffer_index);
+       int (*stop_preview)(void *camera_handle);
+       int (*start_auto_focus)(void *camera_handle);
+       int (*stop_auto_focus)(void *camera_handle);
+       int (*start_capture)(void *camera_handle, camera_capture_cb callback, void *user_data);
+       int (*stop_capture)(void *camera_handle);
+       int (*set_video_stream_format)(void *camera_handle, camera_format_t *format);
+       int (*get_video_stream_format)(void *camera_handle, camera_format_t *format);
+       int (*start_record)(void *camera_handle, camera_video_frame_cb callback, void *user_data);
+       int (*release_video_buffer)(void *camera_handle, int buffer_index);
+       int (*stop_record)(void *camera_handle);
+       int (*set_command)(void *camera_handle, int command, void *value);
+       int (*get_command)(void *camera_handle, int command, void *value);
+       int (*set_batch_command)(void *camera_handle, camera_batch_command_control_t *batch_command, int64_t *error_command);
+} camera_interface_t;
+
+
+/**
+ * @brief Initializes new handle of camera HAL.
+ * @since_tizen 3.0
+ * @param[out] camera_handle A newly returned handle to the camera HAL
+ * @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_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_INITIALIZED.
+ *
+ * @see camera_deinit()
+ */
+int camera_init(void **camera_handle);
+
+/**
+ * @brief Deinitializes handle of camera HAL.
+ * @since_tizen 3.0
+ * @param[in] camera_handle The handle to the camera HAL
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @see camera_init()
+ */
+int camera_deinit(void *camera_handle);
+
+/**
+ * @brief Gets the device list of camera.
+ * @since_tizen 3.0
+ * @param[in] camera_handle The handle to the camera HAL
+ * @param[out] device_list The device list 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_NOT_SUPPORTED The feature is not supported
+ */
+int camera_get_device_list(void *camera_handle, camera_device_list_t *device_list);
+
+/**
+ * @brief Opens camera device.
+ * @since_tizen 3.0
+ * @param[in] camera_handle The handle to the camera HAL
+ * @param[in] device_index The device index 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_INVALID_STATE Invalid state
+ * @retval #CAMERA_ERROR_OUT_OF_MEMORY Out of memory
+ * @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_NOT_FOUND Failed to find camera device
+ * @retval #CAMERA_ERROR_DEVICE_UNAVAILABLE The camera device is unavailable
+ * @pre    The camera state must be set to #CAMERA_STATE_INITIALIZED.
+ * @post   If it succeeds, the camera state will be #CAMERA_STATE_OPENED.
+ * @see camera_close_device()
+ */
+int camera_open_device(void *camera_handle, int device_index);
+
+/**
+ * @brief Closes camera device.
+ * @since_tizen 3.0
+ * @param[in] camera_handle The handle to the camera HAL
+ * @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
+ * @pre    The camera state must be set to #CAMERA_STATE_OPENED.
+ * @post   If it succeeds, the camera state will be #CAMERA_STATE_INITIALIZED.
+ * @see camera_open_device()
+ */
+int camera_close_device(void *camera_handle);
+
+/**
+ * @brief Registers a callback function to be called to send a message by camera HAL.
+ * @since_tizen 3.0
+ * @param[in] camera_handle The handle to the camera HAL
+ * @param[in] callback The callback function to be registered
+ * @param[in] user_data The user data to be passed to the callback function
+ * @param[out] cb_id The callback id
+ * @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
+ * @see camera_remove_message_callback()
+ */
+int camera_add_message_callback(void *camera_handle, camera_message_cb callback, void *user_data, uint32_t *cb_id);
+
+/**
+ * @brief Unregisters a callback function.
+ * @since_tizen 3.0
+ * @param[in] camera_handle The handle to the camera HAL
+ * @param[in] cb_id The callback id
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #CAMERA_ERROR_NONE Successful
+ * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
+ * @see camera_remove_message_callback()
+ */
+int camera_remove_message_callback(void *camera_handle, uint32_t cb_id);
+
+/**
+ * @brief Sets the format of the preview stream.
+ * @since_tizen 3.0
+ * @remarks This function should be called before previewing (see camera_start_preview()).
+ * @param[in] camera_handle The handle to the camera HAL
+ * @param[in] format The format of the preview 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_INVALID_STATE Invalid state
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @pre    The camera state must be set to #CAMERA_STATE_OPENED.
+ * @see camera_start_preview()
+ * @see camera_start_capture()
+ * @see camera_get_preview_stream_format()
+ */
+int camera_set_preview_stream_format(void *camera_handle, camera_format_t *format);
+
+/**
+ * @brief Gets the format of the preview stream.
+ * @since_tizen 3.0
+ * @param[in] camera_handle The handle to the camera HAL
+ * @param[out] format The format of the preview 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_INVALID_STATE Invalid state
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see camera_start_preview()
+ * @see camera_start_capture()
+ * @see camera_set_preview_stream_format()
+ * @see camera_foreach_supported_preview_format()
+ */
+int camera_get_preview_stream_format(void *camera_handle, camera_format_t *format);
+
+/**
+ * @brief Starts preview frames on the screen.
+ * @since_tizen 3.0
+ * @param[in] camera_handle The handle to the camera HAL
+ * @param[in] callback The callback for preview frame
+ * @param[in] user_data The user data for callback
+ * @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_DEVICE_BUSY The device is being used in another application or is performing other operations
+ * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @pre    The camera state must be set to #CAMERA_STATE_OPENED.
+ * @post   If it succeeds, the camera state will be #CAMERA_STATE_PREVIEWING.
+ * @see camera_stop_preview()
+ */
+int camera_start_preview(void *camera_handle, camera_preview_frame_cb callback, void *user_data);
+
+/**
+ * @brief Release the preview buffer.
+ * @since_tizen 3.0
+ * @remarks The preview buffer should be released with this function after use it.
+ * @param[in] camera_handle The handle to the camera HAL
+ * @param[in] buffer_index The index of preview buffer
+ * @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
+ * @see camera_start_preview()
+ */
+int camera_release_preview_buffer(void *camera_handle, int buffer_index);
+
+/**
+ * @brief Stops preview frames.
+ * @since_tizen 3.0
+ * @param[in] camera_handle The handle to the camera HAL
+ * @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
+ * @pre    The camera state must be set to #CAMERA_STATE_PREVIEWING.
+ * @post   The camera state will be #CAMERA_STATE_OPENED.
+ * @see camera_start_preview()
+ */
+int camera_stop_preview(void *camera_handle);
+
+/**
+ * @brief Starts camera auto focusing operation.
+ * @since_tizen 3.0
+ * @param[in] camera_handle The handle to the camera HAL
+ * @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_NOT_SUPPORTED The feature is not supported
+ * @pre    The camera state must be set to #CAMERA_STATE_PREVIEWING or #CAMERA_STATE_RECORDING.
+ * @post   The camera focus state will be #CAMERA_FOCUS_STATE_ONGOING.
+ * @see camera_stop_auto_focus()
+ * @see camera_add_message_callback()
+ * @see camera_message_cb()
+ * @see camera_set_command()
+ */
+int camera_start_auto_focus(void *camera_handle);
+
+/**
+ * @brief Stops camera auto focusing operation.
+ * @since_tizen 3.0
+ * @param[in] camera_handle The handle to the camera HAL
+ * @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_NOT_SUPPORTED The feature is not supported
+ * @pre    The camera state must be set to #CAMERA_STATE_PREVIEWING or #CAMERA_STATE_RECORDING.
+ * @post   The camera focus state will be #CAMERA_FOCUS_STATE_ONGOING.
+ * @see camera_start_auto_focus()
+ * @see camera_add_message_callback()
+ * @see camera_message_cb()
+ */
+int camera_stop_auto_focus(void *camera_handle);
+
+/**
+ * @brief Starts capturing of still images.
+ * @since_tizen 3.0
+ * @remarks In case of zero shutter lag capture, preview frame won't be stopped while capturing.
+ * @param[in] camera_handle The handle to the camera HAL
+ * @param[in] callback The callback for captured data
+ * @param[in] user_data The user data for callback
+ * @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
+ * @pre    The camera state must be set to #CAMERA_STATE_PREVIEWING or #CAMERA_STATE_RECORDING.
+ * @post   If it succeeds the camera state will be #CAMERA_STATE_CAPTURING or #CAMERA_STATE_RECORDING_SNAPSHOT.
+ * @see camera_start_preview()
+ * @see camera_start_record()
+ * @see camera_set_preview_stream_format()
+ * @see camera_get_preview_stream_format()
+ */
+int camera_start_capture(void *camera_handle, camera_capture_cb callback, void *user_data);
+
+/**
+ * @brief Stops capturing of still images.
+ * @since_tizen 3.0
+ * @remarks In case of zero shutter lag, this function will changes only the state of camera HAL \n
+ *          from #CAMERA_STATE_PREVIEWING or #CAMERA_STATE_RECORDING to #CAMERA_STATE_PREVIEWING or #CAMERA_STATE_RECORDING.\n
+ *          Otherwise, preview frame will be restarted.
+ * @param[in] camera_handle The handle to the camera HAL
+ * @param[in] callback The callback for captured data
+ * @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
+ * @pre    The camera state must be set to #CAMERA_STATE_CAPTURING or #CAMERA_STATE_RECORDING_SNAPSHOT.
+ * @post   If it succeeds the camera state will be #CAMERA_STATE_PREVIEWING or #CAMERA_STATE_RECORDING.
+ * @see camera_start_capture()
+ * @see camera_start_record()
+ * @see camera_set_preview_stream_format()
+ * @see camera_get_preview_stream_format()
+ * @see camera_set_video_stream_format()
+ * @see camera_get_video_stream_format()
+ */
+int camera_stop_capture(void *camera_handle);
+
+/**
+ * @brief Sets the format of the video stream for recording.
+ * @since_tizen 3.0
+ * @remarks This function should be called before recording (see camera_start_record()).
+ * @param[in] camera_handle The handle to the camera HAL
+ * @param[in] format The format of the 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_INVALID_STATE Invalid state
+ * @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @pre    The camera state must be set to #CAMERA_STATE_OPENED.
+ * @see camera_start_record()
+ * @see camera_start_capture()
+ * @see camera_get_video_stream_format()
+ */
+int camera_set_video_stream_format(void *camera_handle, camera_format_t *format);
+
+/**
+ * @brief Gets the format of the video stream for recording.
+ * @since_tizen 3.0
+ * @param[in] camera_handle The handle to the camera HAL
+ * @param[out] format The format of the 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_INVALID_STATE Invalid state
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see camera_start_preview()
+ * @see camera_start_capture()
+ * @see camera_set_preview_stream_format()
+ * @see camera_foreach_supported_preview_format()
+ */
+int camera_get_video_stream_format(void *camera_handle, camera_format_t *format);
+
+/**
+ * @brief Starts the video frame for recording.
+ * @since_tizen 3.0
+ * @param[in] camera_handle The handle to the camera HAL
+ * @param[in] callback The callback for video frame
+ * @param[in] user_data The user data for callback
+ * @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
+ * @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_PREVIEWING.
+ * @post The camera state will be #CAMERA_STATE_RECORDING.
+ * @see camera_set_video_stream_format()
+ * @see camera_get_video_stream_format()
+ * @see camera_stop_record()
+ */
+int camera_start_record(void *camera_handle, camera_video_frame_cb callback, void *user_data);
+
+/**
+ * @brief Release the video buffer.
+ * @remarks The video buffer should be released with this function after use it.
+ * @since_tizen 3.0
+ * @param[in] camera_handle The handle to the camera HAL
+ * @param[in] buffer_index The index of video buffer
+ * @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
+ * @pre    The camera state must be set to #CAMERA_STATE_PREVIEWING.
+ * @see camera_start_record()
+ */
+int camera_release_video_buffer(void *camera_handle, int buffer_index);
+
+/**
+ * @brief Stops the video frame.
+ * @since_tizen 3.0
+ * @param[in] camera_handle The handle to the camera HAL
+ * @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_RECORDING.
+ * @post The camera state will be #CAMERA_STATE_PREVIEWING.
+ * @see camera_set_video_stream_format()
+ * @see camera_get_video_stream_format()
+ * @see camera_start_record()
+ */
+int camera_stop_record(void *camera_handle);
+
+/**
+ * @brief Sets the various command and value to control camera device.
+ * @since_tizen 3.0
+ * @param[in] camera_handle The handle to the camera HAL
+ * @param[in] command The command to control the camera device
+ * @param[in] value The value to set
+ * @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
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see camera_get_command()
+ */
+int camera_set_command(void *camera_handle, int64_t command, void *value);
+
+/**
+ * @brief Gets the current value of command.
+ * @since_tizen 3.0
+ * @param[in] camera_handle The handle to the camera HAL
+ * @param[in] command The command to control the camera device
+ * @param[out] value The value to get
+ * @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
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see camera_get_command()
+ */
+int camera_get_command(void *camera_handle, int64_t command, void *value);
+
+/**
+ * @brief Sets a set of commands.
+ * @since_tizen 3.0
+ * @remarks error_command will be set if error is returned from the function.
+ * @param[in] camera_handle The handle to the camera HAL
+ * @param[in] batch_command The batch command to set
+ * @param[out] error_command The error command
+ * @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
+ * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see camera_set_command()
+ * @see camera_get_command()
+ */
+int camera_set_batch_command(void *camera_handle, camera_batch_command_control_t *batch_command, int64_t *error_command);
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __TIZEN_CAMERA_HAL_H__ */
diff --git a/include/radio/tizen-radio.h b/include/radio/tizen-radio.h
new file mode 100644 (file)
index 0000000..8f6ce17
--- /dev/null
@@ -0,0 +1,264 @@
+/*
+ * tizen-radio.h
+ *
+ * Copyright (c) 2016 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_RADIO_HAL_H__
+#define __TIZEN_RADIO_HAL_H__
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/**
+ * @file tizen-radio.h
+ * @brief This file contains the Tizen radio HAL API, related structures and enumerations.
+ * @since_tizen 3.0
+ */
+
+/**
+ * @addtogroup TIZEN_RADIO_HAL_MODULE
+ * @{
+ */
+
+/**
+ * @brief Enumeration for the radio error.
+ * @since_tizen 3.0
+ */
+typedef enum radio_error {
+       RADIO_ERROR_NONE,
+       RADIO_ERROR_INVALID_PARAMETER,
+       RADIO_ERROR_INVALID_STATE,
+       RADIO_ERROR_INVALID_OPERATION,
+       RADIO_ERROR_PERMISSION_DENIED,
+       RADIO_ERROR_NOT_SUPPORTED,
+       RADIO_ERROR_OUT_OF_MEMORY,
+       RADIO_ERROR_DEVICE_NOT_PREPARED,
+       RADIO_ERROR_DEVICE_NOT_OPENED,
+       RADIO_ERROR_DEVICE_NOT_FOUND,
+       RADIO_ERROR_DEVICE_NOT_SUPPORTED,
+       RADIO_ERROR_NO_ANTENNA,
+       RADIO_ERROR_INTERNAL,
+       RADIO_ERROR_UNKNOWN
+} radio_error_t;
+
+/**
+ * @brief Enumeration for the radio seek direction.
+ * @since_tizen 3.0
+ */
+typedef enum radio_seek_direction_type {
+       RADIO_SEEK_DIRECTION_UP,        /**< Seek upward */
+       RADIO_SEEK_DIRECTION_DOWN       /**< Seek downward */
+} radio_seek_direction_type_t;
+
+typedef struct radio_interface {
+       /* create & destroy */
+       radio_error_t (*init)(void **radio_hanle);
+       radio_error_t (*deinit)(void *radio_handle);
+       radio_error_t (*prepare)(void *radio_handle);
+       radio_error_t (*unprepare)(void *radio_handle);
+       radio_error_t (*open)(void *radio_handle);
+       radio_error_t (*close)(void *radio_handle);
+       radio_error_t (*start)(void *radio_handle);
+       radio_error_t (*stop)(void *radio_handle);
+       radio_error_t (*seek)(void *radio_handle, radio_seek_direction_type_t direction);
+       radio_error_t (*get_frequency)(void *radio_handle, uint32_t *frequency);
+       radio_error_t (*set_frequency)(void *radio_handle, uint32_t frequency);
+       radio_error_t (*mute)(void *radio_handle);
+       radio_error_t (*unmute)(void *radio_handle);
+       radio_error_t (*get_signal_strength)(void *radio_handle, uint32_t *strength);
+} radio_interface_t;
+
+/**
+ * @brief Initializes new handle of radio HAL.
+ * @since_tizen 3.0
+ * @param[out] radio_handle A newly returned handle to the radio HAL
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #RADIO_ERROR_NONE Successful
+ * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #RADIO_ERROR_OUT_OF_MEMORY Out of memory
+ * @see radio_deinit()
+ */
+radio_error_t radio_init(void **radio_handle);
+
+/**
+ * @brief Deinitializes handle of camera HAL.
+ * @since_tizen 3.0
+ * @param[in] radio_handle The handle to the radio HAL
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #RADIO_ERROR_NONE Successful
+ * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
+ * @see radio_init()
+ */
+radio_error_t radio_deinit(void *radio_handle);
+
+/**
+ * @brief Prepare the device of radio.
+ * @since_tizen 3.0
+ * @param[in] radio_handle The handle to the radio HAL
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #RADIO_ERROR_NONE Successful
+ * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #RADIO_ERROR_DEVICE_NOT_OPENED The radio device is not opened
+ * @see radio_unprepare()
+ */
+radio_error_t radio_prepare(void *radio_handle);
+
+/**
+ * @brief Unprepare the device of radio.
+ * @since_tizen 3.0
+ * @param[in] radio_handle The handle to the radio HAL
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #RADIO_ERROR_NONE Successful
+ * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
+ * @see radio_prepare()
+ */
+radio_error_t radio_unprepare(void *radio_handle);
+
+/**
+ * @brief Opens the device of radio.
+ * @since_tizen 3.0
+ * @param[in] radio_handle The handle to the radio HAL
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #RADIO_ERROR_NONE Successful
+ * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #RADIO_ERROR_DEVICE_NOT_FOUND Failed to find radio device
+ * @retval #RADIO_ERROR_DEVICE_NOT_OPENED The radio device is not opened
+ * @retval #RADIO_ERROR_PERMISSION_DENIED The access to the resources can not be granted.
+ * @retval #RADIO_ERROR_DEVICE_NOT_PREPARED Not prepared the radio device
+ * @see radio_close()
+ */
+radio_error_t radio_open(void *radio_handle);
+
+/**
+ * @brief Closes the device of radio.
+ * @since_tizen 3.0
+ * @param[in] radio_handle The handle to the radio HAL
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #RADIO_ERROR_NONE Successful
+ * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
+ * @see radio_open()
+ */
+radio_error_t radio_close(void *radio_handle);
+
+/**
+ * @brief Starts the device of radio.
+ * @since_tizen 3.0
+ * @param[in] radio_handle The handle to the radio HAL
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #RADIO_ERROR_NONE Successful
+ * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
+ * @see radio_stop()
+ */
+radio_error_t radio_start(void *radio_handle);
+
+/**
+ * @brief Stops the device of radio.
+ * @since_tizen 3.0
+ * @param[in] radio_handle The handle to the radio HAL
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #RADIO_ERROR_NONE Successful
+ * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
+ * @see radio_start()
+ */
+radio_error_t radio_stop(void *radio_handle);
+
+/**
+ * @brief Seeks (up or down) the effective frequency of the radio.
+ * @since_tizen 3.0
+ * @param[in] radio_handle The handle to the radio HAL
+ * @param[in] direction The seek direction type (up or down)
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #RADIO_ERROR_NONE Successful
+ * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #RADIO_ERROR_DEVICE_NOT_OPENED The radio device is not opened
+ * @retval #RADIO_ERROR_INVALID_OPERATION Invalid operation
+ */
+radio_error_t radio_seek(void *radio_handle, radio_seek_direction_type_t direction);
+
+/**
+ * @brief Gets the radio frequency.
+ * @since_tizen 3.0
+ * @param[in] radio_handle The handle to the radio HAL
+ * @param[out] frequency The current frequency (khz)
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #RADIO_ERROR_NONE Successful
+ * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #RADIO_ERROR_DEVICE_NOT_OPENED The radio device is not opened
+ * @retval #RADIO_ERROR_INVALID_OPERATION Invalid operation
+ */
+radio_error_t radio_get_frequency(void *radio_handle, uint32_t *frequency);
+
+/**
+ * @brief Sets the radio frequency.
+ * @since_tizen 3.0
+ * @param[in] radio_handle The handle to the radio HAL
+ * @param[in] frequency The frequency to set (khz)
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #RADIO_ERROR_NONE Successful
+ * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #RADIO_ERROR_DEVICE_NOT_OPENED The radio device is not opened
+ * @retval #RADIO_ERROR_INVALID_OPERATION Invalid operation
+ */
+radio_error_t radio_set_frequency(void *radio_handle, uint32_t frequency);
+
+/**
+ * @brief Sets the radio's mute
+ * @since_tizen 3.0
+ * @param[in] radio_handle The handle to the radio HAL
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #RADIO_ERROR_NONE Successful
+ * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #RADIO_ERROR_INVALID_OPERATION Invalid operation
+ */
+radio_error_t radio_mute(void *radio_handle);
+
+/**
+ * @brief Unsets the radio's mute
+ * @since_tizen 3.0
+ * @param[in] radio_handle The handle to the radio HAL
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #RADIO_ERROR_NONE Successful
+ * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #RADIO_ERROR_INVALID_OPERATION Invalid operation
+ */
+radio_error_t radio_unmute(void *radio_handle);
+
+/**
+ * @brief Gets the current signal strength of the radio
+ * @since_tizen 3.0
+ * @param[in] radio_handle The handle to the radio HAL
+ * @param[out] strength The current signal strength (dBm)
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #RADIO_ERROR_NONE Successful
+ * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #RADIO_ERROR_INVALID_OPERATION Invalid operation
+ */
+radio_error_t radio_get_signal_strength(void *radio_handle, uint32_t *strength);
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __TIZEN_RADIO_HAL_H__ */
+
index 2f8a42f4d253fe3840bb4e2d62e5db3ab0bce251..1d87343605b6fd74d7c2e2e290537cf12894ac79 100644 (file)
@@ -1,7 +1,7 @@
 Name:       mm-hal-interface
 Summary:    Multimedia HAL Interface
 Version:    0.0.3
-Release:    0
+Release:    1
 Group:      Multimedia/Development
 License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
@@ -18,9 +18,9 @@ Multimedia framework hardware abstraction layer interface package.
 
 %install
 install -d -m 755 %{buildroot}%{_includedir}
-install -m 644 audio/*.h %{buildroot}%{_includedir}
-install -m 644 camera/*.h %{buildroot}%{_includedir}
-install -m 644 radio/*.h %{buildroot}%{_includedir}
+install -m 644 include/audio/*.h %{buildroot}%{_includedir}
+install -m 644 include/camera/*.h %{buildroot}%{_includedir}
+install -m 644 include/radio/*.h %{buildroot}%{_includedir}
 
 %files
 %defattr(-,root,root,-)
diff --git a/radio/tizen-radio.h b/radio/tizen-radio.h
deleted file mode 100644 (file)
index 8f6ce17..0000000
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
- * tizen-radio.h
- *
- * Copyright (c) 2016 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_RADIO_HAL_H__
-#define __TIZEN_RADIO_HAL_H__
-
-#include <stdint.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-/**
- * @file tizen-radio.h
- * @brief This file contains the Tizen radio HAL API, related structures and enumerations.
- * @since_tizen 3.0
- */
-
-/**
- * @addtogroup TIZEN_RADIO_HAL_MODULE
- * @{
- */
-
-/**
- * @brief Enumeration for the radio error.
- * @since_tizen 3.0
- */
-typedef enum radio_error {
-       RADIO_ERROR_NONE,
-       RADIO_ERROR_INVALID_PARAMETER,
-       RADIO_ERROR_INVALID_STATE,
-       RADIO_ERROR_INVALID_OPERATION,
-       RADIO_ERROR_PERMISSION_DENIED,
-       RADIO_ERROR_NOT_SUPPORTED,
-       RADIO_ERROR_OUT_OF_MEMORY,
-       RADIO_ERROR_DEVICE_NOT_PREPARED,
-       RADIO_ERROR_DEVICE_NOT_OPENED,
-       RADIO_ERROR_DEVICE_NOT_FOUND,
-       RADIO_ERROR_DEVICE_NOT_SUPPORTED,
-       RADIO_ERROR_NO_ANTENNA,
-       RADIO_ERROR_INTERNAL,
-       RADIO_ERROR_UNKNOWN
-} radio_error_t;
-
-/**
- * @brief Enumeration for the radio seek direction.
- * @since_tizen 3.0
- */
-typedef enum radio_seek_direction_type {
-       RADIO_SEEK_DIRECTION_UP,        /**< Seek upward */
-       RADIO_SEEK_DIRECTION_DOWN       /**< Seek downward */
-} radio_seek_direction_type_t;
-
-typedef struct radio_interface {
-       /* create & destroy */
-       radio_error_t (*init)(void **radio_hanle);
-       radio_error_t (*deinit)(void *radio_handle);
-       radio_error_t (*prepare)(void *radio_handle);
-       radio_error_t (*unprepare)(void *radio_handle);
-       radio_error_t (*open)(void *radio_handle);
-       radio_error_t (*close)(void *radio_handle);
-       radio_error_t (*start)(void *radio_handle);
-       radio_error_t (*stop)(void *radio_handle);
-       radio_error_t (*seek)(void *radio_handle, radio_seek_direction_type_t direction);
-       radio_error_t (*get_frequency)(void *radio_handle, uint32_t *frequency);
-       radio_error_t (*set_frequency)(void *radio_handle, uint32_t frequency);
-       radio_error_t (*mute)(void *radio_handle);
-       radio_error_t (*unmute)(void *radio_handle);
-       radio_error_t (*get_signal_strength)(void *radio_handle, uint32_t *strength);
-} radio_interface_t;
-
-/**
- * @brief Initializes new handle of radio HAL.
- * @since_tizen 3.0
- * @param[out] radio_handle A newly returned handle to the radio HAL
- * @return @c 0 on success, otherwise a negative error value
- * @retval #RADIO_ERROR_NONE Successful
- * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #RADIO_ERROR_OUT_OF_MEMORY Out of memory
- * @see radio_deinit()
- */
-radio_error_t radio_init(void **radio_handle);
-
-/**
- * @brief Deinitializes handle of camera HAL.
- * @since_tizen 3.0
- * @param[in] radio_handle The handle to the radio HAL
- * @return @c 0 on success, otherwise a negative error value
- * @retval #RADIO_ERROR_NONE Successful
- * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
- * @see radio_init()
- */
-radio_error_t radio_deinit(void *radio_handle);
-
-/**
- * @brief Prepare the device of radio.
- * @since_tizen 3.0
- * @param[in] radio_handle The handle to the radio HAL
- * @return @c 0 on success, otherwise a negative error value
- * @retval #RADIO_ERROR_NONE Successful
- * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #RADIO_ERROR_DEVICE_NOT_OPENED The radio device is not opened
- * @see radio_unprepare()
- */
-radio_error_t radio_prepare(void *radio_handle);
-
-/**
- * @brief Unprepare the device of radio.
- * @since_tizen 3.0
- * @param[in] radio_handle The handle to the radio HAL
- * @return @c 0 on success, otherwise a negative error value
- * @retval #RADIO_ERROR_NONE Successful
- * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
- * @see radio_prepare()
- */
-radio_error_t radio_unprepare(void *radio_handle);
-
-/**
- * @brief Opens the device of radio.
- * @since_tizen 3.0
- * @param[in] radio_handle The handle to the radio HAL
- * @return @c 0 on success, otherwise a negative error value
- * @retval #RADIO_ERROR_NONE Successful
- * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #RADIO_ERROR_DEVICE_NOT_FOUND Failed to find radio device
- * @retval #RADIO_ERROR_DEVICE_NOT_OPENED The radio device is not opened
- * @retval #RADIO_ERROR_PERMISSION_DENIED The access to the resources can not be granted.
- * @retval #RADIO_ERROR_DEVICE_NOT_PREPARED Not prepared the radio device
- * @see radio_close()
- */
-radio_error_t radio_open(void *radio_handle);
-
-/**
- * @brief Closes the device of radio.
- * @since_tizen 3.0
- * @param[in] radio_handle The handle to the radio HAL
- * @return @c 0 on success, otherwise a negative error value
- * @retval #RADIO_ERROR_NONE Successful
- * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
- * @see radio_open()
- */
-radio_error_t radio_close(void *radio_handle);
-
-/**
- * @brief Starts the device of radio.
- * @since_tizen 3.0
- * @param[in] radio_handle The handle to the radio HAL
- * @return @c 0 on success, otherwise a negative error value
- * @retval #RADIO_ERROR_NONE Successful
- * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
- * @see radio_stop()
- */
-radio_error_t radio_start(void *radio_handle);
-
-/**
- * @brief Stops the device of radio.
- * @since_tizen 3.0
- * @param[in] radio_handle The handle to the radio HAL
- * @return @c 0 on success, otherwise a negative error value
- * @retval #RADIO_ERROR_NONE Successful
- * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
- * @see radio_start()
- */
-radio_error_t radio_stop(void *radio_handle);
-
-/**
- * @brief Seeks (up or down) the effective frequency of the radio.
- * @since_tizen 3.0
- * @param[in] radio_handle The handle to the radio HAL
- * @param[in] direction The seek direction type (up or down)
- * @return @c 0 on success, otherwise a negative error value
- * @retval #RADIO_ERROR_NONE Successful
- * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #RADIO_ERROR_DEVICE_NOT_OPENED The radio device is not opened
- * @retval #RADIO_ERROR_INVALID_OPERATION Invalid operation
- */
-radio_error_t radio_seek(void *radio_handle, radio_seek_direction_type_t direction);
-
-/**
- * @brief Gets the radio frequency.
- * @since_tizen 3.0
- * @param[in] radio_handle The handle to the radio HAL
- * @param[out] frequency The current frequency (khz)
- * @return @c 0 on success, otherwise a negative error value
- * @retval #RADIO_ERROR_NONE Successful
- * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #RADIO_ERROR_DEVICE_NOT_OPENED The radio device is not opened
- * @retval #RADIO_ERROR_INVALID_OPERATION Invalid operation
- */
-radio_error_t radio_get_frequency(void *radio_handle, uint32_t *frequency);
-
-/**
- * @brief Sets the radio frequency.
- * @since_tizen 3.0
- * @param[in] radio_handle The handle to the radio HAL
- * @param[in] frequency The frequency to set (khz)
- * @return @c 0 on success, otherwise a negative error value
- * @retval #RADIO_ERROR_NONE Successful
- * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #RADIO_ERROR_DEVICE_NOT_OPENED The radio device is not opened
- * @retval #RADIO_ERROR_INVALID_OPERATION Invalid operation
- */
-radio_error_t radio_set_frequency(void *radio_handle, uint32_t frequency);
-
-/**
- * @brief Sets the radio's mute
- * @since_tizen 3.0
- * @param[in] radio_handle The handle to the radio HAL
- * @return @c 0 on success, otherwise a negative error value
- * @retval #RADIO_ERROR_NONE Successful
- * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #RADIO_ERROR_INVALID_OPERATION Invalid operation
- */
-radio_error_t radio_mute(void *radio_handle);
-
-/**
- * @brief Unsets the radio's mute
- * @since_tizen 3.0
- * @param[in] radio_handle The handle to the radio HAL
- * @return @c 0 on success, otherwise a negative error value
- * @retval #RADIO_ERROR_NONE Successful
- * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #RADIO_ERROR_INVALID_OPERATION Invalid operation
- */
-radio_error_t radio_unmute(void *radio_handle);
-
-/**
- * @brief Gets the current signal strength of the radio
- * @since_tizen 3.0
- * @param[in] radio_handle The handle to the radio HAL
- * @param[out] strength The current signal strength (dBm)
- * @return @c 0 on success, otherwise a negative error value
- * @retval #RADIO_ERROR_NONE Successful
- * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #RADIO_ERROR_INVALID_OPERATION Invalid operation
- */
-radio_error_t radio_get_signal_strength(void *radio_handle, uint32_t *strength);
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __TIZEN_RADIO_HAL_H__ */
-