From 95e666404e1e31dfb95d7dc8b00c1b0be88659b3 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Wed, 30 Aug 2017 19:03:49 +0700 Subject: Introduce a shared 'libosmogapk' library The previous GAPK implementation was represented as a single executable. So, all audio transcoding operations were available only by calling the 'gapk' binary. This approach didn't allow external applications to benefit from using GAPK API directly. Since there are some projects (such as GR-GSM and OsmocomBB), which are potential users of GAPK code base, it would be better to have all transcoding functions within a shared library. So, this change separates the common code into a shared library, named 'libosmogapk', and links the 'gapk' binary against one. Currently there are no shared headers, pkg-config manifest and the export map, but they will be done latter. --- src/Makefile.am | 100 +++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 85 insertions(+), 15 deletions(-) (limited to 'src/Makefile.am') diff --git a/src/Makefile.am b/src/Makefile.am index e0b622c..93bdfa1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,20 +1,90 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir) -AM_CFLAGS=-Wall $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOCORE_CFLAGS) \ - ${OPENCORE_AMRNB_CFLAGS} $(LIBALSA_CFLAGS) -AM_LDFLAGS=$(LIBOSMOCODEC_LIBS) $(LIBOSMOCORE_LIBS) \ - ${OPENCORE_AMRNB_LIBS} ${LIBGSM_LIBS} $(LIBALSA_LIBS) - -COM_SOURCES = procqueue.c pq_file.c pq_format.c pq_codec.c pq_rtp.c pq_alsa.c \ - formats.c fmt_amr.c fmt_gsm.c fmt_hr_ref.c fmt_racal.c \ - fmt_amr_opencore.c \ - fmt_rtp_amr.c fmt_rtp_efr.c fmt_rtp_hr_etsi.c fmt_rtp_hr_ietf.c \ - fmt_rawpcm.c fmt_ti.c benchmark.c \ - codecs.c codec_pcm.c codec_hr.c codec_fr.c codec_efr.c codec_amr.c +# This is _NOT_ the library release version, it's an API version. +# Please read Chapter 6 "Library interface versions" of the libtool +# documentation before making any modification +LIBVERSION = 0:0:0 -bin_PROGRAMS = gapk +AM_CPPFLAGS = \ + $(all_includes) \ + -I$(top_builddir) \ + -I$(top_srcdir)/include \ + $(NULL) + +AM_CFLAGS = \ + -Wall \ + $(LIBOSMOCORE_CFLAGS) \ + $(LIBOSMOCODEC_CFLAGS) \ + ${OPENCORE_AMRNB_CFLAGS} \ + $(LIBALSA_CFLAGS) \ + $(NULL) + +lib_LTLIBRARIES = libosmogapk.la -gapk_SOURCES = main.c $(COM_SOURCES) +libosmogapk_la_LDFLAGS = \ + $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOCODEC_LIBS) \ + ${OPENCORE_AMRNB_LIBS} \ + ${LIBGSM_LIBS} \ + $(LIBALSA_LIBS) \ + -version-info $(LIBVERSION) \ + -no-undefined \ + $(NULL) if ENABLE_GSMHR -gapk_LDADD = $(top_builddir)/libgsmhr/libgsmhr.la +libosmogapk_la_LIBADD = $(top_builddir)/libgsmhr/libgsmhr.la endif + +# Processing queue implementation +libosmogapk_la_SOURCES = \ + procqueue.c \ + pq_format.c \ + pq_codec.c \ + pq_file.c \ + pq_alsa.c \ + pq_rtp.c \ + $(NULL) + +# Formats implementation +libosmogapk_la_SOURCES += \ + formats.c \ + fmt_ti.c \ + fmt_amr.c \ + fmt_gsm.c \ + fmt_hr_ref.c \ + fmt_racal.c \ + fmt_rawpcm.c \ + fmt_rtp_amr.c \ + fmt_rtp_efr.c \ + fmt_rtp_hr_etsi.c \ + fmt_rtp_hr_ietf.c \ + fmt_amr_opencore.c \ + $(NULL) + +# Codecs implementation +libosmogapk_la_SOURCES += \ + codecs.c \ + codec_pcm.c \ + codec_hr.c \ + codec_fr.c \ + codec_efr.c \ + codec_amr.c \ + $(NULL) + +# Codec benchmarking +libosmogapk_la_SOURCES += \ + benchmark.c \ + $(NULL) + +# libosmogapk representative application +bin_PROGRAMS = gapk + +gapk_SOURCES = \ + main.c \ + $(NULL) + +gapk_LDFLAGS = \ + $(LIBOSMOCORE_LIBS) \ + $(NULL) + +gapk_LDADD = \ + $(top_builddir)/src/libosmogapk.la \ + $(NULL) -- cgit v1.2.3 From 48206ad2e07216e01c9870b606aee442b3d7ec0e Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Wed, 30 Aug 2017 19:35:51 +0700 Subject: Add an 'osmo' prefix to the 'gapk' binary This is a common practice of all Osmocom executables to have an 'osmo' prefix. Let's follow this here too. --- src/Makefile.am | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Makefile.am') diff --git a/src/Makefile.am b/src/Makefile.am index 93bdfa1..c38f2fe 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -75,16 +75,16 @@ libosmogapk_la_SOURCES += \ $(NULL) # libosmogapk representative application -bin_PROGRAMS = gapk +bin_PROGRAMS = osmo-gapk -gapk_SOURCES = \ +osmo_gapk_SOURCES = \ main.c \ $(NULL) -gapk_LDFLAGS = \ +osmo_gapk_LDFLAGS = \ $(LIBOSMOCORE_LIBS) \ $(NULL) -gapk_LDADD = \ +osmo_gapk_LDADD = \ $(top_builddir)/src/libosmogapk.la \ $(NULL) -- cgit v1.2.3 From 4f0a47d0e35ece9ca46bb62294357d89920d06aa Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Thu, 31 Aug 2017 17:49:36 +0700 Subject: Add the symbol export map for libosmogapk --- src/Makefile.am | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/Makefile.am') diff --git a/src/Makefile.am b/src/Makefile.am index c38f2fe..5dd75ff 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -18,6 +18,7 @@ AM_CFLAGS = \ $(NULL) lib_LTLIBRARIES = libosmogapk.la +EXTRA_DIST = libosmogapk.map libosmogapk_la_LDFLAGS = \ $(LIBOSMOCORE_LIBS) \ @@ -25,6 +26,7 @@ libosmogapk_la_LDFLAGS = \ ${OPENCORE_AMRNB_LIBS} \ ${LIBGSM_LIBS} \ $(LIBALSA_LIBS) \ + $(LTLDFLAGS_OSMOGAPK) \ -version-info $(LIBVERSION) \ -no-undefined \ $(NULL) -- cgit v1.2.3 From f8d91a07b45a618fd25c9d6edcf28218642044c9 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Thu, 7 Sep 2017 00:04:01 +0300 Subject: osmo-gapk: use more convenient name for the source file Since GAPK package contains a library and the representative osmo-gapk application, the 'main.c' looks a bit confusing. Let's use the common naming scheme. --- src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Makefile.am') diff --git a/src/Makefile.am b/src/Makefile.am index 5dd75ff..2c52ec1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -80,7 +80,7 @@ libosmogapk_la_SOURCES += \ bin_PROGRAMS = osmo-gapk osmo_gapk_SOURCES = \ - main.c \ + app_osmo_gapk.c \ $(NULL) osmo_gapk_LDFLAGS = \ -- cgit v1.2.3 From c35ba8a725405f7712618871c56a3b7fb3933e2a Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Thu, 7 Sep 2017 16:36:56 +0300 Subject: libosmogapk: use Osmocom logging framework Since this change, the libosmogapk uses the Osmocom logging framework. By default, logging is disabled and could be enabled by the external applications calling the osmo_gapk_log_init() with a desired log target as an argument. --- src/Makefile.am | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/Makefile.am') diff --git a/src/Makefile.am b/src/Makefile.am index 2c52ec1..060d435 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -76,6 +76,11 @@ libosmogapk_la_SOURCES += \ benchmark.c \ $(NULL) +# Logging +libosmogapk_la_SOURCES += \ + logging.c \ + $(NULL) + # libosmogapk representative application bin_PROGRAMS = osmo-gapk -- cgit v1.2.3 From 750c896b4a9e619bbc6f712f82b8d602a1750f96 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Sat, 9 Sep 2017 14:09:55 +0300 Subject: libosmogapk: rename the 'logging.c' to 'common.c' There are not so much code, related to internal logging subsystem. So, there is no reason to keep a few lines in a dedicated file. In the future one may also be used for other routines. --- src/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Makefile.am') diff --git a/src/Makefile.am b/src/Makefile.am index 060d435..8efd165 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -76,9 +76,9 @@ libosmogapk_la_SOURCES += \ benchmark.c \ $(NULL) -# Logging +# Common routines libosmogapk_la_SOURCES += \ - logging.c \ + common.c \ $(NULL) # libosmogapk representative application -- cgit v1.2.3