spandsp  0.0.6
private/t38_non_ecm_buffer.h
1 /*
2  * SpanDSP - a series of DSP components for telephony
3  *
4  * private/t38_non_ecm_buffer.h - A rate adapting buffer for T.38 non-ECM image
5  * and TCF data
6  *
7  * Written by Steve Underwood <steveu@coppice.org>
8  *
9  * Copyright (C) 2005, 2006, 2007, 2008 Steve Underwood
10  *
11  * All rights reserved.
12  *
13  * This program is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU Lesser General Public License version 2.1,
15  * as published by the Free Software Foundation.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public
23  * License along with this program; if not, write to the Free Software
24  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25  */
26 
27 #if !defined(_SPANDSP_PRIVATE_T38_NON_ECM_BUFFER_H_)
28 #define _SPANDSP_PRIVATE_T38_NON_ECM_BUFFER_H_
29 
30 /*! \brief A flow controlled non-ECM image data buffer, for buffering T.38 to analogue
31  modem data.
32 */
34 {
35  /*! \brief Minimum number of bits per row, used when fill bits are being deleted on the
36  link, and restored at the emitting gateway. */
38 
39  /*! \brief non-ECM modem transmit data buffer. */
41  /*! \brief The current write point in the buffer. */
42  int in_ptr;
43  /*! \brief The current read point in the buffer. */
44  int out_ptr;
45  /*! \brief The location of the most recent EOL marker in the buffer. */
47  /*! \brief The number of bits to date in the current row, used when min_row_bits is
48  to be applied. */
49  int row_bits;
50 
51  /*! \brief The bit stream entering the buffer, used to detect EOLs */
52  unsigned int bit_stream;
53  /*! \brief The non-ECM flow control fill octet (0xFF before the first data, and 0x00
54  once data has started). */
56  /*! \brief A code for the phase of input buffering, from initial all ones to completion. */
58  /*! \brief TRUE is the end of non-ECM data indication has been received. */
60  /*! \brief The current octet being transmitted from the buffer. */
61  unsigned int octet;
62  /*! \brief The current bit number in the current non-ECM octet. */
63  int bit_no;
64  /*! \brief TRUE if in image data mode, as opposed to TCF mode. */
66 
67  /*! \brief The number of octets input to the buffer. */
68  int in_octets;
69  /*! \brief The number of rows input to the buffer. */
70  int in_rows;
71  /*! \brief The number of non-ECM fill octets generated for minimum row bits
72  purposes. */
74  /*! \brief The number of octets output from the buffer. */
76  /*! \brief The number of rows output from the buffer. */
77  int out_rows;
78  /*! \brief The number of non-ECM fill octets generated for flow control
79  purposes. */
81 };
82 
83 #endif
84 /*- End of file ------------------------------------------------------------*/
t30_set_rx_file
void t30_set_rx_file(t30_state_t *s, const char *file, int stop_page)
Set next receive file name.
Definition: t30_api.c:614
t38_non_ecm_buffer_state_s::image_data_mode
int image_data_mode
TRUE if in image data mode, as opposed to TCF mode.
Definition: private/t38_non_ecm_buffer.h:65
t38_non_ecm_buffer_state_s::out_octets
int out_octets
The number of octets output from the buffer.
Definition: private/t38_non_ecm_buffer.h:75
t38_gateway_set_real_time_frame_handler
void t38_gateway_set_real_time_frame_handler(t38_gateway_state_t *s, t38_gateway_real_time_frame_handler_t *handler, void *user_data)
Set a callback function for T.30 frame exchange monitoring.
Definition: t38_gateway.c:2440
t30_set_tx_nsf
int t30_set_tx_nsf(t30_state_t *s, const uint8_t *nsf, int len)
Set the transmitted NSF frame to be associated with a T.30 context.
Definition: t30_api.c:271
T30_SUPPORT_T6_COMPRESSION
@ T30_SUPPORT_T6_COMPRESSION
Definition: t30.h:362
t38_stats_t::bit_rate
int bit_rate
The current bit rate for image transfer.
Definition: t38_gateway.h:71
t38_stats_t::pages_transferred
int pages_transferred
The number of pages transferred so far.
Definition: t38_gateway.h:75
t38_non_ecm_buffer_state_s::flow_control_fill_octet
uint8_t flow_control_fill_octet
The non-ECM flow control fill octet (0xFF before the first data, and 0x00 once data has started).
Definition: private/t38_non_ecm_buffer.h:55
t38_non_ecm_buffer_state_s::min_row_bits_fill_octets
int min_row_bits_fill_octets
The number of non-ECM fill octets generated for minimum row bits purposes.
Definition: private/t38_non_ecm_buffer.h:73
t38_gateway_set_ecm_capability
void t38_gateway_set_ecm_capability(t38_gateway_state_t *s, int ecm_allowed)
Control whether error correcting mode (ECM) is allowed.
Definition: t38_gateway.c:2392
t30_completion_code_to_str
const char * t30_completion_code_to_str(int result)
Convert a phase E completion code to a short text description.
Definition: t30_logging.c:108
t30_set_minimum_scan_line_time
int t30_set_minimum_scan_line_time(t30_state_t *s, int min_time)
Specify minimum scan line time.
Definition: t30_api.c:659
t38_non_ecm_buffer_state_s::in_rows
int in_rows
The number of rows input to the buffer.
Definition: private/t38_non_ecm_buffer.h:70
fax_set_transmit_on_idle
void fax_set_transmit_on_idle(fax_state_t *s, int transmit_on_idle)
Select whether silent audio will be sent when FAX transmit is idle.
Definition: fax.c:579
t38_stats_t::error_correcting_mode
int error_correcting_mode
TRUE if error correcting mode is used.
Definition: t38_gateway.h:73
t38_non_ecm_buffer_state_s::row_bits
int row_bits
The number of bits to date in the current row, used when min_row_bits is to be applied.
Definition: private/t38_non_ecm_buffer.h:49
t38_gateway_state_s
Definition: private/t38_gateway.h:195
fax_init
fax_state_t * fax_init(fax_state_t *s, int calling_party)
Initialise a FAX context.
Definition: fax.c:664
t38_non_ecm_buffer_state_s::input_phase
int input_phase
A code for the phase of input buffering, from initial all ones to completion.
Definition: private/t38_non_ecm_buffer.h:57
async.h
t30_set_supported_compressions
int t30_set_supported_compressions(t30_state_t *s, int supported_compressions)
Specify supported compression types.
Definition: t30_api.c:688
t30_stats_t
Definition: t30.h:519
t38_non_ecm_buffer_report_input_status
void t38_non_ecm_buffer_report_input_status(t38_non_ecm_buffer_state_t *s, logging_state_t *logging)
Report the input status of a T.38 rate adapting non-ECM buffer context to the specified logging conte...
Definition: t38_non_ecm_buffer.c:309
fax_utils.h
t38_gateway_set_fill_bit_removal
void t38_gateway_set_fill_bit_removal(t38_gateway_state_t *s, int remove)
Select whether non-ECM fill bits are to be removed during transmission.
Definition: t38_gateway.c:2434
t38_core_state_s
Definition: private/t38_core.h:33
t38_gateway_get_transfer_statistics
void t38_gateway_get_transfer_statistics(t38_gateway_state_t *s, t38_stats_t *t)
Get the current transfer statistics.
Definition: t38_gateway.c:2371
t30_frametype
const char * t30_frametype(uint8_t x)
Return a text name for a T.30 frame type.
Definition: t30_logging.c:241
t38_non_ecm_buffer_state_s::min_bits_per_row
int min_bits_per_row
Minimum number of bits per row, used when fill bits are being deleted on the link,...
Definition: private/t38_non_ecm_buffer.h:37
t38_non_ecm_buffer_state_s::flow_control_fill_octets
int flow_control_fill_octets
The number of non-ECM fill octets generated for flow control purposes.
Definition: private/t38_non_ecm_buffer.h:80
t38_non_ecm_buffer_state_s::out_ptr
int out_ptr
The current read point in the buffer.
Definition: private/t38_non_ecm_buffer.h:44
t38_gateway_get_logging_state
logging_state_t * t38_gateway_get_logging_state(t38_gateway_state_t *s)
Get a pointer to the logging context associated with a T.38 context.
Definition: t38_gateway.c:2386
t38_non_ecm_buffer_state_s::data_finished
int data_finished
TRUE is the end of non-ECM data indication has been received.
Definition: private/t38_non_ecm_buffer.h:59
SPAN_DECLARE_NONSTD
SPAN_DECLARE_NONSTD(int) async_tx_get_bit(void *user_data)
Get the next bit of a transmitted serial bit stream.
t38_gateway_get_t38_core_state
t38_core_state_t * t38_gateway_get_t38_core_state(t38_gateway_state_t *s)
Get a pointer to the T.38 core IFP packet engine associated with a T.38 context.
Definition: t38_gateway.c:2380
t38_gateway_state_s::logging
logging_state_t logging
Error and flow logging control.
Definition: private/t38_gateway.h:204
t38_non_ecm_buffer_state_s::bit_no
int bit_no
The current bit number in the current non-ECM octet.
Definition: private/t38_non_ecm_buffer.h:63
t38_terminal_get_t38_core_state
t38_core_state_t * t38_terminal_get_t38_core_state(t38_terminal_state_t *s)
Get a pointer to the T.38 core IFP packet engine associated with a T.38 context.
Definition: t38_terminal.c:1433
fax_set_tep_mode
void fax_set_tep_mode(fax_state_t *s, int use_tep)
Select whether TEP will be sent for the image modems.
Definition: fax.c:585
v17_rx_state_s::logging
logging_state_t logging
Error and flow logging control.
Definition: private/v17rx.h:238
g1050_state_t
Definition: g1050.h:249
t38_core_get_logging_state
logging_state_t * t38_core_get_logging_state(t38_core_state_t *s)
Get a pointer to the logging context associated with a T.38 context.
Definition: t38_core.c:1076
t38_non_ecm_buffer.h
T30_SUPPORT_T4_2D_COMPRESSION
@ T30_SUPPORT_T4_2D_COMPRESSION
Definition: t30.h:360
t38_non_ecm_buffer_state_s::in_ptr
int in_ptr
The current write point in the buffer.
Definition: private/t38_non_ecm_buffer.h:42
t38_gateway_state_s::audio
t38_gateway_audio_state_t audio
Definition: private/t38_gateway.h:199
T30_SUPPORT_V29
@ T30_SUPPORT_V29
Definition: t30.h:344
t38_terminal_state_s
Definition: private/t38_terminal.h:111
t38_gateway_set_supported_modems
void t38_gateway_set_supported_modems(t38_gateway_state_t *s, int supported_modems)
Specify supported modems.
Definition: t38_gateway.c:2404
T38_NON_ECM_TX_BUF_LEN
#define T38_NON_ECM_TX_BUF_LEN
Definition: t38_non_ecm_buffer.h:72
t30_get_logging_state
logging_state_t * t30_get_logging_state(t30_state_t *s)
Get a pointer to the logging context associated with a T.30 context.
Definition: t30_api.c:784
T30_SUPPORT_V27TER
@ T30_SUPPORT_V27TER
Definition: t30.h:342
bit_operations.h
t38_non_ecm_buffer_state_s::in_octets
int in_octets
The number of octets input to the buffer.
Definition: private/t38_non_ecm_buffer.h:68
queue.h
fax_state_s
Definition: private/fax.h:36
t38_gateway_init
t38_gateway_state_t * t38_gateway_init(t38_gateway_state_t *s, t38_tx_packet_handler_t *tx_packet_handler, void *tx_packet_user_data)
Initialise a gateway mode T.38 context.
Definition: t38_gateway.c:2494
t38_terminal_init
t38_terminal_state_t * t38_terminal_init(t38_terminal_state_t *s, int calling_party, t38_tx_packet_handler_t *tx_packet_handler, void *tx_packet_user_data)
Initialise a termination mode T.38 context.
Definition: t38_terminal.c:1509
span_log
int span_log(logging_state_t *s, int level, const char *format,...)
Generate a log entry.
Definition: logging.c:84
t38_non_ecm_buffer_state_s::bit_stream
unsigned int bit_stream
The bit stream entering the buffer, used to detect EOLs.
Definition: private/t38_non_ecm_buffer.h:52
t30_get_transfer_statistics
void t30_get_transfer_statistics(t30_state_t *s, t30_stats_t *t)
Get the current transfer statistics.
Definition: t30.c:6229
t38_non_ecm_buffer_state_s::latest_eol_ptr
int latest_eol_ptr
The location of the most recent EOL marker in the buffer.
Definition: private/t38_non_ecm_buffer.h:46
dc_restore.h
t38_non_ecm_buffer_init
t38_non_ecm_buffer_state_t * t38_non_ecm_buffer_init(t38_non_ecm_buffer_state_t *s, int mode, int min_bits_per_row)
Initialise a T.38 rate adapting non-ECM buffer context.
Definition: t38_non_ecm_buffer.c:350
t38_core_state_s::logging
logging_state_t logging
Error and flow logging control.
Definition: private/t38_core.h:132
t30_set_phase_d_handler
void t30_set_phase_d_handler(t30_state_t *s, t30_phase_d_handler_t *handler, void *user_data)
Set a callback function for T.30 phase D handling.
Definition: t30_api.c:756
t38_non_ecm_buffer_push
void t38_non_ecm_buffer_push(t38_non_ecm_buffer_state_t *s)
Inform a T.38 rate adapting non-ECM buffer context that the incoming data has finished,...
Definition: t38_non_ecm_buffer.c:121
t30_set_tx_file
void t30_set_tx_file(t30_state_t *s, const char *file, int start_page, int stop_page)
Set next transmit file name.
Definition: t30_api.c:622
spandsp-sim.h
t38_terminal_release
int t38_terminal_release(t38_terminal_state_t *s)
Release a T.38 context.
Definition: t38_terminal.c:1549
t30_state_s
Definition: private/t30.h:36
t30_set_phase_b_handler
void t30_set_phase_b_handler(t30_state_t *s, t30_phase_b_handler_t *handler, void *user_data)
Set a callback function for T.30 phase B handling.
Definition: t30_api.c:749
fax_get_t30_state
t30_state_t * fax_get_t30_state(fax_state_t *s)
Get a pointer to the T.30 engine associated with a FAX context.
Definition: fax.c:591
t30_set_phase_e_handler
void t30_set_phase_e_handler(t30_state_t *s, t30_phase_e_handler_t *handler, void *user_data)
Set a callback function for T.30 phase E handling.
Definition: t30_api.c:763
t38_non_ecm_buffer_state_s::octet
unsigned int octet
The current octet being transmitted from the buffer.
Definition: private/t38_non_ecm_buffer.h:61
t38_core_state_s::tx_seq_no
int tx_seq_no
The sequence number for the next packet to be transmitted.
Definition: private/t38_core.h:112
logging.h
fax_release
int fax_release(fax_state_t *s)
Release a FAX context.
Definition: fax.c:719
t38_gateway_audio_state_t::modems
fax_modems_state_t modems
The FAX modem set for the audio side fo the gateway.
Definition: private/t38_gateway.h:61
t30_stats_t::pages_rx
int pages_rx
The number of pages received so far.
Definition: t30.h:527
t38_terminal_get_t30_state
t30_state_t * t38_terminal_get_t30_state(t38_terminal_state_t *s)
Get a pointer to the T.30 engine associated with a T.38 context.
Definition: t38_terminal.c:1427
T30_SUPPORT_T4_1D_COMPRESSION
@ T30_SUPPORT_T4_1D_COMPRESSION
Definition: t30.h:358
t30_stats_t::pages_tx
int pages_tx
The number of pages sent so far.
Definition: t30.h:525
t30_set_supported_modems
int t30_set_supported_modems(t30_state_t *s, int supported_modems)
Specify supported modems.
Definition: t30_api.c:680
t38_non_ecm_buffer_inject
void t38_non_ecm_buffer_inject(t38_non_ecm_buffer_state_t *s, const uint8_t *buf, int len)
Inject data to T.38 rate adapting non-ECM buffer context.
Definition: t38_non_ecm_buffer.c:130
t38_non_ecm_buffer_state_s
A flow controlled non-ECM image data buffer, for buffering T.38 to analogue modem data.
Definition: private/t38_non_ecm_buffer.h:34
fax_modems_state_s::v17_rx
v17_rx_state_t v17_rx
A V.29 modem context used when receiving FAXes at 7200bps, 9600bps 12000bps or 14400bps.
Definition: private/fax_modems.h:62
t38_gateway_set_transmit_on_idle
void t38_gateway_set_transmit_on_idle(t38_gateway_state_t *s, int transmit_on_idle)
Select whether silent audio will be sent when transmit is idle.
Definition: t38_gateway.c:2398
fax_get_logging_state
logging_state_t * fax_get_logging_state(fax_state_t *s)
Get a pointer to the logging context associated with a FAX context.
Definition: fax.c:597
T30_SUPPORT_V17
@ T30_SUPPORT_V17
Definition: t30.h:346
t38_non_ecm_buffer_report_output_status
void t38_non_ecm_buffer_report_output_status(t38_non_ecm_buffer_state_t *s, logging_state_t *logging)
Report the output status of a T.38 rate adapting non-ECM buffer context to the specified logging cont...
Definition: t38_non_ecm_buffer.c:326
t30_set_tx_ident
int t30_set_tx_ident(t30_state_t *s, const char *id)
Set the transmitted identifier associated with a T.30 context.
Definition: t30_api.c:90
t38_stats_t
Definition: t38_gateway.h:69
logging_state_s
Definition: private/logging.h:34
t38_non_ecm_buffer_set_mode
void t38_non_ecm_buffer_set_mode(t38_non_ecm_buffer_state_t *s, int mode, int min_bits_per_row)
Set the mode of a T.38 rate adapting non-ECM buffer context.
Definition: t38_non_ecm_buffer.c:343
t30_set_ecm_capability
int t30_set_ecm_capability(t30_state_t *s, int enabled)
Select ECM capability.
Definition: t30_api.c:637
t38_set_t38_version
void t38_set_t38_version(t38_core_state_t *s, int t38_version)
Definition: t38_core.c:1034
t38_non_ecm_buffer_state_s::data
uint8_t data[T38_NON_ECM_TX_BUF_LEN]
non-ECM modem transmit data buffer.
Definition: private/t38_non_ecm_buffer.h:40
t38_terminal_get_logging_state
logging_state_t * t38_terminal_get_logging_state(t38_terminal_state_t *s)
Get a pointer to the logging context associated with a T.38 context.
Definition: t38_terminal.c:1494
SIG_STATUS_END_OF_DATA
@ SIG_STATUS_END_OF_DATA
The data stream has ended.
Definition: async.h:71
t38_gateway_release
int t38_gateway_release(t38_gateway_state_t *s)
Release a T.38 context.
Definition: t38_gateway.c:2560
t38_non_ecm_buffer_state_s::out_rows
int out_rows
The number of rows output from the buffer.
Definition: private/t38_non_ecm_buffer.h:77