summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKibum Kim <kb0929.kim@samsung.com>2012-02-27 21:15:48 +0900
committerKibum Kim <kb0929.kim@samsung.com>2012-02-27 21:15:48 +0900
commitb8e758c1624a163a988aa868fbf3da19e2612f6c (patch)
tree15744098f716f394766a5ee2947aed8946f04d2f /include
downloadavsystem-b8e758c1624a163a988aa868fbf3da19e2612f6c.tar.gz
avsystem-b8e758c1624a163a988aa868fbf3da19e2612f6c.tar.bz2
avsystem-b8e758c1624a163a988aa868fbf3da19e2612f6c.zip
tizen beta release
Diffstat (limited to 'include')
-rw-r--r--include/avsys-audio-alsa.h51
-rw-r--r--include/avsys-audio-ascenario.h96
-rw-r--r--include/avsys-audio-handle.h117
-rw-r--r--include/avsys-audio-logical-volume.h87
-rw-r--r--include/avsys-audio-pactrl.h72
-rw-r--r--include/avsys-audio-pasimple.h57
-rw-r--r--include/avsys-audio-path.h232
-rw-r--r--include/avsys-audio-shm.h44
-rw-r--r--include/avsys-audio-sync.h47
-rw-r--r--include/avsys-audio.h600
-rw-r--r--include/avsys-common.h80
-rw-r--r--include/avsys-debug.h91
-rw-r--r--include/avsys-error.h130
-rw-r--r--include/avsys-types.h41
-rw-r--r--include/avsystem.h37
15 files changed, 1782 insertions, 0 deletions
diff --git a/include/avsys-audio-alsa.h b/include/avsys-audio-alsa.h
new file mode 100644
index 0000000..1711f84
--- /dev/null
+++ b/include/avsys-audio-alsa.h
@@ -0,0 +1,51 @@
+/*
+ * avsystem
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jonghyuk Choi <jhchoi.choi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __AVSYS_AUDIO_ALSA_H__
+#define __AVSYS_AUDIO_ALSA_H__
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+#include <avsys-audio-handle.h>
+
+enum AIF_device_type_t {
+ AIF2_CAPTURE,
+ AIF2_PLAYBACK,
+ AIF3_CAPTURE,
+ AIF3_PLAYBACK,
+ AIF_DEVICE_MAX,
+};
+
+typedef struct {
+ void *alsa_handle;
+ int type;
+} avsys_audio_alsa_aif_handle_t;;
+
+int avsys_audio_alsa_open_AIF_device(const int AIF_type, avsys_audio_alsa_aif_handle_t *handle);
+int avsys_audio_alsa_close_AIF_device(avsys_audio_alsa_aif_handle_t* handle);
+int avsys_audio_alsa_set_AIF_params(avsys_audio_alsa_aif_handle_t *handle);
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif /* __AVSYS_AUDIO_H__ */
diff --git a/include/avsys-audio-ascenario.h b/include/avsys-audio-ascenario.h
new file mode 100644
index 0000000..a5f8c24
--- /dev/null
+++ b/include/avsys-audio-ascenario.h
@@ -0,0 +1,96 @@
+/*
+ * avsystem
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jonghyuk Choi <jhchoi.choi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __AVSYS_AUDIO_ASCENARIO_H__
+#define __AVSYS_AUDIO_ASCENARIO_H__
+
+typedef enum {
+ ASCN_RESET_NONE = 0,
+ ASCN_RESET_ALL,
+ ASCN_RESET_PLAYBACK,
+ ASCN_RESET_CAPTURE,
+ ASCN_RESET_MODEM,
+}AscnResetType;
+
+#define ASCN_STR_RESET "reset"
+#define ASCN_STR_RESET_PLAYBACK "reset_playback"
+#define ASCN_STR_RESET_CAPTURE "reset_capture"
+#define ASCN_STR_PLAYBACK_MUTE "mute_playback"
+#define ASCN_STR_PLAYBACK_UNMUTE "unmute_playback"
+#define ASCN_CODEC_DISABLE_ON_SUSPEND "codec_disable_on_suspend"
+
+#define IN 0
+#define OUT 16
+
+#define INPUT_CH_0 ((1 << (0 + IN))) /* Main Mic. 0x00000001 */
+#define INPUT_CH_1 ((1 << (1 + IN))) /* Sub Mic. 0x00000002 */
+#define INPUT_CH_2 ((1 << (2 + IN))) /* Stereo Mic. , 0x00000004 */
+#define INPUT_CH_3 ((1 << (3 + IN))) /* Ear Mic. , 0x00000008 */
+#define INPUT_CH_4 ((1 << (4 + IN))) /* BT Mic. 0x00000010 */
+#define INPUT_CH_5 ((1 << (5 + IN))) /* AP 0x00000020 */
+#define INPUT_CH_6 ((1 << (6 + IN))) /* CP 0x00000040 */
+#define INPUT_CH_7 ((1 << (7 + IN))) /* FM Radio 0x00000080 */
+#define INPUT_CH_8 ((1 << (8 + IN))) /* Reserved */
+#define INPUT_CH_9 ((1 << (9 + IN))) /* Reserved */
+
+#define OUTPUT_CH_0 ((1 << (0 + OUT))) /* Headset (Earphone) 0x00010000 */
+#define OUTPUT_CH_1 ((1 << (1 + OUT))) /* Left Speaker , 0x00020000 */
+#define OUTPUT_CH_2 ((1 << (2 + OUT))) /* Right Speaker , 0x00040000 */
+#define OUTPUT_CH_3 ((1 << (3 + OUT))) /* Stereo Speaker , 0x00080000 */
+#define OUTPUT_CH_4 ((1 << (4 + OUT))) /* Receiver (Mono) , 0x00100000 */
+#define OUTPUT_CH_5 ((1 << (5 + OUT))) /* BT Headset 0x00200000 */
+#define OUTPUT_CH_6 ((1 << (6 + OUT))) /* CP 0x00400000 */
+#define OUTPUT_CH_7 ((1 << (7 + OUT))) /* AP 0x00800000 */
+#define OUTPUT_CH_8 ((1 << (8 + OUT))) /* Gain */
+#define OUTPUT_CH_9 ((1 << (9 + OUT))) /* Video call gain */
+#define OUTPUT_CH_10 ((1 << (10 + OUT))) /* Video call gain */
+#define OUTPUT_CH_11 ((1 << (11 + OUT))) /* Reserved */
+#define OUTPUT_CH_12 ((1 << (12 + OUT))) /* Reserved */
+#define OUTPUT_CH_13 ((1 << (13 + OUT))) /* Call alert Gain */
+
+#define INPUT_MAIN_MIC (INPUT_CH_0)
+#define INPUT_SUB_MIC (INPUT_CH_1)
+#define INPUT_STEREO_MIC (INPUT_CH_2)
+#define INPUT_EAR_MIC (INPUT_CH_3)
+#define INPUT_BT_MIC (INPUT_CH_4)
+#define INPUT_AP (INPUT_CH_5)
+#define INPUT_CP (INPUT_CH_6)
+#define INPUT_FMRADIO (INPUT_CH_7)
+
+#define OUTPUT_HEADSET (OUTPUT_CH_0)
+#define OUTPUT_LEFT_SPK (OUTPUT_CH_1)
+#define OUTPUT_RIGHT_SPK (OUTPUT_CH_2)
+#define OUTPUT_STEREO_SPK (OUTPUT_CH_3)
+#define OUTPUT_RECV (OUTPUT_CH_4)
+#define OUTPUT_BT_HEADSET (OUTPUT_CH_5)
+#define OUTPUT_CP (OUTPUT_CH_6)
+#define OUTPUT_AP (OUTPUT_CH_7)
+
+#define GAIN_MODE (OUTPUT_CH_8)
+#define GAIN_VIDEO_CALL (OUTPUT_CH_9)
+#define GAIN_VOICE_CALL (OUTPUT_CH_10)
+#define GAIN_CALLALERT (OUTPUT_CH_13)
+
+/* function prototype */
+int avsys_audio_ascn_bulk_set(int * bulk, int bulk_cnt, AscnResetType clear);
+int avsys_audio_ascn_single_set(char * str);
+
+#endif /* __AVSYS_AUDIO_ASCENARIO_H__ */
diff --git a/include/avsys-audio-handle.h b/include/avsys-audio-handle.h
new file mode 100644
index 0000000..b05c099
--- /dev/null
+++ b/include/avsys-audio-handle.h
@@ -0,0 +1,117 @@
+/*
+ * avsystem
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jonghyuk Choi <jhchoi.choi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __AVSYS_AUDIO_HANDLE_H__
+#define __AVSYS_AUDIO_HANDLE_H__
+
+#include <pthread.h>
+#include "avsys-audio-logical-volume.h"
+
+#define AVSYS_AUDIO_HANDLE_MAX 64 /* this is related with allocated bit size in avsys_audio_handle_info_t*/
+#define AVSYS_AUDIO_LOCK_SLOT_MAX 4
+
+enum {
+ AVSYS_AUDIO_PRIMARY_VOLUME_CLEAR = 0,
+ AVSYS_AUDIO_PRIMARY_VOLUME_SET
+};
+
+enum {
+ AVSYS_AUDIO_HANDLE_PRIORITY_TYPE_0 = 0, /**< normal */
+ AVSYS_AUDIO_HANDLE_PRIORITY_TYPE_1, /**< solo */
+ AVSYS_AUDIO_HANDLE_PRIORITY_TYPE_2, /**< solo with transition effect */
+ AVSYS_AUDIO_HANDLE_PRIORITY_TYPE_MAX,
+};
+
+enum {
+ AVSYS_AUDIO_HANDLE_EXT_DEV_NONE = 0x00000000,
+ AVSYS_AUDIO_HANDLE_EXT_DEV_FMRADIO = 0x00000001,
+};
+
+typedef struct {
+ /* common base */
+ int mode;
+ int channels;
+ int mute;
+ int format;
+ int samplerate;
+ int period;
+ int msec_per_period;
+ int pid;
+ int tid;
+ int priority;
+
+ /* logical volume */
+ avsys_audio_volume_setting_t gain_setting;
+ avsys_audio_volume_t setting_vol;
+ avsys_audio_volume_t working_vol;
+ int fadeup_vol;
+ int fadeup_multiplier;
+ char dirty_volume;
+
+ /* routing information */
+ char during_cp_audio;/* if this value set 1, this handle created during cp audio status (means call) */
+ char path_off;
+ int stream_index;
+ int handle_route;
+
+ /* backend specific */
+ void *device;
+} avsys_audio_handle_t;
+
+typedef struct {
+ long long int allocated;
+ int handle_amp; /* 1 for unmute, 0 for mute per each handle*/
+ int ext_device_amp;
+ int ext_device_status;
+ int volume_value[AVSYS_AUDIO_VOLUME_TYPE_MAX];
+ int primary_volume_type;
+ pid_t primary_volume_pid;
+ char handle_priority[AVSYS_AUDIO_HANDLE_MAX];
+ pid_t handlelock_pid[AVSYS_AUDIO_LOCK_SLOT_MAX];
+ avsys_audio_handle_t handles[AVSYS_AUDIO_HANDLE_MAX];
+} avsys_audio_handle_info_t;
+
+enum {
+ HANDLE_PTR_MODE_NORMAL,
+ HANDLE_PTR_MODE_FAST,
+ HANDLE_PTR_MODE_NUM,
+};
+
+int avsys_audio_handle_init(void);
+int avsys_audio_handle_fini(void);
+int avsys_audio_handle_reset(int *);
+int avsys_audio_handle_dump(void);
+int avsys_audio_handle_rejuvenation(void);
+int avsys_audio_handle_alloc(int *handle);
+int avsys_audio_handle_free(int handle);
+int avsys_audio_handle_get_ptr(int handle, avsys_audio_handle_t **ptr, const int mode);
+int avsys_audio_handle_release_ptr(int handle, const int mode);
+int avsys_audio_handle_set_mute(int handle, int mute);
+int avsys_audio_handle_ext_dev_set_mute(avsysaudio_ext_device_t device_type, int mute);
+int avsys_audio_handle_ext_dev_status(avsysaudio_ext_device_t device_type, int *onoff);
+int avsys_audio_handle_ext_dev_status_update(avsysaudio_ext_device_t device_type, int onoff);
+int avsys_audio_handle_current_playing_volume_type(int *type);
+int avsys_audio_handle_update_volume(avsys_audio_handle_t *p, const int vol_type);
+int avsys_audio_handle_update_volume_by_type(const int volume_type, const int volume_value);
+int avsys_audio_handle_set_primary_volume_type(const int pid, const int type, const int command);
+int avsys_audio_handle_update_priority(int handle, int priority, int handle_route, int cmd);
+int avsys_audio_handle_current_capture_status(int *on_capture);
+#endif /* __AVSYS_AUDIO_HANDLE_H__ */
diff --git a/include/avsys-audio-logical-volume.h b/include/avsys-audio-logical-volume.h
new file mode 100644
index 0000000..1b4ad52
--- /dev/null
+++ b/include/avsys-audio-logical-volume.h
@@ -0,0 +1,87 @@
+/*
+ * avsystem
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jonghyuk Choi <jhchoi.choi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __AVSYS_AUDIO_LOGICAL_VOLUME_H__
+#define __AVSYS_AUDIO_LOGICAL_VOLUME_H__
+
+#include "avsys-audio.h"
+
+#define LVOLUME_MAX_MULTIMEDIA 16 /**< same with AVSYS_AUDIO_VOLUME_MAX_MULTIMEDIA */
+#define LVOLUME_MAX_BASIC 8 /**< same with AVSYS_AUDIO_VOLUME_MAX_BASIC */
+#define LVOLUME_MAX_SINGLE 1 /**< same with AVSYS_AUDIO_VOLUME_MAX_SINGLE */
+
+#define FADE_UP_MULTIPLIER 1//2
+#define FADE_DOWN_MULTIPLIER 1
+
+#define VOLUME_FILE_PATH "/opt/system/volume.txt"
+
+enum
+{
+ AVSYS_AUDIO_LVOL_GAIN_TYPE_0 = 0, /* system */
+ AVSYS_AUDIO_LVOL_GAIN_TYPE_1, /* notification */
+ AVSYS_AUDIO_LVOL_GAIN_TYPE_2, /* alarm */
+ AVSYS_AUDIO_LVOL_GAIN_TYPE_3, /* ringtone */
+ AVSYS_AUDIO_LVOL_GAIN_TYPE_4, /* media */
+ AVSYS_AUDIO_LVOL_GAIN_TYPE_5, /* call */
+ AVSYS_AUDIO_LVOL_GAIN_TYPE_6, /* android */
+ AVSYS_AUDIO_LVOL_GAIN_TYPE_7, /* java */
+ AVSYS_AUDIO_LVOL_GAIN_TYPE_8, /* music (media2) */
+ AVSYS_AUDIO_LVOL_GAIN_TYPE_MAX,
+};
+
+enum
+{
+ AVSYS_AUDIO_LVOL_DEV_TYPE_SPK,
+ AVSYS_AUDIO_LVOL_DEV_TYPE_HEADSET,
+ AVSYS_AUDIO_LVOL_DEV_TYPE_BTHEADSET,
+ AVSYS_AUDIO_LVOL_DEV_TYPE_MAX,
+};
+
+
+typedef struct {
+ int max_len;
+ avsys_audio_volume_t gain[LVOLUME_MAX_MULTIMEDIA];
+} avsys_a_logical_volume_t;
+
+
+typedef struct {
+ int type;
+ avsys_a_logical_volume_t devices[AVSYS_AUDIO_LVOL_DEV_TYPE_MAX];
+} avsys_logical_gain_t;
+
+typedef struct {
+ int vol_type;
+ int dev_type;
+ int max_len;
+ avsys_audio_volume_t *table;
+} avsys_audio_volume_setting_t;
+
+int avsys_audio_logical_volume_get_max(int vol_type, int dev_type, int *max);
+int avsys_audio_logical_volume_set_table(int vol_type, int dev_type, avsys_audio_volume_setting_t *setting);
+int avsys_audio_logical_volume_update_table(int dev_type, avsys_audio_volume_setting_t *setting);
+int avsys_audio_logical_volume_convert(avsys_audio_volume_t *level, avsys_audio_volume_t *converted, avsys_audio_volume_setting_t *setting);
+/* Tuning */
+int avsys_audio_logical_volume_init(void);
+int avsys_audio_logical_volume_set_to_table(int gain_type, int dev_type, int step, int lv, int rv);
+int avsys_audio_logical_volume_get_from_table(int gain_type, int dev_type, int step, int *lv, int *rv);
+int avsys_audio_load_volume_from_file(void);
+
+#endif /* __AVSYS_AUDIO_LOGICAL_VOLUME_H__ */
diff --git a/include/avsys-audio-pactrl.h b/include/avsys-audio-pactrl.h
new file mode 100644
index 0000000..e446c40
--- /dev/null
+++ b/include/avsys-audio-pactrl.h
@@ -0,0 +1,72 @@
+/*
+ * avsystem
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jonghyuk Choi <jhchoi.choi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __AVSYS_AUDIO_PACTRL_H__
+#define __AVSYS_AUDIO_PACTRL_H__
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+#include <avsys-audio-handle.h>
+#include <pulse/pulseaudio.h>
+#include <pulse/thread-mainloop.h>
+#include <pulse/error.h>
+#include <pulse/gccmacro.h>
+#include <pulse/proplist.h>
+
+/*
+ * Enums
+ */
+enum {
+ AVSYS_AUDIO_PA_CTL_SINK_UNKNOWN = 0x0000,
+ AVSYS_AUDIO_PA_CTL_SINK_ALSA = 0x0001,
+ AVSYS_AUDIO_PA_CTL_SINK_BLUEZ = 0x0002,
+};
+/*
+ * Defines
+ */
+#define ALSA_SINK 0
+#define BLUEZ_SINK 16
+
+#define _EXIST 1
+#define _DEACTIVE 2
+#define _ACTIVE 3
+
+#define ALSA_SINK_EXIST ((1 << (_EXIST + ALSA_SINK)))
+#define ALSA_SINK_DEACTIVE ((1 << (_DEACTIVE + ALSA_SINK)))
+#define ALSA_SINK_ACTIVE ((1 << (_ACTIVE + ALSA_SINK)))
+
+#define BULEZ_SINK_EXIST ((1 << (_EXIST + BLUEZ_SINK)))
+#define BULEZ_SINK_DEACTIVE ((1 << (_DEACTIVE + BLUEZ_SINK)))
+#define BULEZ_SINK_ACTIVE ((1 << (_ACTIVE + BLUEZ_SINK)))
+
+/*
+ * Function Prorotypes
+ */
+int avsys_audio_pa_ctrl_volume_by_index(unsigned int idx, int volume, int ch);
+int avsys_audio_pa_ctrl_mute_by_index(unsigned int idx, int mute);
+int avsys_audio_pa_ctrl_get_default_sink(int *sink);
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif /* __AVSYS_AUDIO_PACTRL_H__ */
diff --git a/include/avsys-audio-pasimple.h b/include/avsys-audio-pasimple.h
new file mode 100644
index 0000000..06fec34
--- /dev/null
+++ b/include/avsys-audio-pasimple.h
@@ -0,0 +1,57 @@
+/*
+ * avsystem
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jonghyuk Choi <jhchoi.choi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __AVSYS_AUDIO_PASIMPLE_H__
+#define __AVSYS_AUDIO_PASIMPLE_H__
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+#include <avsys-audio-handle.h>
+#include <pulse/simple.h>
+#include <pulse/error.h>
+#include <pulse/gccmacro.h>
+#include <pulse/proplist.h>
+
+typedef struct {
+ void *pasimple_handle;
+ unsigned int samplesize;
+ unsigned int period_frames;
+ unsigned int buffer_frames;
+ unsigned int mode;
+ unsigned int periods_per_buffer;
+} avsys_audio_pasimple_handle_t;
+
+int avsys_audio_pasimple_open_device(const int mode, const unsigned int format, const unsigned int channel, const unsigned int samplerate, avsys_audio_handle_t *handle,int policy);
+int avsys_audio_pasimple_close_device(avsys_audio_handle_t *handle);
+int avsys_audio_pasimple_write(avsys_audio_handle_t *handle, const void *buf, int size);
+int avsys_audio_pasimple_read(avsys_audio_handle_t *handle, void *buf, int size);
+int avsys_audio_pasimple_reset(avsys_audio_handle_t *handle);
+int avsys_audio_pasimple_drain(avsys_audio_handle_t *handle);
+int avsys_audio_pasimple_delay(avsys_audio_handle_t *handle, int *delay_frames);
+int avsys_audio_pasimple_set_volume(avsys_audio_handle_t *handle, int volume);
+int avsys_audio_pasimple_get_period_buffer_time(avsys_audio_handle_t *handle, unsigned int *period_time, unsigned int *buffer_time);
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif /* __AVSYS_AUDIO_PASIMPLE_H__ */
diff --git a/include/avsys-audio-path.h b/include/avsys-audio-path.h
new file mode 100644
index 0000000..2f20b46
--- /dev/null
+++ b/include/avsys-audio-path.h
@@ -0,0 +1,232 @@
+/*
+ * avsystem
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jonghyuk Choi <jhchoi.choi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __AVSYS_AUDIO_PATH_H__
+#define __AVSYS_AUDIO_PATH_H__
+
+#include "avsys-audio.h"
+#include "avsys-audio-handle.h"
+
+#include <sys/types.h>
+#include <stdbool.h>
+
+enum {
+ AVSYS_AUDIO_INSERTED_NONE = 0,
+ AVSYS_AUDIO_INSERTED_3,
+ AVSYS_AUDIO_INSERTED_4,
+ AVSYS_AUDIO_INSERTED_AV
+};
+
+enum avsys_audio_playback_gain{
+ AVSYS_AUDIO_PLAYBACK_GAIN_AP = 0,
+ AVSYS_AUDIO_PLAYBACK_GAIN_FMRADIO,
+ AVSYS_AUDIO_PLAYBACK_GAIN_VOICECALL,
+ AVSYS_AUDIO_PLAYBACK_GAIN_VIDEOCALL,
+ AVSYS_AUDIO_PLAYBACK_GAIN_CALLALERT,
+ AVSYS_AUDIO_PLAYBACK_GAIN_MAX
+};
+
+enum avsys_audio_capture_gain{
+ AVSYS_AUDIO_CAPTURE_GAIN_AP = 0,
+ AVSYS_AUDIO_CAPTURE_GAIN_FMRADIO,
+ AVSYS_AUDIO_CAPTURE_GAIN_VOICECALL,
+ AVSYS_AUDIO_CAPTURE_GAIN_VIDEOCALL,
+ AVSYS_AUDIO_CAPTURE_GAIN_MAX
+};
+
+enum avsys_audio_ear_ctrl {
+ AVSYS_AUDIO_EAR_SWITCH_MANUAL,
+ AVSYS_AUDIO_EAR_SWITCH_AUTO_WITH_MUTE,
+ AVSYS_AUDIO_EAR_SWITCH_AUTO_WITHOUT_MUTE,
+};
+
+struct avsys_audio_jack_event {
+ struct timeval time;
+ unsigned short type;
+ unsigned short code;
+ int value;
+};
+
+#define PATH_MASK_MAX 23
+#define GAIN_MASK_MAX 30
+/* sound path status bit */
+#define PS_PATH_NONE (0)
+#define PS_AP_TO_SPK (1 << 0)
+#define PS_AP_TO_HEADSET (1 << 1)
+#define PS_AP_TO_RECV (1 << 2)
+#define PS_AP_TO_HDMI (1 << 3)
+#define PS_AP_TO_BT (1 << 4)
+#define PS_AP_TO_MODEM (1 << 5)
+#define PS_MODEM_TO_SPK (1 << 6)
+#define PS_MODEM_TO_HEADSET (1 << 7)
+#define PS_MODEM_TO_RECV (1 << 8)
+#define PS_MODEM_TO_BT (1 << 9)
+#define PS_MODEM_TO_AP (1 << 10)
+#define PS_FMRADIO_TO_SPK (1 << 11)
+#define PS_FMRADIO_TO_HEADSET (1 << 12)
+#define PS_MAINMIC_TO_AP (1 << 13)
+#define PS_MAINMIC_TO_MODEM (1 << 14)
+#define PS_SUBMIC_TO_AP (1 << 15)
+#define PS_SUBMIC_TO_MODEM (1 << 16)
+#define PS_STEREOMIC_TO_AP (1 << 17)
+#define PS_EARMIC_TO_AP (1 << 18)
+#define PS_EARMIC_TO_MODEM (1 << 19)
+#define PS_BTMIC_TO_AP (1 << 20)
+#define PS_BTMIC_TO_MODEM (1 << 21)
+#define PS_FMRADIO_TO_AP (1 << 22)
+#define PS_CODEC_DISABLE_ON_SUSPEND (1 << 23)
+#define PS_CP_TO_AP (1 << PATH_MASK_MAX)
+
+
+/* hw gain status enum */
+#define GS_GAIN_NONE (0)
+#define GS_AP_TO_SPK (1 << 0)
+#define GS_AP_TO_SPK_CALLALERT (1 << 1)
+#define GS_AP_TO_HEADSET (1 << 2)
+#define GS_AP_TO_HEADSET_CALLALERT (1 << 3)
+#define GS_AP_TO_RECV (1 << 4)
+#define GS_AP_TO_HDMI (1 << 5)
+#define GS_AP_TO_BT (1 << 6)
+#define GS_AP_TO_MODEM (1 << 7)
+#define GS_MODEM_TO_SPK_VOICE (1 << 8)
+#define GS_MODEM_TO_HEADSET_VOICE (1 << 9)
+#define GS_MODEM_TO_RECV_VOICE (1 << 10)
+#define GS_MODEM_TO_BT_VOICE (1 << 11)
+#define GS_MODEM_TO_AP_VOICE (1 << 12)
+#define GS_MODEM_TO_SPK_VIDEO (1 << 13)
+#define GS_MODEM_TO_HEADSET_VIDEO (1 << 14)
+#define GS_MODEM_TO_RECV_VIDEO (1 << 15)
+#define GS_MODEM_TO_BT_VIDEO (1 << 16)
+#define GS_MODEM_TO_AP_VIDEO (1 << 17)
+#define GS_FMRADIO_TO_SPK (1 << 18)
+#define GS_FMRADIO_TO_HEADSET (1 << 19)
+#define GS_MAINMIC_TO_AP (1 << 20)
+#define GS_MAINMIC_TO_MODEM_VOICE (1 << 21)
+#define GS_SUBMIC_TO_AP (1 << 22)
+#define GS_SUBMIC_TO_MODEM_VOICE (1 << 23)
+#define GS_STEREOMIC_TO_AP (1 << 24)
+#define GS_EARMIC_TO_AP (1 << 25)
+#define GS_EARMIC_TO_MODEM_VOICE (1 << 26)
+#define GS_BTMIC_TO_AP (1 << 27)
+#define GS_BTMIC_TO_MODEM_VOICE (1 << 28)
+#define GS_FMRADIO_TO_AP (1 << 29)
+#define GS_CP_TO_AP (1 << GAIN_MASK_MAX)
+
+#define TYPE_EVENT_SWITCH 0x05
+#define CODE_HEADPHONE_INSERT 0x02
+#define CODE_MICROPHONE_INSERT 0x04
+#define CODE_LINEOUT_INSERT 0x06
+#define CODE_JACK_PHYSICAL_INSERT 0x07
+
+#define PATH_FIXED_NONE (0x00000000)
+#define PATH_FIXED_WITH_FMRADIO (1 << PATH_FIXED_TYPE_FMRADIO) /* 0x00000001 */
+#define PATH_FIXED_WITH_CALL (1 << PATH_FIXED_TYPE_CALL) /* 0x00000002 */
+
+enum avsys_audio_amp_t {
+ AVSYS_AUDIO_AMP_OFF = 0, /**< AMP OFF in pda out */
+ AVSYS_AUDIO_AMP_ON, /**< AMP ON in pda out */
+ AVSYS_AUDIO_AMP_OFF_ALL,
+};
+
+enum path_fixed_type_t {
+ PATH_FIXED_TYPE_FMRADIO = 0,
+ PATH_FIXED_TYPE_CALL,
+ PATH_FIXED_TYPE_MAX,
+};
+
+struct audio_route_info_t {
+ int playback;
+ int capture;
+};
+
+typedef struct audio_route_info_t gain_info_t;
+typedef struct audio_route_info_t path_info_t;
+typedef struct audio_route_info_t option_info_t;
+typedef struct audio_route_info_t gain_status_t;
+typedef struct audio_route_info_t path_status_t;
+
+typedef struct {
+ gain_info_t gain;
+ path_info_t path;
+
+ gain_info_t backup_gain;
+ path_info_t backup_path;
+
+ gain_info_t pregain;
+ gain_info_t reqgain;
+
+ option_info_t option;
+
+ /* path fixed information */
+ int path_fixed;
+ pid_t path_fixed_pid[PATH_FIXED_TYPE_MAX];
+
+ /* hw mute */
+ int mute;
+
+ /* For earphone control */
+ int inserted;
+ int ear_auto;
+
+ /* for alsa scenario, aquila */
+ gain_status_t gain_status;
+ path_status_t path_status;
+
+ gain_status_t p_gain_status;
+ path_status_t p_path_status;
+
+ int lvol_dev_type;
+ int gain_debug_mode;
+
+ /* For Lock debugging */
+ pid_t pathlock_pid[AVSYS_AUDIO_LOCK_SLOT_MAX];
+
+ /* system route policy */
+ avsys_audio_route_policy_t route_policy;
+ int a2dp_status;
+ int earpiece_on;
+} avsys_audio_path_ex_info_t;
+
+int avsys_audio_path_ex_init(void);
+int avsys_audio_path_ex_fini(void);
+int avsys_audio_path_ex_reset(int forced);
+int avsys_audio_path_ex_dump(void);
+int avsys_audio_path_ex_set_path(int gain, int out, int in, int option);
+int avsys_audio_path_ex_get_path(int *gain, int *out, int *in, int *option);
+int avsys_audio_path_manage_earjack(void);
+int avsys_audio_path_ex_set_amp(const int onoff);
+int avsys_audio_path_ex_set_mute(const int mute);
+int avsys_audio_path_ex_get_mute(int *mute);
+int avsys_audio_path_set_volume(int handle);
+
+int avsys_audio_path_earjack_init(int *init_type, int *outfd);
+int avsys_audio_path_earjack_wait(int fd, int *current_type, int *new_type, int *is_auto_mute);
+int avsys_audio_path_earjack_process(int new_type);
+int avsys_audio_path_earjack_deinit(int fd);
+int avsys_audio_path_earjack_unlock(void);
+
+int avsys_audio_path_set_route_policy(avsys_audio_route_policy_t route);
+int avsys_audio_path_get_route_policy(avsys_audio_route_policy_t *route);
+int avsys_audio_path_check_loud(bool *loud);
+int avsys_audio_path_check_cp_audio(bool *cpaudio, bool *btpath);
+int avsys_audio_path_set_single_ascn(char *str);
+
+#endif /* __AVSYS_AUDIO_PATH_H__ */
diff --git a/include/avsys-audio-shm.h b/include/avsys-audio-shm.h
new file mode 100644
index 0000000..9edde57
--- /dev/null
+++ b/include/avsys-audio-shm.h
@@ -0,0 +1,44 @@
+/*
+ * avsystem
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jonghyuk Choi <jhchoi.choi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __AVSYS_AUDIO_SHM_H__
+#define __AVSYS_AUDIO_SHM_H__
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+typedef enum {
+ AVSYS_AUDIO_SHM_IDEN_HANDLE,
+ AVSYS_AUDIO_SHM_IDEN_PATH,
+ AVSYS_AUDIO_SHM_IDEN_LVOLUME,
+ AVSYS_AUDIO_SHM_IDEN_CNT
+} avsys_audio_shm_iden_t;
+
+int avsys_audio_create_shm(const avsys_audio_shm_iden_t iden);
+int avsys_audio_remove_shm(const avsys_audio_shm_iden_t iden);
+int avsys_audio_get_shm(const avsys_audio_shm_iden_t iden, void **ptr);
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif /* __AVSYS_AUDIO_SHM_H__ */
diff --git a/include/avsys-audio-sync.h b/include/avsys-audio-sync.h
new file mode 100644
index 0000000..d55d5a1
--- /dev/null
+++ b/include/avsys-audio-sync.h
@@ -0,0 +1,47 @@
+/*
+ * avsystem
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jonghyuk Choi <jhchoi.choi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __AVSYS_AUDIO_SYNC_H__
+#define __AVSYS_AUDIO_SYNC_H__
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+typedef enum {
+ AVSYS_AUDIO_SYNC_IDEN_HANDLE,
+ AVSYS_AUDIO_SYNC_IDEN_PATH,
+ AVSYS_AUDIO_SYNC_IDEN_SOUNDPATH,
+ AVSYS_AUDIO_SYNC_IDEN_VOLUME,
+ AVSYS_AUDIO_SYNC_IDEN_CNT
+} avsys_audio_sync_iden_t;
+
+int avsys_audio_create_sync(const avsys_audio_sync_iden_t iden);
+int avsys_audio_remove_sync(const avsys_audio_sync_iden_t iden);
+int avsys_audio_lock_sync(const avsys_audio_sync_iden_t iden);
+int avsys_audio_unlock_sync(const avsys_audio_sync_iden_t iden);
+int avsys_check_process(int check_pid);
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif /* __AVSYS_AUDIO_SYNC_H__ */
diff --git a/include/avsys-audio.h b/include/avsys-audio.h
new file mode 100644
index 0000000..3853f46
--- /dev/null
+++ b/include/avsys-audio.h
@@ -0,0 +1,600 @@
+/*
+ * avsystem
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jonghyuk Choi <jhchoi.choi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __AVSYS_AUDIO_H__
+#define __AVSYS_AUDIO_H__
+
+#include "avsys-types.h"
+#include "avsys-error.h"
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+/**
+ @addtogroup AVSYSTEM
+ @{
+
+ @par
+ This part describes the interface with audio input/output.
+ */
+
+#define AVSYS_AUDIO_VOLUME_MAX_MULTIMEDIA 16
+#define AVSYS_AUDIO_VOLUME_MAX_BASIC 8
+#define AVSYS_AUDIO_VOLUME_MAX_SINGLE 1
+
+/**
+ * Enumerations for audio mode
+ */
+enum avsys_audio_mode_t {
+ AVSYS_AUDIO_MODE_OUTPUT, /**< Output mode of handle */
+ AVSYS_AUDIO_MODE_OUTPUT_CLOCK, /**< Output mode of gst audio only mode */
+ AVSYS_AUDIO_MODE_OUTPUT_VIDEO, /**< Output mode of gst video mode */
+ AVSYS_AUDIO_MODE_OUTPUT_LOW_LATENCY, /**< Output mode for low latency play mode. typically for game */
+ AVSYS_AUDIO_MODE_INPUT, /**< Input mode of handle */
+ AVSYS_AUDIO_MODE_INPUT_HIGH_LATENCY, /**< Input mode for high latency capture mode. */
+ AVSYS_AUDIO_MODE_INPUT_LOW_LATENCY, /**< Input mode for low latency capture mode. typically for VoIP */
+ AVSYS_AUDIO_MODE_CALL_OUT, /**< for voice call establish */
+ AVSYS_AUDIO_MODE_CALL_IN, /**< for voice call establish */
+ AVSYS_AUDIO_MODE_OUTPUT_AP_CALL, /**< for VT call on thin modem */
+ AVSYS_AUDIO_MODE_INPUT_AP_CALL, /**< for VT call on thin modem */
+ AVSYS_AUDIO_MODE_NUM, /**< Number of mode */
+};
+
+/**
+ * Enumerations for audio format
+ */
+enum avsys_audio_format_t {
+ AVSYS_AUDIO_FORMAT_UNKNOWN = -1, /**< Invalid audio format */
+ AVSYS_AUDIO_FORMAT_8BIT, /**< Unsigned 8Bit */
+ AVSYS_AUDIO_FORMAT_16BIT, /**< Signed 16bit Little Endian */
+ AVSYS_AUDIO_FORMAT_MIN = AVSYS_AUDIO_FORMAT_8BIT, /**< Minimum value 8-bit integer per sample */
+ AVSYS_AUDIO_FORMAT_MAX = AVSYS_AUDIO_FORMAT_16BIT, /**< Maximum value 16-bit integer per sample */
+};
+
+
+/*
+ * Enums for volume types
+ */
+enum avsys_audio_volume_type_t {
+ AVSYS_AUDIO_VOLUME_TYPE_SYSTEM,
+ AVSYS_AUDIO_VOLUME_TYPE_NOTIFICATION,
+ AVSYS_AUDIO_VOLUME_TYPE_ALARM,
+ AVSYS_AUDIO_VOLUME_TYPE_RINGTONE,
+ AVSYS_AUDIO_VOLUME_TYPE_MEDIA,
+ AVSYS_AUDIO_VOLUME_TYPE_CALL,
+ AVSYS_AUDIO_VOLUME_TYPE_FIXED,
+ AVSYS_AUDIO_VOLUME_TYPE_EXT_SYSTEM_JAVA,
+ AVSYS_AUDIO_VOLUME_TYPE_MEDIA_HL,
+ AVSYS_AUDIO_VOLUME_TYPE_NUM,
+ AVSYS_AUDIO_VOLUME_TYPE_MAX = AVSYS_AUDIO_VOLUME_TYPE_NUM,
+ AVSYS_AUDIO_VOLUME_TYPE_EXT_SYSTEM_ANDROID = AVSYS_AUDIO_VOLUME_TYPE_FIXED,
+};
+
+enum avsys_audio_priority_t {
+ AVSYS_AUDIO_PRIORITY_0 = 0, /*< deprecated. use AVSYS_AUDIO_PRIORITY_NORMAL or AVSYS_AUDIO_PRIORITY_SOLO instead */
+ AVSYS_AUDIO_PRIORITY_NORMAL = AVSYS_AUDIO_PRIORITY_0,
+ AVSYS_AUDIO_PRIORITY_SOLO,
+ AVSYS_AUDIO_PRIORITY_SOLO_WITH_TRANSITION_EFFECT,
+ AVSYS_AUDIO_PRIORITY_MAX,
+};
+
+enum avsys_audio_device_t {
+ AVSYS_AUDIO_DEVICE_TYPE_SPK = 0,
+ AVSYS_AUDIO_DEVICE_TYPE_RECV,
+ AVSYS_AUDIO_DEVICE_TYPE_HEADSET,
+ AVSYS_AUDIO_DEVICE_TYPE_HANDSFREE,
+ AVSYS_AUDIO_DEVICE_TYPE_BT,
+ AVSYS_AUDIO_DEVICE_TYPE_NUM,
+ AVSYS_AUDIO_DEVICE_TYPE_MAX = AVSYS_AUDIO_DEVICE_TYPE_NUM,
+};
+
+/**
+ * Enumerations for audio channel
+ */
+enum avsys_audio_channel_t {
+ AVSYS_AUDIO_CHANNEL_LEFT, /**< front-left channel */
+ AVSYS_AUDIO_CHANNEL_RIGHT, /**< front-righth channel */
+ AVSYS_AUDIO_CHANNEL_NUM, /**< Number of channels */
+};
+
+/**
+ * Enumerations for audio mute condition
+ */
+enum avsys_audio_mute_t {
+ AVSYS_AUDIO_UNMUTE = 0, /**< Unmute state */
+ AVSYS_AUDIO_MUTE, /**< Mute state */
+ AVSYS_AUDIO_UNMUTE_NOLOCK, /** < Unmute without lock */
+ AVSYS_AUDIO_MUTE_NOLOCK, /** < Mute without lock */
+};
+
+/**
+ * Enumerations for priority command
+ */
+enum avsys_audio_priority_cmd_t {
+ AVSYS_AUDIO_SET_PRIORITY = 0, /**< Command set priority */
+ AVSYS_AUDIO_UNSET_PRIORITY, /**< Command unset priority */
+};
+
+/**
+ * Structure for sound device parameters.
+ */
+typedef struct {
+ int mode; /**< Open mode (In/Out) */
+ int priority; /**< Priority of sound handle */
+ int channels; /**< Number of channels */
+ int samplerate; /**< Sampling rate */
+ int format; /**< Sampling format */
+ int bluetooth; /**< Handle route information. refer. avsys_audio_handle_route_t */
+ int vol_type; /**< volume type */
+ int allow_mix;
+} avsys_audio_param_t;
+
+
+/**
+ * Structure for volume information.
+ */
+typedef struct {
+ int level[AVSYS_AUDIO_CHANNEL_NUM]; /**< Array of volume level for each channel */
+} avsys_audio_volume_t;
+
+/* NEW PATH DEFINE */
+ /**
+ *
+ */
+enum avsys_audio_path_ex {
+ AVSYS_AUDIO_PATH_EX_NONE = 0,
+ AVSYS_AUDIO_PATH_EX_SPK,
+ AVSYS_AUDIO_PATH_EX_RECV,
+ AVSYS_AUDIO_PATH_EX_HEADSET,
+ AVSYS_AUDIO_PATH_EX_BTHEADSET,
+ AVSYS_AUDIO_PATH_EX_A2DP,
+ AVSYS_AUDIO_PATH_EX_HANDSFREE,
+ AVSYS_AUDIO_PATH_EX_HDMI,
+ AVSYS_AUDIO_PATH_EX_OUTMAX,
+ AVSYS_AUDIO_PATH_EX_MIC = 1,
+ AVSYS_AUDIO_PATH_EX_HEADSETMIC,
+ AVSYS_AUDIO_PATH_EX_BTMIC,
+ AVSYS_AUDIO_PATH_EX_FMINPUT,
+ AVSYS_AUDIO_PATH_EX_HANDSFREEMIC,
+ AVSYS_AUDIO_PATH_EX_INMAX,
+};
+
+enum avsys_audio_gain_ex {
+ AVSYS_AUDIO_GAIN_EX_KEYTONE = 0,
+ AVSYS_AUDIO_GAIN_EX_RINGTONE,
+ AVSYS_AUDIO_GAIN_EX_ALARMTONE,
+ AVSYS_AUDIO_GAIN_EX_CALLTONE,
+ AVSYS_AUDIO_GAIN_EX_AUDIOPLAYER,
+ AVSYS_AUDIO_GAIN_EX_VIDEOPLAYER,
+ AVSYS_AUDIO_GAIN_EX_VOICECALL,
+ AVSYS_AUDIO_GAIN_EX_VIDEOCALL,
+ AVSYS_AUDIO_GAIN_EX_FMRADIO,
+ AVSYS_AUDIO_GAIN_EX_VOICEREC,
+ AVSYS_AUDIO_GAIN_EX_CAMCORDER,
+ AVSYS_AUDIO_GAIN_EX_CAMERA,
+ AVSYS_AUDIO_GAIN_EX_GAME,
+ AVSYS_AUDIO_GAIN_EX_MAX,
+ AVSYS_AUDIO_GAIN_EX_PDA_PLAYBACK = AVSYS_AUDIO_GAIN_EX_KEYTONE,
+};
+
+typedef enum {
+ AVSYS_AUDIO_EXT_DEVICE_FMRADIO = 0,
+ AVSYS_AUDIO_EXT_DEVICE_NUM
+}avsysaudio_ext_device_t;
+
+
+typedef enum {
+ AVSYS_AUDIO_ROUTE_POLICY_DEFAULT,
+ AVSYS_AUDIO_ROUTE_POLICY_IGNORE_A2DP,
+ AVSYS_AUDIO_ROUTE_POLICY_HANDSET_ONLY,
+ AVSYS_AUDIO_ROUTE_POLICY_MAX,
+}avsys_audio_route_policy_t; /* system global configuration */
+
+enum avsys_audio_handle_route_t{
+ AVSYS_AUDIO_HANDLE_ROUTE_FOLLOWING_POLICY,
+ AVSYS_AUDIO_HANDLE_ROUTE_HANDSET_ONLY,
+}; /* custom routing per handle */
+
+typedef enum {
+ AVSYS_AUDIO_ROUTE_DEVICE_UNKNOWN = -1,
+ AVSYS_AUDIO_ROUTE_DEVICE_HANDSET,
+ AVSYS_AUDIO_ROUTE_DEVICE_BLUETOOTH,
+ AVSYS_AUDIO_ROUTE_DEVICE_EARPHONE,
+ AVSYS_AUDIO_ROUTE_DEVICE_NUM,
+}avsys_audio_playing_devcie_t;/* routing device */
+
+/* path option */
+#define AVSYS_AUDIO_PATH_OPTION_NONE 0x00000000 /*!< Sound path option none */
+#define AVSYS_AUDIO_PATH_OPTION_JACK_AUTO 0x00000001 /*!< Sound path auto change between SPK/Recv and headset */
+#define AVSYS_AUDIO_PATH_OPTION_DUAL_OUT 0x00000002 /*!< SPK or Recv with headset sound path. used for Ringtone or Alarm */
+#define AVSYS_AUDIO_PATH_OPTION_LEFT_SPK_ONLY 0x00000004 /*!< AP playback left speaker only */
+#define AVSYS_AUDIO_PATH_OPTION_RIGHT_SPK_ONLY 0x00000008 /*!< AP playback right speaker only */
+#define AVSYS_AUDIO_PATH_OPTION_VOICECALL_REC 0x00000010 /*!< Voice call recording path option */
+#define AVSYS_AUDIO_PATH_OPTION_USE_SUBMIC 0x00000020 /*!< Use sub-mic when call or recording */
+#define AVSYS_AUDIO_PATH_OPTION_USE_STEREOMIC 0x00000040 /*!< Use stereo mic when recording */
+#define AVSYS_AUDIO_PATH_OPTION_FORCED 0x01000000 /*!< Forced sound path setting. only for booting animation */
+#define AVSYS_AUDIO_PATH_OPTION_LEGACY_MODE 0x10000000 /*!< Now Plus Style */
+
+
+/**
+ * This function make instance for audio system, and retreives handle.
+ *
+ * @param param [in] Parameters of audio system.
+ * @param phandle [out] Handle of audio system.
+ * @param size [out] Recomended buffer size.
+ *
+ * @return This function returns AVSYS_STATE_SUCCESS on success, or negative
+ * value with error code.
+ * on failure.
+ * @remark
+ * @see
+ */
+int avsys_audio_open(avsys_audio_param_t *param, avsys_handle_t *phandle, int *size);
+
+/**
+ * This function is to close sound handle and release allocated resources.
+ *
+ * @param handle [in] Handle of audio system
+ *
+ * @return This function returns AVSYS_STATE_SUCCESS on success, or negative
+ * value with error code.
+ * @remark
+ * @see
+ */
+int avsys_audio_close(avsys_handle_t handle);
+
+/**
+ * This function is to stop playback stream immediately. this drops all buffer remaining data.
+ *
+ * @param handle [in] Playback handle of audio system
+ *
+ * @return This function returns AVSYS_STATE_SUCCESS on success, or negative
+ * value with error code.
+ * @remark
+ * @see
+ */
+int avsys_audio_flush(avsys_handle_t handle);
+
+/**
+ * This function is to stop playback stream after all remaining buffer data played.
+ *
+ * @param handle [in] Playback handle of audio system
+ *
+ * @return This function returns AVSYS_STATE_SUCCESS on success, or negative
+ * value with error code.
+ * @remark
+ * @see
+ */
+int avsys_audio_drain(avsys_handle_t handle);
+
+/**
+ * This function is turn on speaker amp.
+ *
+ *
+ * @return This function returns AVSYS_STATE_SUCCESS on success, or negative
+ * value with error code.
+ * @remark
+ * @see
+ */
+int avsys_audio_ampon(void) __attribute__((deprecated));
+
+/**
+ * This function is turn off speaker amp.
+ *
+ * @return This function returns AVSYS_STATE_SUCCESS on success, or negative
+ * value with error code.
+ * @remark
+ * @see
+ */
+int avsys_audio_ampoff(void) __attribute__((deprecated));
+
+/**
+ * This function is to read pcm data from sound handle.
+ *
+ * @param handle [in] Handle of audio system
+ * @param buf [in] Buffer of audio data to read
+ * @param size [in] Size of buffer
+ *
+ * @return This function returns number of bytes read, or negative value with
+ * error code on failure.
+ * @remark
+ * @see
+ */
+int avsys_audio_read(avsys_handle_t handle, void *buf, int size);
+
+/**
+ * This function is to write audio data to sound handle.
+ *
+ * @param handle [in] Handle of audio system
+ * @param buf [in] Buffer of audio data to write
+ * @param size [in] Size of buffer
+ *
+ * @return This function returns number of bytes written, or negative value
+ * with error code on failure.
+ * @remark
+ * @see
+ */
+int avsys_audio_write(avsys_handle_t handle, void *buf, int size);
+
+int avsys_audio_set_volume_table(int gain_type, int dev_type, int step, int lv, int rv);
+int avsys_audio_get_volume_table(int gain_type, int dev_type, int step, int *lv, int *rv);
+
+int avsys_audio_set_volume_fadeup(avsys_handle_t handle);
+
+/**
+ * This function is to get volume max.
+ *
+ * @param vol_type [in] Type of volume table
+ * @param max [out] number of volume steps
+ *
+ * @return This function returns AVSYS_STATE_SUCCESS on success, or negative
+ * value with error code.
+ * @remark
+ * @see
+ */
+int avsys_audio_get_volume_max_ex(int volume_table, int *max_step);
+
+/**
+ * This function is to set relative mute of sound handle.
+ *
+ * @param handle [in] Handle of audio system
+ * @param mute [in] Mute information to set
+ *
+ * @return This function returns AVSYS_STATE_SUCCESS on success, or negative
+ * value with error code.
+ * @remark
+ * mute is AVSYS_AUDIO_MUTE : mute
+ * mute is AVSYS_AUDIO_UNMUTE : unmute
+ * @see
+ */
+int avsys_audio_set_mute(avsys_handle_t handle, int mute);
+
+
+/**
+ * This function is to set mute of sound handle with fade out effect.
+ *
+ * @param handle [in] Handle of audio system
+ *
+ * @return This function returns AVSYS_STATE_SUCCESS on success, or negative
+ * value with error code.
+ * @remark
+ * @see
+ */
+int avsys_audio_set_mute_fadedown(avsys_handle_t handle);
+
+/**
+ * This function is to get relative mute of sound handle.
+ *
+ * @param handle [in] Handle of audio system
+ * @param pmute [out] Pointer to mute information to retrieve
+ *
+ * @return This function returns AVSYS_STATE_SUCCESS on success, or negative
+ * value with error code.
+ * @remark
+ * pmute is AVSYS_AUDIO_MUTE : mute
+ * pmute is AVSYS_AUDIO_UNMUTE : unmute
+ * @see avsys_audio_mute_t
+ */
+int avsys_audio_get_mute(avsys_handle_t handle, int* pmute);
+
+
+/**
+ * This function is to set amp on external device
+ *
+ * @param device [in] External audio device type
+ *
+ * @return This function returns AVSYS_STATE_SUCCESS on success, or negative
+ * value with error code.
+ * @remark
+ * mute is AVSYS_AUDIO_MUTE : mute
+ * mute is AVSYS_AUDIO_UNMUTE : unmute
+ * @see avsysaudio_ext_device_t
+ */
+int avsys_audio_ext_device_ampon(avsysaudio_ext_device_t device);
+
+/**
+ * This function is to set amp off external device
+ *
+ * @param device [in] External audio device type
+ *
+ * @return This function returns AVSYS_STATE_SUCCESS on success, or negative
+ * value with error code.
+ * @remark
+ * pmute is AVSYS_AUDIO_MUTE : mute
+ * pmute is AVSYS_AUDIO_UNMUTE : unmute
+ * @see avsysaudio_ext_device_t
+ */
+int avsys_audio_ext_device_ampoff(avsysaudio_ext_device_t device);
+
+/**
+ * This function is to set status of external device
+ *
+ * @param device [in] External audio device type
+ * @param onoff [in] 1 for on , 0 for off
+ *
+ * @return This function returns AVSYS_STATE_SUCCESS on success, or negative
+ * value with error code.
+ * @remark
+ * @see avsysaudio_ext_device_t
+ */
+int avsys_audio_set_ext_device_status(avsysaudio_ext_device_t device_type, int onoff);
+
+/**
+ * This function is to get status of external device
+ *
+ * @param device [in] External audio device type
+ * @param onoff [out] 1 for on , 0 for off
+ *
+ * @return This function returns AVSYS_STATE_SUCCESS on success, or negative
+ * value with error code.
+ * @remark
+ * @see avsys_audio_set_ext_device_status
+ */
+int avsys_audio_get_ext_device_status(avsysaudio_ext_device_t device_type, int *onoff);
+/**
+ * This function is to set sound path of sound device.
+ *
+ * @param path [in] value of sound gain
+ * @param output [in] value of output device
+ * @param input [in] value of input device
+ * @param option [in] value of sound path option
+ *
+ * @return This function returns AVSYS_STATE_SUCCESS on success, or negative
+ * value with error code.
+ * AVSYS_STATE_ERR_RANGE_OVER : input path value is invalid range
+ * AVSYS_STATE_ERR_INTERNAL : internal device error
+ * @remark
+ * @see
+ */
+int avsys_audio_set_path_ex(int gain, int out, int in, int option);
+
+/**
+ * This function is to get sound path of sound device.
+ *
+ * @param path [out] value of sound gain
+ * @param output [out] value of output device
+ * @param input [out] value of input device
+ * @param option [out] value of sound path option
+ *
+ * @return This function returns AVSYS_STATE_SUCCESS on success, or negative
+ * value with error code.
+ * AVSYS_STATE_ERR_INTERNAL : internal device error
+ * @remark
+ * @see
+ */
+int avsys_audio_get_path_ex(int *gain, int *out, int *in, int *option);
+
+/**
+ * This function is to set relative global mute of sound device.
+ *
+ * @param mute [in] Global mute information to retreive
+ *
+ * @return This function returns AVSYS_STATE_SUCCESS on success, or negative
+ * value with error code.
+ * @remark
+ * mute is avsys_audio_mute_disable : unmute
+ * mute is avsys_audio_mute_enable : mute
+ * others : ignore
+ * @see avsys_audio_mute_t
+ */
+int avsys_audio_set_global_mute(int mute);
+
+/**
+ * This function is to get relative global mute of sound device.
+ *
+ * @param pmute [out] Pointer to global mute information to retreive
+ *
+ * @return This function returns AVSYS_STATE_SUCCESS on success, or negative
+ * value with error code.
+ * @remark
+ * *pbmute is avsys_audio_mute_disable or avsys_audio_mute_enable
+ * @see
+ */
+int avsys_audio_get_global_mute(int* pmute);
+
+/**
+ * This function is to get number of remaining audio frames in hw buffer.
+ *
+ * @param handle [in] handle to get delay frames
+ * @param frame_delay [out] value of number of remaining audio frames
+ *
+ * @return This function returns AVSYS_STATE_SUCCESS on success, or negative
+ * value with error code.
+ * @remark
+ * @see
+ */
+int avsys_audio_delay(avsys_handle_t handle, int *frame_delay);
+
+/**
+ * This function is to reset audio stream. (drops all remaining audio frames in device buffer)
+ *
+ * @param handle [in] handle to reset
+ *
+ * @return This function returns AVSYS_STATE_SUCCESS on success, or negative
+ * value with error code.
+ * @remark
+ * @see
+ */
+int avsys_audio_reset(avsys_handle_t handle);
+
+/**
+ * This function is to get period time and buffer time of audio stream.
+ *
+ * @param handle [in] handle to get period & buffer time
+ * @param period_time [out] value of period time in microsecond.
+ * @param buffer_time [out] value of buffer time in microsecond.
+ *
+ * @return This function returns AVSYS_STATE_SUCCESS on success, or negative
+ * value with error code.
+ * @remark
+ * @see
+ */
+int avsys_audio_get_period_buffer_time(avsys_handle_t handle, unsigned int *period_time, unsigned int *buffer_time);
+
+/**
+ * This function is to get playback audio device information of system.
+ *
+ * @param dev [out] current playback device type
+ *
+ * @return This function returns AVSYS_STATE_SUCCESS on success, or negative
+ * value with error code.
+ * @remark
+ * @see avsys_audio_playing_devcie_t
+ */
+int avsys_audio_get_playing_device_info(avsys_audio_playing_devcie_t *dev);
+
+/**
+ * This function is to get audio capturing status of system.
+ *
+ * @param on_capture [out] capture status.
+ * zero if there is no capture instance.
+ * positive value if there is capture instance
+ *
+ * @return This function returns AVSYS_STATE_SUCCESS on success, or negative
+ * value with error code.
+ * @remark
+ * @see
+ */
+int avsys_audio_get_capture_status(int *on_capture);
+
+int avsys_audio_earjack_manager_init(int *earjack_type, int *waitfd);
+int avsys_audio_earjack_manager_wait(int waitfd, int *current_earjack_type, int *new_earjack_type, int *need_mute);
+int avsys_audio_earjack_manager_process(int new_earjack_type);
+int avsys_audio_earjack_manager_deinit(int waitfd);
+int avsys_audio_earjack_manager_unlock(void);
+
+int avsys_audio_set_route_policy(avsys_audio_route_policy_t route);
+int avsys_audio_get_route_policy(avsys_audio_route_policy_t *route);
+int avsys_audio_get_current_playing_volume_type(int *volume_type);
+int avsys_audio_set_volume_by_type(const int volume_type, const int volume_value);
+int avsys_audio_set_primary_volume(const int pid, const int type);
+int avsys_audio_clear_primary_volume(const int pid);
+int avsys_audio_hibernation_reset(int *vol);
+/**
+ @}
+ */
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif /* __AVSYS_AUDIO_H__ */
diff --git a/include/avsys-common.h b/include/avsys-common.h
new file mode 100644
index 0000000..b7ad027
--- /dev/null
+++ b/include/avsys-common.h
@@ -0,0 +1,80 @@
+/*
+ * avsystem
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jonghyuk Choi <jhchoi.choi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __AVSYS_COMMON_H__
+#define __AVSYS_COMMON_H__
+
+#include <stdlib.h>
+#include <sys/syscall.h>
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+#define EXPORT_API __attribute__((__visibility__("default")))
+
+#define AVSYS_MAGIC_START "TSVA"
+#define AVSYS_MAGIC_END "NEVA"
+
+#define AVSYS_KEY_PREFIX_AUDIO 0x10
+#define AVSYS_KEY_PREFIX_GEN(X,Y) ((X) + (Y))
+
+typedef struct {
+ char *key_path;
+ int key_prefix;
+ int size;
+} avsys_shm_param_t;
+
+typedef struct {
+ char *key_path;
+ int key_prefix;
+} avsys_sync_param_t;
+
+
+#define LOCK_TIMEOUT_SEC 6
+
+/* get thread id : Not implemented 'gettid' at system libs. */
+#define avsys_gettid() (long int)syscall(__NR_gettid)
+
+/* memory */
+void * avsys_malloc(size_t size);
+void avsys_free(void *ptr);
+#define avsys_mem_check(ptr) ( (memcmp(AVSYS_MAGIC_START, ((char*)(ptr))-8, 4) == 0) && \
+ (memcmp(AVSYS_MAGIC_END, ((char*)(ptr))+(*((int*)((ptr)-4))), 4) == 0) )
+
+/* shared memory */
+int avsys_create_shm(const avsys_shm_param_t* param);
+int avsys_remove_shm(const avsys_shm_param_t* param);
+void* avsys_get_shm(const avsys_shm_param_t* param);
+
+/* Sync object */
+int avsys_create_sync(const avsys_sync_param_t *param);
+int avsys_remove_sync(const avsys_sync_param_t *param);
+int avsys_lock_sync(const avsys_sync_param_t *param);
+int avsys_unlock_sync(const avsys_sync_param_t *param);
+
+/* Privilege */
+int avsys_check_root_privilege(void);
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif /* __AVSYS_COMMON_H__ */
diff --git a/include/avsys-debug.h b/include/avsys-debug.h
new file mode 100644
index 0000000..6f19daa
--- /dev/null
+++ b/include/avsys-debug.h
@@ -0,0 +1,91 @@
+/*
+ * avsystem
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jonghyuk Choi <jhchoi.choi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/**
+ * This file defines the debug function of AV System.
+ *
+ * @file avsys_debug.h
+ * @version 0.1
+ */
+
+#ifndef __AVSYS_DEBUG_H__
+#define __AVSYS_DEBUG_H__
+
+#ifdef __USE_LOGMANAGER__
+#include <stdio.h>
+#include <mm_log.h>
+#define AVAUDIO LOG_AVAUDIO
+#define AVVIDEO LOG_AVVIDEO
+#define AVCAMERA LOG_AVCAMERA
+#else
+#define AVAUDIO
+#define AVVIDEO
+#define AVCAMERA
+#endif
+
+#ifdef __DEBUG_MODE__
+#ifdef __USE_LOGMANAGER__
+
+#define avsys_info_r(owner, msg, args...) log_print_rel( owner, LOG_CLASS_INFO, "[%05d:%s] "msg, __LINE__, __func__, ##args )
+#define avsys_warning_r(owner, msg, args...) log_print_rel( owner, LOG_CLASS_WARNING, "[%05d:%s] "msg, __LINE__, __func__, ##args )
+#define avsys_error_r(owner, msg, args...) log_print_rel( owner, LOG_CLASS_ERR, "[%05d:%s] "msg, __LINE__, __func__, ##args )
+#define avsys_critical_r(owner, msg, args...) log_print_rel( owner, LOG_CLASS_CRITICAL, "[%05d:%s] "msg, __LINE__, __func__, ##args )
+#define avsys_assert_r(condition) log_assert_rel(( condition ))
+
+#define avsys_info(owner, msg, args...) log_print_dbg( owner, LOG_CLASS_INFO, "[%05d:%s] "msg, __LINE__, __func__, ##args )
+#define avsys_warning(owner, msg, args...) log_print_dbg( owner, LOG_CLASS_WARNING, "[%05d:%s] "msg, __LINE__, __func__, ##args )
+#define avsys_error(owner, msg, args...) log_print_dbg( owner, LOG_CLASS_ERR, "[%05d:%s] "msg, __LINE__, __func__, ##args )
+#define avsys_critical(owner, msg, args...) log_print_dbg( owner, LOG_CLASS_CRITICAL, "[%05d:%s] "msg, __LINE__, __func__, ##args )
+#define avsys_assert(condition) log_assert_dbg( (condition) )
+
+#else /* __USE_LOGMANAGER__ */
+
+#define avsys_info_r(owner, msg, args...) fprintf(stderr, msg, ##args)
+#define avsys_warning_r(owner, msg, args...) fprintf(stderr, msg, ##args)
+#define avsys_error_r(owner, msg, args...) fprintf(stderr, msg, ##args)
+#define avsys_critical_r(owner, msg, args...) fprintf(stderr, msg, ##args)
+#define avsys_assert_r(condition) (condition)
+
+#define avsys_info(owner, msg, args...) fprintf(stderr, msg, ##args)
+#define avsys_warning(owner, msg, args...) fprintf(stderr, msg, ##args)
+#define avsys_error(owner, msg, args...) fprintf(stderr, msg, ##args)
+#define avsys_critical(owner, msg, args...) fprintf(stderr, msg, ##args)
+#define avsys_assert(condition) (condition)
+
+#endif /* __USE_LOGMANAGER__ */
+
+#else /* __DEBUG_MODE__ */
+
+#define avsys_info_r(owner, msg, args...)
+#define avsys_warning_r(owner, msg, args...)
+#define avsys_error_r(owner, msg, args...)
+#define avsys_critical_r(owner, msg, args...)
+#define avsys_assert_r(condition) (condition)
+
+#define avsys_info(owner, msg, args...)
+#define avsys_warning(owner, msg, args...)
+#define avsys_error(owner, msg, args...)
+#define avsys_critical(owner, msg, args...)
+#define avsys_assert(condition) (condition)
+
+#endif /* __DEBUG_MODE__ */
+
+#endif /* __AVSYS_DEBUG_H__ */
diff --git a/include/avsys-error.h b/include/avsys-error.h
new file mode 100644
index 0000000..1be188c
--- /dev/null
+++ b/include/avsys-error.h
@@ -0,0 +1,130 @@
+/*
+ * avsystem
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jonghyuk Choi <jhchoi.choi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __AVSYS_ERROR_H__
+#define __AVSYS_ERROR_H__
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+/**
+ * AVSYS CLASS
+ */
+#define AVSYS_STATE_SUCCESS (0x00000000) /**< No Error */
+#define AVSYS_STATE_ERROR (0x80000000) /**< Error Class */
+#define AVSYS_STATE_WARING (0x70000000) /**< Waring Class */
+
+/*
+ * Detail enumeration
+ */
+enum {
+ AVSYS_IN_UNKNOWN = 0,
+ AVSYS_IN_PARAMETER,
+ AVSYS_IN_HANDLE,
+ AVSYS_IN_POINTER,
+ AVSYS_IN_VALUE,
+ AVSYS_IN_OVERRUN,
+ AVSYS_IN_UNDERRUN,
+ AVSYS_IN_RANGE_OVER,
+ AVSYS_IN_RANGE_UNDER,
+ AVSYS_IN_MODE,
+ AVSYS_IN_FORMAT,
+ AVSYS_IN_CHANNEL,
+ AVSYS_IN_SAMPLERATE,
+ AVSYS_IN_LAYER,
+ AVSYS_IN_ROTATE,
+ AVSYS_IN_ALLOC,
+ AVSYS_IN_INTERNAL,
+ /*Extra state for camera*/
+ AVSYS_IN_IO_CONTROL,
+ AVSYS_IN_DEVICE,
+ AVSYS_IN_WAIT_RES,
+ AVSYS_IN_SUPPORT,
+ AVSYS_IN_STATE,
+ AVSYS_IN_PRIVILEGE,
+};
+
+/*
+ * AVSYS_WARING
+ */
+#define AVSYS_STATE_WAR_INVALID_PARAMETER (AVSYS_STATE_WARING | AVSYS_IN_PARAMETER)
+#define AVSYS_STATE_WAR_INVALID_HANDLE (AVSYS_STATE_WARING | AVSYS_IN_HANDLE)
+#define AVSYS_STATE_WAR_INVALID_VALUE (AVSYS_STATE_WARING | AVSYS_IN_VALUE)
+#define AVSYS_STATE_WAR_INVALID_MODE (AVSYS_STATE_WARING | AVSYS_IN_MODE)
+#define AVSYS_STATE_WAR_INVALID_FORMAT (AVSYS_STATE_WARING | AVSYS_IN_FORMAT)
+#define AVSYS_STATE_WAR_INVALID_CHANNEL (AVSYS_STATE_WARING | AVSYS_IN_CHANNEL)
+#define AVSYS_STATE_WAR_INVALID_SAMPLERATE (AVSYS_STATE_WARING | AVSYS_IN_SAMPLERATE)
+#define AVSYS_STATE_WAR_INVALID_LAYER (AVSYS_STATE_WARING | AVSYS_IN_LAYER)
+#define AVSYS_STATE_WAR_INVALID_ROTATE (AVSYS_STATE_WARING | AVSYS_IN_ROTATE)
+#define AVSYS_STATE_WAR_NULL_POINTER (AVSYS_STATE_WARING | AVSYS_IN_POINTER)
+#define AVSYS_STATE_WAR_UNDERRUN (AVSYS_STATE_WARING | AVSYS_IN_UNDERRUN)
+#define AVSYS_STATE_WAR_OVERRUN (AVSYS_STATE_WARING | AVSYS_IN_OVERRUN)
+#define AVSYS_STATE_WAR_RANGE_OVER (AVSYS_STATE_WARING | AVSYS_IN_RANGE_OVER)
+#define AVSYS_STATE_WAR_RANGE_UNDER (AVSYS_STATE_WARING | AVSYS_IN_RANGE_UNDER)
+#define AVSYS_STATE_WAR_ALLOCATION (AVSYS_STATE_WARING | AVSYS_IN_ALLOC)
+#define AVSYS_STATE_WAR_INTERNAL (AVSYS_STATE_WARING | AVSYS_IN_INTERNAL)
+/*Extra warning for camera*/
+#define AVSYS_STATE_WAR_IO_CONTROL (AVSYS_STATE_WARING | AVSYS_IN_IO_CONTROL)
+#define AVSYS_STATE_WAR_UNAVAILABLE_DEVICE (AVSYS_STATE_WARING | AVSYS_IN_DEVICE)
+#define AVSYS_STATE_WAR_DEVICE_WAIT_TIMEOUT (AVSYS_STATE_WARING | AVSYS_IN_WAIT_RES)
+#define AVSYS_STATE_WAR_DEVICE_NOT_SUPPORT (AVSYS_STATE_WARING | AVSYS_IN_SUPPORT)
+#define AVSYS_STATE_WAR_INVALID_STATE_TRANSITION (AVSYS_STATE_WARING | AVSYS_IN_STATE)
+
+/**
+ * AVSYS_ERROR
+ */
+#define AVSYS_STATE_ERR_INVALID_PARAMETER (AVSYS_STATE_ERROR | AVSYS_IN_PARAMETER)
+#define AVSYS_STATE_ERR_INVALID_HANDLE (AVSYS_STATE_ERROR | AVSYS_IN_HANDLE)
+#define AVSYS_STATE_ERR_INVALID_VALUE (AVSYS_STATE_ERROR | AVSYS_IN_VALUE)
+#define AVSYS_STATE_ERR_INVALID_MODE (AVSYS_STATE_ERROR | AVSYS_IN_MODE)
+#define AVSYS_STATE_ERR_INVALID_FORMAT (AVSYS_STATE_ERROR | AVSYS_IN_FORMAT)
+#define AVSYS_STATE_ERR_INVALID_CHANNEL (AVSYS_STATE_ERROR | AVSYS_IN_CHANNEL)
+#define AVSYS_STATE_ERR_INVALID_SAMPLERATE (AVSYS_STATE_ERROR | AVSYS_IN_SAMPLERATE)
+#define AVSYS_STATE_ERR_INVALID_LAYER (AVSYS_STATE_ERROR | AVSYS_IN_LAYER)
+#define AVSYS_STATE_ERR_INVALID_ROTATE (AVSYS_STATE_ERROR | AVSYS_IN_ROTATE)
+#define AVSYS_STATE_ERR_NULL_POINTER (AVSYS_STATE_ERROR | AVSYS_IN_POINTER)
+#define AVSYS_STATE_ERR_UNDERRUN (AVSYS_STATE_ERROR | AVSYS_IN_UNDERRUN)
+#define AVSYS_STATE_ERR_OVERRUN (AVSYS_STATE_ERROR | AVSYS_IN_OVERRUN)
+#define AVSYS_STATE_ERR_RANGE_OVER (AVSYS_STATE_ERROR | AVSYS_IN_RANGE_OVER)
+#define AVSYS_STATE_ERR_RANGE_UNDER (AVSYS_STATE_ERROR | AVSYS_IN_RANGE_UNDER)
+#define AVSYS_STATE_ERR_ALLOCATION (AVSYS_STATE_ERROR | AVSYS_IN_ALLOC)
+#define AVSYS_STATE_ERR_INTERNAL (AVSYS_STATE_ERROR | AVSYS_IN_INTERNAL)
+#define AVSYS_STATE_ERR_UNKNOWN (AVSYS_STATE_ERROR | AVSYS_IN_UNKNOWN) /**< unknown error */
+/*Extra warning for camera*/
+#define AVSYS_STATE_ERR_IO_CONTROL (AVSYS_STATE_ERROR | AVSYS_IN_IO_CONTROL)
+#define AVSYS_STATE_ERR_UNAVAILABLE_DEVICE (AVSYS_STATE_ERROR | AVSYS_IN_DEVICE)
+#define AVSYS_STATE_ERR_DEVICE_WAIT_TIMEOUT (AVSYS_STATE_ERROR | AVSYS_IN_WAIT_RES)
+#define AVSYS_STATE_ERR_DEVICE_NOT_SUPPORT (AVSYS_STATE_ERROR | AVSYS_IN_SUPPORT)
+#define AVSYS_STATE_ERR_INVALID_STATE (AVSYS_STATE_ERROR | AVSYS_IN_STATE)
+#define AVSYS_STATE_ERR_PRIVILEGE (AVSYS_STATE_ERROR | AVSYS_IN_PRIVILEGE)
+
+
+#define AVSYS_FAIL(_A_) (AVSYS_STATE_ERROR & (_A_))
+#define AVSYS_SUCCESS(_A_) (!AVSYS_FAIL(_A_))
+#define AVSYS_WARING(_A_) (AVSYS_STATE_WARING & (_A_))
+#define AVSYS_ERROR(_A_) (AVSYS_STATE_ERROR & (_A_))
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif /* __AVSYS_ERROR_H__ */
diff --git a/include/avsys-types.h b/include/avsys-types.h
new file mode 100644
index 0000000..7e0066d
--- /dev/null
+++ b/include/avsys-types.h
@@ -0,0 +1,41 @@
+/*
+ * avsystem
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jonghyuk Choi <jhchoi.choi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __AVSYS_TYPES_H__
+#define __AVSYS_TYPES_H__
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+/**
+ * Type definition of av system handle.
+ */
+typedef void *avsys_handle_t;
+
+#define AVSYS_INVALID_HANDLE NULL
+#define AVSYS_AUDIO_INVALID_HANDLE (-1)
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif /* __AVSYS_TYPES_H__ */
diff --git a/include/avsystem.h b/include/avsystem.h
new file mode 100644
index 0000000..ca1195a
--- /dev/null
+++ b/include/avsystem.h
@@ -0,0 +1,37 @@
+/*
+ * avsystem
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jonghyuk Choi <jhchoi.choi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __AVSYSTEM_H__
+#define __AVSYSTEM_H__
+
+#include <avsys-types.h>
+#include <avsys-audio.h>
+#include <avsys-error.h>
+
+/**
+ @mainpage AV System
+
+ @par
+ This document provides necessary information for developers who are going
+ to use audio/video functionality.
+*/
+
+#endif /* __AVSYSTEM_H__ */