Пример #1
0
static void phase_e_handler(t30_state_t *s, void *user_data, int result)
{
    int i;
    t30_stats_t t;
    char ident[21];
    
    i = (int) (intptr_t) user_data;
    printf("%c: Phase E handler on channel %c - (%d) %s\n", i, i, result, t30_completion_code_to_str(result));
    t30_get_transfer_statistics(s, &t);
    printf("%c: Phase E: bit rate %d\n", i, t.bit_rate);
    printf("%c: Phase E: ECM %s\n", i, (t.error_correcting_mode)  ?  "on"  :  "off");
    printf("%c: Phase E: pages transferred %d\n", i, t.pages_transferred);
    printf("%c: Phase E: image size %d x %d\n", i, t.width, t.length);
    printf("%c: Phase E: image resolution %d x %d\n", i, t.x_resolution, t.y_resolution);
    printf("%c: Phase E: bad rows %d\n", i, t.bad_rows);
    printf("%c: Phase E: longest bad row run %d\n", i, t.longest_bad_row_run);
    printf("%c: Phase E: coding method %s\n", i, t4_encoding_to_str(t.encoding));
    printf("%c: Phase E: image size %d bytes\n", i, t.image_size);
    t30_get_local_ident(s, ident);
    printf("%c: Phase E: local ident '%s'\n", i, ident);
    t30_get_far_ident(s, ident);
    printf("%c: Phase E: remote ident '%s'\n", i, ident);
    succeeded[i - 'A'] = (result == T30_ERR_OK)  &&  (t.pages_transferred == 12);
    //done[i - 'A'] = TRUE;
}
Пример #2
0
static void phase_e_handler(t30_state_t *s, void *user_data, int result)
{
    int session;
    t30_stats_t t;
    const char *u;
    char ident[21];
    
    session = (intptr_t) user_data;
    printf("Phase E handler on session %d - (%d) %s\n", session, result, t30_completion_code_to_str(result));    
    t30_get_transfer_statistics(s, &t);
    printf( "Phase E: bit rate %d\n", t.bit_rate);
    printf( "Phase E: ECM %s\n", (t.error_correcting_mode)  ?  "on"  :  "off");
    printf( "Phase E: pages transferred %d\n", t.pages_transferred);
    printf( "Phase E: image size %d x %d\n", t.width, t.length);
    printf( "Phase E: image resolution %d x %d\n", t.x_resolution, t.y_resolution);
    printf( "Phase E: bad rows %d\n", t.bad_rows);
    printf( "Phase E: longest bad row run %d\n", t.longest_bad_row_run);
    printf( "Phase E: coding method %s\n", t4_encoding_to_str(t.encoding));
    printf( "Phase E: image size %d bytes\n", t.image_size);
    t30_get_local_ident(s, ident);
    printf( "Phase E: local ident '%s'\n", ident);
    t30_get_far_ident(s, ident);
    printf( "Phase E: remote ident '%s'\n", ident);
    if ((u = t30_get_far_country(s)))
        printf( "Phase E: Remote was made in '%s'\n", u);
    if ((u = t30_get_far_vendor(s)))
        printf( "Phase E: Remote was made by '%s'\n", u);
    if ((u = t30_get_far_model(s)))
        printf( "Phase E: Remote is model '%s'\n", u);
}
Пример #3
0
void fax_log_page_transfer_statistics(t30_state_t *s, const char *tag)
{
    t30_stats_t t;

    t30_get_transfer_statistics(s, &t);
    printf("%s: Page statistics\n", tag);
    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.encoding), t.encoding);
    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);
    printf("%s:   Image resolution %d pels/m x %d pels/m (%d pels/m x %d pels/m in the file)\n", tag, t.x_resolution, t.y_resolution, t.image_x_resolution, t.image_y_resolution);
