summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSeungbae Shin <seungbae.shin@samsung.com>2018-07-25 20:58:38 +0900
committerSeungbae Shin <seungbae.shin@samsung.com>2018-08-16 20:21:19 +0900
commita32a1e03387c57ce6c06ae9ca4fd976a17c9719e (patch)
tree810a466da47a684f31b76d9001fa008b0be16464 /include
parentd06767768203168895ae22481b4090121924feb3 (diff)
downloadmm-hal-interface-a32a1e03387c57ce6c06ae9ca4fd976a17c9719e.tar.gz
mm-hal-interface-a32a1e03387c57ce6c06ae9ca4fd976a17c9719e.tar.bz2
mm-hal-interface-a32a1e03387c57ce6c06ae9ca4fd976a17c9719e.zip
[Version] 0.0.13 [Profile] Common [Issue Type] Add [Dependency module] N/A Change-Id: I1c3bc6f1b84242ee04a4cfa1b5d8fd0432f0295e
Diffstat (limited to 'include')
-rw-r--r--include/audio/audio_hal_interface.h101
1 files changed, 101 insertions, 0 deletions
diff --git a/include/audio/audio_hal_interface.h b/include/audio/audio_hal_interface.h
new file mode 100644
index 0000000..e7bb157
--- /dev/null
+++ b/include/audio/audio_hal_interface.h
@@ -0,0 +1,101 @@
+/*
+ * audio_hal_interface.h
+ *
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Seungbae Shin <seungbae.shin@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.
+ *
+ */
+
+#include <tizen-audio.h>
+#include <stdbool.h>
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum _io_direction {
+ DIRECTION_IN,
+ DIRECTION_OUT,
+} io_direction_t;
+
+typedef enum _audio_hal_return {
+ AUDIO_HAL_ERROR = -1,
+ AUDIO_HAL_SUCCESS
+} audio_hal_return_t;
+
+typedef struct _hal_device_info {
+ const char *type;
+ uint32_t direction;
+ uint32_t id;
+} hal_device_info;
+
+typedef struct _hal_route_info {
+ const char *role;
+ hal_device_info *device_infos;
+ uint32_t num_of_devices;
+} hal_route_info;
+
+typedef struct _hal_route_option {
+ const char *role;
+ const char *name;
+ int32_t value;
+} hal_route_option;
+
+typedef struct _hal_stream_connection_info {
+ const char *role;
+ uint32_t direction;
+ uint32_t idx;
+ bool is_connected;
+} hal_stream_connection_info;
+
+typedef void* pcm_handle;
+typedef void (*hal_message_callback)(const char *name, int value, void *user_data);
+typedef struct _audio_hal_interface audio_hal_interface;
+
+int32_t audio_hal_interface_init(audio_hal_interface **h);
+int32_t audio_hal_interface_deinit(audio_hal_interface *h);
+int32_t audio_hal_interface_get_volume_level_max(audio_hal_interface *h, const char *volume_type, io_direction_t direction, uint32_t *level);
+int32_t audio_hal_interface_get_volume_level(audio_hal_interface *h, const char *volume_type, io_direction_t direction, uint32_t *level);
+int32_t audio_hal_interface_set_volume_level(audio_hal_interface *h, const char *volume_type, io_direction_t direction, uint32_t level);
+int32_t audio_hal_interface_get_volume_value(audio_hal_interface *h, const char *volume_type, const char *gain_type,
+ io_direction_t direction, uint32_t level, double *value);
+int32_t audio_hal_interface_get_volume_mute(audio_hal_interface *h, const char *volume_type, io_direction_t direction, uint32_t *mute);
+int32_t audio_hal_interface_set_volume_mute(audio_hal_interface *h, const char *volume_type, io_direction_t direction, uint32_t mute);
+int32_t audio_hal_interface_update_route(audio_hal_interface *h, hal_route_info *info);
+int32_t audio_hal_interface_update_route_option(audio_hal_interface *h, hal_route_option *option);
+int32_t audio_hal_interface_notify_stream_connection_changed(audio_hal_interface *h, hal_stream_connection_info *info);
+int32_t audio_hal_interface_pcm_open(audio_hal_interface *h, const char *card, const char *device, io_direction_t direction,
+ void *sample_spec, uint32_t period_size, uint32_t periods, pcm_handle *pcm_h);
+int32_t audio_hal_interface_pcm_start(audio_hal_interface *h, pcm_handle pcm_h);
+int32_t audio_hal_interface_pcm_stop(audio_hal_interface *h, pcm_handle pcm_h);
+int32_t audio_hal_interface_pcm_close(audio_hal_interface *h, pcm_handle pcm_h);
+int32_t audio_hal_interface_pcm_available(audio_hal_interface *h, pcm_handle pcm_h, uint32_t *available);
+int32_t audio_hal_interface_pcm_write(audio_hal_interface *h, pcm_handle pcm_h, const void *buffer, uint32_t frames);
+int32_t audio_hal_interface_pcm_read(audio_hal_interface *h, pcm_handle pcm_h, void *buffer, uint32_t frames);
+int32_t audio_hal_interface_pcm_get_fd(audio_hal_interface *h, pcm_handle pcm_h, int *fd);
+int32_t audio_hal_interface_pcm_recover(audio_hal_interface *h, pcm_handle pcm_h, int err);
+int32_t audio_hal_interface_pcm_get_params(audio_hal_interface *h, pcm_handle pcm_h, uint32_t direction, void **sample_spec,
+ uint32_t *period_size, uint32_t *periods);
+int32_t audio_hal_interface_pcm_set_params(audio_hal_interface *h, pcm_handle pcm_h, uint32_t direction, void *sample_spec,
+ uint32_t period_size, uint32_t periods);
+int32_t audio_hal_interface_add_message_callback(audio_hal_interface *h, hal_message_callback callback, void *user_data);
+int32_t audio_hal_interface_remove_message_callback(audio_hal_interface *h, hal_message_callback callback);
+
+#ifdef __cplusplus
+}
+#endif
+