avtp: AVTP plugin bootstrap code
authorAndre Guedes <andre.guedes@intel.com>
Mon, 14 Jan 2019 18:18:42 +0000 (10:18 -0800)
committerEderson de Souza <ederson.desouza@intel.com>
Wed, 3 Jul 2019 16:59:35 +0000 (09:59 -0700)
This patch introduces the bootstrap code from the AVTP plugin (plugin
definition and init) as well as the build system files. Upcoming patches
will introduce payloaders, source and sink elements provided by the AVTP
plugin. These elements can be utilized by a GStreamer pipeline to
implement TSN audio/video applications.

Regarding the plugin build system files, both autotools and meson files
are introduced. The AVTP plugin is landed in ext/ since it has an
external dependency on libavtp, an opensource AVTP packetization
library. For further information about libavtp check [1].

[1] https://github.com/AVnu/libavtp

configure.ac
ext/Makefile.am
ext/avtp/Makefile.am [new file with mode: 0644]
ext/avtp/gstavtp.c [new file with mode: 0644]
ext/avtp/meson.build [new file with mode: 0644]
ext/meson.build
meson_options.txt

index 43bcbc0..3aaadbd 100644 (file)
@@ -1092,6 +1092,12 @@ AG_GST_CHECK_FEATURE(AOM, [AV1 encoder/decoder], aom, [
   AG_GST_PKG_CHECK_MODULES(AOM, aom)
 ])
 
+dnl *** avtp ***
+translit(dnm, m, l) AM_CONDITIONAL(USE_AVTP, true)
+AG_GST_CHECK_FEATURE(AVTP, [Audio/Video Transport Protocol], avtp, [
+  AG_GST_PKG_CHECK_MODULES(AVTP, avtp)
+])
+
 dnl *** vo-amrwbenc ***
 translit(dnm, m, l) AM_CONDITIONAL(USE_VOAMRWBENC, true)
 AG_GST_CHECK_FEATURE(VOAMRWBENC, [vo-amrwbenc library], vo-amrwbenc, [
@@ -2214,6 +2220,7 @@ dnl but we still need to set the conditionals
 
 AM_CONDITIONAL(USE_ASSRENDER, false)
 AM_CONDITIONAL(USE_AOM, false)
+AM_CONDITIONAL(USE_AVTP, false)
 AM_CONDITIONAL(USE_VOAMRWBENC, false)
 AM_CONDITIONAL(USE_VOAACENC, false)
 AM_CONDITIONAL(USE_BS2B, false)
@@ -2517,6 +2524,7 @@ ext/voamrwbenc/Makefile
 ext/voaacenc/Makefile
 ext/assrender/Makefile
 ext/aom/Makefile
+ext/avtp/Makefile
 ext/bs2b/Makefile
 ext/bz2/Makefile
 ext/chromaprint/Makefile
index 9656ce7..17e427d 100644 (file)
@@ -10,6 +10,12 @@ else
 AOM_DIR=
 endif
 
+if USE_AVTP
+AVTP_DIR=avtp
+else
+AVTP_DIR=
+endif
+
 if USE_VOAMRWBENC
 VOAMRWBENC_DIR = voamrwbenc
 else
@@ -398,6 +404,7 @@ SUBDIRS=\
        $(VOAACENC_DIR) \
        $(ASSRENDER_DIR) \
        $(AOM_DIR) \
+       $(AVTP_DIR) \
        $(VOAMRWBENC_DIR) \
        $(AUDIOFILE_DIR) \
        $(BS2B_DIR) \
@@ -466,6 +473,7 @@ SUBDIRS=\
 DIST_SUBDIRS = \
        assrender \
        aom \
+       avtp \
        bs2b \
        bz2 \
        colormanagement \
diff --git a/ext/avtp/Makefile.am b/ext/avtp/Makefile.am
new file mode 100644 (file)
index 0000000..709bdfa
--- /dev/null
@@ -0,0 +1,17 @@
+plugin_LTLIBRARIES = libgstavtp.la
+
+libgstavtp_la_SOURCES = gstavtp.c
+
+libgstavtp_la_CFLAGS = \
+       $(GST_PLUGINS_BASE_CFLAGS) \
+       $(GST_BASE_CFLAGS) \
+       $(GST_CFLAGS) \
+       $(AVTP_CFLAGS)
+
+libgstavtp_la_LIBADD = \
+       $(GST_PLUGINS_BASE_LIBS) \
+       $(GST_BASE_LIBS) \
+       $(GST_LIBS) \
+       $(AVTP_LIBS)
+
+libgstavtp_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
diff --git a/ext/avtp/gstavtp.c b/ext/avtp/gstavtp.c
new file mode 100644 (file)
index 0000000..af0adf7
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * GStreamer AVTP Plugin
+ * Copyright (C) 2019 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 library 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
+ */
+
+/**
+ * plugin-avtp:
+ *
+ * ## Audio Video Transport Protocol (AVTP) Plugin
+ *
+ * The AVTP plugin implements typical Talker and Listener functionalities that
+ * can be leveraged by GStreamer-based applications in order to implement TSN
+ * audio/video applications.
+ *
+ * ### Dependencies
+ *
+ * The 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.
+ *
+ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gst/gst.h>
+
+static gboolean
+plugin_init (GstPlugin * plugin)
+{
+  return TRUE;
+}
+
+GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR,
+    avtp, "Audio/Video Transport Protocol (AVTP) plugin",
+    plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN);
diff --git a/ext/avtp/meson.build b/ext/avtp/meson.build
new file mode 100644 (file)
index 0000000..17706d9
--- /dev/null
@@ -0,0 +1,17 @@
+avtp_sources = [
+  'gstavtp.c',
+]
+
+avtp_dep = dependency('avtp', required: get_option('avtp'))
+
+if avtp_dep.found()
+  gstavtp = library('gstavtp',
+    avtp_sources,
+    c_args : gst_plugins_bad_args,
+    include_directories : [configinc],
+    dependencies : libavtp_dep,
+    install : true,
+    install_dir : plugins_install_dir,
+  )
+  pkgconfig.generate(gstavtp, install_dir : plugins_pkgconfig_install_dir)
+endif
index e1ce405..1d3320c 100644 (file)
@@ -1,5 +1,6 @@
 subdir('assrender')
 subdir('aom')
+subdir('avtp')
 subdir('bs2b')
 subdir('bz2')
 subdir('chromaprint')
index 5531d70..2a6dca3 100644 (file)
@@ -74,6 +74,7 @@ option('x11', type : 'feature', value : 'auto', description : 'X11 support in Vu
 
 # Feature options for plugins that need external deps
 option('aom', type : 'feature', value : 'auto', description : 'AOM AV1 video codec plugin')
+option('avtp', type : 'feature', value : 'auto', description : 'Audio/Video Transport Protocol (AVTP) plugin')
 option('androidmedia', type : 'feature', value : 'auto', description : 'Video capture and codec plugins for Android')
 option('applemedia', type : 'feature', value : 'auto', description : 'Video capture and codec access plugins for macOS and iOS')
 option('assrender', type : 'feature', value : 'auto', description : 'ASS/SSA subtitle renderer plugin')