#include "device-manager-dbus-priv.h"
#include "device-manager-db-priv.h"
+#ifdef SUPPORT_AEC
+#include "aec-manager.h"
+#endif
+
#define SHARED_DEVICE_MANAGER "tizen-device-manager"
#define DEVICE_MAP_FILE "/etc/pulse/device-map.json"
pa_device_manager* pa_device_manager_get(pa_core *c) {
pa_device_manager *dm;
+ pa_source *source;
+ pa_sink *sink;
pa_assert(c);
}
/* Just for convenience when test*/
- if (!_device_manager_set_default_sink(dm, DEVICE_TYPE_SPEAKER, "normal")) {
+ sink = _device_manager_set_default_sink(dm, DEVICE_TYPE_SPEAKER, "normal");
+ if (!sink)
pa_log_warn("Set default sink with speaker(normal) failed");
- }
- if (!_device_manager_set_default_source(dm, DEVICE_TYPE_MIC, "normal")) {
+
+ source = _device_manager_set_default_source(dm, DEVICE_TYPE_MIC, "normal");
+ if (!source)
pa_log_warn("Set default source with mic(normal) failed");
- }
+
+#ifdef SUPPORT_AEC
+ aec_manager_init(dm->core, source, sink);
+#endif
pa_shared_set(c, SHARED_DEVICE_MANAGER, dm);
pa_shared_remove(dm->core, SHARED_DEVICE_MANAGER);
pa_xfree(dm);
+
+#ifdef SUPPORT_AEC
+ aec_manager_deinit();
+#endif
+
}