]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Tweaks to spandsp
authorSteve Underwood <steveu@x100e.coppice.org>
Mon, 22 Jul 2013 10:48:35 +0000 (18:48 +0800)
committerSteve Underwood <steveu@x100e.coppice.org>
Mon, 22 Jul 2013 10:48:35 +0000 (18:48 +0800)
libs/spandsp/src/adsi.c
libs/spandsp/src/spandsp/fsk.h
libs/spandsp/src/spandsp/t4_tx.h
libs/spandsp/src/v18.c

index 44add41be0b03d43c51f4ed3dc66ca4b562bc9c2..df327bf3c5eb9fead4bb2cbc734b0566f343fd93 100644 (file)
@@ -384,7 +384,7 @@ static void start_tx(adsi_tx_state_t *s)
         dtmf_tx_init(&s->dtmftx, NULL, NULL);
         break;
     case ADSI_STANDARD_TDD:
-        fsk_tx_init(&s->fsktx, &preset_fsk_specs[FSK_WEITBRECHT], async_tx_get_bit, &s->asynctx);
+        fsk_tx_init(&s->fsktx, &preset_fsk_specs[FSK_WEITBRECHT_4545], async_tx_get_bit, &s->asynctx);
         async_tx_init(&s->asynctx, 5, ASYNC_PARITY_NONE, 2, FALSE, adsi_tdd_get_async_byte, s);
         /* Schedule an explicit shift at the start of baudot transmission */
         s->baudot_shift = 2;
@@ -448,7 +448,7 @@ SPAN_DECLARE(adsi_rx_state_t *) adsi_rx_init(adsi_rx_state_t *s,
     case ADSI_STANDARD_TDD:
         /* TDD uses 5 bit data, no parity and 1.5 stop bits. We scan for the first stop bit, and
            ride over the fraction. */
-        fsk_rx_init(&s->fskrx, &preset_fsk_specs[FSK_WEITBRECHT], FSK_FRAME_MODE_5N1_FRAMES, adsi_tdd_put_async_byte, s);
+        fsk_rx_init(&s->fskrx, &preset_fsk_specs[FSK_WEITBRECHT_4545], FSK_FRAME_MODE_5N1_FRAMES, adsi_tdd_put_async_byte, s);
         break;
     }
     s->standard = standard;
index bcb8df1de76008b6f51239de07b2c214f91242a4..b65cd7842f1f674a0a957b82a544b99925a1ce53 100644 (file)
@@ -109,9 +109,10 @@ enum
     FSK_BELL103CH1,
     FSK_BELL103CH2,
     FSK_BELL202,
-    FSK_WEITBRECHT,     /* 45.45 baud version, used for TDD (Telecom Device for the Deaf) */
-    FSK_WEITBRECHT50,   /* 50 baud version, used for TDD (Telecom Device for the Deaf) */
-    FSK_V21CH1_110      /* 110 bps version of V.21 channel 1, as used by V.18 */
+    FSK_WEITBRECHT_4545,    /* 45.45 baud version, used for TDD (Telecom Device for the Deaf) */
+    FSK_WEITBRECHT_50,      /* 50 baud version, used for TDD (Telecom Device for the Deaf) */
+    FSK_WEITBRECHT_476,     /* 47.6 baud version, used for V.18 probing */
+    FSK_V21CH1_110          /* 110 bps version of V.21 channel 1, as used by V.18 */
 };
 
 enum
index bcf75d6c0251e22fbad4e7119557a97b8e740597..c5e08265f44e9a019e7f44ff83a8ce3457b96c9b 100644 (file)
@@ -212,6 +212,14 @@ ImageLayer(34732)                                                   LONG
 #define     COMPRESSION_T43             10
 #endif
 
+typedef enum
+{
+    T4_IMAGE_FORMAT_OK = 0,
+    T4_IMAGE_FORMAT_INCOMPATIBLE = -1,
+    T4_IMAGE_FORMAT_NOSIZESUPPORT = -2,
+    T4_IMAGE_FORMAT_NORESSUPPORT = -3
+} t4_image_format_status_t;
+
 #if defined(__cplusplus)
 extern "C" {
 #endif
@@ -267,7 +275,7 @@ SPAN_DECLARE(int) t4_tx_get_bit(t4_tx_state_t *s);
             indicates that the end of the document has been reached. */
 SPAN_DECLARE(int) t4_tx_get(t4_tx_state_t *s, uint8_t buf[], size_t max_len);
 
-/*! \brief Set the encoding for the encoded data.
+/*! \brief Set the compression for the encoded data.
     \param s The T.4 context.
     \param encoding The encoding.
     \return 0 for success, otherwise -1. */
index e821aa3b3983abe8fb8ef45ee9cda62a3340731f..70a9cacc9158b552368d09a44538d3de8b68a814 100644 (file)
@@ -973,25 +973,25 @@ SPAN_DECLARE(v18_state_t *) v18_init(v18_state_t *s,
     {
     case V18_MODE_5BIT_45:
         s->repeat_shifts = mode & 0x100;
-        fsk_tx_init(&s->fsk_tx, &preset_fsk_specs[FSK_WEITBRECHT], async_tx_get_bit, &s->async_tx);
+        fsk_tx_init(&s->fsk_tx, &preset_fsk_specs[FSK_WEITBRECHT_4545], async_tx_get_bit, &s->async_tx);
         async_tx_init(&s->async_tx, 5, ASYNC_PARITY_NONE, 2, FALSE, v18_tdd_get_async_byte, s);
         /* Schedule an explicit shift at the start of baudot transmission */
         s->baudot_tx_shift = 2;
         /* TDD uses 5 bit data, no parity and 1.5 stop bits. We scan for the first stop bit, and
            ride over the fraction. */
-        fsk_rx_init(&s->fsk_rx, &preset_fsk_specs[FSK_WEITBRECHT], FSK_FRAME_MODE_5N1_FRAMES, v18_tdd_put_async_byte, s);
+        fsk_rx_init(&s->fsk_rx, &preset_fsk_specs[FSK_WEITBRECHT_4545], FSK_FRAME_MODE_5N1_FRAMES, v18_tdd_put_async_byte, s);
         s->baudot_rx_shift = 0;
         s->next_byte = (uint8_t) 0xFF;
         break;
     case V18_MODE_5BIT_50:
         s->repeat_shifts = mode & 0x100;
-        fsk_tx_init(&s->fsk_tx, &preset_fsk_specs[FSK_WEITBRECHT50], async_tx_get_bit, &s->async_tx);
+        fsk_tx_init(&s->fsk_tx, &preset_fsk_specs[FSK_WEITBRECHT_50], async_tx_get_bit, &s->async_tx);
         async_tx_init(&s->async_tx, 5, ASYNC_PARITY_NONE, 2, FALSE, v18_tdd_get_async_byte, s);
         /* Schedule an explicit shift at the start of baudot transmission */
         s->baudot_tx_shift = 2;
         /* TDD uses 5 bit data, no parity and 1.5 stop bits. We scan for the first stop bit, and
            ride over the fraction. */
-        fsk_rx_init(&s->fsk_rx, &preset_fsk_specs[FSK_WEITBRECHT50], FSK_FRAME_MODE_5N1_FRAMES, v18_tdd_put_async_byte, s);
+        fsk_rx_init(&s->fsk_rx, &preset_fsk_specs[FSK_WEITBRECHT_50], FSK_FRAME_MODE_5N1_FRAMES, v18_tdd_put_async_byte, s);
         s->baudot_rx_shift = 0;
         s->next_byte = (uint8_t) 0xFF;
         break;