diff options
author | A. Maitland Bottoms <bottoms@debian.org> | 2016-06-25 18:08:44 -0400 |
---|---|---|
committer | A. Maitland Bottoms <bottoms@debian.org> | 2016-06-25 18:49:56 -0400 |
commit | d2afb9f9698a34bdd6f6dc43298a4521fcd30da1 (patch) | |
tree | d3d93c5013ab93fdd0787652c798aa3147d21fc0 /gr-vocoder | |
parent | 309798aea8f35e4a208c62ebf349fb5553b8d907 (diff) |
gr-vocoder: gsm subcomponent using external gsm library
Diffstat (limited to 'gr-vocoder')
-rw-r--r-- | gr-vocoder/CMakeLists.txt | 10 | ||||
-rw-r--r-- | gr-vocoder/examples/CMakeLists.txt | 11 | ||||
-rw-r--r-- | gr-vocoder/grc/CMakeLists.txt | 13 | ||||
-rw-r--r-- | gr-vocoder/include/gnuradio/vocoder/CMakeLists.txt | 13 | ||||
-rw-r--r-- | gr-vocoder/lib/CMakeLists.txt | 82 | ||||
-rw-r--r-- | gr-vocoder/lib/gsm_fr_decode_ps_impl.cc | 3 | ||||
-rw-r--r-- | gr-vocoder/lib/gsm_fr_encode_sp_impl.cc | 3 | ||||
-rw-r--r-- | gr-vocoder/python/vocoder/CMakeLists.txt | 8 | ||||
-rw-r--r-- | gr-vocoder/swig/CMakeLists.txt | 6 | ||||
-rw-r--r-- | gr-vocoder/swig/vocoder_swig.i | 21 |
10 files changed, 75 insertions, 95 deletions
diff --git a/gr-vocoder/CMakeLists.txt b/gr-vocoder/CMakeLists.txt index ddf3684479..56ba2a9639 100644 --- a/gr-vocoder/CMakeLists.txt +++ b/gr-vocoder/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 2011 Free Software Foundation, Inc. +# Copyright 2011,2016 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -104,6 +104,14 @@ if(LIBCODEC2_FOUND) endif(LIBCODEC2_FOUND) ######################################################################## +## GSM Support +######################################################################## +find_package(GSM) +if(LIBGSM_FOUND) + GR_APPEND_SUBCOMPONENT("gsm") +endif(LIBGSM_FOUND) + +######################################################################## # Add subdirectories ######################################################################## add_subdirectory(include/gnuradio/vocoder) diff --git a/gr-vocoder/examples/CMakeLists.txt b/gr-vocoder/examples/CMakeLists.txt index 86cba6d01f..0957d81eb6 100644 --- a/gr-vocoder/examples/CMakeLists.txt +++ b/gr-vocoder/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 2011 Free Software Foundation, Inc. +# Copyright 2011,2016 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -29,7 +29,6 @@ GR_PYTHON_INSTALL( g721_audio_loopback.py g723_24_audio_loopback.py g723_40_audio_loopback.py - gsm_audio_loopback.py ulaw_audio_loopback.py DESTINATION ${GR_PKG_VOCODER_EXAMPLES_DIR} COMPONENT "vocoder_examples" @@ -42,3 +41,11 @@ if(LIBCODEC2_FOUND) COMPONENT "vocoder_examples" ) endif(LIBCODEC2_FOUND) +if(LIBGSM_FOUND) + GR_PYTHON_INSTALL( + PROGRAMS + gsm_audio_loopback.py + DESTINATION ${GR_PKG_VOCODER_EXAMPLES_DIR} + COMPONENT "vocoder_examples" + ) +endif(LIBGSM_FOUND) diff --git a/gr-vocoder/grc/CMakeLists.txt b/gr-vocoder/grc/CMakeLists.txt index 35a585a754..e6c8115dbe 100644 --- a/gr-vocoder/grc/CMakeLists.txt +++ b/gr-vocoder/grc/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 2011 Free Software Foundation, Inc. +# Copyright 2011,2016 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -31,8 +31,6 @@ install(FILES vocoder_g723_24_encode_sb.xml vocoder_g723_40_decode_bs.xml vocoder_g723_40_encode_sb.xml - vocoder_gsm_fr_decode_ps.xml - vocoder_gsm_fr_encode_sp.xml vocoder_ulaw_decode_bs.xml vocoder_ulaw_encode_sb.xml DESTINATION ${GRC_BLOCKS_DIR} @@ -47,3 +45,12 @@ if(LIBCODEC2_FOUND) COMPONENT "vocoder_python" ) endif(LIBCODEC2_FOUND) + +if(LIBGSM_FOUND) + install(FILES + vocoder_gsm_fr_decode_ps.xml + vocoder_gsm_fr_encode_sp.xml + DESTINATION ${GRC_BLOCKS_DIR} + COMPONENT "vocoder_python" + ) +endif(LIBGSM_FOUND) diff --git a/gr-vocoder/include/gnuradio/vocoder/CMakeLists.txt b/gr-vocoder/include/gnuradio/vocoder/CMakeLists.txt index 6d9bbe8310..13efea7add 100644 --- a/gr-vocoder/include/gnuradio/vocoder/CMakeLists.txt +++ b/gr-vocoder/include/gnuradio/vocoder/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 2012,2013 Free Software Foundation, Inc. +# Copyright 2012,2013,2016 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -32,14 +32,11 @@ install(FILES g723_24_encode_sb.h g723_40_decode_bs.h g723_40_encode_sb.h - gsm_fr_decode_ps.h - gsm_fr_encode_sp.h ulaw_decode_bs.h ulaw_encode_sb.h DESTINATION ${GR_INCLUDE_DIR}/gnuradio/vocoder COMPONENT "vocoder_devel" ) - if(LIBCODEC2_FOUND) install(FILES codec2.h @@ -49,3 +46,11 @@ install(FILES COMPONENT "vocoder_devel" ) endif(LIBCODEC2_FOUND) +if(LIBGSM_FOUND) +install(FILES + gsm_fr_decode_ps.h + gsm_fr_encode_sp.h + DESTINATION ${GR_INCLUDE_DIR}/gnuradio/vocoder + COMPONENT "vocoder_devel" +) +endif(LIBGSM_FOUND) diff --git a/gr-vocoder/lib/CMakeLists.txt b/gr-vocoder/lib/CMakeLists.txt index 67939c53d2..a8fc874d31 100644 --- a/gr-vocoder/lib/CMakeLists.txt +++ b/gr-vocoder/lib/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 2011,2013 Free Software Foundation, Inc. +# Copyright 2011,2013,2016 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -18,70 +18,6 @@ # Boston, MA 02110-1301, USA. ######################################################################## -# Check for system libgsm via CMake variable GR_USE_SYSTEM_LIBGSM .... -# if undefined, try to find system libgsm library, -# but if there is no system library use a local copy. -# if defined True, use system libgsm if found, otherwise do not -# use a local copy. -# if defined False, use the local copy -######################################################################## -if (NOT DEFINED GR_USE_SYSTEM_LIBGSM) - find_path(LIBGSM_INCLUDE_DIR NAMES gsm.h - PATHS - ${LIBGSM_PKG_INCLUDE_DIRS} - /usr/include/gsm - /usr/include - ) - - find_library(LIBGSM_LIBRARIES NAMES gsm - PATHS - ${LIBGSM_PKG_LIBRARY_DIRS} - /usr/lib - ) - - if(LIBGSM_INCLUDE_DIR AND LIBGSM_LIBRARIES) - set(GR_USE_SYSTEM_LIBGSM TRUE CACHE INTERNAL "System libgsm found") - message(STATUS "Found libgsm: ${LIBGSM_INCLUDE_DIR}, ${LIBGSM_LIBRARIES}") - set(GR_USE_LOCAL_LIBGSM FALSE) - set(GR_USE_SYSTEM_LIBGSM TRUE) - else(LIBGSM_INCLUDE_DIR AND LIBGSM_LIBRARIES) - set(GR_USE_SYSTEM_LIBGSM FALSE CACHE INTERNAL "System libgsm found") - message(STATUS "System libgsm not found.") - set(GR_USE_LOCAL_LIBGSM TRUE) - endif(LIBGSM_INCLUDE_DIR AND LIBGSM_LIBRARIES) -else (NOT DEFINED GR_USE_SYSTEM_LIBGSM) - if (GR_USE_SYSTEM_LIBGSM) - find_path(LIBGSM_INCLUDE_DIR NAMES gsm.h - PATHS - ${LIBGSM_PKG_INCLUDE_DIRS} - /usr/include/gsm - /usr/include - ) - - find_library(LIBGSM_LIBRARIES NAMES gsm - PATHS - ${LIBGSM_PKG_LIBRARY_DIRS} - /usr/lib - ) - - if(LIBGSM_INCLUDE_DIR AND LIBGSM_LIBRARIES) - set(GR_USE_SYSTEM_LIBGSM TRUE CACHE INTERNAL "System libgsm found") - message(STATUS "Found libgsm: ${LIBGSM_INCLUDE_DIR}, ${LIBGSM_LIBRARIES}") - set(GR_USE_LOCAL_LIBGSM FALSE) - else(LIBGSM_INCLUDE_DIR AND LIBGSM_LIBRARIES) - set(GR_USE_SYSTEM_LIBGSM FALSE CACHE INTERNAL "System libgsm found") - message(STATUS "System libgsm not found.") - set(GR_USE_LOCAL_LIBGSM FALSE) - endif(LIBGSM_INCLUDE_DIR AND LIBGSM_LIBRARIES) - else (GR_USE_SYSTEM_LIBGSM) - set(GR_USE_LOCAL_LIBGSM TRUE) - message(STATUS "Using gnuradio local copy of libgsm.") - endif (GR_USE_SYSTEM_LIBGSM) -endif (NOT DEFINED GR_USE_SYSTEM_LIBGSM) - -mark_as_advanced(LIBGSM_INCLUDE_DIR LIBGSM_LIBRARIES) - -######################################################################## # Setup the include and linker paths ######################################################################## include_directories( @@ -115,8 +51,6 @@ list(APPEND gr_vocoder_sources g723_24_encode_sb_impl.cc g723_40_decode_bs_impl.cc g723_40_encode_sb_impl.cc - gsm_fr_decode_ps_impl.cc - gsm_fr_encode_sp_impl.cc ulaw_decode_bs_impl.cc ulaw_encode_sb_impl.cc ) @@ -127,6 +61,12 @@ if(LIBCODEC2_FOUND) codec2_encode_sp_impl.cc ) endif(LIBCODEC2_FOUND) +if(LIBGSM_FOUND) + list(APPEND gr_vocoder_sources + gsm_fr_decode_ps_impl.cc + gsm_fr_encode_sp_impl.cc + ) +endif(LIBGSM_FOUND) #Add Windows DLL resource file if using MSVC if(MSVC) @@ -147,10 +87,6 @@ endif(MSVC) ######################################################################## GR_INCLUDE_SUBDIRECTORY(g7xx) -if(GR_USE_LOCAL_LIBGSM) - GR_INCLUDE_SUBDIRECTORY(gsm) -endif(GR_USE_LOCAL_LIBGSM) - list(APPEND vocoder_libs gnuradio-runtime ${Boost_LIBRARIES} @@ -161,9 +97,9 @@ if(LIBCODEC2_LIBRARIES) list(APPEND vocoder_libs ${LIBCODEC2_LIBRARIES}) endif(LIBCODEC2_LIBRARIES) -if(GR_USE_SYSTEM_LIBGSM) +if(LIBGSM_LIBRARIES) list(APPEND vocoder_libs ${LIBGSM_LIBRARIES}) -endif(GR_USE_SYSTEM_LIBGSM) +endif(LIBGSM_LIBRARIES) add_library(gnuradio-vocoder SHARED ${gr_vocoder_sources}) target_link_libraries(gnuradio-vocoder ${vocoder_libs}) diff --git a/gr-vocoder/lib/gsm_fr_decode_ps_impl.cc b/gr-vocoder/lib/gsm_fr_decode_ps_impl.cc index 97fbc1b9b0..4bf85ac9e7 100644 --- a/gr-vocoder/lib/gsm_fr_decode_ps_impl.cc +++ b/gr-vocoder/lib/gsm_fr_decode_ps_impl.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005,2010,2013 Free Software Foundation, Inc. + * Copyright 2005,2010,2013,2016 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -24,6 +24,7 @@ #include "config.h" #endif +#define GSM_SAMPLES_PER_FRAME 160 #include "gsm_fr_decode_ps_impl.h" #include <gnuradio/io_signature.h> #include <stdexcept> diff --git a/gr-vocoder/lib/gsm_fr_encode_sp_impl.cc b/gr-vocoder/lib/gsm_fr_encode_sp_impl.cc index 0c3afe8f59..9cbd4da679 100644 --- a/gr-vocoder/lib/gsm_fr_encode_sp_impl.cc +++ b/gr-vocoder/lib/gsm_fr_encode_sp_impl.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005,2010,2013 Free Software Foundation, Inc. + * Copyright 2005,2010,2013,2016 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -24,6 +24,7 @@ #include "config.h" #endif +#define GSM_SAMPLES_PER_FRAME 160 #include "gsm_fr_encode_sp_impl.h" #include <gnuradio/io_signature.h> #include <stdexcept> diff --git a/gr-vocoder/python/vocoder/CMakeLists.txt b/gr-vocoder/python/vocoder/CMakeLists.txt index 1626df1868..02a4320ec5 100644 --- a/gr-vocoder/python/vocoder/CMakeLists.txt +++ b/gr-vocoder/python/vocoder/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 2011 Free Software Foundation, Inc. +# Copyright 2011,2016 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -48,7 +48,6 @@ if(ENABLE_TESTING) qa_g721_vocoder.py qa_g723_24_vocoder.py qa_g723_40_vocoder.py - qa_gsm_full_rate.py qa_ulaw_vocoder.py ) if(LIBCODEC2_FOUND) @@ -56,6 +55,11 @@ if(ENABLE_TESTING) qa_codec2_vocoder.py ) endif() + if(LIBGSM_FOUND) + list(APPEND py_qa_test_files + qa_gsm_full_rate.py + ) + endif() foreach(py_qa_test_file ${py_qa_test_files}) get_filename_component(py_qa_test_name ${py_qa_test_file} NAME_WE) GR_ADD_TEST(${py_qa_test_name} ${QA_PYTHON_EXECUTABLE} ${PYTHON_DASH_B} ${py_qa_test_file}) diff --git a/gr-vocoder/swig/CMakeLists.txt b/gr-vocoder/swig/CMakeLists.txt index 6ba29516f7..3eb7a83f31 100644 --- a/gr-vocoder/swig/CMakeLists.txt +++ b/gr-vocoder/swig/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 2011 Free Software Foundation, Inc. +# Copyright 2011,2016 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -37,6 +37,10 @@ if(LIBCODEC2_FOUND) list(APPEND GR_SWIG_FLAGS "-DLIBCODEC2_FOUND") endif(LIBCODEC2_FOUND) +if(LIBGSM_FOUND) + list(APPEND GR_SWIG_FLAGS "-DLIBGSM_FOUND") +endif(LIBGSM_FOUND) + set(GR_SWIG_DOC_FILE ${CMAKE_CURRENT_BINARY_DIR}/vocoder_swig_doc.i) set(GR_SWIG_DOC_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../include/gnuradio/vocoder) set(GR_SWIG_DOCS_TARGET_DEPS runtime_swig_swig_doc) diff --git a/gr-vocoder/swig/vocoder_swig.i b/gr-vocoder/swig/vocoder_swig.i index 22aad98e08..43d0d1f79b 100644 --- a/gr-vocoder/swig/vocoder_swig.i +++ b/gr-vocoder/swig/vocoder_swig.i @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2011,2013 Free Software Foundation, Inc. + * Copyright 2011,2013,2016 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -38,8 +38,6 @@ #include "gnuradio/vocoder/g723_24_encode_sb.h" #include "gnuradio/vocoder/g723_40_decode_bs.h" #include "gnuradio/vocoder/g723_40_encode_sb.h" -#include "gnuradio/vocoder/gsm_fr_decode_ps.h" -#include "gnuradio/vocoder/gsm_fr_encode_sp.h" #include "gnuradio/vocoder/ulaw_decode_bs.h" #include "gnuradio/vocoder/ulaw_encode_sb.h" %} @@ -54,8 +52,6 @@ %include "gnuradio/vocoder/g723_24_encode_sb.h" %include "gnuradio/vocoder/g723_40_decode_bs.h" %include "gnuradio/vocoder/g723_40_encode_sb.h" -%include "gnuradio/vocoder/gsm_fr_decode_ps.h" -%include "gnuradio/vocoder/gsm_fr_encode_sp.h" %include "gnuradio/vocoder/ulaw_decode_bs.h" %include "gnuradio/vocoder/ulaw_encode_sb.h" @@ -69,8 +65,6 @@ GR_SWIG_BLOCK_MAGIC2(vocoder, g723_24_decode_bs); GR_SWIG_BLOCK_MAGIC2(vocoder, g723_24_encode_sb); GR_SWIG_BLOCK_MAGIC2(vocoder, g723_40_decode_bs); GR_SWIG_BLOCK_MAGIC2(vocoder, g723_40_encode_sb); -GR_SWIG_BLOCK_MAGIC2(vocoder, gsm_fr_decode_ps); -GR_SWIG_BLOCK_MAGIC2(vocoder, gsm_fr_encode_sp); GR_SWIG_BLOCK_MAGIC2(vocoder, ulaw_decode_bs); GR_SWIG_BLOCK_MAGIC2(vocoder, ulaw_encode_sb); @@ -90,3 +84,16 @@ GR_SWIG_BLOCK_MAGIC2(vocoder, ulaw_encode_sb); GR_SWIG_BLOCK_MAGIC2(vocoder, codec2_decode_ps); GR_SWIG_BLOCK_MAGIC2(vocoder, codec2_encode_sp); #endif + +#ifdef LIBGSM_FOUND +%{ +#include "gnuradio/vocoder/gsm_fr_decode_ps.h" +#include "gnuradio/vocoder/gsm_fr_encode_sp.h" +%} + +%include "gnuradio/vocoder/gsm_fr_decode_ps.h" +%include "gnuradio/vocoder/gsm_fr_encode_sp.h" + +GR_SWIG_BLOCK_MAGIC2(vocoder, gsm_fr_decode_ps); +GR_SWIG_BLOCK_MAGIC2(vocoder, gsm_fr_encode_sp); +#endif |