Rename hal-manager to hal-interface 95/69895/1
authorSangchul Lee <sc11.lee@samsung.com>
Tue, 17 May 2016 08:03:05 +0000 (17:03 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Tue, 17 May 2016 08:17:28 +0000 (17:17 +0900)
[Version] 5.0.50
[Profile] Common
[Issue Type] Rename file and API

Change-Id: I7b180fbd40cd76788651da01ceec0ff35bf2c5cf
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
Makefile.am
packaging/pulseaudio-modules-tizen.spec
src/hal-interface.c [moved from src/hal-manager.c with 79% similarity]
src/hal-interface.h [new file with mode: 0644]
src/hal-manager.h [deleted file]
src/module-policy.c
src/module-tizenaudio-sink.c
src/module-tizenaudio-source.c
src/stream-manager-priv.h
src/stream-manager-volume.c
src/stream-manager.c

index 7eb6812..9832133 100644 (file)
@@ -30,7 +30,7 @@ MODULE_LDFLAGS = $(AM_LDFLAGS) -module -disable-static -avoid-version
 MODULE_LIBADD = $(AM_LIBADD) $(LIBLTDL)
 
 pulsemodlibexec_LTLIBRARIES = \
-               libhal-manager.la \
+               libhal-interface.la \
                module-tizenaudio-sink.la \
                module-tizenaudio-source.la \
                module-sound-player.la \
@@ -38,7 +38,7 @@ pulsemodlibexec_LTLIBRARIES = \
 
 # These are generated by an M4 script
 SYMDEF_FILES = \
-               libhal-manager-symdef.h \
+               libhal-interface-symdef.h \
                module-tizenaudio-sink-symdef.h \
                module-tizenaudio-source-symdef.h \
                module-sound-player-symdef.h \
@@ -55,20 +55,20 @@ $(SYMDEF_FILES): src/module-defs.h.m4
        $(AM_V_at)$(MKDIR_P) .
        $(AM_V_GEN)$(M4) -Dfname="$@" $< > $@
 
-libhal_manager_la_SOURCES = \
-          src/hal-manager.c   src/hal-manager.h
-libhal_manager_la_LDFLAGS = $(AM_LDFLAGS) $(PA_LDFLAGS) -avoid-version
-libhal_manager_la_LIBADD = $(AM_LIBADD) $(PACORE_LIBS) $(PA_LIBS)
-libhal_manager_la_CFLAGS = $(AM_CFLAGS) $(PACORE_CFLAGS) $(PA_CFLAGS)
+libhal_interface_la_SOURCES = \
+          src/hal-interface.c   src/hal-interface.h
+libhal_interface_la_LDFLAGS = $(AM_LDFLAGS) $(PA_LDFLAGS) -avoid-version
+libhal_interface_la_LIBADD = $(AM_LIBADD) $(PACORE_LIBS) $(PA_LIBS)
+libhal_interface_la_CFLAGS = $(AM_CFLAGS) $(PACORE_CFLAGS) $(PA_CFLAGS)
 
 module_tizenaudio_sink_la_SOURCES = src/module-tizenaudio-sink.c
 module_tizenaudio_sink_la_LDFLAGS = $(PACORE_LDFLAGS) $(PA_LDFLAGS) $(MODULE_LDFLAGS)
-module_tizenaudio_sink_la_LIBADD = $(PACORE_LIBS) $(PA_LIBS) $(MODULE_LIBADD) libhal-manager.la
+module_tizenaudio_sink_la_LIBADD = $(PACORE_LIBS) $(PA_LIBS) $(MODULE_LIBADD) libhal-interface.la
 module_tizenaudio_sink_la_CFLAGS = $(PACORE_CFLAGS) $(PA_CFLAGS) $(AM_CFLAGS)
 
 module_tizenaudio_source_la_SOURCES = src/module-tizenaudio-source.c
 module_tizenaudio_source_la_LDFLAGS = $(PACORE_LDFLAGS) $(PA_LDFLAGS) $(MODULE_LDFLAGS)
-module_tizenaudio_source_la_LIBADD = $(PACORE_LIBS) $(PA_LIBS) $(MODULE_LIBADD) libhal-manager.la
+module_tizenaudio_source_la_LIBADD = $(PACORE_LIBS) $(PA_LIBS) $(MODULE_LIBADD) libhal-interface.la
 module_tizenaudio_source_la_CFLAGS = $(PACORE_CFLAGS) $(PA_CFLAGS) $(AM_CFLAGS)
 
 module_sound_player_la_SOURCES = src/module-sound-player.c
@@ -85,6 +85,6 @@ module_policy_la_SOURCES = \
           src/device-manager.c   src/device-manager.h \
           src/subscribe-observer.c   src/subscribe-observer.h
 module_policy_la_LDFLAGS = $(MODULE_LDFLAGS) $(PACORE_LDFLAGS) $(PA_LDFLAGS) -L$(pulsemodlibexecdir)
-module_policy_la_LIBADD = $(AM_LIBADD) $(PACORE_LIBS) $(PA_LIBS) $(DBUS_LIBS) $(VCONF_LIBS) $(INIPARSER_LIBS) $(LIBJSON_LIBS) libhal-manager.la
+module_policy_la_LIBADD = $(AM_LIBADD) $(PACORE_LIBS) $(PA_LIBS) $(DBUS_LIBS) $(VCONF_LIBS) $(INIPARSER_LIBS) $(LIBJSON_LIBS) libhal-interface.la
 module_policy_la_CFLAGS = $(AM_CFLAGS) $(PACORE_CFLAGS) $(PA_CFLAGS) $(DBUS_CFLAGS) $(VCONF_CFLAGS) $(INIPARSER_CFLAGS) $(LIBJSON_CFLAGS)
 
index a978fab..94a97cd 100644 (file)
@@ -1,6 +1,6 @@
 Name:             pulseaudio-modules-tizen
 Summary:          Pulseaudio modules for Tizen
-Version:          5.0.49
+Version:          5.0.50
 Release:          0
 Group:            Multimedia/Audio
 License:          LGPL-2.1+
@@ -54,4 +54,4 @@ export LD_AS_NEEDED=0
 %defattr(-,root,root,-)
 %license LICENSE.LGPL-2.1+
 %{_libdir}/pulse-5.0/modules/module-*.so
-%{_libdir}/pulse-5.0/modules/libhal-manager.so
+%{_libdir}/pulse-5.0/modules/libhal-interface.so
similarity index 79%
rename from src/hal-manager.c
rename to src/hal-interface.c
index 75cbd05..2a1873f 100644 (file)
@@ -1,7 +1,7 @@
 /***
   This file is part of PulseAudio.
 
-  Copyright 2015 Sangchul Lee <sc11.lee@samsung.com>
+  Copyright 2015-2016 Sangchul Lee <sc11.lee@samsung.com>
 
   PulseAudio is free software; you can redistribute it and/or modify
   it under the terms of the GNU Lesser General Public License as published
 #include <config.h>
 #endif
 
-#include "hal-manager.h"
+#include "hal-interface.h"
 #include "tizen-audio.h"
 #include <pulsecore/shared.h>
 
-#define SHARED_HAL_MANAGER "tizen-hal-manager"
+#define SHARED_HAL_INTF "tizen-hal-interface"
 
 /* Audio HAL library */
 #define LIB_TIZEN_AUDIO "libtizen-audio.so"
 
-struct _pa_hal_manager {
+struct _pa_hal_interface {
     PA_REFCNT_DECLARE;
 
     pa_core *core;
@@ -41,19 +41,19 @@ struct _pa_hal_manager {
     audio_interface_t intf;
 };
 
-pa_hal_manager* pa_hal_manager_get(pa_core *core) {
-    pa_hal_manager *h;
+pa_hal_interface* pa_hal_interface_get(pa_core *core) {
+    pa_hal_interface *h;
 
     pa_assert(core);
 
-    if ((h = pa_shared_get(core, SHARED_HAL_MANAGER)))
-        return pa_hal_manager_ref(h);
+    if ((h = pa_shared_get(core, SHARED_HAL_INTF)))
+        return pa_hal_interface_ref(h);
 
-    h = pa_xnew0(pa_hal_manager, 1);
+    h = pa_xnew0(pa_hal_interface, 1);
     PA_REFCNT_INIT(h);
     h->core = core;
 
-    /* Load library & init HAL manager */
+    /* Load library & init HAL interface */
     h->dl_handle = dlopen(LIB_TIZEN_AUDIO, RTLD_NOW);
     if (h->dl_handle) {
         h->intf.init = dlsym(h->dl_handle, "audio_init");
@@ -83,20 +83,20 @@ pa_hal_manager* pa_hal_manager_get(pa_core *core) {
         h->intf.remove_message_cb = dlsym(h->dl_handle, "audio_remove_message_cb");
         if (h->intf.init) {
             if (h->intf.init(&h->ah_handle) != AUDIO_RET_OK)
-                pa_log_error("hal_manager init failed");
+                pa_log_error("hal_interface init failed");
         }
 
      } else {
-         pa_log_error("open hal_manager failed :%s", dlerror());
+         pa_log_error("open hal_interface failed :%s", dlerror());
          return NULL;
      }
 
-    pa_shared_set(core, SHARED_HAL_MANAGER, h);
+    pa_shared_set(core, SHARED_HAL_INTF, h);
 
     return h;
 }
 
-pa_hal_manager* pa_hal_manager_ref(pa_hal_manager *h) {
+pa_hal_interface* pa_hal_interface_ref(pa_hal_interface *h) {
     pa_assert(h);
     pa_assert(PA_REFCNT_VALUE(h) > 0);
 
@@ -105,7 +105,7 @@ pa_hal_manager* pa_hal_manager_ref(pa_hal_manager *h) {
     return h;
 }
 
-void pa_hal_manager_unref(pa_hal_manager *h) {
+void pa_hal_interface_unref(pa_hal_interface *h) {
     pa_assert(h);
     pa_assert(PA_REFCNT_VALUE(h) > 0);
 
@@ -115,7 +115,7 @@ void pa_hal_manager_unref(pa_hal_manager *h) {
     /* Deinit HAL manager & unload library */
     if (h->intf.deinit) {
         if (h->intf.deinit(h->ah_handle) != AUDIO_RET_OK) {
-            pa_log_error("hal_manager deinit failed");
+            pa_log_error("hal_interface deinit failed");
         }
     }
     if (h->dl_handle) {
@@ -123,12 +123,12 @@ void pa_hal_manager_unref(pa_hal_manager *h) {
     }
 
     if (h->core)
-        pa_shared_remove(h->core, SHARED_HAL_MANAGER);
+        pa_shared_remove(h->core, SHARED_HAL_INTF);
 
     pa_xfree(h);
 }
 
-int32_t pa_hal_manager_get_volume_level_max(pa_hal_manager *h, const char *volume_type, io_direction_t direction, uint32_t *level) {
+int32_t pa_hal_interface_get_volume_level_max(pa_hal_interface *h, const char *volume_type, io_direction_t direction, uint32_t *level) {
     int32_t ret = 0;
     audio_return_t hal_ret = AUDIO_RET_OK;
     audio_volume_info_t info = {NULL, NULL, 0};
@@ -147,7 +147,7 @@ int32_t pa_hal_manager_get_volume_level_max(pa_hal_manager *h, const char *volum
     return ret;
 }
 
-int32_t pa_hal_manager_get_volume_level(pa_hal_manager *h, const char *volume_type, io_direction_t direction, uint32_t *level) {
+int32_t pa_hal_interface_get_volume_level(pa_hal_interface *h, const char *volume_type, io_direction_t direction, uint32_t *level) {
     int32_t ret = 0;
     audio_return_t hal_ret = AUDIO_RET_OK;
     audio_volume_info_t info = {NULL, NULL, 0};
@@ -166,7 +166,7 @@ int32_t pa_hal_manager_get_volume_level(pa_hal_manager *h, const char *volume_ty
     return ret;
 }
 
-int32_t pa_hal_manager_set_volume_level(pa_hal_manager *h, const char *volume_type, io_direction_t direction, uint32_t level) {
+int32_t pa_hal_interface_set_volume_level(pa_hal_interface *h, const char *volume_type, io_direction_t direction, uint32_t level) {
     int32_t ret = 0;
     audio_return_t hal_ret = AUDIO_RET_OK;
     audio_volume_info_t info = {NULL, NULL, 0};
@@ -185,7 +185,7 @@ int32_t pa_hal_manager_set_volume_level(pa_hal_manager *h, const char *volume_ty
     return ret;
 }
 
-int32_t pa_hal_manager_get_volume_value(pa_hal_manager *h, const char *volume_type, const char *gain_type, io_direction_t direction, uint32_t level, double *value) {
+int32_t pa_hal_interface_get_volume_value(pa_hal_interface *h, const char *volume_type, const char *gain_type, io_direction_t direction, uint32_t level, double *value) {
     int32_t ret = 0;
     audio_return_t hal_ret = AUDIO_RET_OK;
     audio_volume_info_t info = {NULL, NULL, 0};
@@ -206,7 +206,7 @@ int32_t pa_hal_manager_get_volume_value(pa_hal_manager *h, const char *volume_ty
     return ret;
 }
 
-int32_t pa_hal_manager_get_volume_mute(pa_hal_manager *h, const char *volume_type, io_direction_t direction, uint32_t *mute) {
+int32_t pa_hal_interface_get_volume_mute(pa_hal_interface *h, const char *volume_type, io_direction_t direction, uint32_t *mute) {
     int32_t ret = 0;
     audio_return_t hal_ret = AUDIO_RET_OK;
     audio_volume_info_t info = {NULL, NULL, 0};
@@ -225,7 +225,7 @@ int32_t pa_hal_manager_get_volume_mute(pa_hal_manager *h, const char *volume_typ
     return ret;
 }
 
-int32_t pa_hal_manager_set_volume_mute(pa_hal_manager *h, const char *volume_type, io_direction_t direction, uint32_t mute) {
+int32_t pa_hal_interface_set_volume_mute(pa_hal_interface *h, const char *volume_type, io_direction_t direction, uint32_t mute) {
     int32_t ret = 0;
     audio_return_t hal_ret = AUDIO_RET_OK;
     audio_volume_info_t info = {NULL, NULL, 0};
@@ -243,7 +243,7 @@ int32_t pa_hal_manager_set_volume_mute(pa_hal_manager *h, const char *volume_typ
     return ret;
 }
 
-int32_t pa_hal_manager_update_route(pa_hal_manager *h, hal_route_info *info) {
+int32_t pa_hal_interface_update_route(pa_hal_interface *h, hal_route_info *info) {
     int32_t ret = 0;
     audio_return_t hal_ret = AUDIO_RET_OK;
 
@@ -257,7 +257,7 @@ int32_t pa_hal_manager_update_route(pa_hal_manager *h, hal_route_info *info) {
     return ret;
 }
 
-int32_t pa_hal_manager_update_route_option(pa_hal_manager *h, hal_route_option *option) {
+int32_t pa_hal_interface_update_route_option(pa_hal_interface *h, hal_route_option *option) {
     int32_t ret = 0;
     audio_return_t hal_ret = AUDIO_RET_OK;
 
@@ -271,7 +271,7 @@ int32_t pa_hal_manager_update_route_option(pa_hal_manager *h, hal_route_option *
     return ret;
 }
 
-int32_t pa_hal_manager_notify_stream_connection_changed(pa_hal_manager *h, hal_stream_connection_info *info) {
+int32_t pa_hal_interface_notify_stream_connection_changed(pa_hal_interface *h, hal_stream_connection_info *info) {
     int32_t ret = 0;
     audio_return_t hal_ret = AUDIO_RET_OK;
     audio_stream_info_t hal_info;
@@ -290,7 +290,7 @@ int32_t pa_hal_manager_notify_stream_connection_changed(pa_hal_manager *h, hal_s
     return ret;
 }
 
-int32_t pa_hal_manager_get_buffer_attribute(pa_hal_manager *h, hal_stream_info *info,
+int32_t pa_hal_interface_get_buffer_attribute(pa_hal_interface *h, hal_stream_info *info,
                                             uint32_t *maxlength, uint32_t *tlength, uint32_t *prebuf, uint32_t* minreq, uint32_t *fragsize) {
     int32_t ret = 0;
     audio_return_t hal_ret = AUDIO_RET_OK;
@@ -311,7 +311,7 @@ int32_t pa_hal_manager_get_buffer_attribute(pa_hal_manager *h, hal_stream_info *
     return ret;
 }
 
-int32_t pa_hal_manager_pcm_open(pa_hal_manager *h, pcm_handle *pcm_h, io_direction_t direction, pa_sample_spec *sample_spec, uint32_t period_size, uint32_t periods) {
+int32_t pa_hal_interface_pcm_open(pa_hal_interface *h, pcm_handle *pcm_h, io_direction_t direction, pa_sample_spec *sample_spec, uint32_t period_size, uint32_t periods) {
     int32_t ret = 0;
     audio_return_t hal_ret = AUDIO_RET_OK;
 
@@ -326,7 +326,7 @@ int32_t pa_hal_manager_pcm_open(pa_hal_manager *h, pcm_handle *pcm_h, io_directi
     return ret;
 }
 
-int32_t pa_hal_manager_pcm_start(pa_hal_manager *h, pcm_handle pcm_h) {
+int32_t pa_hal_interface_pcm_start(pa_hal_interface *h, pcm_handle pcm_h) {
     int32_t ret = 0;
     audio_return_t hal_ret = AUDIO_RET_OK;
 
@@ -340,7 +340,7 @@ int32_t pa_hal_manager_pcm_start(pa_hal_manager *h, pcm_handle pcm_h) {
     return ret;
 }
 
-int32_t pa_hal_manager_pcm_stop(pa_hal_manager *h, pcm_handle pcm_h) {
+int32_t pa_hal_interface_pcm_stop(pa_hal_interface *h, pcm_handle pcm_h) {
     int32_t ret = 0;
     audio_return_t hal_ret = AUDIO_RET_OK;
 
@@ -354,7 +354,7 @@ int32_t pa_hal_manager_pcm_stop(pa_hal_manager *h, pcm_handle pcm_h) {
     return ret;
 }
 
-int32_t pa_hal_manager_pcm_close(pa_hal_manager *h, pcm_handle pcm_h) {
+int32_t pa_hal_interface_pcm_close(pa_hal_interface *h, pcm_handle pcm_h) {
     int32_t ret = 0;
     audio_return_t hal_ret = AUDIO_RET_OK;
 
@@ -368,7 +368,7 @@ int32_t pa_hal_manager_pcm_close(pa_hal_manager *h, pcm_handle pcm_h) {
     return ret;
 }
 
-int32_t pa_hal_manager_pcm_available(pa_hal_manager *h, pcm_handle pcm_h, uint32_t *available) {
+int32_t pa_hal_interface_pcm_available(pa_hal_interface *h, pcm_handle pcm_h, uint32_t *available) {
     int32_t ret = 0;
     audio_return_t hal_ret = AUDIO_RET_OK;
 
@@ -383,7 +383,7 @@ int32_t pa_hal_manager_pcm_available(pa_hal_manager *h, pcm_handle pcm_h, uint32
     return ret;
 }
 
-int32_t pa_hal_manager_pcm_write(pa_hal_manager *h, pcm_handle pcm_h, const void *buffer, uint32_t frames) {
+int32_t pa_hal_interface_pcm_write(pa_hal_interface *h, pcm_handle pcm_h, const void *buffer, uint32_t frames) {
     int32_t ret = 0;
     audio_return_t hal_ret = AUDIO_RET_OK;
 
@@ -398,7 +398,7 @@ int32_t pa_hal_manager_pcm_write(pa_hal_manager *h, pcm_handle pcm_h, const void
     return ret;
 }
 
-int32_t pa_hal_manager_pcm_read(pa_hal_manager *h, pcm_handle pcm_h, void *buffer, uint32_t frames) {
+int32_t pa_hal_interface_pcm_read(pa_hal_interface *h, pcm_handle pcm_h, void *buffer, uint32_t frames) {
     int32_t ret = 0;
     audio_return_t hal_ret = AUDIO_RET_OK;
 
@@ -413,7 +413,7 @@ int32_t pa_hal_manager_pcm_read(pa_hal_manager *h, pcm_handle pcm_h, void *buffe
     return ret;
 }
 
-int32_t pa_hal_manager_pcm_get_fd(pa_hal_manager *h, pcm_handle pcm_h, int *fd) {
+int32_t pa_hal_interface_pcm_get_fd(pa_hal_interface *h, pcm_handle pcm_h, int *fd) {
     int32_t ret = 0;
     audio_return_t hal_ret = AUDIO_RET_OK;
 
@@ -428,7 +428,7 @@ int32_t pa_hal_manager_pcm_get_fd(pa_hal_manager *h, pcm_handle pcm_h, int *fd)
     return ret;
 }
 
-int32_t pa_hal_manager_pcm_recover(pa_hal_manager *h, pcm_handle pcm_h, int err) {
+int32_t pa_hal_interface_pcm_recover(pa_hal_interface *h, pcm_handle pcm_h, int err) {
     int32_t ret = 0;
     audio_return_t hal_ret = AUDIO_RET_OK;
 
@@ -442,7 +442,7 @@ int32_t pa_hal_manager_pcm_recover(pa_hal_manager *h, pcm_handle pcm_h, int err)
     return ret;
 }
 
-int32_t pa_hal_manager_pcm_get_params(pa_hal_manager *h, pcm_handle pcm_h, uint32_t direction, void **sample_spec, uint32_t *period_size, uint32_t *periods) {
+int32_t pa_hal_interface_pcm_get_params(pa_hal_interface *h, pcm_handle pcm_h, uint32_t direction, void **sample_spec, uint32_t *period_size, uint32_t *periods) {
     int32_t ret = 0;
     audio_return_t hal_ret = AUDIO_RET_OK;
 
@@ -458,7 +458,7 @@ int32_t pa_hal_manager_pcm_get_params(pa_hal_manager *h, pcm_handle pcm_h, uint3
     return ret;
 }
 
-int32_t pa_hal_manager_pcm_set_params(pa_hal_manager *h, pcm_handle pcm_h, uint32_t direction, void *sample_spec, uint32_t period_size, uint32_t periods) {
+int32_t pa_hal_interface_pcm_set_params(pa_hal_interface *h, pcm_handle pcm_h, uint32_t direction, void *sample_spec, uint32_t period_size, uint32_t periods) {
     int32_t ret = 0;
     audio_return_t hal_ret = AUDIO_RET_OK;
 
@@ -472,7 +472,7 @@ int32_t pa_hal_manager_pcm_set_params(pa_hal_manager *h, pcm_handle pcm_h, uint3
     return ret;
 }
 
-int32_t pa_hal_manager_add_message_callback(pa_hal_manager *h, hal_message_callback callback, void *user_data) {
+int32_t pa_hal_interface_add_message_callback(pa_hal_interface *h, hal_message_callback callback, void *user_data) {
     int32_t ret = 0;
     audio_return_t hal_ret = AUDIO_RET_OK;
 
@@ -490,7 +490,7 @@ int32_t pa_hal_manager_add_message_callback(pa_hal_manager *h, hal_message_callb
     return ret;
 }
 
-int32_t pa_hal_manager_remove_message_callback(pa_hal_manager *h, hal_message_callback callback) {
+int32_t pa_hal_interface_remove_message_callback(pa_hal_interface *h, hal_message_callback callback) {
     int32_t ret = 0;
     audio_return_t hal_ret = AUDIO_RET_OK;
 
diff --git a/src/hal-interface.h b/src/hal-interface.h
new file mode 100644 (file)
index 0000000..060b401
--- /dev/null
@@ -0,0 +1,77 @@
+#ifndef foohalinterfacefoo
+#define foohalinterfacefoo
+#include <dlfcn.h>
+#include <pulsecore/core.h>
+
+typedef struct _pa_hal_interface pa_hal_interface;
+
+typedef enum _io_direction {
+    DIRECTION_IN,
+    DIRECTION_OUT,
+} io_direction_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 struct _hal_stream_info {
+    io_direction_t direction;
+    const char *latency;
+    pa_sample_spec *sample_spec;
+} hal_stream_info;
+
+typedef void* pcm_handle;
+
+#define MSG_FOR_LOOPBACK_ARG_LATENCY      "loopback::latency"
+#define MSG_FOR_LOOPBACK_ARG_ADJUST_TIME  "loopback::adjust_time"
+typedef void (*hal_message_callback)(const char *name, int value, void *user_data);
+
+pa_hal_interface* pa_hal_interface_get(pa_core *core);
+pa_hal_interface* pa_hal_interface_ref(pa_hal_interface *h);
+void pa_hal_interface_unref(pa_hal_interface *h);
+int32_t pa_hal_interface_get_volume_level_max(pa_hal_interface *h, const char *volume_type, io_direction_t direction, uint32_t *level);
+int32_t pa_hal_interface_get_volume_level(pa_hal_interface *h, const char *volume_type, io_direction_t direction, uint32_t *level);
+int32_t pa_hal_interface_set_volume_level(pa_hal_interface *h, const char *volume_type, io_direction_t direction, uint32_t level);
+int32_t pa_hal_interface_get_volume_value(pa_hal_interface *h, const char *volume_type, const char *gain_type, io_direction_t direction, uint32_t level, double *value);
+int32_t pa_hal_interface_get_volume_mute(pa_hal_interface *h, const char *volume_type, io_direction_t direction, uint32_t *mute);
+int32_t pa_hal_interface_set_volume_mute(pa_hal_interface *h, const char *volume_type, io_direction_t direction, uint32_t mute);
+int32_t pa_hal_interface_update_route(pa_hal_interface *h, hal_route_info *info);
+int32_t pa_hal_interface_update_route_option(pa_hal_interface *h, hal_route_option *option);
+int32_t pa_hal_interface_notify_stream_connection_changed(pa_hal_interface *h, hal_stream_connection_info *info);
+int32_t pa_hal_interface_get_buffer_attribute(pa_hal_interface *h, hal_stream_info *info, uint32_t *maxlength, uint32_t *tlength, uint32_t *prebuf, uint32_t* minreq, uint32_t *fragsize);
+int32_t pa_hal_interface_pcm_open(pa_hal_interface *h, pcm_handle *pcm_h, io_direction_t direction, pa_sample_spec *sample_spec, uint32_t period_size, uint32_t periods);
+int32_t pa_hal_interface_pcm_start(pa_hal_interface *h, pcm_handle pcm_h);
+int32_t pa_hal_interface_pcm_stop(pa_hal_interface *h, pcm_handle pcm_h);
+int32_t pa_hal_interface_pcm_close(pa_hal_interface *h, pcm_handle pcm_h);
+int32_t pa_hal_interface_pcm_available(pa_hal_interface *h, pcm_handle pcm_h, uint32_t *available);
+int32_t pa_hal_interface_pcm_write(pa_hal_interface *h, pcm_handle pcm_h, const void *buffer, uint32_t frames);
+int32_t pa_hal_interface_pcm_read(pa_hal_interface *h, pcm_handle pcm_h, void *buffer, uint32_t frames);
+int32_t pa_hal_interface_pcm_get_fd(pa_hal_interface *h, pcm_handle pcm_h, int *fd);
+int32_t pa_hal_interface_pcm_recover(pa_hal_interface *h, pcm_handle pcm_h, int err);
+int32_t pa_hal_interface_pcm_get_params(pa_hal_interface *h, pcm_handle pcm_h, uint32_t direction, void **sample_spec, uint32_t *period_size, uint32_t *periods);
+int32_t pa_hal_interface_pcm_set_params(pa_hal_interface *h, pcm_handle pcm_h, uint32_t direction, void *sample_spec, uint32_t period_size, uint32_t periods);
+int32_t pa_hal_interface_add_message_callback(pa_hal_interface *h, hal_message_callback callback, void *user_data);
+int32_t pa_hal_interface_remove_message_callback(pa_hal_interface *h, hal_message_callback callback);
+
+#endif
diff --git a/src/hal-manager.h b/src/hal-manager.h
deleted file mode 100644 (file)
index 4375e6a..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-#ifndef foohalmanagerfoo
-#define foohalmanagerfoo
-#include <dlfcn.h>
-#include <pulsecore/core.h>
-
-typedef struct _pa_hal_manager pa_hal_manager;
-
-typedef enum _io_direction {
-    DIRECTION_IN,
-    DIRECTION_OUT,
-} io_direction_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 struct _hal_stream_info {
-    io_direction_t direction;
-    const char *latency;
-    pa_sample_spec *sample_spec;
-} hal_stream_info;
-
-typedef void* pcm_handle;
-
-#define MSG_FOR_LOOPBACK_ARG_LATENCY      "loopback::latency"
-#define MSG_FOR_LOOPBACK_ARG_ADJUST_TIME  "loopback::adjust_time"
-typedef void (*hal_message_callback)(const char *name, int value, void *user_data);
-
-pa_hal_manager* pa_hal_manager_get(pa_core *core);
-pa_hal_manager* pa_hal_manager_ref(pa_hal_manager *h);
-void pa_hal_manager_unref(pa_hal_manager *h);
-int32_t pa_hal_manager_get_volume_level_max(pa_hal_manager *h, const char *volume_type, io_direction_t direction, uint32_t *level);
-int32_t pa_hal_manager_get_volume_level(pa_hal_manager *h, const char *volume_type, io_direction_t direction, uint32_t *level);
-int32_t pa_hal_manager_set_volume_level(pa_hal_manager *h, const char *volume_type, io_direction_t direction, uint32_t level);
-int32_t pa_hal_manager_get_volume_value(pa_hal_manager *h, const char *volume_type, const char *gain_type, io_direction_t direction, uint32_t level, double *value);
-int32_t pa_hal_manager_get_volume_mute(pa_hal_manager *h, const char *volume_type, io_direction_t direction, uint32_t *mute);
-int32_t pa_hal_manager_set_volume_mute(pa_hal_manager *h, const char *volume_type, io_direction_t direction, uint32_t mute);
-int32_t pa_hal_manager_update_route(pa_hal_manager *h, hal_route_info *info);
-int32_t pa_hal_manager_update_route_option(pa_hal_manager *h, hal_route_option *option);
-int32_t pa_hal_manager_notify_stream_connection_changed(pa_hal_manager *h, hal_stream_connection_info *info);
-int32_t pa_hal_manager_get_buffer_attribute(pa_hal_manager *h, hal_stream_info *info, uint32_t *maxlength, uint32_t *tlength, uint32_t *prebuf, uint32_t* minreq, uint32_t *fragsize);
-int32_t pa_hal_manager_pcm_open(pa_hal_manager *h, pcm_handle *pcm_h, io_direction_t direction, pa_sample_spec *sample_spec, uint32_t period_size, uint32_t periods);
-int32_t pa_hal_manager_pcm_start(pa_hal_manager *h, pcm_handle pcm_h);
-int32_t pa_hal_manager_pcm_stop(pa_hal_manager *h, pcm_handle pcm_h);
-int32_t pa_hal_manager_pcm_close(pa_hal_manager *h, pcm_handle pcm_h);
-int32_t pa_hal_manager_pcm_available(pa_hal_manager *h, pcm_handle pcm_h, uint32_t *available);
-int32_t pa_hal_manager_pcm_write(pa_hal_manager *h, pcm_handle pcm_h, const void *buffer, uint32_t frames);
-int32_t pa_hal_manager_pcm_read(pa_hal_manager *h, pcm_handle pcm_h, void *buffer, uint32_t frames);
-int32_t pa_hal_manager_pcm_get_fd(pa_hal_manager *h, pcm_handle pcm_h, int *fd);
-int32_t pa_hal_manager_pcm_recover(pa_hal_manager *h, pcm_handle pcm_h, int err);
-int32_t pa_hal_manager_pcm_get_params(pa_hal_manager *h, pcm_handle pcm_h, uint32_t direction, void **sample_spec, uint32_t *period_size, uint32_t *periods);
-int32_t pa_hal_manager_pcm_set_params(pa_hal_manager *h, pcm_handle pcm_h, uint32_t direction, void *sample_spec, uint32_t period_size, uint32_t periods);
-int32_t pa_hal_manager_add_message_callback(pa_hal_manager *h, hal_message_callback callback, void *user_data);
-int32_t pa_hal_manager_remove_message_callback(pa_hal_manager *h, hal_message_callback callback);
-
-#endif
index cec90d6..c6ca931 100644 (file)
@@ -36,7 +36,7 @@
 
 #include "module-policy-symdef.h"
 #include "communicator.h"
-#include "hal-manager.h"
+#include "hal-interface.h"
 #include "stream-manager.h"
 #include "device-manager.h"
 
@@ -139,7 +139,7 @@ struct userdata {
         pa_hook_slot *comm_hook_update_info_slot;
     } communicator;
 
-    pa_hal_manager *hal_manager;
+    pa_hal_interface *hal_interface;
     pa_stream_manager *stream_manager;
     pa_device_manager *device_manager;
 
@@ -965,8 +965,8 @@ static pa_hook_result_t route_change_hook_cb(pa_core *c, pa_stream_manager_hook_
 
     if (route_info.device_infos) {
         /* send information to HAL to update route */
-        if (pa_hal_manager_update_route(u->hal_manager, &route_info))
-            pa_log_error("[ROUTE] Failed to pa_hal_manager_update_route()");
+        if (pa_hal_interface_update_route(u->hal_interface, &route_info))
+            pa_log_error("[ROUTE] Failed to pa_hal_interface_update_route()");
         pa_xfree(route_info.device_infos);
     }
 
@@ -1196,7 +1196,7 @@ int pa__init(pa_module *m)
     u->core = m->core;
     u->module = m;
 
-    u->hal_manager = pa_hal_manager_get(u->core);
+    u->hal_interface = pa_hal_interface_get(u->core);
 
     if ((u->communicator.comm = pa_communicator_get(u->core))) {
         u->communicator.comm_hook_select_proper_sink_or_source_slot = pa_hook_connect(
@@ -1276,8 +1276,8 @@ void pa__done(pa_module *m)
         pa_communicator_unref(u->communicator.comm);
     }
 
-    if (u->hal_manager)
-        pa_hal_manager_unref(u->hal_manager);
+    if (u->hal_interface)
+        pa_hal_interface_unref(u->hal_interface);
 
     pa_xfree(u);
 
index 577fde0..5c6efd2 100644 (file)
@@ -44,7 +44,7 @@
 #include <pulsecore/rtpoll.h>
 #include <pulsecore/poll.h>
 
-#include "hal-manager.h"
+#include "hal-interface.h"
 #include "module-tizenaudio-sink-symdef.h"
 
 
@@ -94,7 +94,7 @@ struct userdata {
     pa_rtpoll_item *rtpoll_item;
 
     uint64_t write_count;
-    pa_hal_manager *hal_manager;
+    pa_hal_interface *hal_interface;
 };
 
 static const char* const valid_modargs[] = {
@@ -127,7 +127,7 @@ static int build_pollfd(struct userdata *u) {
 
     u->rtpoll_item = pa_rtpoll_item_new(u->rtpoll, PA_RTPOLL_NEVER, 1);
     pollfd = pa_rtpoll_item_get_pollfd(u->rtpoll_item, NULL);
-    ret = pa_hal_manager_pcm_get_fd(u->hal_manager, u->pcm_handle, &fd);
+    ret = pa_hal_interface_pcm_get_fd(u->hal_interface, u->pcm_handle, &fd);
     if (ret < 0 || fd < 0) {
         pa_log_error("Failed to get fd(%d) of PCM device %d", fd, ret);
         return -1;
@@ -144,7 +144,7 @@ static int suspend(struct userdata *u) {
     pa_assert(u);
     pa_assert(u->pcm_handle);
 
-    ret = pa_hal_manager_pcm_close(u->hal_manager, u->pcm_handle);
+    ret = pa_hal_interface_pcm_close(u->hal_interface, u->pcm_handle);
     if (ret) {
         pa_log_error("Error closing PCM device %x", ret);
     }
@@ -169,7 +169,7 @@ static int unsuspend(struct userdata *u) {
 
     pa_log_info("Trying resume...");
     sample_spec = u->sink->sample_spec;
-    ret = pa_hal_manager_pcm_open(u->hal_manager,
+    ret = pa_hal_interface_pcm_open(u->hal_interface,
               (void **)&u->pcm_handle,
               DIRECTION_OUT,
               &sample_spec,
@@ -192,7 +192,7 @@ static int unsuspend(struct userdata *u) {
 
 fail:
     if (u->pcm_handle) {
-        pa_hal_manager_pcm_close(u->hal_manager, u->pcm_handle);
+        pa_hal_interface_pcm_close(u->hal_interface, u->pcm_handle);
         u->pcm_handle = NULL;
     }
     return -PA_ERR_IO;
@@ -327,7 +327,7 @@ static int process_render(struct userdata *u, pa_usec_t now) {
         pa_memchunk chunk;
         frame_size = pa_frame_size(&u->sink->sample_spec);
 
-        pa_hal_manager_pcm_available(u->hal_manager, u->pcm_handle, &avail);
+        pa_hal_interface_pcm_available(u->hal_interface, u->pcm_handle, &avail);
         if ((avail == 0) && !(u->first)) {
             break;
         }
@@ -345,7 +345,7 @@ static int process_render(struct userdata *u, pa_usec_t now) {
         pa_sink_render_full(u->sink, frames_to_write * frame_size, &chunk);
         p = pa_memblock_acquire(chunk.memblock);
 
-        pa_hal_manager_pcm_write(u->hal_manager, u->pcm_handle, (const char*)p + chunk.index, (uint32_t)frames_to_write);
+        pa_hal_interface_pcm_write(u->hal_interface, u->pcm_handle, (const char*)p + chunk.index, (uint32_t)frames_to_write);
 
         pa_memblock_release(chunk.memblock);
         pa_memblock_unref(chunk.memblock);
@@ -398,7 +398,7 @@ static void thread_func(void *userdata) {
             } else {
                 if (u->first) {
                     pa_log_info("Starting playback.");
-                    pa_hal_manager_pcm_start(u->hal_manager, u->pcm_handle);
+                    pa_hal_interface_pcm_start(u->hal_interface, u->pcm_handle);
                     u->first = false;
                 }
                 pa_rtpoll_set_timer_relative(u->rtpoll, (10 * PA_USEC_PER_MSEC));
@@ -421,7 +421,7 @@ static void thread_func(void *userdata) {
                 revents = pollfd->revents;
                 if (revents & ~POLLOUT) {
                     pa_log_debug("Poll error 0x%x occured, try recover.", revents);
-                    pa_hal_manager_pcm_recover(u->hal_manager, u->pcm_handle, revents);
+                    pa_hal_interface_pcm_recover(u->hal_interface, u->pcm_handle, revents);
                     u->first = true;
                     revents = 0;
                 } else {
@@ -474,7 +474,7 @@ int pa__init(pa_module*m) {
     u->core = m->core;
     u->module = m;
     u->first = true;
-    u->hal_manager = pa_hal_manager_get(u->core);
+    u->hal_interface = pa_hal_interface_get(u->core);
     u->rtpoll = pa_rtpoll_new();
     pa_thread_mq_init(&u->thread_mq, m->core->mainloop, u->rtpoll);
 
index 41d175a..d96adb4 100644 (file)
@@ -44,7 +44,7 @@
 #include <pulsecore/rtpoll.h>
 #include <pulsecore/poll.h>
 
-#include "hal-manager.h"
+#include "hal-interface.h"
 #include "module-tizenaudio-source-symdef.h"
 
 
@@ -95,7 +95,7 @@ struct userdata {
 
     uint64_t read_count;
     pa_usec_t latency_time;
-    pa_hal_manager *hal_manager;
+    pa_hal_interface *hal_interface;
 };
 
 static const char* const valid_modargs[] = {
@@ -128,7 +128,7 @@ static int build_pollfd(struct userdata *u) {
 
     u->rtpoll_item = pa_rtpoll_item_new(u->rtpoll, PA_RTPOLL_NEVER, 1);
     pollfd = pa_rtpoll_item_get_pollfd(u->rtpoll_item, NULL);
-    ret = pa_hal_manager_pcm_get_fd(u->hal_manager, u->pcm_handle, &fd);
+    ret = pa_hal_interface_pcm_get_fd(u->hal_interface, u->pcm_handle, &fd);
     if (ret < 0 || fd < 0) {
         pa_log_error("Failed to get fd(%d) of PCM device %d", fd, ret);
         return -1;
@@ -145,7 +145,7 @@ static int suspend(struct userdata *u) {
     pa_assert(u);
     pa_assert(u->pcm_handle);
 
-    ret = pa_hal_manager_pcm_close(u->hal_manager, u->pcm_handle);
+    ret = pa_hal_interface_pcm_close(u->hal_interface, u->pcm_handle);
     if (ret) {
         pa_log_error("Error closing PCM device %x", ret);
     }
@@ -170,7 +170,7 @@ static int unsuspend(struct userdata *u) {
 
     pa_log_info("Trying resume...");
     sample_spec = u->source->sample_spec;
-    ret = pa_hal_manager_pcm_open(u->hal_manager,
+    ret = pa_hal_interface_pcm_open(u->hal_interface,
               (void **)&u->pcm_handle,
               DIRECTION_IN,
               &sample_spec,
@@ -193,7 +193,7 @@ static int unsuspend(struct userdata *u) {
 
 fail:
     if (u->pcm_handle) {
-        pa_hal_manager_pcm_close(u->hal_manager, u->pcm_handle);
+        pa_hal_interface_pcm_close(u->hal_interface, u->pcm_handle);
         u->pcm_handle = NULL;
     }
     return -PA_ERR_IO;
@@ -281,7 +281,7 @@ static int process_render(struct userdata *u, pa_usec_t now) {
         pa_memchunk chunk;
         frame_size = pa_frame_size(&u->source->sample_spec);
 
-        pa_hal_manager_pcm_available(u->hal_manager, u->pcm_handle, &avail);
+        pa_hal_interface_pcm_available(u->hal_interface, u->pcm_handle, &avail);
         if (avail == 0) {
             break;
         }
@@ -295,7 +295,7 @@ static int process_render(struct userdata *u, pa_usec_t now) {
             frames_to_read = (size_t)avail;
 
         p = pa_memblock_acquire(chunk.memblock);
-        pa_hal_manager_pcm_read(u->hal_manager, u->pcm_handle, p, (uint32_t)frames_to_read);
+        pa_hal_interface_pcm_read(u->hal_interface, u->pcm_handle, p, (uint32_t)frames_to_read);
         pa_memblock_release(chunk.memblock);
 
         chunk.index = 0;
@@ -341,7 +341,7 @@ static void thread_func(void *userdata) {
 
             if (u->first) {
                 pa_log_info("Starting capture.");
-                pa_hal_manager_pcm_start(u->hal_manager, u->pcm_handle);
+                pa_hal_interface_pcm_start(u->hal_interface, u->pcm_handle);
                 u->first = false;
                 u->timestamp = now;
             }
@@ -374,7 +374,7 @@ static void thread_func(void *userdata) {
                 revents = pollfd->revents;
                 if (revents & ~POLLIN) {
                     pa_log_debug("Poll error 0x%x occured, try recover.", revents);
-                    pa_hal_manager_pcm_recover(u->hal_manager, u->pcm_handle, revents);
+                    pa_hal_interface_pcm_recover(u->hal_interface, u->pcm_handle, revents);
                     u->first = true;
                     revents = 0;
                 } else {
@@ -426,7 +426,7 @@ int pa__init(pa_module*m) {
     u->core = m->core;
     u->module = m;
     u->first = true;
-    u->hal_manager = pa_hal_manager_get(u->core);
+    u->hal_interface = pa_hal_interface_get(u->core);
     u->rtpoll = pa_rtpoll_new();
     pa_thread_mq_init(&u->thread_mq, m->core->mainloop, u->rtpoll);
 
index 2d1fb4e..3c505de 100644 (file)
@@ -2,7 +2,7 @@
 #define foostreammanagerprivfoo
 
 #include "stream-manager.h"
-#include "hal-manager.h"
+#include "hal-interface.h"
 #include "communicator.h"
 #include "device-manager.h"
 #include "subscribe-observer.h"
@@ -72,7 +72,7 @@ typedef struct _stream_restrictions {
 
 struct _stream_manager {
     pa_core *core;
-    pa_hal_manager *hal;
+    pa_hal_interface *hal;
     pa_device_manager *dm;
     pa_subscribe_observer *subs_ob;
 
index f87eaf7..6cc6ff0 100644 (file)
@@ -200,7 +200,7 @@ static int get_volume_value(pa_stream_manager *m, stream_type_t stream_type, boo
     /* Get volume value by type & level */
     if (is_hal_volume) {
         /* Get value from HAL */
-        if (pa_hal_manager_get_volume_value(m->hal, volume_type, NULL,
+        if (pa_hal_interface_get_volume_value(m->hal, volume_type, NULL,
                                             CONVERT_TO_HAL_DIRECTION(stream_type), volume_level, &volume_linear)) {
             return -1;
         }
@@ -258,7 +258,7 @@ int32_t set_volume_level_by_type(pa_stream_manager *m, stream_type_t stream_type
      }
 
     if (is_hal_volume)
-        if (pa_hal_manager_set_volume_level(m->hal, volume_type, CONVERT_TO_HAL_DIRECTION(stream_type), volume_level))
+        if (pa_hal_interface_set_volume_level(m->hal, volume_type, CONVERT_TO_HAL_DIRECTION(stream_type), volume_level))
             return -1;
 
     volumes = m->volume_infos;
@@ -369,7 +369,7 @@ int32_t get_volume_level_by_type(pa_stream_manager *m, pa_volume_get_command_t c
         /* Get level */
         if (is_hal_volume) {
             /* from HAL */
-            if (pa_hal_manager_get_volume_level(m->hal, volume_type, CONVERT_TO_HAL_DIRECTION(stream_type), volume_level))
+            if (pa_hal_interface_get_volume_level(m->hal, volume_type, CONVERT_TO_HAL_DIRECTION(stream_type), volume_level))
                 return -1;
         } else {
             /* from stream-manager */
@@ -388,7 +388,7 @@ int32_t get_volume_level_by_type(pa_stream_manager *m, pa_volume_get_command_t c
             /* Get max level */
             if (is_hal_volume) {
                 /* from HAL */
-                if (pa_hal_manager_get_volume_level_max(m->hal, volume_type, CONVERT_TO_HAL_DIRECTION(stream_type), volume_level))
+                if (pa_hal_interface_get_volume_level_max(m->hal, volume_type, CONVERT_TO_HAL_DIRECTION(stream_type), volume_level))
                     return -1;
             } else {
                 /* from stream-manager */
@@ -430,7 +430,7 @@ int32_t set_volume_level_by_idx(pa_stream_manager *m, stream_type_t stream_type,
      }
 
     if (is_hal_volume)
-        if (pa_hal_manager_set_volume_level(m->hal, volume_type_str, CONVERT_TO_HAL_DIRECTION(stream_type), volume_level))
+        if (pa_hal_interface_set_volume_level(m->hal, volume_type_str, CONVERT_TO_HAL_DIRECTION(stream_type), volume_level))
             return -1;
 
     /* Get modifier for gain */
@@ -478,7 +478,7 @@ int32_t set_volume_level_with_new_data(pa_stream_manager *m, void *stream, strea
      }
 
     if (is_hal_volume)
-        if (pa_hal_manager_set_volume_level(m->hal, volume_type_str, CONVERT_TO_HAL_DIRECTION(stream_type), volume_level))
+        if (pa_hal_interface_set_volume_level(m->hal, volume_type_str, CONVERT_TO_HAL_DIRECTION(stream_type), volume_level))
             return -1;
 
     /* Get modifier for gain */
@@ -523,7 +523,7 @@ int32_t set_volume_mute_by_type(pa_stream_manager *m, stream_type_t stream_type,
      }
 
     if (is_hal_volume)
-        if (pa_hal_manager_set_volume_mute(m->hal, volume_type, CONVERT_TO_HAL_DIRECTION(stream_type), (uint32_t)volume_mute))
+        if (pa_hal_interface_set_volume_mute(m->hal, volume_type, CONVERT_TO_HAL_DIRECTION(stream_type), (uint32_t)volume_mute))
             return -1;
 
     /* Set mute */
@@ -659,7 +659,7 @@ int32_t set_volume_mute_with_new_data(pa_stream_manager *m, void *stream, stream
      }
 
     if (is_hal_volume)
-        if (pa_hal_manager_set_volume_mute(m->hal, volume_type_str, CONVERT_TO_HAL_DIRECTION(stream_type), volume_mute))
+        if (pa_hal_interface_set_volume_mute(m->hal, volume_type_str, CONVERT_TO_HAL_DIRECTION(stream_type), volume_mute))
             return -1;
 
     if (stream_type == STREAM_SINK_INPUT)
index 4aa649b..683bdf5 100644 (file)
@@ -2191,7 +2191,7 @@ static void do_notify(pa_stream_manager *m, notify_command_type_t command, strea
                                                                               (m->cur_highest_priority.role_so);
             route_option.name = ((stream_route_option*)user_data)->name;
             route_option.value = ((stream_route_option*)user_data)->value;
-            pa_hal_manager_update_route_option(m->hal, &route_option);
+            pa_hal_interface_update_route_option(m->hal, &route_option);
         }
         break;
     }
@@ -2205,7 +2205,7 @@ static void do_notify(pa_stream_manager *m, notify_command_type_t command, strea
             stream_conn_info.direction = (type == STREAM_SINK_INPUT) ? DIRECTION_OUT : DIRECTION_IN;
             stream_conn_info.idx = (type == STREAM_SINK_INPUT) ? ((pa_sink_input*)s)->index : ((pa_source_output*)s)->index;
             stream_conn_info.is_connected = (command == NOTIFY_COMMAND_INFORM_STREAM_CONNECTED) ? true : false;
-            pa_hal_manager_notify_stream_connection_changed(m->hal, &stream_conn_info);
+            pa_hal_interface_notify_stream_connection_changed(m->hal, &stream_conn_info);
         }
         break;
     }
@@ -2553,7 +2553,7 @@ static void set_buffer_attribute(pa_stream_manager *m, void *new_data, stream_ty
     info.direction = (io_direction_t)!stream_type;
     info.sample_spec = GET_STREAM_NEW_SAMPLE_SPEC_PTR(new_data, stream_type);
 
-    if (!pa_hal_manager_get_buffer_attribute(m->hal, &info, (uint32_t*)&maxlength, (uint32_t*)&tlength,
+    if (!pa_hal_interface_get_buffer_attribute(m->hal, &info, (uint32_t*)&maxlength, (uint32_t*)&tlength,
                                              (uint32_t*)&prebuf, (uint32_t*)&minreq, (uint32_t*)&fragsize)) {
         pa_log_info(" - maxlength:%d, tlength:%d, prebuf:%d, minreq:%d, fragsize:%d", maxlength, tlength, prebuf, minreq, fragsize);
         pa_proplist_setf(GET_STREAM_NEW_PROPLIST(new_data, stream_type), "maxlength", "%d", maxlength);
@@ -3465,8 +3465,8 @@ pa_stream_manager* pa_stream_manager_init(pa_core *c) {
     m = pa_xnew0(pa_stream_manager, 1);
     m->core = c;
 
-    m->hal = pa_hal_manager_get(c);
-    if (pa_hal_manager_add_message_callback(m->hal, message_cb, m))
+    m->hal = pa_hal_interface_get(c);
+    if (pa_hal_interface_add_message_callback(m->hal, message_cb, m))
         pa_log_warn("skip adding message callback");
     m->dm = pa_device_manager_get(c);
     m->subs_ob = pa_subscribe_observer_get(c);
@@ -3515,8 +3515,8 @@ fail:
     deinit_stream_map(m);
     deinit_ipc(m);
     if (m->hal) {
-        pa_hal_manager_remove_message_callback(m->hal, message_cb);
-        pa_hal_manager_unref(m->hal);
+        pa_hal_interface_remove_message_callback(m->hal, message_cb);
+        pa_hal_interface_unref(m->hal);
     }
     if (m->dm)
         pa_device_manager_unref(m->dm);
@@ -3584,8 +3584,8 @@ void pa_stream_manager_done(pa_stream_manager *m) {
         pa_device_manager_unref(m->dm);
 
     if (m->hal) {
-        pa_hal_manager_remove_message_callback(m->hal, message_cb);
-        pa_hal_manager_unref(m->hal);
+        pa_hal_interface_remove_message_callback(m->hal, message_cb);
+        pa_hal_interface_unref(m->hal);
     }
 
     pa_xfree(m);