diff options
author | Josh Blum | 2011-07-21 22:18:42 -0700 |
---|---|---|
committer | Josh Blum | 2011-07-21 22:18:42 -0700 |
commit | d760edf9fb851d97c972a69690b26114dd998157 (patch) | |
tree | d2adb2089083ad1865637ec4f0635ebd6920bf27 | |
parent | b192751f34ecca720adf64c90660b9e965cfd40e (diff) | |
download | gnuradio-d760edf9fb851d97c972a69690b26114dd998157.tar.gz gnuradio-d760edf9fb851d97c972a69690b26114dd998157.tar.bz2 gnuradio-d760edf9fb851d97c972a69690b26114dd998157.zip |
vocoder: added symbol visibility defines to gr-vocoder, builds on MSVC and linux
-rw-r--r-- | gr-vocoder/CMakeLists.txt | 3 | ||||
-rw-r--r-- | gr-vocoder/include/CMakeLists.txt | 1 | ||||
-rw-r--r-- | gr-vocoder/include/Makefile.am | 1 | ||||
-rw-r--r-- | gr-vocoder/include/gr_vocoder_api.h | 33 | ||||
-rw-r--r-- | gr-vocoder/include/vocoder_alaw_decode_bs.h | 7 | ||||
-rw-r--r-- | gr-vocoder/include/vocoder_alaw_encode_sb.h | 7 | ||||
-rw-r--r-- | gr-vocoder/include/vocoder_codec2_decode_ps.h | 7 | ||||
-rw-r--r-- | gr-vocoder/include/vocoder_codec2_encode_sp.h | 7 | ||||
-rw-r--r-- | gr-vocoder/include/vocoder_cvsd_decode_bs.h | 7 | ||||
-rw-r--r-- | gr-vocoder/include/vocoder_cvsd_encode_sb.h | 7 | ||||
-rw-r--r-- | gr-vocoder/include/vocoder_gsm_fr_decode_ps.h | 7 | ||||
-rw-r--r-- | gr-vocoder/include/vocoder_gsm_fr_encode_sp.h | 7 | ||||
-rw-r--r-- | gr-vocoder/include/vocoder_ulaw_decode_bs.h | 7 | ||||
-rw-r--r-- | gr-vocoder/include/vocoder_ulaw_encode_sb.h | 7 | ||||
-rw-r--r-- | gr-vocoder/lib/codec2/fft.c | 6 | ||||
-rw-r--r-- | gr-vocoder/lib/gsm/gsm_create.c | 1 |
16 files changed, 78 insertions, 37 deletions
diff --git a/gr-vocoder/CMakeLists.txt b/gr-vocoder/CMakeLists.txt index 812fb728a..02ebced90 100644 --- a/gr-vocoder/CMakeLists.txt +++ b/gr-vocoder/CMakeLists.txt @@ -27,13 +27,10 @@ INCLUDE(GrBoost) ######################################################################## INCLUDE(GrComponent) GR_REGISTER_COMPONENT("gr-vocoder" ENABLE_GR_VOCODER - UNIX #FIXME until we get MSVC working Boost_FOUND ENABLE_GR_CORE_ ) -REMOVE_DEFINITIONS(-fvisibility=hidden) #FIXME until we do symbol visibility - GR_SET_GLOBAL(GR_VOCODER_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include ) diff --git a/gr-vocoder/include/CMakeLists.txt b/gr-vocoder/include/CMakeLists.txt index 4e88d9af2..5cbe938b0 100644 --- a/gr-vocoder/include/CMakeLists.txt +++ b/gr-vocoder/include/CMakeLists.txt @@ -21,6 +21,7 @@ # Install header files ######################################################################## INSTALL(FILES + gr_vocoder_api.h vocoder_alaw_decode_bs.h vocoder_alaw_encode_sb.h vocoder_codec2_decode_ps.h diff --git a/gr-vocoder/include/Makefile.am b/gr-vocoder/include/Makefile.am index 06c649680..83960ef24 100644 --- a/gr-vocoder/include/Makefile.am +++ b/gr-vocoder/include/Makefile.am @@ -23,6 +23,7 @@ include $(top_srcdir)/Makefile.common # C/C++ headers get installed in ${prefix}/include/gnuradio grinclude_HEADERS = \ + gr_vocoder_api.h \ vocoder_alaw_decode_bs.h \ vocoder_alaw_encode_sb.h \ vocoder_codec2_decode_ps.h \ diff --git a/gr-vocoder/include/gr_vocoder_api.h b/gr-vocoder/include/gr_vocoder_api.h new file mode 100644 index 000000000..d32db3c6c --- /dev/null +++ b/gr-vocoder/include/gr_vocoder_api.h @@ -0,0 +1,33 @@ +/* + * Copyright 2011 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_GR_VOCODER_API_H +#define INCLUDED_GR_VOCODER_API_H + +#include <gruel/attributes.h> + +#ifdef gnuradio_vocoder_EXPORTS +# define GR_VOCODER_API __GR_ATTR_EXPORT +#else +# define GR_VOCODER_API __GR_ATTR_IMPORT +#endif + +#endif /* INCLUDED_GR_VOCODER_API_H */ diff --git a/gr-vocoder/include/vocoder_alaw_decode_bs.h b/gr-vocoder/include/vocoder_alaw_decode_bs.h index b71569439..250b4eb4f 100644 --- a/gr-vocoder/include/vocoder_alaw_decode_bs.h +++ b/gr-vocoder/include/vocoder_alaw_decode_bs.h @@ -23,13 +23,14 @@ #ifndef INCLUDED_VOCODER_ALAW_DECODE_BS_H #define INCLUDED_VOCODER_ALAW_DECODE_BS_H +#include <gr_vocoder_api.h> #include <gr_sync_block.h> class vocoder_alaw_decode_bs; typedef boost::shared_ptr<vocoder_alaw_decode_bs> vocoder_alaw_decode_bs_sptr; -vocoder_alaw_decode_bs_sptr vocoder_make_alaw_decode_bs(); +GR_VOCODER_API vocoder_alaw_decode_bs_sptr vocoder_make_alaw_decode_bs(); /*! * \brief This block performs alaw audio decoding. @@ -37,10 +38,10 @@ vocoder_alaw_decode_bs_sptr vocoder_make_alaw_decode_bs(); * \ingroup vocoder_blk */ -class vocoder_alaw_decode_bs : public gr_sync_block +class GR_VOCODER_API vocoder_alaw_decode_bs : public gr_sync_block { private: - friend vocoder_alaw_decode_bs_sptr vocoder_make_alaw_decode_bs(); + friend GR_VOCODER_API vocoder_alaw_decode_bs_sptr vocoder_make_alaw_decode_bs(); vocoder_alaw_decode_bs(); diff --git a/gr-vocoder/include/vocoder_alaw_encode_sb.h b/gr-vocoder/include/vocoder_alaw_encode_sb.h index d1858d048..9c20b639c 100644 --- a/gr-vocoder/include/vocoder_alaw_encode_sb.h +++ b/gr-vocoder/include/vocoder_alaw_encode_sb.h @@ -23,23 +23,24 @@ #ifndef INCLUDED_VOCODER_ALAW_ENCODER_SB_H #define INCLUDED_VOCODER_ALAW_ENCODER_SB_H +#include <gr_vocoder_api.h> #include <gr_sync_block.h> class vocoder_alaw_encode_sb; typedef boost::shared_ptr<vocoder_alaw_encode_sb> vocoder_alaw_encode_sb_sptr; -vocoder_alaw_encode_sb_sptr vocoder_make_alaw_encode_sb(); +GR_VOCODER_API vocoder_alaw_encode_sb_sptr vocoder_make_alaw_encode_sb(); /*! * \brief This block performs g.711 alaw audio encoding. * * \ingroup vocoder_blk */ -class vocoder_alaw_encode_sb : public gr_sync_block +class GR_VOCODER_API vocoder_alaw_encode_sb : public gr_sync_block { private: - friend vocoder_alaw_encode_sb_sptr vocoder_make_alaw_encode_sb(); + friend GR_VOCODER_API vocoder_alaw_encode_sb_sptr vocoder_make_alaw_encode_sb(); vocoder_alaw_encode_sb(); diff --git a/gr-vocoder/include/vocoder_codec2_decode_ps.h b/gr-vocoder/include/vocoder_codec2_decode_ps.h index 02b80a454..26115bd13 100644 --- a/gr-vocoder/include/vocoder_codec2_decode_ps.h +++ b/gr-vocoder/include/vocoder_codec2_decode_ps.h @@ -22,21 +22,22 @@ #ifndef INCLUDED_VOCODER_CODEC2_DECODE_PS_H #define INCLUDED_VOCODER_CODEC2_DECODE_PS_H +#include <gr_vocoder_api.h> #include <gr_sync_interpolator.h> class vocoder_codec2_decode_ps; typedef boost::shared_ptr<vocoder_codec2_decode_ps> vocoder_codec2_decode_ps_sptr; -vocoder_codec2_decode_ps_sptr vocoder_make_codec2_decode_ps (); +GR_VOCODER_API vocoder_codec2_decode_ps_sptr vocoder_make_codec2_decode_ps (); /*! * \brief CODEC2 Vocoder Decoder * \ingroup vocoder_blk */ -class vocoder_codec2_decode_ps : public gr_sync_interpolator { +class GR_VOCODER_API vocoder_codec2_decode_ps : public gr_sync_interpolator { void *d_codec2; - friend vocoder_codec2_decode_ps_sptr vocoder_make_codec2_decode_ps (); + friend GR_VOCODER_API vocoder_codec2_decode_ps_sptr vocoder_make_codec2_decode_ps (); vocoder_codec2_decode_ps (); public: diff --git a/gr-vocoder/include/vocoder_codec2_encode_sp.h b/gr-vocoder/include/vocoder_codec2_encode_sp.h index de4784f8d..486e5b636 100644 --- a/gr-vocoder/include/vocoder_codec2_encode_sp.h +++ b/gr-vocoder/include/vocoder_codec2_encode_sp.h @@ -22,21 +22,22 @@ #ifndef INCLUDED_VOCODER_CODEC2_ENCODE_SP_H #define INCLUDED_VOCODER_CODEC2_ENCODE_SP_H +#include <gr_vocoder_api.h> #include <gr_sync_decimator.h> class vocoder_codec2_encode_sp; typedef boost::shared_ptr<vocoder_codec2_encode_sp> vocoder_codec2_encode_sp_sptr; -vocoder_codec2_encode_sp_sptr vocoder_make_codec2_encode_sp (); +GR_VOCODER_API vocoder_codec2_encode_sp_sptr vocoder_make_codec2_encode_sp (); /*! * \brief CODEC2 Vocoder Encoder * \ingroup vocoder_blk */ -class vocoder_codec2_encode_sp : public gr_sync_decimator { +class GR_VOCODER_API vocoder_codec2_encode_sp : public gr_sync_decimator { void *d_codec2; - friend vocoder_codec2_encode_sp_sptr vocoder_make_codec2_encode_sp (); + friend GR_VOCODER_API vocoder_codec2_encode_sp_sptr vocoder_make_codec2_encode_sp (); vocoder_codec2_encode_sp (); public: diff --git a/gr-vocoder/include/vocoder_cvsd_decode_bs.h b/gr-vocoder/include/vocoder_cvsd_decode_bs.h index dd588c661..48b92d8cf 100644 --- a/gr-vocoder/include/vocoder_cvsd_decode_bs.h +++ b/gr-vocoder/include/vocoder_cvsd_decode_bs.h @@ -23,6 +23,7 @@ #ifndef INCLUDED_VOCODER_CVSD_DECODE_BS_H #define INCLUDED_VOCODER_CVSD_DECODE_BS_H +#include <gr_vocoder_api.h> #include <gr_sync_interpolator.h> class vocoder_cvsd_decode_bs; @@ -44,7 +45,7 @@ typedef boost::shared_ptr<vocoder_cvsd_decode_bs> vocoder_cvsd_decode_bs_sptr; * \param neg_accum_max Minimum integer value allowed for the internal reference. Default: "-32767" (-2^15 + 1 or MINSHORT+1) * */ -vocoder_cvsd_decode_bs_sptr vocoder_make_cvsd_decode_bs (short min_step=10, +GR_VOCODER_API vocoder_cvsd_decode_bs_sptr vocoder_make_cvsd_decode_bs (short min_step=10, short max_step=1280, double step_decay=0.9990234375, double accum_decay= 0.96875, @@ -105,10 +106,10 @@ vocoder_cvsd_decode_bs_sptr vocoder_make_cvsd_decode_bs (short min_step=10, * */ -class vocoder_cvsd_decode_bs : public gr_sync_interpolator +class GR_VOCODER_API vocoder_cvsd_decode_bs : public gr_sync_interpolator { private: - friend vocoder_cvsd_decode_bs_sptr vocoder_make_cvsd_decode_bs (short min_step, + friend GR_VOCODER_API vocoder_cvsd_decode_bs_sptr vocoder_make_cvsd_decode_bs (short min_step, short max_step, double step_decay, double accum_decay, diff --git a/gr-vocoder/include/vocoder_cvsd_encode_sb.h b/gr-vocoder/include/vocoder_cvsd_encode_sb.h index da09b3927..15ab0823e 100644 --- a/gr-vocoder/include/vocoder_cvsd_encode_sb.h +++ b/gr-vocoder/include/vocoder_cvsd_encode_sb.h @@ -22,6 +22,7 @@ #ifndef INCLUDED_VOCODER_CVSD_ENCODER_SB_H #define INCLUDED_VOCODER_CVSD_ENCODER_SB_H +#include <gr_vocoder_api.h> #include <gr_sync_decimator.h> class vocoder_cvsd_encode_sb; @@ -44,7 +45,7 @@ typedef boost::shared_ptr<vocoder_cvsd_encode_sb> vocoder_cvsd_encode_sb_sptr; * */ -vocoder_cvsd_encode_sb_sptr vocoder_make_cvsd_encode_sb(short min_step=10, +GR_VOCODER_API vocoder_cvsd_encode_sb_sptr vocoder_make_cvsd_encode_sb(short min_step=10, short max_step=1280, double step_decay=0.9990234375, double accum_decay= 0.96875, @@ -107,10 +108,10 @@ vocoder_cvsd_encode_sb_sptr vocoder_make_cvsd_encode_sb(short min_step=10, * */ -class vocoder_cvsd_encode_sb : public gr_sync_decimator +class GR_VOCODER_API vocoder_cvsd_encode_sb : public gr_sync_decimator { private: - friend vocoder_cvsd_encode_sb_sptr vocoder_make_cvsd_encode_sb(short min_step, + friend GR_VOCODER_API vocoder_cvsd_encode_sb_sptr vocoder_make_cvsd_encode_sb(short min_step, short max_step, double step_decay, double accum_decay, diff --git a/gr-vocoder/include/vocoder_gsm_fr_decode_ps.h b/gr-vocoder/include/vocoder_gsm_fr_decode_ps.h index 4c6248d39..448d046db 100644 --- a/gr-vocoder/include/vocoder_gsm_fr_decode_ps.h +++ b/gr-vocoder/include/vocoder_gsm_fr_decode_ps.h @@ -23,21 +23,22 @@ #ifndef INCLUDED_VOCODER_GSM_FR_DECODE_PS_H #define INCLUDED_VOCODER_GSM_FR_DECODE_PS_H +#include <gr_vocoder_api.h> #include <gr_sync_interpolator.h> class vocoder_gsm_fr_decode_ps; typedef boost::shared_ptr<vocoder_gsm_fr_decode_ps> vocoder_gsm_fr_decode_ps_sptr; -vocoder_gsm_fr_decode_ps_sptr vocoder_make_gsm_fr_decode_ps (); +GR_VOCODER_API vocoder_gsm_fr_decode_ps_sptr vocoder_make_gsm_fr_decode_ps (); /*! * \brief GSM 06.10 Full Rate Vocoder Decoder * \ingroup vocoder_blk */ -class vocoder_gsm_fr_decode_ps : public gr_sync_interpolator { +class GR_VOCODER_API vocoder_gsm_fr_decode_ps : public gr_sync_interpolator { struct gsm_state *d_gsm; - friend vocoder_gsm_fr_decode_ps_sptr vocoder_make_gsm_fr_decode_ps (); + friend GR_VOCODER_API vocoder_gsm_fr_decode_ps_sptr vocoder_make_gsm_fr_decode_ps (); vocoder_gsm_fr_decode_ps (); public: diff --git a/gr-vocoder/include/vocoder_gsm_fr_encode_sp.h b/gr-vocoder/include/vocoder_gsm_fr_encode_sp.h index d1803c82e..dd190719e 100644 --- a/gr-vocoder/include/vocoder_gsm_fr_encode_sp.h +++ b/gr-vocoder/include/vocoder_gsm_fr_encode_sp.h @@ -23,12 +23,13 @@ #ifndef INCLUDED_VOCODER_GSM_FR_ENCODE_SP_H #define INCLUDED_VOCODER_GSM_FR_ENCODE_SP_H +#include <gr_vocoder_api.h> #include <gr_sync_decimator.h> class vocoder_gsm_fr_encode_sp; typedef boost::shared_ptr<vocoder_gsm_fr_encode_sp> vocoder_gsm_fr_encode_sp_sptr; -vocoder_gsm_fr_encode_sp_sptr vocoder_make_gsm_fr_encode_sp (); +GR_VOCODER_API vocoder_gsm_fr_encode_sp_sptr vocoder_make_gsm_fr_encode_sp (); /*! * \brief GSM 06.10 Full Rate Vocoder Encoder @@ -36,10 +37,10 @@ vocoder_gsm_fr_encode_sp_sptr vocoder_make_gsm_fr_encode_sp (); * * shorts in; 33 byte packets out */ -class vocoder_gsm_fr_encode_sp : public gr_sync_decimator { +class GR_VOCODER_API vocoder_gsm_fr_encode_sp : public gr_sync_decimator { struct gsm_state *d_gsm; - friend vocoder_gsm_fr_encode_sp_sptr vocoder_make_gsm_fr_encode_sp (); + friend GR_VOCODER_API vocoder_gsm_fr_encode_sp_sptr vocoder_make_gsm_fr_encode_sp (); vocoder_gsm_fr_encode_sp (); public: diff --git a/gr-vocoder/include/vocoder_ulaw_decode_bs.h b/gr-vocoder/include/vocoder_ulaw_decode_bs.h index 1126c6cb3..14998a64f 100644 --- a/gr-vocoder/include/vocoder_ulaw_decode_bs.h +++ b/gr-vocoder/include/vocoder_ulaw_decode_bs.h @@ -23,13 +23,14 @@ #ifndef INCLUDED_VOCODER_ULAW_DECODE_BS_H #define INCLUDED_VOCODER_ULAW_DECODE_BS_H +#include <gr_vocoder_api.h> #include <gr_sync_block.h> class vocoder_ulaw_decode_bs; typedef boost::shared_ptr<vocoder_ulaw_decode_bs> vocoder_ulaw_decode_bs_sptr; -vocoder_ulaw_decode_bs_sptr vocoder_make_ulaw_decode_bs(); +GR_VOCODER_API vocoder_ulaw_decode_bs_sptr vocoder_make_ulaw_decode_bs(); /*! * \brief This block performs ulaw audio decoding. @@ -37,10 +38,10 @@ vocoder_ulaw_decode_bs_sptr vocoder_make_ulaw_decode_bs(); * \ingroup vocoder_blk */ -class vocoder_ulaw_decode_bs : public gr_sync_block +class GR_VOCODER_API vocoder_ulaw_decode_bs : public gr_sync_block { private: - friend vocoder_ulaw_decode_bs_sptr vocoder_make_ulaw_decode_bs(); + friend GR_VOCODER_API vocoder_ulaw_decode_bs_sptr vocoder_make_ulaw_decode_bs(); vocoder_ulaw_decode_bs(); diff --git a/gr-vocoder/include/vocoder_ulaw_encode_sb.h b/gr-vocoder/include/vocoder_ulaw_encode_sb.h index eddc4f4e5..a0be3430c 100644 --- a/gr-vocoder/include/vocoder_ulaw_encode_sb.h +++ b/gr-vocoder/include/vocoder_ulaw_encode_sb.h @@ -23,23 +23,24 @@ #ifndef INCLUDED_VOCODER_ULAW_ENCODER_SB_H #define INCLUDED_VOCODER_ULAW_ENCODER_SB_H +#include <gr_vocoder_api.h> #include <gr_sync_block.h> class vocoder_ulaw_encode_sb; typedef boost::shared_ptr<vocoder_ulaw_encode_sb> vocoder_ulaw_encode_sb_sptr; -vocoder_ulaw_encode_sb_sptr vocoder_make_ulaw_encode_sb(); +GR_VOCODER_API vocoder_ulaw_encode_sb_sptr vocoder_make_ulaw_encode_sb(); /*! * \brief This block performs g.711 ulaw audio encoding. * * \ingroup vocoder_blk */ -class vocoder_ulaw_encode_sb : public gr_sync_block +class GR_VOCODER_API vocoder_ulaw_encode_sb : public gr_sync_block { private: - friend vocoder_ulaw_encode_sb_sptr vocoder_make_ulaw_encode_sb(); + friend GR_VOCODER_API vocoder_ulaw_encode_sb_sptr vocoder_make_ulaw_encode_sb(); vocoder_ulaw_encode_sb(); diff --git a/gr-vocoder/lib/codec2/fft.c b/gr-vocoder/lib/codec2/fft.c index 73c46c846..a33e4d2c8 100644 --- a/gr-vocoder/lib/codec2/fft.c +++ b/gr-vocoder/lib/codec2/fft.c @@ -72,18 +72,18 @@ initialize_fft (int n) void fft (float x[], int n, int isign) { + int isReverse = 0; + int c; + kiss_fft_cfg cfg; if (cfg_forward == NULL) { initialize_fft (n); } - int isReverse = 0; - int c; for (c = 0; c < n * 2; c += 2) { fin[c / 2].r = x[c]; fin[c / 2].i = -x[c + 1]; } - kiss_fft_cfg cfg; if (isign == -1) { cfg = cfg_reverse; diff --git a/gr-vocoder/lib/gsm/gsm_create.c b/gr-vocoder/lib/gsm/gsm_create.c index de0b125b4..a59aa2f2a 100644 --- a/gr-vocoder/lib/gsm/gsm_create.c +++ b/gr-vocoder/lib/gsm/gsm_create.c @@ -30,7 +30,6 @@ static char const ident[] = "$Header$"; #include "gsm.h" #include "private.h" #include "proto.h" -#include <strings.h> gsm gsm_create P0() { |