Exemplo n.º 1
0
SPAN_DECLARE(int) fax_modems_v17_v21_rx_fillin(void *user_data, int len)
{
    fax_modems_state_t *s;

    s = (fax_modems_state_t *) user_data;
    v17_rx_fillin(&s->v17_rx, len);
    fsk_rx_fillin(&s->v21_rx, len);
    return 0;
}
Exemplo n.º 2
0
static int v17_v21_rx_fillin(void *user_data, int len)
{
    fax_state_t *t;
    fax_modems_state_t *s;

    t = (fax_state_t *) user_data;
    s = &t->modems;
    v17_rx_fillin(&s->v17_rx, len);
    fsk_rx_fillin(&s->v21_rx, len);
    return 0;
}
Exemplo n.º 3
0
SPAN_DECLARE(int) fax_rx_fillin(fax_state_t *s, int len)
{
    /* To mitigate the effect of lost packets on a packet network we should
       try to sustain the status quo. If there is no receive modem running, keep
       things that way. If there is a receive modem running, try to sustain its
       operation, without causing a phase hop, or letting its adaptive functions
       diverge. */
#if defined(LOG_FAX_AUDIO)
    if (s->modems.audio_rx_log >= 0)
    {
        int i;
#if defined(_MSC_VER)
        int16_t *amp = (int16_t *) _alloca(sizeof(int16_t)*len);
#else
        int16_t amp[len];
#endif

        vec_zeroi16(amp, len);
        write(s->modems.audio_rx_log, amp, len*sizeof(int16_t));
    }
#endif
    t30_timer_update(&s->t30, len);
    /* Call the fillin function of the current modem (if there is one). */
    switch (s->modems.current_rx_type)
    {
    case T30_MODEM_V21:
        len = fsk_rx_fillin(&s->modems.v21_rx, len);
        break;
    case T30_MODEM_V27TER:
        /* TODO: what about FSK in the early stages */
        len = v27ter_rx_fillin(&s->modems.v27ter_rx, len);
        break;
    case T30_MODEM_V29:
        /* TODO: what about FSK in the early stages */
        len = v29_rx_fillin(&s->modems.v29_rx, len);
        break;
    case T30_MODEM_V17:
        /* TODO: what about FSK in the early stages */
        len = v17_rx_fillin(&s->modems.v17_rx, len);
        break;
    }
    return len;
}