#if defined(SPANDSP_EXPOSE_INTERNAL_STRUCTURES)
    printf("%s:   Bits per row - min %d, max %d\n", tag, s->t4.tx.encoder.t4_t6.min_row_bits, s->t4.tx.encoder.t4_t6.max_row_bits);
#endif

    fax_log_final_transfer_statistics(s, tag);
}
Пример #4
0
static int phase_d_handler(t30_state_t *s, void *user_data, int result)
{
    struct cw_channel *chan;
    t30_stats_t t;
    
    chan = (struct cw_channel *) user_data;
    if (result)
    {
        t30_get_transfer_statistics(s, &t);
        cw_log(LOG_DEBUG, "==============================================================================\n");
        cw_log(LOG_DEBUG, "Pages transferred:  %i\n", t.pages_rx);
        cw_log(LOG_DEBUG, "Image size:         %i x %i\n", t.width, t.length);
        cw_log(LOG_DEBUG, "Image resolution    %i x %i\n", t.x_resolution, t.y_resolution);
        cw_log(LOG_DEBUG, "Transfer Rate:      %i\n", t.bit_rate);
        cw_log(LOG_DEBUG, "Bad rows            %i\n", t.bad_rows);
        cw_log(LOG_DEBUG, "Longest bad row run %i\n", t.longest_bad_row_run);
        cw_log(LOG_DEBUG, "Compression type    %s\n", t4_encoding_to_str(t.encoding));
        cw_log(LOG_DEBUG, "Image size (bytes)  %i\n", t.image_size);
        cw_log(LOG_DEBUG, "==============================================================================\n");
    }
    return T30_ERR_OK;
}
Пример #5
0
static void phase_d_handler(t30_state_t *s, void *user_data, int result)
{
    int i;
    t30_stats_t t;
    char ident[21];

    i = (int) (intptr_t) user_data;
    printf("%c: Phase D handler on channel %c - (0x%X) %s\n", i, i, result, t30_frametype(result));
    t30_get_transfer_statistics(s, &t);
    printf("%c: Phase D: bit rate %d\n", i, t.bit_rate);
    printf("%c: Phase D: ECM %s\n", i, (t.error_correcting_mode)  ?  "on"  :  "off");
    printf("%c: Phase D: pages transferred %d\n", i, t.pages_transferred);
    printf("%c: Phase D: image size %d x %d\n", i, t.width, t.length);
    printf("%c: Phase D: image resolution %d x %d\n", i, t.x_resolution, t.y_resolution);
    printf("%c: Phase D: bad rows %d\n", i, t.bad_rows);
    printf("%c: Phase D: longest bad row run %d\n", i, t.longest_bad_row_run);
    printf("%c: Phase D: coding method %s\n", i, t4_encoding_to_str(t.encoding));
    printf("%c: Phase D: image size %d\n", i, t.image_size);
    t30_get_local_ident(s, ident);
    printf("%c: Phase D: local ident '%s'\n", i, ident);
    t30_get_far_ident(s, ident);
    printf("%c: Phase D: remote ident '%s'\n", i, ident);
}
Пример #6
0
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->line_encoding));

    switch (s->line_encoding)
    {
    case T4_COMPRESSION_ITU_T4_1D:
    case T4_COMPRESSION_ITU_T4_2D:
    case T4_COMPRESSION_ITU_T6:
        t4_t6_decode_restart(&s->decoder.t4_t6, s->image_width);
        break;
    case T4_COMPRESSION_ITU_T42:
        t42_decode_restart(&s->decoder.t42);
        break;
#if defined(SPANDSP_SUPPORT_T43)
    case T4_COMPRESSION_ITU_T43:
        t43_decode_restart(&s->decoder.t43);
        break;
#endif
    case T4_COMPRESSION_ITU_T85:
    case T4_COMPRESSION_ITU_T85_L0:
        t85_decode_restart(&s->decoder.t85);
        break;
    }
    s->line_image_size = 0;
    s->tiff.image_size = 0;

    time (&s->tiff.page_start_time);

    return 0;
}