/*! \brief The number of vertical pixels in the exchanged page. */
int length;
/*! \brief The type of compression used between the FAX machines */
- int encoding;
+ int compression;
/*! \brief The size of the image on the line, in bytes */
int line_image_size;
} t4_stats_t;
\param t A pointer to a statistics structure. */
SPAN_DECLARE(void) t4_rx_get_transfer_statistics(t4_rx_state_t *s, t4_stats_t *t);
-/*! Get the short text name of an encoding format.
+/*! Get the short text name of a compression format.
\brief Get the short text name of an encoding format.
\param encoding The encoding type.
\return A pointer to the string. */
-SPAN_DECLARE(const char *) t4_encoding_to_str(int encoding);
+SPAN_DECLARE(const char *) t4_compression_to_str(int compression);
/*! Get the short text name of an image format.
\brief Get the short text name of an image format.
span_log(&s->logging, SPAN_LOG_FLOW, "Page no = %d\n", stats.pages_transferred);
span_log(&s->logging, SPAN_LOG_FLOW, "Image size = %d x %d pixels\n", stats.width, stats.length);
span_log(&s->logging, SPAN_LOG_FLOW, "Image resolution = %d/m x %d/m\n", stats.x_resolution, stats.y_resolution);
- span_log(&s->logging, SPAN_LOG_FLOW, "Compression = %s (%d)\n", t4_encoding_to_str(stats.encoding), stats.encoding);
+ span_log(&s->logging, SPAN_LOG_FLOW, "Compression = %s (%d)\n", t4_compression_to_str(stats.compression), stats.compression);
span_log(&s->logging, SPAN_LOG_FLOW, "Compressed image size = %d bytes\n", stats.line_image_size);
}
/*- End of function --------------------------------------------------------*/
span_log(&s->logging, SPAN_LOG_FLOW, "Page no = %d\n", stats.pages_transferred + 1);
span_log(&s->logging, SPAN_LOG_FLOW, "Image size = %d x %d pixels\n", stats.width, stats.length);
span_log(&s->logging, SPAN_LOG_FLOW, "Image resolution = %d/m x %d/m\n", stats.x_resolution, stats.y_resolution);
- span_log(&s->logging, SPAN_LOG_FLOW, "Compression = %s (%d)\n", t4_encoding_to_str(stats.encoding), stats.encoding);
+ span_log(&s->logging, SPAN_LOG_FLOW, "Compression = %s (%d)\n", t4_compression_to_str(stats.compression), stats.compression);
span_log(&s->logging, SPAN_LOG_FLOW, "Compressed image size = %d bytes\n", stats.line_image_size);
span_log(&s->logging, SPAN_LOG_FLOW, "Bad rows = %d\n", stats.bad_rows);
span_log(&s->logging, SPAN_LOG_FLOW, "Longest bad row run = %d\n", stats.longest_bad_row_run);
t30_set_status(s, T30_ERR_INCOMPATIBLE);
return -1;
}
- span_log(&s->logging, SPAN_LOG_FLOW, "Far end selected compression %s (%d)\n", t4_encoding_to_str(s->line_compression), s->line_compression);
+ span_log(&s->logging, SPAN_LOG_FLOW, "Far end selected compression %s (%d)\n", t4_compression_to_str(s->line_compression), s->line_compression);
if (x < 0)
{
else
s->line_compression = T4_COMPRESSION_T4_1D;
- span_log(&s->logging, SPAN_LOG_FLOW, "Choose compression %s (%d)\n", t4_encoding_to_str(s->line_compression), s->line_compression);
+ span_log(&s->logging, SPAN_LOG_FLOW, "Choose compression %s (%d)\n", t4_compression_to_str(s->line_compression), s->line_compression);
if (s->phase_b_handler)
{
t->width = stats.width;
t->length = stats.length;
- t->compression = stats.encoding;
+ t->compression = stats.compression;
t->image_size = stats.line_image_size;
t->current_status = s->current_status;
t->rtn_events = s->rtn_events;
extern TIFFFieldArray tiff_fx_field_array;
#endif
-SPAN_DECLARE(const char *) t4_encoding_to_str(int encoding)
+SPAN_DECLARE(const char *) t4_compression_to_str(int compression)
{
- switch (encoding)
+ switch (compression)
{
case T4_COMPRESSION_NONE:
return "None";
t->image_y_resolution = s->metadata.y_resolution;
t->x_resolution = s->metadata.x_resolution;
t->y_resolution = s->metadata.y_resolution;
- t->encoding = s->metadata.compression;
+ t->compression = s->metadata.compression;
switch (s->metadata.compression)
{
case T4_COMPRESSION_T4_1D:
SPAN_DECLARE(int) t4_rx_start_page(t4_rx_state_t *s)
{
- span_log(&s->logging, SPAN_LOG_FLOW, "Start rx page %d - compression %s\n", s->current_page, t4_encoding_to_str(s->metadata.compression));
+ span_log(&s->logging, SPAN_LOG_FLOW, "Start rx page %d - compression %s\n", s->current_page, t4_compression_to_str(s->metadata.compression));
switch (s->metadata.compression)
{
t->x_resolution = s->metadata.x_resolution;
t->y_resolution = s->metadata.y_resolution/s->row_squashing_ratio;
- t->encoding = s->metadata.compression;
+ t->compression = s->metadata.compression;
switch (s->metadata.compression)
{
case T4_COMPRESSION_T4_1D:
SPAN_DECLARE(int) t4_tx_start_page(t4_tx_state_t *s)
{
- span_log(&s->logging, SPAN_LOG_FLOW, "Start tx page %d - compression %s\n", s->current_page, t4_encoding_to_str(s->metadata.compression));
+ span_log(&s->logging, SPAN_LOG_FLOW, "Start tx page %d - compression %s\n", s->current_page, t4_compression_to_str(s->metadata.compression));
if (s->current_page > s->stop_page)
return -1;
if (s->tiff.file)
printf("%s: Pages in the file %d\n", tag, t.pages_in_file);
printf("%s: Bad rows %d, longest bad row run %d\n", tag, t.bad_rows, t.longest_bad_row_run);
printf("%s: Bad ECM frames %d\n", tag, t.error_correcting_mode_retries);
- printf("%s: Compression type %s (%d)\n", tag, t4_encoding_to_str(t.compression), t.compression);
+ printf("%s: Compression type %s (%d)\n", tag, t4_compression_to_str(t.compression), t.compression);
printf("%s: Compressed image size %d bytes\n", tag, t.image_size);
printf("%s: Image type %s (%s in the file)\n", tag, t4_image_type_to_str(t.type), t4_image_type_to_str(t.image_type));
printf("%s: Image size %d pels x %d pels (%d pels x %d pels in the file)\n", tag, t.width, t.length, t.image_width, t.image_length);
t4_rx_get_transfer_statistics(s, &stats);
printf("Pages = %d\n", stats.pages_transferred);
- printf("Compression = %s\n", t4_encoding_to_str(stats.encoding));
+ printf("Compression = %s\n", t4_compression_to_str(stats.compression));
printf("Compressed size = %d\n", stats.line_image_size);
printf("Raw image size = %d pels x %d pels\n", stats.image_width, stats.image_length);
printf("Image size = %d pels x %d pels\n", stats.width, stats.length);
switch_channel_set_variable(channel, "fax_encoding", fax_encoding);
}
- switch_channel_set_variable(channel, "fax_encoding_name", t4_encoding_to_str(t30_stats.compression));
+ switch_channel_set_variable(channel, "fax_encoding_name", t4_compression_to_str(t30_stats.compression));
fax_document_transferred_pages = switch_core_session_sprintf(session, "%d", (pvt->app_mode == FUNCTION_TX) ? t30_stats.pages_tx : t30_stats.pages_rx);
if (fax_document_transferred_pages) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Image type = %s (%s in the file)\n", t4_image_type_to_str(t30_stats.type), t4_image_type_to_str(t30_stats.image_type));
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Image size = %d x %d pixels (%d x %d pixels in the file)\n", t30_stats.width, t30_stats.length, t30_stats.image_width, t30_stats.image_length);
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Image resolution = %d/m x %d/m (%d/m x %d/m in the file)\n", t30_stats.x_resolution, t30_stats.y_resolution, t30_stats.image_x_resolution, t30_stats.image_y_resolution);
- switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Compression = %s (%d)\n", t4_encoding_to_str(t30_stats.compression), t30_stats.compression);
+ switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Compression = %s (%d)\n", t4_compression_to_str(t30_stats.compression), t30_stats.compression);
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Compressed image size = %d bytes\n", t30_stats.image_size);
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Bad rows = %d\n", t30_stats.bad_rows);
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Longest bad row run = %d\n", t30_stats.longest_bad_row_run);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-bad-rows", fax_bad_rows);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-longest-bad-row-run", fax_longest_bad_row_run);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-encoding", fax_encoding);
- switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-encoding-name", t4_encoding_to_str(t30_stats.compression));
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-encoding-name", t4_compression_to_str(t30_stats.compression));
switch_event_fire(&event);
}