--- /dev/null
+asound_module_pcm_aaf_LTLIBRARIES = libasound_module_pcm_aaf.la
+
+asound_module_pcm_aafdir = @ALSA_PLUGIN_DIR@
+
+AM_CFLAGS = @ALSA_CFLAGS@ @AVTP_CFLAGS@
+AM_LDFLAGS = -module -avoid-version -export-dynamic -no-undefined $(LDFLAGS_NOUNDEFINED)
+
+libasound_module_pcm_aaf_la_SOURCES = pcm_aaf.c
+libasound_module_pcm_aaf_la_LIBADD = @ALSA_LIBS@ @AVTP_LIBS@
--- /dev/null
+/*
+ * AVTP Audio Format (AAF) PCM Plugin
+ *
+ * Copyright (c) 2018, Intel Corporation
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <alsa/asoundlib.h>
+#include <alsa/pcm_external.h>
+
+typedef struct {
+ snd_pcm_ioplug_t io;
+} snd_pcm_aaf_t;
+
+static int aaf_close(snd_pcm_ioplug_t *io)
+{
+ free(io->private_data);
+ return 0;
+}
+
+static snd_pcm_sframes_t aaf_pointer(snd_pcm_ioplug_t *io)
+{
+ return 0;
+}
+
+static int aaf_start(snd_pcm_ioplug_t *io)
+{
+ return 0;
+}
+
+static int aaf_stop(snd_pcm_ioplug_t *io)
+{
+ return 0;
+}
+
+static const snd_pcm_ioplug_callback_t aaf_callback = {
+ .close = aaf_close,
+ .pointer = aaf_pointer,
+ .start = aaf_start,
+ .stop = aaf_stop,
+};
+
+SND_PCM_PLUGIN_DEFINE_FUNC(aaf)
+{
+ snd_pcm_aaf_t *aaf;
+ int res;
+
+ aaf = calloc(1, sizeof(*aaf));
+ if (!aaf) {
+ SNDERR("Failed to allocate memory");
+ return -ENOMEM;
+ }
+
+ aaf->io.version = SND_PCM_IOPLUG_VERSION;
+ aaf->io.name = "AVTP Audio Format (AAF) Plugin";
+ aaf->io.callback = &aaf_callback;
+ aaf->io.private_data = aaf;
+ res = snd_pcm_ioplug_create(&aaf->io, name, stream, mode);
+ if (res < 0) {
+ SNDERR("Failed to create ioplug instance");
+ goto err;
+ }
+
+ *pcmp = aaf->io.pcm;
+ return 0;
+
+err:
+ free(aaf);
+ return res;
+}
+
+SND_PCM_PLUGIN_SYMBOL(aaf);
test "x$prefix" = xNONE && prefix=$ac_default_prefix
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
+AC_ARG_ENABLE([aaf],
+ AS_HELP_STRING([--disable-aaf], [Disable building of AAF plugin]))
+
+if test "x$enable_aaf" != "xno"; then
+ PKG_CHECK_MODULES(AVTP, avtp >= 0.1, [HAVE_AAF=yes], [HAVE_AAF=no])
+fi
+AM_CONDITIONAL(HAVE_AAF, test x$HAVE_AAF = xyes)
+
dnl ALSA plugin directory
AC_ARG_WITH(plugindir,
AS_HELP_STRING([--with-plugindir=dir],
usb_stream/Makefile
speex/Makefile
arcam-av/Makefile
+ aaf/Makefile
])
dnl Show the build conditions
echo " speexdsp_CFLAGS: $speexdsp_CFLAGS"
echo " speexdsp_LIBS: $speexdsp_LIBS"
fi
+echo "AAF plugin: $HAVE_AAF"
--- /dev/null
+AVTP Audio Format (AAF) Plugin
+==============================
+
+Overview
+--------
+
+The AAF plugin is a PCM plugin that uses Audio Video Transport Protocol (AVTP)
+to transmit/receive audio samples through a Time-Sensitive Network (TSN)
+capable network. The plugin enables media applications to easily implement AVTP
+Talker and Listener functionalities.
+
+Plugin Dependencies
+-------------------
+
+The AAF plugin uses libavtp to handle AVTP packetization. Libavtp source code
+can be found in https://github.com/AVnu/libavtp as well as instructions to
+build and install it. If libavtp isn't detected by configure, the plugin isn't
+built.