From eaeab383bb7dc15b3f18a120486f61c2838fc80c Mon Sep 17 00:00:00 2001 From: Andre Guedes Date: Mon, 14 Jan 2019 10:18:42 -0800 Subject: [PATCH] avtp: AVTP plugin bootstrap code 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 | 8 +++++++ ext/Makefile.am | 8 +++++++ ext/avtp/Makefile.am | 17 ++++++++++++++ ext/avtp/gstavtp.c | 54 ++++++++++++++++++++++++++++++++++++++++++++ ext/avtp/meson.build | 17 ++++++++++++++ ext/meson.build | 1 + meson_options.txt | 1 + 7 files changed, 106 insertions(+) create mode 100644 ext/avtp/Makefile.am create mode 100644 ext/avtp/gstavtp.c create mode 100644 ext/avtp/meson.build diff --git a/configure.ac b/configure.ac index 43bcbc0475..3aaadbd090 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/ext/Makefile.am b/ext/Makefile.am index 9656ce7bf6..17e427da37 100644 --- a/ext/Makefile.am +++ b/ext/Makefile.am @@ -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 index 0000000000..709bdfa671 --- /dev/null +++ b/ext/avtp/Makefile.am @@ -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 index 0000000000..af0adf7121 --- /dev/null +++ b/ext/avtp/gstavtp.c @@ -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 +#endif + +#include + +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 index 0000000000..17706d9271 --- /dev/null +++ b/ext/avtp/meson.build @@ -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 diff --git a/ext/meson.build b/ext/meson.build index e1ce405887..1d3320c590 100644 --- a/ext/meson.build +++ b/ext/meson.build @@ -1,5 +1,6 @@ subdir('assrender') subdir('aom') +subdir('avtp') subdir('bs2b') subdir('bz2') subdir('chromaprint') diff --git a/meson_options.txt b/meson_options.txt index 5531d70e73..2a6dca3060 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -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')