summaryrefslogtreecommitdiff
path: root/modules/pulse/pulse.c
diff options
context:
space:
mode:
authorAlfred E. Heggestad <aeh@db.org>2016-06-11 21:02:12 +0200
committerGitHub <noreply@github.com>2016-06-11 21:02:12 +0200
commitc02880777a5eafbcc57949928bfb2ac50c3c00b8 (patch)
tree7f6bfbd8d578bb7e4e2565b085a31b3b1693e6d3 /modules/pulse/pulse.c
parent90a65c8be70ef7ccca5fee3026e76b0384643657 (diff)
parent9eef4975c5f79a96e6cfe287b919ad707a47e87f (diff)
Merge pull request #142 from alfredh/pulse
Pulse
Diffstat (limited to 'modules/pulse/pulse.c')
-rw-r--r--modules/pulse/pulse.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/modules/pulse/pulse.c b/modules/pulse/pulse.c
new file mode 100644
index 0000000..450b917
--- /dev/null
+++ b/modules/pulse/pulse.c
@@ -0,0 +1,52 @@
+/**
+ * @file pulse.c Pulseaudio sound driver
+ *
+ * Copyright (C) 2010 - 2016 Creytiv.com
+ */
+
+#include <re.h>
+#include <rem.h>
+#include <baresip.h>
+#include "pulse.h"
+
+
+/**
+ * @defgroup pulse pulse
+ *
+ * Audio driver module for Pulseaudio
+ *
+ * This module is experimental and work-in-progress. It is using
+ * the pulseaudio "simple" interface.
+ */
+
+
+static struct auplay *auplay;
+static struct ausrc *ausrc;
+
+
+static int module_init(void)
+{
+ int err;
+
+ err = auplay_register(&auplay, "pulse", pulse_player_alloc);
+ err |= ausrc_register(&ausrc, "pulse", pulse_recorder_alloc);
+
+ return err;
+}
+
+
+static int module_close(void)
+{
+ auplay = mem_deref(auplay);
+ ausrc = mem_deref(ausrc);
+
+ return 0;
+}
+
+
+EXPORT_SYM const struct mod_export DECL_EXPORTS(pulse) = {
+ "pulse",
+ "audio",
+ module_init,
+ module_close,
+};