summaryrefslogtreecommitdiff
path: root/tizen-audio.h
diff options
context:
space:
mode:
Diffstat (limited to 'tizen-audio.h')
-rw-r--r--tizen-audio.h45
1 files changed, 6 insertions, 39 deletions
diff --git a/tizen-audio.h b/tizen-audio.h
index 1e25b15..5b7b075 100644
--- a/tizen-audio.h
+++ b/tizen-audio.h
@@ -24,12 +24,9 @@
#include <stdlib.h>
#include <stdint.h>
-#define AUDIO_REVISION 1
-
/* Error code */
#define AUDIO_IS_ERROR(ret) (ret < 0)
-
typedef enum audio_return {
AUDIO_RET_OK = 0,
AUDIO_ERR_UNDEFINED = (int32_t)0x80001000,
@@ -45,18 +42,6 @@ typedef enum audio_direction {
AUDIO_DIRECTION_OUT, /**< Playback */
} audio_direction_t;
-typedef enum audio_route_flag {
- AUDIO_ROUTE_FLAG_NONE = 0,
- AUDIO_ROUTE_FLAG_MUTE_POLICY = 0x00000001,
- AUDIO_ROUTE_FLAG_DUAL_OUT = 0x00000002,
- AUDIO_ROUTE_FLAG_NOISE_REDUCTION = 0x00000010,
- AUDIO_ROUTE_FLAG_EXTRA_VOL = 0x00000020,
- AUDIO_ROUTE_FLAG_NETWORK_WB = 0x00000040,
- AUDIO_ROUTE_FLAG_BT_WB = 0x00000100,
- AUDIO_ROUTE_FLAG_BT_NREC = 0x00000200,
- AUDIO_ROUTE_FLAG_VOICE_COMMAND = 0x00040000,
-} audio_route_flag_t;
-
typedef enum audio_device_api {
AUDIO_DEVICE_API_UNKNOWN,
AUDIO_DEVICE_API_ALSA,
@@ -196,19 +181,9 @@ typedef enum audio_gain {
} audio_gain_t;
/* Overall */
-
-typedef struct audio_cb_interface {
- audio_return_t (*load_device)(void *platform_data, audio_device_info_t *device_info, audio_device_param_info_t *params);
- audio_return_t (*open_device)(void *platform_data, audio_device_info_t *device_info, audio_device_param_info_t *params);
- audio_return_t (*close_all_devices)(void *platform_data);
- audio_return_t (*close_device)(void *platform_data, audio_device_info_t *device_info);
- audio_return_t (*unload_device)(void *platform_data, audio_device_info_t *device_info);
-} audio_cb_interface_t;
-
typedef struct audio_interface {
- audio_return_t (*init)(void **userdata, void *platform_data);
+ audio_return_t (*init)(void **userdata);
audio_return_t (*deinit)(void **userdata);
- audio_return_t (*reset_volume)(void **userdata);
audio_return_t (*get_volume_level_max)(void *userdata, audio_volume_info_t *info, uint32_t *level);
audio_return_t (*get_volume_level)(void *userdata, audio_volume_info_t *info, uint32_t *level);
audio_return_t (*set_volume_level)(void *userdata, audio_volume_info_t *info, uint32_t level);
@@ -218,9 +193,8 @@ typedef struct audio_interface {
audio_return_t (*do_route)(void *userdata, audio_route_info_t *info);
audio_return_t (*update_route_option)(void *userdata, audio_route_option_t *option);
audio_return_t (*update_stream_connection_info) (void *userdata, audio_stream_info_t *info, uint32_t is_connected);
- audio_return_t (*alsa_pcm_open)(void *userdata, void **pcm_handle, char *device_name, uint32_t direction, int mode);
- audio_return_t (*alsa_pcm_close)(void *userdata, void *pcm_handle);
-
+ audio_return_t (*get_buffer_attr)(void *userdata, uint32_t direction, const char *latency, uint32_t samplerate, int format, uint32_t channels,
+ uint32_t *maxlength, uint32_t *tlength, uint32_t *prebuf, uint32_t* minreq, uint32_t *fragsize);
/* Interface of PCM device */
audio_return_t (*pcm_open)(void *userdata, void **pcm_handle, void *sample_spec, uint32_t direction);
audio_return_t (*pcm_start)(void *userdata, void *pcm_handle);
@@ -229,15 +203,10 @@ typedef struct audio_interface {
audio_return_t (*pcm_avail)(void *userdata, void *pcm_handle, uint32_t *avail);
audio_return_t (*pcm_write)(void *userdata, void *pcm_handle, const void *buffer, uint32_t frames);
audio_return_t (*pcm_read)(void *userdata, void *pcm_handle, void *buffer, uint32_t frames);
-
- audio_return_t (*get_buffer_attr)(void *userdata, uint32_t direction, const char *latency, uint32_t samplerate, audio_sample_format_t format, uint32_t channels, uint32_t *maxlength, uint32_t *tlength, uint32_t *prebuf, uint32_t* minreq, uint32_t *fragsize);
- audio_return_t (*set_callback)(void *userdata, audio_cb_interface_t *cb_interface);
} audio_interface_t;
-int audio_get_revision (void);
-audio_return_t audio_init (void **userdata, void *platform_data);
+audio_return_t audio_init (void **userdata);
audio_return_t audio_deinit (void **userdata);
-audio_return_t audio_reset_volume (void **userdata);
audio_return_t audio_get_volume_level_max (void *userdata, audio_volume_info_t *info, uint32_t *level);
audio_return_t audio_get_volume_level (void *userdata, audio_volume_info_t *info, uint32_t *level);
audio_return_t audio_set_volume_level (void *userdata, audio_volume_info_t *info, uint32_t level);
@@ -247,8 +216,8 @@ audio_return_t audio_set_volume_mute (void *userdata, audio_volume_info_t *info,
audio_return_t audio_do_route (void *userdata, audio_route_info_t *info);
audio_return_t audio_update_route_option (void *userdata, audio_route_option_t *option);
audio_return_t audio_update_stream_connection_info (void *userdata, audio_stream_info_t *info, uint32_t is_connected);
-audio_return_t audio_alsa_pcm_open (void *userdata, void **pcm_handle, char *device_name, uint32_t direction, int mode);
-audio_return_t audio_alsa_pcm_close (void *userdata, void *pcm_handle);
+audio_return_t audio_get_buffer_attr(void *userdata, uint32_t direction, const char *latency, uint32_t samplerate, int format, uint32_t channels,
+ uint32_t *maxlength, uint32_t *tlength, uint32_t *prebuf, uint32_t* minreq, uint32_t *fragsize);
audio_return_t audio_pcm_open (void *userdata, void **pcm_handle, void *sample_spec, uint32_t direction);
audio_return_t audio_pcm_start (void *userdata, void *pcm_handle);
audio_return_t audio_pcm_stop (void *userdata, void *pcm_handle);
@@ -256,6 +225,4 @@ audio_return_t audio_pcm_close (void *userdata, void *pcm_handle);
audio_return_t audio_pcm_avail (void *userdata, void *pcm_handle, uint32_t *avail);
audio_return_t audio_pcm_write (void *userdata, void *pcm_handle, const void *buffer, uint32_t frames);
audio_return_t audio_pcm_read (void *userdata, void *pcm_handle, void *buffer, uint32_t frames);
-audio_return_t audio_get_buffer_attr(void *userdata, uint32_t direction, const char *latency, uint32_t samplerate, audio_sample_format_t format, uint32_t channels, uint32_t *maxlength, uint32_t *tlength, uint32_t *prebuf, uint32_t* minreq, uint32_t *fragsize);
-audio_return_t audio_set_callback (void *userdata, audio_cb_interface_t *cb_interface);
#endif