Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
6f439d37
提交
6f439d37
authored
7月 16, 2014
作者:
Steve Underwood
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Tweaks, and a fix for FAX polling.
上级
3a00260d
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
28 个修改的文件
包含
222 行增加
和
98 行删除
+222
-98
ademco_contactid.c
libs/spandsp/src/ademco_contactid.c
+1
-1
async.c
libs/spandsp/src/async.c
+1
-0
bell_r2_mf.c
libs/spandsp/src/bell_r2_mf.c
+4
-4
fax_modems.c
libs/spandsp/src/fax_modems.c
+5
-0
gsm0610_local.h
libs/spandsp/src/gsm0610_local.h
+19
-19
gsm0610_rpe.c
libs/spandsp/src/gsm0610_rpe.c
+1
-1
sig_tone.c
libs/spandsp/src/sig_tone.c
+1
-1
fast_convert.h
libs/spandsp/src/spandsp/fast_convert.h
+2
-2
fir.h
libs/spandsp/src/spandsp/fir.h
+7
-7
hdlc.h
libs/spandsp/src/spandsp/hdlc.h
+2
-1
at_interpreter.h
libs/spandsp/src/spandsp/private/at_interpreter.h
+2
-2
bell_r2_mf.h
libs/spandsp/src/spandsp/private/bell_r2_mf.h
+1
-1
g722.h
libs/spandsp/src/spandsp/private/g722.h
+2
-2
v42.h
libs/spandsp/src/spandsp/private/v42.h
+1
-1
t30.h
libs/spandsp/src/spandsp/t30.h
+1
-1
t38_gateway.h
libs/spandsp/src/spandsp/t38_gateway.h
+3
-5
tone_detect.h
libs/spandsp/src/spandsp/tone_detect.h
+1
-1
t30.c
libs/spandsp/src/t30.c
+4
-4
t31.c
libs/spandsp/src/t31.c
+3
-2
t35.c
libs/spandsp/src/t35.c
+2
-2
t38_core.c
libs/spandsp/src/t38_core.c
+95
-1
t38_gateway.c
libs/spandsp/src/t38_gateway.c
+5
-5
t38_terminal.c
libs/spandsp/src/t38_terminal.c
+1
-0
testcpuid.c
libs/spandsp/src/testcpuid.c
+23
-23
time_scale.c
libs/spandsp/src/time_scale.c
+2
-2
v8.c
libs/spandsp/src/v8.c
+1
-1
fax_tester.h
libs/spandsp/tests/fax_tester.h
+24
-0
tsb85_tests.c
libs/spandsp/tests/tsb85_tests.c
+8
-9
没有找到文件。
libs/spandsp/src/ademco_contactid.c
浏览文件 @
6f439d37
...
@@ -504,7 +504,7 @@ SPAN_DECLARE(int) decode_msg(ademco_contactid_report_t *report, const char buf[]
...
@@ -504,7 +504,7 @@ SPAN_DECLARE(int) decode_msg(ademco_contactid_report_t *report, const char buf[]
int
x
;
int
x
;
char
buf2
[
20
];
char
buf2
[
20
];
/* We need to remap normal DTMF (0-
0, *, #, A-D) to Ademco's pseudo-hex (0-0
, B-F, nothing for A)
/* We need to remap normal DTMF (0-
9, *, #, A-D) to Ademco's pseudo-hex (0-9
, B-F, nothing for A)
and calculate the checksum */
and calculate the checksum */
for
(
sum
=
0
,
s
=
buf
,
t
=
buf2
;
*
s
;
s
++
,
t
++
)
for
(
sum
=
0
,
s
=
buf
,
t
=
buf2
;
*
s
;
s
++
,
t
++
)
{
{
...
...
libs/spandsp/src/async.c
浏览文件 @
6f439d37
...
@@ -85,6 +85,7 @@ SPAN_DECLARE(const char *) signal_status_to_str(int status)
...
@@ -85,6 +85,7 @@ SPAN_DECLARE(const char *) signal_status_to_str(int status)
case
SIG_STATUS_LINK_IDLE
:
case
SIG_STATUS_LINK_IDLE
:
return
"Link idle"
;
return
"Link idle"
;
}
}
/*endswitch*/
return
"???"
;
return
"???"
;
}
}
/*- End of function --------------------------------------------------------*/
/*- End of function --------------------------------------------------------*/
...
...
libs/spandsp/src/bell_r2_mf.c
浏览文件 @
6f439d37
...
@@ -293,15 +293,15 @@ SPAN_DECLARE(int) bell_mf_tx(bell_mf_tx_state_t *s, int16_t amp[], int max_sampl
...
@@ -293,15 +293,15 @@ SPAN_DECLARE(int) bell_mf_tx(bell_mf_tx_state_t *s, int16_t amp[], int max_sampl
if
(
s
->
tones
.
current_section
>=
0
)
if
(
s
->
tones
.
current_section
>=
0
)
{
{
/* Deal with the fragment left over from last time */
/* Deal with the fragment left over from last time */
len
=
tone_gen
(
&
(
s
->
tones
)
,
amp
,
max_samples
);
len
=
tone_gen
(
&
s
->
tones
,
amp
,
max_samples
);
}
}
while
(
len
<
max_samples
&&
(
digit
=
queue_read_byte
(
&
s
->
queue
.
queue
))
>=
0
)
while
(
len
<
max_samples
&&
(
digit
=
queue_read_byte
(
&
s
->
queue
.
queue
))
>=
0
)
{
{
/* Step to the next digit */
/* Step to the next digit */
if
((
cp
=
strchr
(
bell_mf_tone_codes
,
digit
))
==
NULL
)
if
((
cp
=
strchr
(
bell_mf_tone_codes
,
digit
))
==
NULL
)
continue
;
continue
;
tone_gen_init
(
&
(
s
->
tones
)
,
&
bell_mf_digit_tones
[
cp
-
bell_mf_tone_codes
]);
tone_gen_init
(
&
s
->
tones
,
&
bell_mf_digit_tones
[
cp
-
bell_mf_tone_codes
]);
len
+=
tone_gen
(
&
(
s
->
tones
)
,
amp
+
len
,
max_samples
-
len
);
len
+=
tone_gen
(
&
s
->
tones
,
amp
+
len
,
max_samples
-
len
);
}
}
return
len
;
return
len
;
}
}
...
@@ -338,7 +338,7 @@ SPAN_DECLARE(bell_mf_tx_state_t *) bell_mf_tx_init(bell_mf_tx_state_t *s)
...
@@ -338,7 +338,7 @@ SPAN_DECLARE(bell_mf_tx_state_t *) bell_mf_tx_init(bell_mf_tx_state_t *s)
if
(
!
bell_mf_gen_inited
)
if
(
!
bell_mf_gen_inited
)
bell_mf_gen_init
();
bell_mf_gen_init
();
tone_gen_init
(
&
(
s
->
tones
)
,
&
bell_mf_digit_tones
[
0
]);
tone_gen_init
(
&
s
->
tones
,
&
bell_mf_digit_tones
[
0
]);
s
->
current_sample
=
0
;
s
->
current_sample
=
0
;
queue_init
(
&
s
->
queue
.
queue
,
MAX_BELL_MF_DIGITS
,
QUEUE_READ_ATOMIC
|
QUEUE_WRITE_ATOMIC
);
queue_init
(
&
s
->
queue
.
queue
,
MAX_BELL_MF_DIGITS
,
QUEUE_READ_ATOMIC
|
QUEUE_WRITE_ATOMIC
);
s
->
tones
.
current_section
=
-
1
;
s
->
tones
.
current_section
=
-
1
;
...
...
libs/spandsp/src/fax_modems.c
浏览文件 @
6f439d37
...
@@ -161,8 +161,10 @@ SPAN_DECLARE_NONSTD(void) fax_modems_hdlc_accept(void *user_data, const uint8_t
...
@@ -161,8 +161,10 @@ SPAN_DECLARE_NONSTD(void) fax_modems_hdlc_accept(void *user_data, const uint8_t
say the current signal source is valid. */
say the current signal source is valid. */
if
(
len
>=
0
&&
ok
)
if
(
len
>=
0
&&
ok
)
s
->
rx_frame_received
=
true
;
s
->
rx_frame_received
=
true
;
/*endif*/
if
(
s
->
hdlc_accept
)
if
(
s
->
hdlc_accept
)
s
->
hdlc_accept
(
s
->
hdlc_accept_user_data
,
msg
,
len
,
ok
);
s
->
hdlc_accept
(
s
->
hdlc_accept_user_data
,
msg
,
len
,
ok
);
/*endif*/
}
}
/*- End of function --------------------------------------------------------*/
/*- End of function --------------------------------------------------------*/
...
@@ -176,6 +178,7 @@ SPAN_DECLARE_NONSTD(void) fax_modems_hdlc_tx_frame(void *user_data, const uint8_
...
@@ -176,6 +178,7 @@ SPAN_DECLARE_NONSTD(void) fax_modems_hdlc_tx_frame(void *user_data, const uint8_
hdlc_tx_restart
(
&
s
->
hdlc_tx
);
hdlc_tx_restart
(
&
s
->
hdlc_tx
);
else
else
hdlc_tx_frame
(
&
s
->
hdlc_tx
,
msg
,
len
);
hdlc_tx_frame
(
&
s
->
hdlc_tx
,
msg
,
len
);
/*endif*/
}
}
/*- End of function --------------------------------------------------------*/
/*- End of function --------------------------------------------------------*/
...
@@ -579,6 +582,7 @@ SPAN_DECLARE(int) fax_modems_set_next_tx_type(fax_modems_state_t *s)
...
@@ -579,6 +582,7 @@ SPAN_DECLARE(int) fax_modems_set_next_tx_type(fax_modems_state_t *s)
fax_modems_set_next_tx_handler
(
s
,
(
span_tx_handler_t
)
NULL
,
NULL
);
fax_modems_set_next_tx_handler
(
s
,
(
span_tx_handler_t
)
NULL
,
NULL
);
return
0
;
return
0
;
}
}
/*endif*/
/* There is nothing else to change to, so use zero length silence */
/* There is nothing else to change to, so use zero length silence */
silence_gen_alter
(
&
s
->
silence_gen
,
0
);
silence_gen_alter
(
&
s
->
silence_gen
,
0
);
fax_modems_set_tx_handler
(
s
,
(
span_tx_handler_t
)
&
silence_gen
,
&
s
->
silence_gen
);
fax_modems_set_tx_handler
(
s
,
(
span_tx_handler_t
)
&
silence_gen
,
&
s
->
silence_gen
);
...
@@ -619,6 +623,7 @@ SPAN_DECLARE(fax_modems_state_t *) fax_modems_init(fax_modems_state_t *s,
...
@@ -619,6 +623,7 @@ SPAN_DECLARE(fax_modems_state_t *) fax_modems_init(fax_modems_state_t *s,
{
{
if
((
s
=
(
fax_modems_state_t
*
)
span_alloc
(
sizeof
(
*
s
)))
==
NULL
)
if
((
s
=
(
fax_modems_state_t
*
)
span_alloc
(
sizeof
(
*
s
)))
==
NULL
)
return
NULL
;
return
NULL
;
/*endif*/
}
}
/*endif*/
/*endif*/
memset
(
s
,
0
,
sizeof
(
*
s
));
memset
(
s
,
0
,
sizeof
(
*
s
));
...
...
libs/spandsp/src/gsm0610_local.h
浏览文件 @
6f439d37
...
@@ -53,7 +53,7 @@ static __inline__ int16_t gsm_add(int16_t a, int16_t b)
...
@@ -53,7 +53,7 @@ static __inline__ int16_t gsm_add(int16_t a, int16_t b)
int32_t
sum
;
int32_t
sum
;
sum
=
(
int32_t
)
a
+
(
int32_t
)
b
;
sum
=
(
int32_t
)
a
+
(
int32_t
)
b
;
return
saturate16
(
sum
);
return
saturate16
(
sum
);
#endif
#endif
}
}
/*- End of function --------------------------------------------------------*/
/*- End of function --------------------------------------------------------*/
...
@@ -78,17 +78,17 @@ static __inline__ int32_t gsm_l_add(int32_t a, int32_t b)
...
@@ -78,17 +78,17 @@ static __inline__ int32_t gsm_l_add(int32_t a, int32_t b)
if
(
a
<
0
)
if
(
a
<
0
)
{
{
if
(
b
>=
0
)
if
(
b
>=
0
)
return
a
+
b
;
return
a
+
b
;
/*endif*/
/*endif*/
A
=
(
uint32_t
)
-
(
a
+
1
)
+
(
uint32_t
)
-
(
b
+
1
);
A
=
(
uint32_t
)
-
(
a
+
1
)
+
(
uint32_t
)
-
(
b
+
1
);
return
(
A
>=
INT32_MAX
)
?
INT32_MIN
:
-
(
int32_t
)
A
-
2
;
return
(
A
>=
INT32_MAX
)
?
INT32_MIN
:
-
(
int32_t
)
A
-
2
;
}
}
/*endif*/
/*endif*/
if
(
b
<=
0
)
if
(
b
<=
0
)
return
a
+
b
;
return
a
+
b
;
/*endif*/
/*endif*/
A
=
(
uint32_t
)
a
+
(
uint32_t
)
b
;
A
=
(
uint32_t
)
a
+
(
uint32_t
)
b
;
return
(
A
>
INT32_MAX
)
?
INT32_MAX
:
A
;
return
(
A
>
INT32_MAX
)
?
INT32_MAX
:
A
;
#endif
#endif
}
}
/*- End of function --------------------------------------------------------*/
/*- End of function --------------------------------------------------------*/
...
@@ -98,23 +98,23 @@ static __inline__ int16_t gsm_sub(int16_t a, int16_t b)
...
@@ -98,23 +98,23 @@ static __inline__ int16_t gsm_sub(int16_t a, int16_t b)
int32_t
diff
;
int32_t
diff
;
diff
=
(
int32_t
)
a
-
(
int32_t
)
b
;
diff
=
(
int32_t
)
a
-
(
int32_t
)
b
;
return
saturate16
(
diff
);
return
saturate16
(
diff
);
}
}
/*- End of function --------------------------------------------------------*/
/*- End of function --------------------------------------------------------*/
static
__inline__
int16_t
gsm_mult
(
int16_t
a
,
int16_t
b
)
static
__inline__
int16_t
gsm_mult
(
int16_t
a
,
int16_t
b
)
{
{
if
(
a
==
INT16_MIN
&&
b
==
INT16_MIN
)
if
(
a
==
INT16_MIN
&&
b
==
INT16_MIN
)
return
INT16_MAX
;
return
INT16_MAX
;
/*endif*/
/*endif*/
return
(
int16_t
)
(((
int32_t
)
a
*
(
int32_t
)
b
)
>>
15
);
return
(
int16_t
)
(((
int32_t
)
a
*
(
int32_t
)
b
)
>>
15
);
}
}
/*- End of function --------------------------------------------------------*/
/*- End of function --------------------------------------------------------*/
static
__inline__
int32_t
gsm_l_mult
(
int16_t
a
,
int16_t
b
)
static
__inline__
int32_t
gsm_l_mult
(
int16_t
a
,
int16_t
b
)
{
{
assert
(
a
!=
INT16_MIN
||
b
!=
INT16_MIN
);
assert
(
a
!=
INT16_MIN
||
b
!=
INT16_MIN
);
return
((
int32_t
)
a
*
(
int32_t
)
b
)
<<
1
;
return
((
int32_t
)
a
*
(
int32_t
)
b
)
<<
1
;
}
}
/*- End of function --------------------------------------------------------*/
/*- End of function --------------------------------------------------------*/
...
@@ -123,47 +123,47 @@ static __inline__ int16_t gsm_mult_r(int16_t a, int16_t b)
...
@@ -123,47 +123,47 @@ static __inline__ int16_t gsm_mult_r(int16_t a, int16_t b)
int32_t
prod
;
int32_t
prod
;
if
(
b
==
INT16_MIN
&&
a
==
INT16_MIN
)
if
(
b
==
INT16_MIN
&&
a
==
INT16_MIN
)
return
INT16_MAX
;
return
INT16_MAX
;
/*endif*/
/*endif*/
prod
=
(
int32_t
)
a
*
(
int32_t
)
b
+
16384
;
prod
=
(
int32_t
)
a
*
(
int32_t
)
b
+
16384
;
prod
>>=
15
;
prod
>>=
15
;
return
(
int16_t
)
(
prod
&
0xFFFF
);
return
(
int16_t
)
(
prod
&
0xFFFF
);
}
}
/*- End of function --------------------------------------------------------*/
/*- End of function --------------------------------------------------------*/
static
__inline__
int16_t
gsm_abs
(
int16_t
a
)
static
__inline__
int16_t
gsm_abs
(
int16_t
a
)
{
{
return
(
a
==
INT16_MIN
)
?
INT16_MAX
:
(
int16_t
)
abs
(
a
);
return
(
a
==
INT16_MIN
)
?
INT16_MAX
:
(
int16_t
)
abs
(
a
);
}
}
/*- End of function --------------------------------------------------------*/
/*- End of function --------------------------------------------------------*/
static
__inline__
int16_t
gsm_asr
(
int16_t
a
,
int
n
)
static
__inline__
int16_t
gsm_asr
(
int16_t
a
,
int
n
)
{
{
if
(
n
>=
16
)
if
(
n
>=
16
)
return
(
int16_t
)
(
-
(
a
<
0
));
return
(
int16_t
)
(
-
(
a
<
0
));
/*endif*/
/*endif*/
if
(
n
<=
-
16
)
if
(
n
<=
-
16
)
return
0
;
return
0
;
/*endif*/
/*endif*/
if
(
n
<
0
)
if
(
n
<
0
)
return
(
int16_t
)
(
a
<<
-
n
);
return
(
int16_t
)
(
a
<<
-
n
);
/*endif*/
/*endif*/
return
(
int16_t
)
(
a
>>
n
);
return
(
int16_t
)
(
a
>>
n
);
}
}
/*- End of function --------------------------------------------------------*/
/*- End of function --------------------------------------------------------*/
static
__inline__
int16_t
gsm_asl
(
int16_t
a
,
int
n
)
static
__inline__
int16_t
gsm_asl
(
int16_t
a
,
int
n
)
{
{
if
(
n
>=
16
)
if
(
n
>=
16
)
return
0
;
return
0
;
/*endif*/
/*endif*/
if
(
n
<=
-
16
)
if
(
n
<=
-
16
)
return
(
int16_t
)
(
-
(
a
<
0
));
return
(
int16_t
)
(
-
(
a
<
0
));
/*endif*/
/*endif*/
if
(
n
<
0
)
if
(
n
<
0
)
return
gsm_asr
(
a
,
-
n
);
return
gsm_asr
(
a
,
-
n
);
/*endif*/
/*endif*/
return
(
int16_t
)
(
a
<<
n
);
return
(
int16_t
)
(
a
<<
n
);
}
}
/*- End of function --------------------------------------------------------*/
/*- End of function --------------------------------------------------------*/
...
...
libs/spandsp/src/gsm0610_rpe.c
浏览文件 @
6f439d37
...
@@ -59,7 +59,7 @@
...
@@ -59,7 +59,7 @@
static
void
weighting_filter
(
int16_t
x
[
40
],
static
void
weighting_filter
(
int16_t
x
[
40
],
const
int16_t
*
e
)
// signal [-5..0.39.44] IN)
const
int16_t
*
e
)
// signal [-5..0.39.44] IN)
{
{
#if defined(__GNUC__) && defined(SPANDSP_USE_MMX) && defined(__x86_64__)
&& !(defined(__APPLE_CC__) && __APPLE_CC__ >= 5448) && !defined(__OpenBSD__)
#if defined(__GNUC__) && defined(SPANDSP_USE_MMX) && defined(__x86_64__)
/* Table 4.4 Coefficients of the weighting filter */
/* Table 4.4 Coefficients of the weighting filter */
/* This must be padded to a multiple of 4 for MMX to work */
/* This must be padded to a multiple of 4 for MMX to work */
static
const
union
static
const
union
...
...
libs/spandsp/src/sig_tone.c
浏览文件 @
6f439d37
...
@@ -302,7 +302,7 @@ SPAN_DECLARE(int) sig_tone_tx(sig_tone_tx_state_t *s, int16_t amp[], int len)
...
@@ -302,7 +302,7 @@ SPAN_DECLARE(int) sig_tone_tx(sig_tone_tx_state_t *s, int16_t amp[], int len)
{
{
for
(
j
=
i
;
j
<
i
+
n
;
j
++
)
for
(
j
=
i
;
j
<
i
+
n
;
j
++
)
{
{
tone
=
dds_mod
(
&
(
s
->
phase_acc
[
k
])
,
s
->
phase_rate
[
k
],
s
->
tone_scaling
[
k
][
high_low
],
0
);
tone
=
dds_mod
(
&
s
->
phase_acc
[
k
]
,
s
->
phase_rate
[
k
],
s
->
tone_scaling
[
k
][
high_low
],
0
);
amp
[
j
]
=
sat_add16
(
amp
[
j
],
tone
);
amp
[
j
]
=
sat_add16
(
amp
[
j
],
tone
);
}
}
/*endfor*/
/*endfor*/
...
...
libs/spandsp/src/spandsp/fast_convert.h
浏览文件 @
6f439d37
...
@@ -322,12 +322,12 @@ extern "C"
...
@@ -322,12 +322,12 @@ extern "C"
#if (_MSC_VER < 1800)
#if (_MSC_VER < 1800)
__inline
long
int
lrint
(
double
x
)
__inline
long
int
lrint
(
double
x
)
{
{
return
(
long
int
)
_mm_cvtsd_si64x
(
_mm_loadu_pd
((
const
double
*
)
&
x
)
);
return
(
long
int
)
_mm_cvtsd_si64x
(
_mm_loadu_pd
((
const
double
*
)
&
x
)
);
}
}
__inline
long
int
lrintf
(
float
x
)
__inline
long
int
lrintf
(
float
x
)
{
{
return
_mm_cvt_ss2si
(
_mm_load_ss
((
const
float
*
)
&
x
)
);
return
_mm_cvt_ss2si
(
_mm_load_ss
((
const
float
*
)
&
x
)
);
}
}
#endif
#endif
...
...
libs/spandsp/src/spandsp/fir.h
浏览文件 @
6f439d37
...
@@ -88,10 +88,10 @@ static __inline__ const int16_t *fir16_create(fir16_state_t *fir,
...
@@ -88,10 +88,10 @@ static __inline__ const int16_t *fir16_create(fir16_state_t *fir,
fir
->
curr_pos
=
taps
-
1
;
fir
->
curr_pos
=
taps
-
1
;
fir
->
coeffs
=
coeffs
;
fir
->
coeffs
=
coeffs
;
#if defined(USE_MMX) || defined(USE_SSE2)
#if defined(USE_MMX) || defined(USE_SSE2)
if
((
fir
->
history
=
m
alloc
(
2
*
taps
*
sizeof
(
int16_t
))))
if
((
fir
->
history
=
span_
alloc
(
2
*
taps
*
sizeof
(
int16_t
))))
memset
(
fir
->
history
,
0
,
2
*
taps
*
sizeof
(
int16_t
));
memset
(
fir
->
history
,
0
,
2
*
taps
*
sizeof
(
int16_t
));
#else
#else
if
((
fir
->
history
=
(
int16_t
*
)
m
alloc
(
taps
*
sizeof
(
int16_t
))))
if
((
fir
->
history
=
(
int16_t
*
)
span_
alloc
(
taps
*
sizeof
(
int16_t
))))
memset
(
fir
->
history
,
0
,
taps
*
sizeof
(
int16_t
));
memset
(
fir
->
history
,
0
,
taps
*
sizeof
(
int16_t
));
#endif
#endif
return
fir
->
history
;
return
fir
->
history
;
...
@@ -110,7 +110,7 @@ static __inline__ void fir16_flush(fir16_state_t *fir)
...
@@ -110,7 +110,7 @@ static __inline__ void fir16_flush(fir16_state_t *fir)
static
__inline__
void
fir16_free
(
fir16_state_t
*
fir
)
static
__inline__
void
fir16_free
(
fir16_state_t
*
fir
)
{
{
free
(
fir
->
history
);
span_
free
(
fir
->
history
);
}
}
/*- End of function --------------------------------------------------------*/
/*- End of function --------------------------------------------------------*/
...
@@ -210,7 +210,7 @@ static __inline__ const int16_t *fir32_create(fir32_state_t *fir,
...
@@ -210,7 +210,7 @@ static __inline__ const int16_t *fir32_create(fir32_state_t *fir,
fir
->
taps
=
taps
;
fir
->
taps
=
taps
;
fir
->
curr_pos
=
taps
-
1
;
fir
->
curr_pos
=
taps
-
1
;
fir
->
coeffs
=
coeffs
;
fir
->
coeffs
=
coeffs
;
fir
->
history
=
(
int16_t
*
)
m
alloc
(
taps
*
sizeof
(
int16_t
));
fir
->
history
=
(
int16_t
*
)
span_
alloc
(
taps
*
sizeof
(
int16_t
));
if
(
fir
->
history
)
if
(
fir
->
history
)
memset
(
fir
->
history
,
'\0'
,
taps
*
sizeof
(
int16_t
));
memset
(
fir
->
history
,
'\0'
,
taps
*
sizeof
(
int16_t
));
return
fir
->
history
;
return
fir
->
history
;
...
@@ -225,7 +225,7 @@ static __inline__ void fir32_flush(fir32_state_t *fir)
...
@@ -225,7 +225,7 @@ static __inline__ void fir32_flush(fir32_state_t *fir)
static
__inline__
void
fir32_free
(
fir32_state_t
*
fir
)
static
__inline__
void
fir32_free
(
fir32_state_t
*
fir
)
{
{
free
(
fir
->
history
);
span_
free
(
fir
->
history
);
}
}
/*- End of function --------------------------------------------------------*/
/*- End of function --------------------------------------------------------*/
...
@@ -258,7 +258,7 @@ static __inline__ const float *fir_float_create(fir_float_state_t *fir,
...
@@ -258,7 +258,7 @@ static __inline__ const float *fir_float_create(fir_float_state_t *fir,
fir
->
taps
=
taps
;
fir
->
taps
=
taps
;
fir
->
curr_pos
=
taps
-
1
;
fir
->
curr_pos
=
taps
-
1
;
fir
->
coeffs
=
coeffs
;
fir
->
coeffs
=
coeffs
;
fir
->
history
=
(
float
*
)
m
alloc
(
taps
*
sizeof
(
float
));
fir
->
history
=
(
float
*
)
span_
alloc
(
taps
*
sizeof
(
float
));
if
(
fir
->
history
)
if
(
fir
->
history
)
memset
(
fir
->
history
,
'\0'
,
taps
*
sizeof
(
float
));
memset
(
fir
->
history
,
'\0'
,
taps
*
sizeof
(
float
));
return
fir
->
history
;
return
fir
->
history
;
...
@@ -267,7 +267,7 @@ static __inline__ const float *fir_float_create(fir_float_state_t *fir,
...
@@ -267,7 +267,7 @@ static __inline__ const float *fir_float_create(fir_float_state_t *fir,
static
__inline__
void
fir_float_free
(
fir_float_state_t
*
fir
)
static
__inline__
void
fir_float_free
(
fir_float_state_t
*
fir
)
{
{
free
(
fir
->
history
);
span_
free
(
fir
->
history
);
}
}
/*- End of function --------------------------------------------------------*/
/*- End of function --------------------------------------------------------*/
...
...
libs/spandsp/src/spandsp/hdlc.h
浏览文件 @
6f439d37
...
@@ -81,7 +81,8 @@ extern "C"
...
@@ -81,7 +81,8 @@ extern "C"
{
{
#endif
#endif
/*! \brief Initialise an HDLC receiver context.
/*! Initialise an HDLC receiver context.
\brief Initialise an HDLC receiver context.
\param s A pointer to an HDLC receiver context.
\param s A pointer to an HDLC receiver context.
\param crc32 True to use ITU CRC32. False to use ITU CRC16.
\param crc32 True to use ITU CRC32. False to use ITU CRC16.
\param report_bad_frames True to request the reporting of bad frames.
\param report_bad_frames True to request the reporting of bad frames.
...
...
libs/spandsp/src/spandsp/private/at_interpreter.h
浏览文件 @
6f439d37
...
@@ -106,9 +106,9 @@ struct at_state_s
...
@@ -106,9 +106,9 @@ struct at_state_s
int
command_dial
;
int
command_dial
;
int
ok_is_pending
;
int
ok_is_pending
;
int
dte_is_waiting
;
int
dte_is_waiting
;
/*! \brief True if a carrier is pres
nt. Otherwise false
. */
/*! \brief True if a carrier is pres
ent
. */
bool
rx_signal_present
;
bool
rx_signal_present
;
/*! \brief True if a modem has trained,
Otherwise false.
*/
/*! \brief True if a modem has trained, */
bool
rx_trained
;
bool
rx_trained
;
int
transmit
;
int
transmit
;
...
...
libs/spandsp/src/spandsp/private/bell_r2_mf.h
浏览文件 @
6f439d37
...
@@ -88,7 +88,7 @@ struct r2_mf_rx_state_s
...
@@ -88,7 +88,7 @@ struct r2_mf_rx_state_s
tone_report_func_t
callback
;
tone_report_func_t
callback
;
/*! An opaque pointer passed to the callback function. */
/*! An opaque pointer passed to the callback function. */
void
*
callback_data
;
void
*
callback_data
;
/*! T
ue is
we are detecting forward tones. False if we are detecting backward tones */
/*! T
rue if
we are detecting forward tones. False if we are detecting backward tones */
bool
fwd
;
bool
fwd
;
/*! Tone detector working states */
/*! Tone detector working states */
goertzel_state_t
out
[
6
];
goertzel_state_t
out
[
6
];
...
...
libs/spandsp/src/spandsp/private/g722.h
浏览文件 @
6f439d37
...
@@ -48,7 +48,7 @@ typedef struct
...
@@ -48,7 +48,7 @@ typedef struct
struct
g722_encode_state_s
struct
g722_encode_state_s
{
{
/*! True if operating in the special ITU test mode, with the band split filters
/*! True if operating in the special ITU test mode, with the band split filters
disabled. */
disabled. */
bool
itu_test_mode
;
bool
itu_test_mode
;
/*! True if the G.722 data is packed */
/*! True if the G.722 data is packed */
bool
packed
;
bool
packed
;
...
@@ -74,7 +74,7 @@ struct g722_encode_state_s
...
@@ -74,7 +74,7 @@ struct g722_encode_state_s
struct
g722_decode_state_s
struct
g722_decode_state_s
{
{
/*! True if operating in the special ITU test mode, with the band split filters
/*! True if operating in the special ITU test mode, with the band split filters
disabled. */
disabled. */
bool
itu_test_mode
;
bool
itu_test_mode
;
/*! True if the G.722 data is packed */
/*! True if the G.722 data is packed */
bool
packed
;
bool
packed
;
...
...
libs/spandsp/src/spandsp/private/v42.h
浏览文件 @
6f439d37
...
@@ -133,7 +133,7 @@ struct v42_state_s
...
@@ -133,7 +133,7 @@ struct v42_state_s
{
{
/*! True if we are the calling party, otherwise false. */
/*! True if we are the calling party, otherwise false. */
bool
calling_party
;
bool
calling_party
;
/*! True if we should detect whether the far end is V.42 capable.
f
alse if we go
/*! True if we should detect whether the far end is V.42 capable.
F
alse if we go
directly to protocol establishment. */
directly to protocol establishment. */
bool
detect
;
bool
detect
;
...
...
libs/spandsp/src/spandsp/t30.h
浏览文件 @
6f439d37
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
\section t30_page_sec_1 What does it do?
\section t30_page_sec_1 What does it do?
The T.30 protocol is the core protocol used for FAX transmission. This module
The T.30 protocol is the core protocol used for FAX transmission. This module
implements most of its key features. It does not interface to the outside wor
k
.
implements most of its key features. It does not interface to the outside wor
ld
.
Seperate modules do that for T.38, analogue line, and other forms of FAX
Seperate modules do that for T.38, analogue line, and other forms of FAX
communication.
communication.
...
...
libs/spandsp/src/spandsp/t38_gateway.h
浏览文件 @
6f439d37
...
@@ -45,16 +45,14 @@ to maximum the tolerance of jitter and packet loss on the IP network.
...
@@ -45,16 +45,14 @@ to maximum the tolerance of jitter and packet loss on the IP network.
typedef
struct
t38_gateway_state_s
t38_gateway_state_t
;
typedef
struct
t38_gateway_state_s
t38_gateway_state_t
;
/*!
/*!
T.30 real time frame handler.
T.38 gateway real time frame handler.
\brief T.30 real time frame handler.
\brief T.38 gateway real time frame handler.
\param s The T.30 context.
\param user_data An opaque pointer.
\param user_data An opaque pointer.
\param incoming True for incoming, false for outgoing.
\param incoming True for incoming, false for outgoing.
\param msg The HDLC message.
\param msg The HDLC message.
\param len The length of the message.
\param len The length of the message.
*/
*/
typedef
void
(
*
t38_gateway_real_time_frame_handler_t
)(
t38_gateway_state_t
*
s
,
typedef
void
(
*
t38_gateway_real_time_frame_handler_t
)(
void
*
user_data
,
void
*
user_data
,
bool
incoming
,
bool
incoming
,
const
uint8_t
*
msg
,
const
uint8_t
*
msg
,
int
len
);
int
len
);
...
...
libs/spandsp/src/spandsp/tone_detect.h
浏览文件 @
6f439d37
...
@@ -78,7 +78,7 @@ SPAN_DECLARE(void) make_goertzel_descriptor(goertzel_descriptor_t *t,
...
@@ -78,7 +78,7 @@ SPAN_DECLARE(void) make_goertzel_descriptor(goertzel_descriptor_t *t,
int
samples
);
int
samples
);
/*! \brief Initialise the state of a Goertzel transform.
/*! \brief Initialise the state of a Goertzel transform.
\param s The Goertzel context. If NULL, a context is allocated
with malloc
.
\param s The Goertzel context. If NULL, a context is allocated.
\param t The Goertzel descriptor.
\param t The Goertzel descriptor.
\return A pointer to the Goertzel state. */
\return A pointer to the Goertzel state. */
SPAN_DECLARE
(
goertzel_state_t
*
)
goertzel_init
(
goertzel_state_t
*
s
,
SPAN_DECLARE
(
goertzel_state_t
*
)
goertzel_init
(
goertzel_state_t
*
s
,
...
...
libs/spandsp/src/t30.c
浏览文件 @
6f439d37
...
@@ -2657,7 +2657,6 @@ static int start_receiving_document(t30_state_t *s)
...
@@ -2657,7 +2657,6 @@ static int start_receiving_document(t30_state_t *s)
return
-
1
;
return
-
1
;
}
}
span_log
(
&
s
->
logging
,
SPAN_LOG_FLOW
,
"Start receiving document
\n
"
);
span_log
(
&
s
->
logging
,
SPAN_LOG_FLOW
,
"Start receiving document
\n
"
);
queue_phase
(
s
,
T30_PHASE_B_TX
);
s
->
ecm_block
=
0
;
s
->
ecm_block
=
0
;
send_dis_or_dtc_sequence
(
s
,
true
);
send_dis_or_dtc_sequence
(
s
,
true
);
return
0
;
return
0
;
...
@@ -2745,7 +2744,7 @@ static int process_rx_dis_dtc(t30_state_t *s, const uint8_t *msg, int len)
...
@@ -2745,7 +2744,7 @@ static int process_rx_dis_dtc(t30_state_t *s, const uint8_t *msg, int len)
send_dcs_sequence
(
s
,
true
);
send_dcs_sequence
(
s
,
true
);
return
0
;
return
0
;
}
}
span_log
(
&
s
->
logging
,
SPAN_LOG_FLOW
,
"%s nothing to send
\n
"
,
t30_frametype
(
msg
[
2
]));
span_log
(
&
s
->
logging
,
SPAN_LOG_FLOW
,
"%s
-
nothing to send
\n
"
,
t30_frametype
(
msg
[
2
]));
/* ... then try to receive something */
/* ... then try to receive something */
if
(
s
->
rx_file
[
0
])
if
(
s
->
rx_file
[
0
])
{
{
...
@@ -2772,7 +2771,7 @@ static int process_rx_dis_dtc(t30_state_t *s, const uint8_t *msg, int len)
...
@@ -2772,7 +2771,7 @@ static int process_rx_dis_dtc(t30_state_t *s, const uint8_t *msg, int len)
send_dis_or_dtc_sequence
(
s
,
true
);
send_dis_or_dtc_sequence
(
s
,
true
);
return
0
;
return
0
;
}
}
span_log
(
&
s
->
logging
,
SPAN_LOG_FLOW
,
"%s nothing to receive
\n
"
,
t30_frametype
(
msg
[
2
]));
span_log
(
&
s
->
logging
,
SPAN_LOG_FLOW
,
"%s
-
nothing to receive
\n
"
,
t30_frametype
(
msg
[
2
]));
/* There is nothing to do, or nothing we are able to do. */
/* There is nothing to do, or nothing we are able to do. */
send_dcn
(
s
);
send_dcn
(
s
);
return
-
1
;
return
-
1
;
...
@@ -5105,6 +5104,7 @@ static void queue_phase(t30_state_t *s, int phase)
...
@@ -5105,6 +5104,7 @@ static void queue_phase(t30_state_t *s, int phase)
s
->
send_hdlc_handler
(
s
->
send_hdlc_user_data
,
NULL
,
-
1
);
s
->
send_hdlc_handler
(
s
->
send_hdlc_user_data
,
NULL
,
-
1
);
}
}
s
->
next_phase
=
phase
;
s
->
next_phase
=
phase
;
span_log
(
&
s
->
logging
,
SPAN_LOG_FLOW
,
"Queuing phase %s
\n
"
,
phase_names
[
s
->
next_phase
]);
}
}
else
else
{
{
...
@@ -5116,7 +5116,7 @@ static void queue_phase(t30_state_t *s, int phase)
...
@@ -5116,7 +5116,7 @@ static void queue_phase(t30_state_t *s, int phase)
static
void
set_phase
(
t30_state_t
*
s
,
int
phase
)
static
void
set_phase
(
t30_state_t
*
s
,
int
phase
)
{
{
if
(
phase
!=
s
->
next_
phase
&&
s
->
next_phase
!=
T30_PHASE_IDLE
)
if
(
s
->
next_phase
!=
phase
&&
s
->
next_phase
!=
T30_PHASE_IDLE
)
{
{
span_log
(
&
s
->
logging
,
SPAN_LOG_FLOW
,
"Flushing queued phase %s
\n
"
,
phase_names
[
s
->
next_phase
]);
span_log
(
&
s
->
logging
,
SPAN_LOG_FLOW
,
"Flushing queued phase %s
\n
"
,
phase_names
[
s
->
next_phase
]);
/* Ensure nothing has been left in the queue that was scheduled to go out in the previous next
/* Ensure nothing has been left in the queue that was scheduled to go out in the previous next
...
...
libs/spandsp/src/t31.c
浏览文件 @
6f439d37
...
@@ -69,6 +69,7 @@
...
@@ -69,6 +69,7 @@
#include "spandsp/async.h"
#include "spandsp/async.h"
#include "spandsp/crc.h"
#include "spandsp/crc.h"
#include "spandsp/hdlc.h"
#include "spandsp/hdlc.h"
#include "spandsp/vector_int.h"
#include "spandsp/silence_gen.h"
#include "spandsp/silence_gen.h"
#include "spandsp/super_tone_rx.h"
#include "spandsp/super_tone_rx.h"
#include "spandsp/fsk.h"
#include "spandsp/fsk.h"
...
@@ -929,7 +930,7 @@ static int stream_non_ecm(t31_state_t *s)
...
@@ -929,7 +930,7 @@ static int stream_non_ecm(t31_state_t *s)
help for all implentations. It is usually ignored, which is probably
help for all implentations. It is usually ignored, which is probably
the right thing to do after receiving a message saying the signal has
the right thing to do after receiving a message saying the signal has
ended. */
ended. */
memset
(
buf
+
len
,
0
,
fe
->
octets_per_data_packet
-
len
);
memset
(
&
buf
[
len
]
,
0
,
fe
->
octets_per_data_packet
-
len
);
fe
->
non_ecm_trailer_bytes
=
3
*
fe
->
octets_per_data_packet
+
len
;
fe
->
non_ecm_trailer_bytes
=
3
*
fe
->
octets_per_data_packet
+
len
;
len
=
fe
->
octets_per_data_packet
;
len
=
fe
->
octets_per_data_packet
;
fe
->
timed_step
=
T38_TIMED_STEP_NON_ECM_MODEM_4
;
fe
->
timed_step
=
T38_TIMED_STEP_NON_ECM_MODEM_4
;
...
@@ -2868,7 +2869,7 @@ SPAN_DECLARE_NONSTD(int) t31_tx(t31_state_t *s, int16_t amp[], int max_len)
...
@@ -2868,7 +2869,7 @@ SPAN_DECLARE_NONSTD(int) t31_tx(t31_state_t *s, int16_t amp[], int max_len)
if
(
s
->
audio
.
modems
.
transmit_on_idle
)
if
(
s
->
audio
.
modems
.
transmit_on_idle
)
{
{
/* Pad to the requested length with silence */
/* Pad to the requested length with silence */
memset
(
&
amp
[
len
],
0
,
(
max_len
-
len
)
*
sizeof
(
int16_t
)
);
vec_zeroi16
(
&
amp
[
len
],
max_len
-
len
);
len
=
max_len
;
len
=
max_len
;
}
}
/*endif*/
/*endif*/
...
...
libs/spandsp/src/t35.c
浏览文件 @
6f439d37
...
@@ -500,7 +500,7 @@ static const nsf_data_t vendor_b5[] =
...
@@ -500,7 +500,7 @@ static const nsf_data_t vendor_b5[] =
{
"
\x00\x6E
"
,
2
,
"Microsoft"
,
false
,
NULL
},
{
"
\x00\x6E
"
,
2
,
"Microsoft"
,
false
,
NULL
},
{
"
\x00\x72
"
,
2
,
"Speaking Devices"
,
false
,
NULL
},
{
"
\x00\x72
"
,
2
,
"Speaking Devices"
,
false
,
NULL
},
{
"
\x00\x74
"
,
2
,
"Compaq"
,
false
,
NULL
},
{
"
\x00\x74
"
,
2
,
"Compaq"
,
false
,
NULL
},
{
"
\x00\x76
"
,
2
,
"Microsoft"
,
false
,
NULL
},
/*
u
ses LSB for country but MSB for manufacturer */
{
"
\x00\x76
"
,
2
,
"Microsoft"
,
false
,
NULL
},
/*
U
ses LSB for country but MSB for manufacturer */
{
"
\x00\x78
"
,
2
,
"Cylink"
,
false
,
NULL
},
{
"
\x00\x78
"
,
2
,
"Cylink"
,
false
,
NULL
},
{
"
\x00\x7A
"
,
2
,
"Pitney Bowes"
,
false
,
NULL
},
{
"
\x00\x7A
"
,
2
,
"Pitney Bowes"
,
false
,
NULL
},
{
"
\x00\x7C
"
,
2
,
"Digiboard"
,
false
,
NULL
},
{
"
\x00\x7C
"
,
2
,
"Digiboard"
,
false
,
NULL
},
...
@@ -724,7 +724,7 @@ static const country_code_t t35_country_codes[255] =
...
@@ -724,7 +724,7 @@ static const country_code_t t35_country_codes[255] =
{
"Vanuatu"
,
NULL
},
{
"Vanuatu"
,
NULL
},
{
"Vatican City State"
,
NULL
},
{
"Vatican City State"
,
NULL
},
{
"Venezuela"
,
NULL
},
{
"Venezuela"
,
NULL
},
{
"Viet
N
am"
,
vendor_bc
},
{
"Viet
n
am"
,
vendor_bc
},
{
"Wallis and Futuna"
,
NULL
},
{
"Wallis and Futuna"
,
NULL
},
{
"Western Samoa"
,
NULL
},
{
"Western Samoa"
,
NULL
},
{
"Yemen (Republic of)"
,
NULL
},
{
"Yemen (Republic of)"
,
NULL
},
...
...
libs/spandsp/src/t38_core.c
浏览文件 @
6f439d37
差异被折叠。
点击展开。
libs/spandsp/src/t38_gateway.c
浏览文件 @
6f439d37
...
@@ -1105,7 +1105,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
...
@@ -1105,7 +1105,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
{
{
monitor_control_messages
(
s
,
false
,
hdlc_buf
->
buf
,
hdlc_buf
->
len
);
monitor_control_messages
(
s
,
false
,
hdlc_buf
->
buf
,
hdlc_buf
->
len
);
if
(
s
->
core
.
real_time_frame_handler
)
if
(
s
->
core
.
real_time_frame_handler
)
s
->
core
.
real_time_frame_handler
(
s
,
s
->
core
.
real_time_frame_user_data
,
false
,
hdlc_buf
->
buf
,
hdlc_buf
->
len
);
s
->
core
.
real_time_frame_handler
(
s
->
core
.
real_time_frame_user_data
,
false
,
hdlc_buf
->
buf
,
hdlc_buf
->
len
);
/*endif*/
/*endif*/
}
}
/*endif*/
/*endif*/
...
@@ -1193,7 +1193,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
...
@@ -1193,7 +1193,7 @@ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type,
{
{
monitor_control_messages
(
s
,
false
,
hdlc_buf
->
buf
,
hdlc_buf
->
len
);
monitor_control_messages
(
s
,
false
,
hdlc_buf
->
buf
,
hdlc_buf
->
len
);
if
(
s
->
core
.
real_time_frame_handler
)
if
(
s
->
core
.
real_time_frame_handler
)
s
->
core
.
real_time_frame_handler
(
s
,
s
->
core
.
real_time_frame_user_data
,
false
,
hdlc_buf
->
buf
,
hdlc_buf
->
len
);
s
->
core
.
real_time_frame_handler
(
s
->
core
.
real_time_frame_user_data
,
false
,
hdlc_buf
->
buf
,
hdlc_buf
->
len
);
/*endif*/
/*endif*/
}
}
/*endif*/
/*endif*/
...
@@ -1830,7 +1830,7 @@ static void rx_flag_or_abort(hdlc_rx_state_t *t)
...
@@ -1830,7 +1830,7 @@ static void rx_flag_or_abort(hdlc_rx_state_t *t)
{
{
monitor_control_messages
(
s
,
true
,
t
->
buffer
,
t
->
len
-
2
);
monitor_control_messages
(
s
,
true
,
t
->
buffer
,
t
->
len
-
2
);
if
(
s
->
core
.
real_time_frame_handler
)
if
(
s
->
core
.
real_time_frame_handler
)
s
->
core
.
real_time_frame_handler
(
s
,
s
->
core
.
real_time_frame_user_data
,
true
,
t
->
buffer
,
t
->
len
-
2
);
s
->
core
.
real_time_frame_handler
(
s
->
core
.
real_time_frame_user_data
,
true
,
t
->
buffer
,
t
->
len
-
2
);
/*endif*/
/*endif*/
}
}
else
else
...
@@ -1937,13 +1937,13 @@ static void t38_hdlc_rx_put_bit(hdlc_rx_state_t *t, int new_bit)
...
@@ -1937,13 +1937,13 @@ static void t38_hdlc_rx_put_bit(hdlc_rx_state_t *t, int new_bit)
if
(
t
->
len
==
1
)
if
(
t
->
len
==
1
)
{
{
/* All valid HDLC frames in FAX communication begin 0xFF 0x03 or 0xFF 0x13.
/* All valid HDLC frames in FAX communication begin 0xFF 0x03 or 0xFF 0x13.
Anything else is bogus
,
*/
Anything else is bogus
.
*/
if
(
t
->
buffer
[
0
]
!=
0xFF
||
(
t
->
buffer
[
1
]
&
0xEF
)
!=
0x03
)
if
(
t
->
buffer
[
0
]
!=
0xFF
||
(
t
->
buffer
[
1
]
&
0xEF
)
!=
0x03
)
{
{
/* Abandon the frame, and wait for the next flag octet. */
/* Abandon the frame, and wait for the next flag octet. */
/* If this is a real frame, where one of these first two octets has a bit
/* If this is a real frame, where one of these first two octets has a bit
error, we will fail to forward the frame with a CRC error, as we do for
error, we will fail to forward the frame with a CRC error, as we do for
other bad frames
s
. This will affect the timing of what goes forward.
other bad frames. This will affect the timing of what goes forward.
Hopefully such timing changes will have less frequent bad effects than
Hopefully such timing changes will have less frequent bad effects than
the consequences of a bad bit stream simulating an HDLC frame start. */
the consequences of a bad bit stream simulating an HDLC frame start. */
span_log
(
&
s
->
logging
,
SPAN_LOG_FLOW
,
"Bad HDLC frame header. Abandoning frame.
\n
"
);
span_log
(
&
s
->
logging
,
SPAN_LOG_FLOW
,
"Bad HDLC frame header. Abandoning frame.
\n
"
);
...
...
libs/spandsp/src/t38_terminal.c
浏览文件 @
6f439d37
...
@@ -330,6 +330,7 @@ static void process_hdlc_data(t38_terminal_front_end_state_t *fe, const uint8_t
...
@@ -330,6 +330,7 @@ static void process_hdlc_data(t38_terminal_front_end_state_t *fe, const uint8_t
{
{
fe
->
rx_data_missing
=
true
;
fe
->
rx_data_missing
=
true
;
}
}
/*endif*/
}
}
/*- End of function --------------------------------------------------------*/
/*- End of function --------------------------------------------------------*/
...
...
libs/spandsp/src/testcpuid.c
浏览文件 @
6f439d37
...
@@ -95,14 +95,14 @@ int has_MMX(void)
...
@@ -95,14 +95,14 @@ int has_MMX(void)
/*endif*/
/*endif*/
__asm__
__volatile__
(
__asm__
__volatile__
(
" push %%ebx;
\n
"
" push %%ebx;
\n
"
" mov
$1,%%eax;
\n
"
" mov $1,%%eax;
\n
"
" cpuid;
\n
"
" cpuid;
\n
"
" xor %%eax,%%eax;
\n
"
" xor %%eax,%%eax;
\n
"
" test
$0x800000,%%edx;
\n
"
" test $0x800000,%%edx;
\n
"
" jz 1f;
\n
"
/* no MMX support */
" jz 1f;
\n
"
/* no MMX support */
" inc %%eax;
\n
"
/* MMX support */
" inc %%eax;
\n
"
/* MMX support */
"1:
\n
"
"1:
\n
"
" pop %%ebx;
\n
"
" pop
%%ebx;
\n
"
:
"=a"
(
result
)
:
"=a"
(
result
)
:
:
:
"ecx"
,
"edx"
);
:
"ecx"
,
"edx"
);
...
@@ -119,14 +119,14 @@ int has_SIMD(void)
...
@@ -119,14 +119,14 @@ int has_SIMD(void)
/*endif*/
/*endif*/
__asm__
__volatile__
(
__asm__
__volatile__
(
" push %%ebx;
\n
"
" push %%ebx;
\n
"
" mov
$1,%%eax;
\n
"
" mov $1,%%eax;
\n
"
" cpuid;
\n
"
" cpuid;
\n
"
" xor %%eax,%%eax;
\n
"
" xor %%eax,%%eax;
\n
"
" test
$0x02000000,%%edx;
\n
"
" test $0x02000000,%%edx;
\n
"
" jz 1f;
\n
"
/* no SIMD support */
" jz 1f;
\n
"
/* no SIMD support */
" inc
%%eax;
\n
"
/* SIMD support */
" inc
%%eax;
\n
"
/* SIMD support */
"1:
\n
"
"1:
\n
"
" pop %%ebx;
\n
"
" pop
%%ebx;
\n
"
:
"=a"
(
result
)
:
"=a"
(
result
)
:
:
:
"ecx"
,
"edx"
);
:
"ecx"
,
"edx"
);
...
@@ -143,14 +143,14 @@ int has_SIMD2(void)
...
@@ -143,14 +143,14 @@ int has_SIMD2(void)
/*endif*/
/*endif*/
__asm__
__volatile__
(
__asm__
__volatile__
(
" push %%ebx;
\n
"
" push %%ebx;
\n
"
" mov
$1,%%eax;
\n
"
" mov $1,%%eax;
\n
"
" cpuid;
\n
"
" cpuid;
\n
"
" xor %%eax,%%eax;
\n
"
" xor %%eax,%%eax;
\n
"
" test
$0x04000000,%%edx;
\n
"
" test $0x04000000,%%edx;
\n
"
" jz 1f;
\n
"
/* no SIMD2 support */
" jz 1f;
\n
"
/* no SIMD2 support */
" inc
%%eax;
\n
"
/* SIMD2 support */
" inc
%%eax;
\n
"
/* SIMD2 support */
"1:
\n
"
"1:
\n
"
" pop %%ebx;
\n
"
" pop
%%ebx;
\n
"
:
"=a"
(
result
)
:
"=a"
(
result
)
:
:
:
"ecx"
,
"edx"
);
:
"ecx"
,
"edx"
);
...
@@ -167,19 +167,19 @@ int has_3DNow(void)
...
@@ -167,19 +167,19 @@ int has_3DNow(void)
/*endif*/
/*endif*/
__asm__
__volatile__
(
__asm__
__volatile__
(
" push %%ebx;
\n
"
" push %%ebx;
\n
"
" mov
$0x80000000,%%eax;
\n
"
" mov $0x80000000,%%eax;
\n
"
" cpuid;
\n
"
" cpuid;
\n
"
" xor %%ecx,%%ecx;
\n
"
" xor %%ecx,%%ecx;
\n
"
" cmp
$0x80000000,%%eax;
\n
"
" cmp $0x80000000,%%eax;
\n
"
" jbe
1f;
\n
"
/* no extended MSR(1), so no 3DNow! */
" jbe
1f;
\n
"
/* no extended MSR(1), so no 3DNow! */
" mov
$0x80000001,%%eax;
\n
"
" mov $0x80000001,%%eax;
\n
"
" cpuid;
\n
"
" cpuid;
\n
"
" xor %%ecx,%%ecx;
\n
"
" xor %%ecx,%%ecx;
\n
"
" test
$0x80000000,%%edx;
\n
"
" test $0x80000000,%%edx;
\n
"
" jz 1f;
\n
"
/* no 3DNow! support */
" jz 1f;
\n
"
/* no 3DNow! support */
" inc %%ecx;
\n
"
/* 3DNow! support */
" inc %%ecx;
\n
"
/* 3DNow! support */
"1:
\n
"
"1:
\n
"
" pop %%ebx;
\n
"
" pop
%%ebx;
\n
"
:
"=c"
(
result
)
:
"=c"
(
result
)
:
:
:
"eax"
,
"edx"
);
:
"eax"
,
"edx"
);
...
...
libs/spandsp/src/time_scale.c
浏览文件 @
6f439d37
...
@@ -258,7 +258,7 @@ SPAN_DECLARE(int) time_scale(time_scale_state_t *s, int16_t out[], int16_t in[],
...
@@ -258,7 +258,7 @@ SPAN_DECLARE(int) time_scale(time_scale_state_t *s, int16_t out[], int16_t in[],
if
(
s
->
playout_rate
<
1
.
0
f
)
if
(
s
->
playout_rate
<
1
.
0
f
)
{
{
/* Speed up - drop a chunk of data */
/* Speed up - drop a chunk of data */
overlap_add
(
s
->
buf
,
s
->
buf
+
pitch
,
pitch
);
overlap_add
(
s
->
buf
,
&
s
->
buf
[
pitch
]
,
pitch
);
memcpy
(
&
s
->
buf
[
pitch
],
&
s
->
buf
[
2
*
pitch
],
sizeof
(
int16_t
)
*
(
s
->
buf_len
-
2
*
pitch
));
memcpy
(
&
s
->
buf
[
pitch
],
&
s
->
buf
[
2
*
pitch
],
sizeof
(
int16_t
)
*
(
s
->
buf_len
-
2
*
pitch
));
if
(
len
-
in_len
<
pitch
)
if
(
len
-
in_len
<
pitch
)
{
{
...
@@ -275,7 +275,7 @@ SPAN_DECLARE(int) time_scale(time_scale_state_t *s, int16_t out[], int16_t in[],
...
@@ -275,7 +275,7 @@ SPAN_DECLARE(int) time_scale(time_scale_state_t *s, int16_t out[], int16_t in[],
/* Slow down - insert a chunk of data */
/* Slow down - insert a chunk of data */
memcpy
(
&
out
[
out_len
],
s
->
buf
,
sizeof
(
int16_t
)
*
pitch
);
memcpy
(
&
out
[
out_len
],
s
->
buf
,
sizeof
(
int16_t
)
*
pitch
);
out_len
+=
pitch
;
out_len
+=
pitch
;
overlap_add
(
s
->
buf
+
pitch
,
s
->
buf
,
pitch
);
overlap_add
(
&
s
->
buf
[
pitch
]
,
s
->
buf
,
pitch
);
}
}
}
}
}
}
...
...
libs/spandsp/src/v8.c
浏览文件 @
6f439d37
...
@@ -1144,7 +1144,7 @@ SPAN_DECLARE(int) v8_free(v8_state_t *s)
...
@@ -1144,7 +1144,7 @@ SPAN_DECLARE(int) v8_free(v8_state_t *s)
{
{
int
ret
;
int
ret
;
ret
=
queue_free
(
s
->
tx_queue
);
ret
=
v8_release
(
s
);
span_free
(
s
);
span_free
(
s
);
return
ret
;
return
ret
;
}
}
...
...
libs/spandsp/tests/fax_tester.h
浏览文件 @
6f439d37
...
@@ -61,6 +61,17 @@ typedef void (*faxtester_front_end_step_complete_handler_t)(faxtester_state_t *s
...
@@ -61,6 +61,17 @@ typedef void (*faxtester_front_end_step_complete_handler_t)(faxtester_state_t *s
*/
*/
struct
faxtester_state_s
struct
faxtester_state_s
{
{
/*! \brief The far end FAX context */
fax_state_t
*
far_fax
;
/*! \brief The far end T.38 terminal context */
t38_terminal_state_t
*
far_t38_fax
;
/*! \brief Path for the FAX image test files. */
char
image_path
[
1024
];
/*! \brief Pointer to the XML document. */
xmlDocPtr
doc
;
/*! \brief Pointer to our current step in the test. */
/*! \brief Pointer to our current step in the test. */
xmlNodePtr
cur
;
xmlNodePtr
cur
;
...
@@ -113,6 +124,19 @@ struct faxtester_state_s
...
@@ -113,6 +124,19 @@ struct faxtester_state_s
int64_t
timer
;
int64_t
timer
;
int64_t
timeout
;
int64_t
timeout
;
bool
test_for_call_clear
;
int
call_clear_timer
;
bool
far_end_cleared_call
;
int
timein_x
;
int
timeout_x
;
uint8_t
awaited
[
1000
];
int
awaited_len
;
char
next_tx_file
[
1000
];
/*! \brief Error and flow logging control */
/*! \brief Error and flow logging control */
logging_state_t
logging
;
logging_state_t
logging
;
};
};
...
...
libs/spandsp/tests/tsb85_tests.c
浏览文件 @
6f439d37
...
@@ -1420,7 +1420,6 @@ static int parse_test_group(faxtester_state_t *s, xmlDocPtr doc, xmlNsPtr ns, xm
...
@@ -1420,7 +1420,6 @@ static int parse_test_group(faxtester_state_t *s, xmlDocPtr doc, xmlNsPtr ns, xm
static
int
get_test_set
(
faxtester_state_t
*
s
,
const
char
*
test_file
,
const
char
*
test
)
static
int
get_test_set
(
faxtester_state_t
*
s
,
const
char
*
test_file
,
const
char
*
test
)
{
{
xmlParserCtxtPtr
ctxt
;
xmlParserCtxtPtr
ctxt
;
xmlDocPtr
doc
;
xmlNsPtr
ns
;
xmlNsPtr
ns
;
xmlNodePtr
cur
;
xmlNodePtr
cur
;
...
@@ -1435,7 +1434,7 @@ static int get_test_set(faxtester_state_t *s, const char *test_file, const char
...
@@ -1435,7 +1434,7 @@ static int get_test_set(faxtester_state_t *s, const char *test_file, const char
exit
(
2
);
exit
(
2
);
}
}
/* parse the file, activating the DTD validation option */
/* parse the file, activating the DTD validation option */
if
((
doc
=
xmlCtxtReadFile
(
ctxt
,
test_file
,
NULL
,
XML_PARSE_XINCLUDE
|
XML_PARSE_DTDVALID
))
==
NULL
)
if
((
s
->
doc
=
xmlCtxtReadFile
(
ctxt
,
test_file
,
NULL
,
XML_PARSE_XINCLUDE
|
XML_PARSE_DTDVALID
))
==
NULL
)
{
{
fprintf
(
stderr
,
"Failed to read the XML document
\n
"
);
fprintf
(
stderr
,
"Failed to read the XML document
\n
"
);
printf
(
"Test failed
\n
"
);
printf
(
"Test failed
\n
"
);
...
@@ -1444,7 +1443,7 @@ static int get_test_set(faxtester_state_t *s, const char *test_file, const char
...
@@ -1444,7 +1443,7 @@ static int get_test_set(faxtester_state_t *s, const char *test_file, const char
if
(
ctxt
->
valid
==
0
)
if
(
ctxt
->
valid
==
0
)
{
{
fprintf
(
stderr
,
"Failed to validate the XML document
\n
"
);
fprintf
(
stderr
,
"Failed to validate the XML document
\n
"
);
xmlFreeDoc
(
doc
);
xmlFreeDoc
(
s
->
doc
);
xmlFreeParserCtxt
(
ctxt
);
xmlFreeParserCtxt
(
ctxt
);
printf
(
"Test failed
\n
"
);
printf
(
"Test failed
\n
"
);
exit
(
2
);
exit
(
2
);
...
@@ -1452,9 +1451,9 @@ static int get_test_set(faxtester_state_t *s, const char *test_file, const char
...
@@ -1452,9 +1451,9 @@ static int get_test_set(faxtester_state_t *s, const char *test_file, const char
xmlFreeParserCtxt
(
ctxt
);
xmlFreeParserCtxt
(
ctxt
);
/* Check the document is of the right kind */
/* Check the document is of the right kind */
if
((
cur
=
xmlDocGetRootElement
(
doc
))
==
NULL
)
if
((
cur
=
xmlDocGetRootElement
(
s
->
doc
))
==
NULL
)
{
{
xmlFreeDoc
(
doc
);
xmlFreeDoc
(
s
->
doc
);
fprintf
(
stderr
,
"Empty document
\n
"
);
fprintf
(
stderr
,
"Empty document
\n
"
);
printf
(
"Test failed
\n
"
);
printf
(
"Test failed
\n
"
);
exit
(
2
);
exit
(
2
);
...
@@ -1462,7 +1461,7 @@ static int get_test_set(faxtester_state_t *s, const char *test_file, const char
...
@@ -1462,7 +1461,7 @@ static int get_test_set(faxtester_state_t *s, const char *test_file, const char
/*endif*/
/*endif*/
if
(
xmlStrcmp
(
cur
->
name
,
(
const
xmlChar
*
)
"fax-tests"
))
if
(
xmlStrcmp
(
cur
->
name
,
(
const
xmlChar
*
)
"fax-tests"
))
{
{
xmlFreeDoc
(
doc
);
xmlFreeDoc
(
s
->
doc
);
fprintf
(
stderr
,
"Document of the wrong type, root node != fax-tests"
);
fprintf
(
stderr
,
"Document of the wrong type, root node != fax-tests"
);
printf
(
"Test failed
\n
"
);
printf
(
"Test failed
\n
"
);
exit
(
2
);
exit
(
2
);
...
@@ -1482,12 +1481,12 @@ static int get_test_set(faxtester_state_t *s, const char *test_file, const char
...
@@ -1482,12 +1481,12 @@ static int get_test_set(faxtester_state_t *s, const char *test_file, const char
{
{
if
(
xmlStrcmp
(
cur
->
name
,
(
const
xmlChar
*
)
"config"
)
==
0
)
if
(
xmlStrcmp
(
cur
->
name
,
(
const
xmlChar
*
)
"config"
)
==
0
)
{
{
parse_config
(
s
,
doc
,
ns
,
cur
->
xmlChildrenNode
);
parse_config
(
s
,
s
->
doc
,
ns
,
cur
->
xmlChildrenNode
);
}
}
/*endif*/
/*endif*/
if
(
xmlStrcmp
(
cur
->
name
,
(
const
xmlChar
*
)
"test-group"
)
==
0
)
if
(
xmlStrcmp
(
cur
->
name
,
(
const
xmlChar
*
)
"test-group"
)
==
0
)
{
{
if
(
parse_test_group
(
s
,
doc
,
ns
,
cur
->
xmlChildrenNode
,
test
)
==
0
)
if
(
parse_test_group
(
s
,
s
->
doc
,
ns
,
cur
->
xmlChildrenNode
,
test
)
==
0
)
{
{
/* We found the test we want, so run it. */
/* We found the test we want, so run it. */
exchange
(
s
);
exchange
(
s
);
...
@@ -1499,7 +1498,7 @@ static int get_test_set(faxtester_state_t *s, const char *test_file, const char
...
@@ -1499,7 +1498,7 @@ static int get_test_set(faxtester_state_t *s, const char *test_file, const char
cur
=
cur
->
next
;
cur
=
cur
->
next
;
}
}
/*endwhile*/
/*endwhile*/
xmlFreeDoc
(
doc
);
xmlFreeDoc
(
s
->
doc
);
return
0
;
return
0
;
}
}
/*- End of function --------------------------------------------------------*/
/*- End of function --------------------------------------------------------*/
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论