spandsp
0.0.6
|
00001 /* 00002 * SpanDSP - a series of DSP components for telephony 00003 * 00004 * fax_modems.h - definitions for the analogue modem set for fax processing 00005 * 00006 * Written by Steve Underwood <steveu@coppice.org> 00007 * 00008 * Copyright (C) 2008 Steve Underwood 00009 * 00010 * All rights reserved. 00011 * 00012 * This program is free software; you can redistribute it and/or modify 00013 * it under the terms of the GNU Lesser General Public License version 2.1, 00014 * as published by the Free Software Foundation. 00015 * 00016 * This program is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU Lesser General Public License for more details. 00020 * 00021 * You should have received a copy of the GNU Lesser General Public 00022 * License along with this program; if not, write to the Free Software 00023 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00024 */ 00025 00026 /*! \file */ 00027 00028 #if !defined(_SPANDSP_FAX_MODEMS_H_) 00029 #define _SPANDSP_FAX_MODEMS_H_ 00030 00031 enum 00032 { 00033 FAX_MODEM_NONE = -1, 00034 FAX_MODEM_FLUSH = 0, 00035 FAX_MODEM_SILENCE_TX, 00036 FAX_MODEM_SILENCE_RX, 00037 FAX_MODEM_CED_TONE, 00038 FAX_MODEM_CNG_TONE, 00039 FAX_MODEM_NOCNG_TONE, 00040 FAX_MODEM_V21_TX, 00041 FAX_MODEM_V17_TX, 00042 FAX_MODEM_V27TER_TX, 00043 FAX_MODEM_V29_TX, 00044 FAX_MODEM_V21_RX, 00045 FAX_MODEM_V17_RX, 00046 FAX_MODEM_V27TER_RX, 00047 FAX_MODEM_V29_RX 00048 }; 00049 00050 /*! 00051 The set of modems needed for FAX, plus the auxilliary stuff, like tone generation. 00052 */ 00053 typedef struct fax_modems_state_s fax_modems_state_t; 00054 00055 #if defined(__cplusplus) 00056 extern "C" 00057 { 00058 #endif 00059 00060 /* N.B. the following are currently a work in progress */ 00061 SPAN_DECLARE_NONSTD(int) fax_modems_v17_v21_rx(void *user_data, const int16_t amp[], int len); 00062 SPAN_DECLARE_NONSTD(int) fax_modems_v27ter_v21_rx(void *user_data, const int16_t amp[], int len); 00063 SPAN_DECLARE_NONSTD(int) fax_modems_v29_v21_rx(void *user_data, const int16_t amp[], int len); 00064 SPAN_DECLARE_NONSTD(int) fax_modems_v17_v21_rx_fillin(void *user_data, int len); 00065 SPAN_DECLARE_NONSTD(int) fax_modems_v27ter_v21_rx_fillin(void *user_data, int len); 00066 SPAN_DECLARE_NONSTD(int) fax_modems_v29_v21_rx_fillin(void *user_data, int len); 00067 SPAN_DECLARE(void) fax_modems_start_rx_modem(fax_modems_state_t *s, int which); 00068 00069 SPAN_DECLARE(void) fax_modems_set_tep_mode(fax_modems_state_t *s, int use_tep); 00070 00071 SPAN_DECLARE(int) fax_modems_restart(fax_modems_state_t *s); 00072 00073 SPAN_DECLARE(fax_modems_state_t *) fax_modems_init(fax_modems_state_t *s, 00074 int use_tep, 00075 hdlc_frame_handler_t hdlc_accept, 00076 hdlc_underflow_handler_t hdlc_tx_underflow, 00077 put_bit_func_t non_ecm_put_bit, 00078 get_bit_func_t non_ecm_get_bit, 00079 tone_report_func_t tone_callback, 00080 void *user_data); 00081 00082 SPAN_DECLARE(int) fax_modems_release(fax_modems_state_t *s); 00083 00084 SPAN_DECLARE(int) fax_modems_free(fax_modems_state_t *s); 00085 00086 #if defined(__cplusplus) 00087 } 00088 #endif 00089 00090 #endif 00091 /*- End of file ------------------------------------------------------------*/