提交 3e30434a authored 作者: Steve Underwood's avatar Steve Underwood

Fixed a typo in spandsp's msvc/inttypes.h

Updated sig_tone processing in spandsp to the latest, to allow moy to
proceed with his signaling work.
上级 1d0ce557
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* SpanDSP - a series of DSP components for telephony * SpanDSP - a series of DSP components for telephony
* *
* sig_tone.h - Signalling tone processing for the 2280Hz, 2400Hz, 2600Hz * sig_tone.h - Signalling tone processing for the 2280Hz, 2400Hz, 2600Hz
* and similar signalling tone used in older protocols. * and similar signalling tones used in older protocols.
* *
* Written by Steve Underwood <steveu@coppice.org> * Written by Steve Underwood <steveu@coppice.org>
* *
...@@ -23,15 +23,15 @@ ...@@ -23,15 +23,15 @@
* License along with this program; if not, write to the Free Software * License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *
* $Id: sig_tone.h,v 1.20 2009/09/04 14:38:46 steveu Exp $ * $Id: sig_tone.h,v 1.23 2010/03/09 13:43:04 steveu Exp $
*/ */
/*! \file */ /*! \file */
/*! \page sig_tone_page The signaling tone processor /*! \page sig_tone_page The 2280/2400/2600Hz signalling tone processor
\section sig_tone_sec_1 What does it do? \section sig_tone_sec_1 What does it do?
The signaling tone processor handles the 2280Hz, 2400Hz and 2600Hz tones, used The signalling tone processor handles the 2280Hz, 2400Hz and 2600Hz tones, used
in many analogue signaling procotols, and digital ones derived from them. in many analogue signalling procotols, and digital ones derived from them.
\section sig_tone_sec_2 How does it work? \section sig_tone_sec_2 How does it work?
Most single and two voice frequency signalling systems share many features, as these Most single and two voice frequency signalling systems share many features, as these
...@@ -57,30 +57,30 @@ least supervisory information may be heard. ...@@ -57,30 +57,30 @@ least supervisory information may be heard.
/* The optional tone sets */ /* The optional tone sets */
enum enum
{ {
/*! European 2280Hz signaling tone. Tone 1 is 2280Hz. Tone 2 is not used. */ /*! European 2280Hz signalling tone. Tone 1 is 2280Hz. Tone 2 is not used. */
SIG_TONE_2280HZ = 1, SIG_TONE_2280HZ = 1,
/*! US 2600Hz signaling tone. Tone 1 is 2600Hz. Tone 2 is not used. */ /*! US 2600Hz signalling tone. Tone 1 is 2600Hz. Tone 2 is not used. */
SIG_TONE_2600HZ, SIG_TONE_2600HZ,
/*! US 2400Hz + 2600Hz signaling tones. Tone 1 is 2600Hz. Tone 2 is 2400Hz. */ /*! US 2400Hz + 2600Hz signalling tones. Tone 1 is 2600Hz. Tone 2 is 2400Hz. */
SIG_TONE_2400HZ_2600HZ SIG_TONE_2400HZ_2600HZ
}; };
/* Mode control and report bits for transmit and receive */ /* Mode control and report bits for transmit and receive */
enum enum
{ {
/*! Signaling tone 1 is present */ /*! Signalling tone 1 is present */
SIG_TONE_1_PRESENT = 0x001, SIG_TONE_1_PRESENT = 0x001,
/*! Signaling tone 1 has changed state (ignored when setting tx mode) */ /*! Signalling tone 1 has changed state (ignored when setting tx mode) */
SIG_TONE_1_CHANGE = 0x002, SIG_TONE_1_CHANGE = 0x002,
/*! Signaling tone 2 is present */ /*! Signalling tone 2 is present */
SIG_TONE_2_PRESENT = 0x004, SIG_TONE_2_PRESENT = 0x004,
/*! Signaling tone 2 has changed state (ignored when setting tx mode) */ /*! Signalling tone 2 has changed state (ignored when setting tx mode) */
SIG_TONE_2_CHANGE = 0x008, SIG_TONE_2_CHANGE = 0x008,
/*! The media signal is passing through. Tones might be added to it. */ /*! The media signal is passing through. Tones might be added to it. */
SIG_TONE_TX_PASSTHROUGH = 0x010, SIG_TONE_TX_PASSTHROUGH = 0x010,
/*! The media signal is passing through. Tones might be extracted from it, if detected. */ /*! The media signal is passing through. Tones might be extracted from it, if detected. */
SIG_TONE_RX_PASSTHROUGH = 0x040, SIG_TONE_RX_PASSTHROUGH = 0x040,
/*! Force filtering of the signaling tone, whether signaling is being detected or not. /*! Force filtering of the signalling tone, whether signalling is being detected or not.
This is mostly useful for test purposes. */ This is mostly useful for test purposes. */
SIG_TONE_RX_FILTER_TONE = 0x080, SIG_TONE_RX_FILTER_TONE = 0x080,
/*! Request an update of the transmit status, upon timeout of the previous status. */ /*! Request an update of the transmit status, upon timeout of the previous status. */
...@@ -89,13 +89,6 @@ enum ...@@ -89,13 +89,6 @@ enum
SIG_TONE_RX_UPDATE_REQUEST = 0x200 SIG_TONE_RX_UPDATE_REQUEST = 0x200
}; };
/*!
Signaling tone descriptor. This defines the working state for a
single instance of the transmit and receive sides of a signaling
tone processor.
*/
typedef struct sig_tone_descriptor_s sig_tone_descriptor_t;
typedef struct sig_tone_tx_state_s sig_tone_tx_state_t; typedef struct sig_tone_tx_state_s sig_tone_tx_state_t;
typedef struct sig_tone_rx_state_s sig_tone_rx_state_t; typedef struct sig_tone_rx_state_s sig_tone_rx_state_t;
...@@ -107,7 +100,7 @@ extern "C" ...@@ -107,7 +100,7 @@ extern "C"
/*! Process a block of received audio samples. /*! Process a block of received audio samples.
\brief Process a block of received audio samples. \brief Process a block of received audio samples.
\param s The signaling tone context. \param s The signalling tone context.
\param amp The audio sample buffer. \param amp The audio sample buffer.
\param len The number of samples in the buffer. \param len The number of samples in the buffer.
\return The number of samples unprocessed. */ \return The number of samples unprocessed. */
...@@ -115,36 +108,36 @@ SPAN_DECLARE(int) sig_tone_rx(sig_tone_rx_state_t *s, int16_t amp[], int len); ...@@ -115,36 +108,36 @@ SPAN_DECLARE(int) sig_tone_rx(sig_tone_rx_state_t *s, int16_t amp[], int len);
/*! Set the receive mode. /*! Set the receive mode.
\brief Set the receive mode. \brief Set the receive mode.
\param s The signaling tone context. \param s The signalling tone context.
\param mode The new mode for the receiver. \param mode The new mode for the receiver.
\param duration The duration for this mode, before an update is requested. \param duration The duration for this mode, before an update is requested.
A duration of zero means forever. */ A duration of zero means forever. */
SPAN_DECLARE(void) sig_tone_rx_set_mode(sig_tone_rx_state_t *s, int mode, int duration); SPAN_DECLARE(void) sig_tone_rx_set_mode(sig_tone_rx_state_t *s, int mode, int duration);
/*! Initialise a signaling tone receiver context. /*! Initialise a signalling tone receiver context.
\brief Initialise a signaling tone context. \brief Initialise a signalling tone context.
\param s The signaling tone context. \param s The signalling tone context.
\param tone_type The type of signaling tone. \param tone_type The type of signalling tone.
\param sig_update Callback function to handle signaling updates. \param sig_update Callback function to handle signalling updates.
\param user_data An opaque pointer. \param user_data An opaque pointer.
\return A pointer to the signalling tone context, or NULL if there was a problem. */ \return A pointer to the signalling tone context, or NULL if there was a problem. */
SPAN_DECLARE(sig_tone_rx_state_t *) sig_tone_rx_init(sig_tone_rx_state_t *s, int tone_type, tone_report_func_t sig_update, void *user_data); SPAN_DECLARE(sig_tone_rx_state_t *) sig_tone_rx_init(sig_tone_rx_state_t *s, int tone_type, tone_report_func_t sig_update, void *user_data);
/*! Release a signaling tone receiver context. /*! Release a signalling tone receiver context.
\brief Release a signaling tone receiver context. \brief Release a signalling tone receiver context.
\param s The signaling tone context. \param s The signalling tone context.
\return 0 for OK */ \return 0 for OK */
SPAN_DECLARE(int) sig_tone_rx_release(sig_tone_rx_state_t *s); SPAN_DECLARE(int) sig_tone_rx_release(sig_tone_rx_state_t *s);
/*! Free a signaling tone receiver context. /*! Free a signalling tone receiver context.
\brief Free a signaling tone receiver context. \brief Free a signalling tone receiver context.
\param s The signaling tone context. \param s The signalling tone context.
\return 0 for OK */ \return 0 for OK */
SPAN_DECLARE(int) sig_tone_rx_free(sig_tone_rx_state_t *s); SPAN_DECLARE(int) sig_tone_rx_free(sig_tone_rx_state_t *s);
/*! Generate a block of signaling tone audio samples. /*! Generate a block of signalling tone audio samples.
\brief Generate a block of signaling tone audio samples. \brief Generate a block of signalling tone audio samples.
\param s The signaling tone context. \param s The signalling tone context.
\param amp The audio sample buffer. \param amp The audio sample buffer.
\param len The number of samples to be generated. \param len The number of samples to be generated.
\return The number of samples actually generated. */ \return The number of samples actually generated. */
...@@ -152,30 +145,30 @@ SPAN_DECLARE(int) sig_tone_tx(sig_tone_tx_state_t *s, int16_t amp[], int len); ...@@ -152,30 +145,30 @@ SPAN_DECLARE(int) sig_tone_tx(sig_tone_tx_state_t *s, int16_t amp[], int len);
/*! Set the tone mode. /*! Set the tone mode.
\brief Set the tone mode. \brief Set the tone mode.
\param s The signaling tone context. \param s The signalling tone context.
\param mode The new mode for the transmitted tones. \param mode The new mode for the transmitted tones.
\param duration The duration for this mode, before an update is requested. \param duration The duration for this mode, before an update is requested.
A duration of zero means forever. */ A duration of zero means forever. */
SPAN_DECLARE(void) sig_tone_tx_set_mode(sig_tone_tx_state_t *s, int mode, int duration); SPAN_DECLARE(void) sig_tone_tx_set_mode(sig_tone_tx_state_t *s, int mode, int duration);
/*! Initialise a signaling tone transmitter context. /*! Initialise a signalling tone transmitter context.
\brief Initialise a signaling tone context. \brief Initialise a signalling tone context.
\param s The signaling tone context. \param s The signalling tone context.
\param tone_type The type of signaling tone. \param tone_type The type of signalling tone.
\param sig_update Callback function to handle signaling updates. \param sig_update Callback function to handle signalling updates.
\param user_data An opaque pointer. \param user_data An opaque pointer.
\return A pointer to the signalling tone context, or NULL if there was a problem. */ \return A pointer to the signalling tone context, or NULL if there was a problem. */
SPAN_DECLARE(sig_tone_tx_state_t *) sig_tone_tx_init(sig_tone_tx_state_t *s, int tone_type, tone_report_func_t sig_update, void *user_data); SPAN_DECLARE(sig_tone_tx_state_t *) sig_tone_tx_init(sig_tone_tx_state_t *s, int tone_type, tone_report_func_t sig_update, void *user_data);
/*! Release a signaling tone transmitter context. /*! Release a signalling tone transmitter context.
\brief Release a signaling tone transmitter context. \brief Release a signalling tone transmitter context.
\param s The signaling tone context. \param s The signalling tone context.
\return 0 for OK */ \return 0 for OK */
SPAN_DECLARE(int) sig_tone_tx_release(sig_tone_tx_state_t *s); SPAN_DECLARE(int) sig_tone_tx_release(sig_tone_tx_state_t *s);
/*! Free a signaling tone transmitter context. /*! Free a signalling tone transmitter context.
\brief Free a signaling tone transmitter context. \brief Free a signalling tone transmitter context.
\param s The signaling tone context. \param s The signalling tone context.
\return 0 for OK */ \return 0 for OK */
SPAN_DECLARE(int) sig_tone_tx_free(sig_tone_tx_state_t *s); SPAN_DECLARE(int) sig_tone_tx_free(sig_tone_tx_state_t *s);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论