spandsp  0.0.6
fax_modems.h
Go to the documentation of this file.
1 /*
2  * SpanDSP - a series of DSP components for telephony
3  *
4  * fax_modems.h - definitions for the analogue modem set for fax processing
5  *
6  * Written by Steve Underwood <steveu@coppice.org>
7  *
8  * Copyright (C) 2008 Steve Underwood
9  *
10  * All rights reserved.
11  *
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU Lesser General Public License version 2.1,
14  * as published by the Free Software Foundation.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public
22  * License along with this program; if not, write to the Free Software
23  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24  */
25 
26 /*! \file */
27 
28 #if !defined(_SPANDSP_FAX_MODEMS_H_)
29 #define _SPANDSP_FAX_MODEMS_H_
30 
31 enum
32 {
33  FAX_MODEM_NONE = -1,
34  FAX_MODEM_FLUSH = 0,
35  FAX_MODEM_SILENCE_TX,
36  FAX_MODEM_SILENCE_RX,
37  FAX_MODEM_CED_TONE,
38  FAX_MODEM_CNG_TONE,
39  FAX_MODEM_NOCNG_TONE,
40  FAX_MODEM_V21_TX,
41  FAX_MODEM_V17_TX,
42  FAX_MODEM_V27TER_TX,
43  FAX_MODEM_V29_TX,
44  FAX_MODEM_V21_RX,
45  FAX_MODEM_V17_RX,
46  FAX_MODEM_V27TER_RX,
47  FAX_MODEM_V29_RX
48 };
49 
50 /*!
51  The set of modems needed for FAX, plus the auxilliary stuff, like tone generation.
52 */
54 
55 #if defined(__cplusplus)
56 extern "C"
57 {
58 #endif
59 
60 /* N.B. the following are currently a work in progress */
61 SPAN_DECLARE_NONSTD(int) fax_modems_v17_v21_rx(void *user_data, const int16_t amp[], int len);
62 SPAN_DECLARE_NONSTD(int) fax_modems_v27ter_v21_rx(void *user_data, const int16_t amp[], int len);
63 SPAN_DECLARE_NONSTD(int) fax_modems_v29_v21_rx(void *user_data, const int16_t amp[], int len);
64 SPAN_DECLARE_NONSTD(int) fax_modems_v17_v21_rx_fillin(void *user_data, int len);
65 SPAN_DECLARE_NONSTD(int) fax_modems_v27ter_v21_rx_fillin(void *user_data, int len);
66 SPAN_DECLARE_NONSTD(int) fax_modems_v29_v21_rx_fillin(void *user_data, int len);
67 SPAN_DECLARE(void) fax_modems_start_rx_modem(fax_modems_state_t *s, int which);
68 
69 SPAN_DECLARE(void) fax_modems_set_tep_mode(fax_modems_state_t *s, int use_tep);
70 
71 SPAN_DECLARE(int) fax_modems_restart(fax_modems_state_t *s);
72 
73 SPAN_DECLARE(fax_modems_state_t *) fax_modems_init(fax_modems_state_t *s,
74  int use_tep,
75  hdlc_frame_handler_t hdlc_accept,
76  hdlc_underflow_handler_t hdlc_tx_underflow,
77  put_bit_func_t non_ecm_put_bit,
78  get_bit_func_t non_ecm_get_bit,
79  tone_report_func_t tone_callback,
80  void *user_data);
81 
82 SPAN_DECLARE(int) fax_modems_release(fax_modems_state_t *s);
83 
84 SPAN_DECLARE(int) fax_modems_free(fax_modems_state_t *s);
85 
86 #if defined(__cplusplus)
87 }
88 #endif
89 
90 #endif
91 /*- End of file ------------------------------------------------------------*/