Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
44b01bee
提交
44b01bee
authored
9月 04, 2013
作者:
Steve Underwood
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Some tweaks to FAX processing
上级
5b4b1dce
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
154 行增加
和
137 行删除
+154
-137
fax_modems.c
libs/spandsp/src/fax_modems.c
+8
-0
t30.h
libs/spandsp/src/spandsp/private/t30.h
+12
-0
t30.h
libs/spandsp/src/spandsp/t30.h
+20
-0
t30_api.h
libs/spandsp/src/spandsp/t30_api.h
+10
-0
t30.c
libs/spandsp/src/t30.c
+78
-95
t30_api.c
libs/spandsp/src/t30_api.c
+20
-0
t4_tx.c
libs/spandsp/src/t4_tx.c
+4
-5
pseudo_terminal_tests.c
libs/spandsp/tests/pseudo_terminal_tests.c
+2
-37
没有找到文件。
libs/spandsp/src/fax_modems.c
浏览文件 @
44b01bee
...
...
@@ -56,6 +56,7 @@
#include "spandsp/alloc.h"
#include "spandsp/logging.h"
#include "spandsp/bit_operations.h"
#include "spandsp/bitstream.h"
#include "spandsp/dc_restore.h"
#include "spandsp/queue.h"
#include "spandsp/power_meter.h"
...
...
@@ -73,14 +74,21 @@
#include "spandsp/v27ter_rx.h"
#include "spandsp/v17tx.h"
#include "spandsp/v17rx.h"
#if defined(SPANDSP_SUPPORT_V34)
#include "spandsp/v34.h"
#endif
#include "spandsp/super_tone_rx.h"
#include "spandsp/modem_connect_tones.h"
#include "spandsp/fax_modems.h"
#include "spandsp/private/logging.h"
#include "spandsp/private/bitstream.h"
#include "spandsp/private/silence_gen.h"
#include "spandsp/private/power_meter.h"
#include "spandsp/private/fsk.h"
#if defined(SPANDSP_SUPPORT_V34)
#include "spandsp/private/v34.h"
#endif
#include "spandsp/private/v17tx.h"
#include "spandsp/private/v17rx.h"
#include "spandsp/private/v27ter_tx.h"
...
...
libs/spandsp/src/spandsp/private/t30.h
浏览文件 @
44b01bee
...
...
@@ -46,6 +46,9 @@ struct t30_state_s
/*! \brief True if behaving as the calling party */
bool
calling_party
;
/*! \brief True if bad quality pages should be kept */
bool
keep_bad_pages
;
/*! \brief Internet aware FAX mode bit mask. */
int
iaf
;
/*! \brief A bit mask of the currently supported modem types. */
...
...
@@ -139,6 +142,15 @@ struct t30_state_s
/*! \brief An opaque pointer passed to the transmitted HDLC frame handler. */
void
*
send_hdlc_user_data
;
/*! \brief The document send handler. */
t30_document_get_handler_t
document_get_handler
;
/*! \brief An opaque pointer passed to the document send handler. */
void
*
document_get_user_data
;
/*! \brief The document delivery handler. */
t30_document_put_handler_t
document_put_handler
;
/*! \brief An opaque pointer passed to the document delivery handler. */
void
*
document_put_user_data
;
/*! \brief The DIS code for the minimum scan row time we require. This is usually 0ms,
but if we are trying to simulate another type of FAX machine, we may need a non-zero
value here. */
...
...
libs/spandsp/src/spandsp/t30.h
浏览文件 @
44b01bee
...
...
@@ -223,6 +223,26 @@ typedef void (*t30_set_handler_t)(void *user_data, int type, int bit_rate, int s
*/
typedef
void
(
*
t30_send_hdlc_handler_t
)(
void
*
user_data
,
const
uint8_t
msg
[],
int
len
);
/*!
T.30 send document handler.
\brief T.30 send document handler.
\param user_data An opaque pointer.
\param msg The document chunk.
\param len The length of the chunk.
\return The actual length of the chunk.
*/
typedef
int
(
*
t30_document_get_handler_t
)(
void
*
user_data
,
uint8_t
msg
[],
int
len
);
/*!
T.30 deliver document handler.
\brief T.30 deliver handler.
\param user_data An opaque pointer.
\param msg The document chunk.
\param len The length of the chunk.
\return The delivery status.
*/
typedef
int
(
*
t30_document_put_handler_t
)(
void
*
user_data
,
const
uint8_t
msg
[],
int
len
);
/*!
T.30 protocol completion codes, at phase E.
*/
...
...
libs/spandsp/src/spandsp/t30_api.h
浏览文件 @
44b01bee
...
...
@@ -225,6 +225,12 @@ SPAN_DECLARE(const char *) t30_get_tx_password(t30_state_t *s);
\return A pointer to the password. */
SPAN_DECLARE
(
const
char
*
)
t30_get_rx_password
(
t30_state_t
*
s
);
/*! Set the save bad quality pages handling associated with a T.30 context.
\brief Set the save bad quality pages handling associated with a T.30 context.
\param s The T.30 context.
\param keep_bad_pages True to save bad quality pages. */
SPAN_DECLARE
(
void
)
t30_set_keep_bad_quality_pages
(
t30_state_t
*
s
,
bool
keep_bad_pages
);
/*! Set the transmitted TSA (i.e. the one we will send to the far
end) associated with a T.30 context.
\brief Set the transmitted TSA associated with a T.30 context.
...
...
@@ -543,6 +549,10 @@ SPAN_DECLARE(void) t30_set_document_handler(t30_state_t *s, t30_document_handler
\param user_data An opaque pointer passed to the callback function. */
SPAN_DECLARE
(
void
)
t30_set_real_time_frame_handler
(
t30_state_t
*
s
,
t30_real_time_frame_handler_t
handler
,
void
*
user_data
);
SPAN_DECLARE
(
void
)
t30_set_document_get_handler
(
t30_state_t
*
s
,
t30_document_get_handler_t
handler
,
void
*
user_data
);
SPAN_DECLARE
(
void
)
t30_set_document_put_handler
(
t30_state_t
*
s
,
t30_document_put_handler_t
handler
,
void
*
user_data
);
/*! Get a pointer to the logging context associated with a T.30 context.
\brief Get a pointer to the logging context associated with a T.30 context.
\param s The T.30 context.
...
...
libs/spandsp/src/t30.c
浏览文件 @
44b01bee
差异被折叠。
点击展开。
libs/spandsp/src/t30_api.c
浏览文件 @
44b01bee
...
...
@@ -648,6 +648,12 @@ SPAN_DECLARE(int) t30_set_ecm_capability(t30_state_t *s, bool enabled)
}
/*- End of function --------------------------------------------------------*/
SPAN_DECLARE
(
void
)
t30_set_keep_bad_quality_pages
(
t30_state_t
*
s
,
bool
keep_bad_pages
)
{
s
->
keep_bad_pages
=
keep_bad_pages
;
}
/*- End of function --------------------------------------------------------*/
SPAN_DECLARE
(
int
)
t30_set_supported_output_compressions
(
t30_state_t
*
s
,
int
supported_compressions
)
{
/* Mask out the ones we actually support today. */
...
...
@@ -859,6 +865,20 @@ SPAN_DECLARE(void) t30_set_real_time_frame_handler(t30_state_t *s, t30_real_time
}
/*- End of function --------------------------------------------------------*/
SPAN_DECLARE
(
void
)
t30_set_document_get_handler
(
t30_state_t
*
s
,
t30_document_get_handler_t
handler
,
void
*
user_data
)
{
s
->
document_get_handler
=
handler
;
s
->
document_get_user_data
=
user_data
;
}
/*- End of function --------------------------------------------------------*/
SPAN_DECLARE
(
void
)
t30_set_document_put_handler
(
t30_state_t
*
s
,
t30_document_put_handler_t
handler
,
void
*
user_data
)
{
s
->
document_put_handler
=
handler
;
s
->
document_put_user_data
=
user_data
;
}
/*- End of function --------------------------------------------------------*/
SPAN_DECLARE
(
logging_state_t
*
)
t30_get_logging_state
(
t30_state_t
*
s
)
{
return
&
s
->
logging
;
...
...
libs/spandsp/src/t4_tx.c
浏览文件 @
44b01bee
...
...
@@ -927,7 +927,7 @@ static int read_tiff_t85_image(t4_tx_state_t *s)
pack
.
row
=
0
;
t85_decode_init
(
&
t85
,
packing_row_write_handler
,
&
pack
);
t85_decode_set_comment_handler
(
&
t85
,
1000
,
embedded_comment_handler
,
s
);
t85_decode_set_image_size_constraints
(
&
t85
,
s
->
tiff
.
image_width
,
s
->
tiff
.
image_length
);
result
=
-
1
;
for
(
i
=
0
;
i
<
num_strips
;
i
++
)
{
...
...
@@ -938,8 +938,7 @@ static int read_tiff_t85_image(t4_tx_state_t *s)
span_free
(
raw_data
);
return
-
1
;
}
result
=
t85_decode_put
(
&
t85
,
raw_data
,
len
);
if
(
result
!=
T4_DECODE_MORE_DATA
)
if
((
result
=
t85_decode_put
(
&
t85
,
raw_data
,
len
))
!=
T4_DECODE_MORE_DATA
)
break
;
}
if
(
result
==
T4_DECODE_MORE_DATA
)
...
...
@@ -1000,6 +999,7 @@ static int read_tiff_t43_image(t4_tx_state_t *s)
t43_decode_init
(
&
t43
,
packing_row_write_handler
,
&
pack
);
t43_decode_set_comment_handler
(
&
t43
,
1000
,
embedded_comment_handler
,
NULL
);
t43_decode_set_image_size_constraints
(
&
t43
,
s
->
tiff
.
image_width
,
s
->
tiff
.
image_length
);
logging
=
t43_decode_get_logging_state
(
&
t43
);
span_log_set_level
(
logging
,
SPAN_LOG_SHOW_SEVERITY
|
SPAN_LOG_SHOW_PROTOCOL
|
SPAN_LOG_FLOW
);
...
...
@@ -1018,8 +1018,7 @@ static int read_tiff_t43_image(t4_tx_state_t *s)
span_free
(
raw_data
);
return
-
1
;
}
result
=
t43_decode_put
(
&
t43
,
raw_data
,
len
);
if
(
result
!=
T4_DECODE_MORE_DATA
)
if
((
result
=
t43_decode_put
(
&
t43
,
raw_data
,
len
))
!=
T4_DECODE_MORE_DATA
)
break
;
}
if
(
result
==
T4_DECODE_MORE_DATA
)
...
...
libs/spandsp/tests/pseudo_terminal_tests.c
浏览文件 @
44b01bee
...
...
@@ -31,7 +31,6 @@
#else
#if defined(__APPLE__)
#include <util.h>
#include <sys/ioctl.h>
#elif defined(__FreeBSD__)
#include <libutil.h>
#include <termios.h>
...
...
@@ -39,6 +38,8 @@
#else
#include <pty.h>
#endif
#include <sys/ioctl.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
...
...
@@ -62,9 +63,6 @@ static int master(void)
char
buf
[
1024
];
int
len
;
int
i
;
#if !defined(WIN32)
int
tioflags
;
#endif
for
(
i
=
0
;
i
<
10
;
i
++
)
{
...
...
@@ -76,15 +74,6 @@ static int master(void)
printf
(
"%s %s
\n
"
,
modem
[
i
].
devlink
,
modem
[
i
].
stty
);
}
for
(
i
=
0
;
i
<
10
;
i
++
)
{
#if !defined(WIN32)
ioctl
(
modem
[
i
].
slave
,
TIOCMGET
,
&
tioflags
);
tioflags
|=
TIOCM_RI
;
ioctl
(
modem
[
i
].
slave
,
TIOCMSET
,
&
tioflags
);
#endif
}
for
(;;)
{
for
(
i
=
0
;
i
<
10
;
i
++
)
...
...
@@ -94,11 +83,6 @@ static int master(void)
{
buf
[
len
]
=
'\0'
;
printf
(
"%d %d '%s' %s
\n
"
,
i
,
len
,
buf
,
strerror
(
errno
));
#if !defined(WIN32)
ioctl
(
modem
[
i
].
slave
,
TIOCMGET
,
&
tioflags
);
tioflags
|=
TIOCM_RI
;
ioctl
(
modem
[
i
].
slave
,
TIOCMSET
,
&
tioflags
);
#endif
}
}
}
...
...
@@ -121,9 +105,6 @@ static int slave(void)
char
name
[
64
];
int
i
;
int
j
;
#if !defined(WIN32)
int
tioflags
;
#endif
for
(
i
=
0
;
i
<
10
;
i
++
)
{
...
...
@@ -136,27 +117,11 @@ static int slave(void)
printf
(
"%s
\n
"
,
name
);
}
for
(
i
=
0
;
i
<
10
;
i
++
)
{
#if !defined(WIN32)
ioctl
(
fd
[
i
],
TIOCMGET
,
&
tioflags
);
if
((
tioflags
&
TIOCM_RI
))
printf
(
"Ring %d
\n
"
,
i
);
else
printf
(
"No ring %d
\n
"
,
i
);
#endif
}
for
(
j
=
0
;
j
<
10
;
j
++
)
{
for
(
i
=
0
;
i
<
10
;
i
++
)
{
write
(
fd
[
i
],
"FRED"
,
4
);
#if !defined(WIN32)
ioctl
(
fd
[
i
],
TIOCMGET
,
&
tioflags
);
if
((
tioflags
&
TIOCM_RI
))
printf
(
"Ring %d
\n
"
,
i
);
#endif
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论