Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
b4e75a27
提交
b4e75a27
authored
12月 10, 2005
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@104
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
e59b65ef
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
22 行增加
和
17 行删除
+22
-17
mod_portaudio.c
src/mod/mod_portaudio/mod_portaudio.c
+14
-14
switch_core.c
src/switch_core.c
+8
-3
没有找到文件。
src/mod/mod_portaudio/mod_portaudio.c
浏览文件 @
b4e75a27
...
@@ -42,8 +42,8 @@ static const char modname[] = "mod_portaudio";
...
@@ -42,8 +42,8 @@ static const char modname[] = "mod_portaudio";
static
switch_memory_pool
*
module_pool
;
static
switch_memory_pool
*
module_pool
;
static
int
running
=
1
;
static
int
running
=
1
;
#define SAMPLE_TYPE paInt16
#define SAMPLE_TYPE paInt16
typedef
short
SAMPLE
;
typedef
short
SAMPLE
;
typedef
enum
{
typedef
enum
{
TFLAG_IO
=
(
1
<<
0
),
TFLAG_IO
=
(
1
<<
0
),
...
@@ -80,9 +80,9 @@ struct private_object {
...
@@ -80,9 +80,9 @@ struct private_object {
unsigned
char
databuf
[
1024
];
unsigned
char
databuf
[
1024
];
switch_core_session
*
session
;
switch_core_session
*
session
;
switch_caller_profile
*
caller_profile
;
switch_caller_profile
*
caller_profile
;
char
call_id
[
50
];
char
call_id
[
50
];
PaError
err
;
PaError
err
;
PABLIO_Stream
*
audio_in
;
PABLIO_Stream
*
audio_in
;
PABLIO_Stream
*
audio_out
;
PABLIO_Stream
*
audio_out
;
int
indev
;
int
indev
;
int
outdev
;
int
outdev
;
...
@@ -189,8 +189,8 @@ static switch_status channel_on_hangup(switch_core_session *session)
...
@@ -189,8 +189,8 @@ static switch_status channel_on_hangup(switch_core_session *session)
switch_core_codec_destroy
(
&
tech_pvt
->
read_codec
);
switch_core_codec_destroy
(
&
tech_pvt
->
read_codec
);
switch_core_codec_destroy
(
&
tech_pvt
->
write_codec
);
switch_core_codec_destroy
(
&
tech_pvt
->
write_codec
);
CloseAudioStream
(
tech_pvt
->
audio_in
);
CloseAudioStream
(
tech_pvt
->
audio_in
);
CloseAudioStream
(
tech_pvt
->
audio_out
);
CloseAudioStream
(
tech_pvt
->
audio_out
);
switch_console_printf
(
SWITCH_CHANNEL_CONSOLE
,
"%s CHANNEL HANGUP
\n
"
,
switch_channel_get_name
(
channel
));
switch_console_printf
(
SWITCH_CHANNEL_CONSOLE
,
"%s CHANNEL HANGUP
\n
"
,
switch_channel_get_name
(
channel
));
...
@@ -328,13 +328,13 @@ static switch_status channel_read_frame(switch_core_session *session, switch_fra
...
@@ -328,13 +328,13 @@ static switch_status channel_read_frame(switch_core_session *session, switch_fra
tech_pvt
=
switch_core_session_get_private
(
session
);
tech_pvt
=
switch_core_session_get_private
(
session
);
assert
(
tech_pvt
!=
NULL
);
assert
(
tech_pvt
!=
NULL
);
if
((
t
=
ReadAudioStream
(
tech_pvt
->
audio_in
,
tech_pvt
->
read_frame
.
data
,
tech_pvt
->
read_codec
.
implementation
->
samples_per_frame
)))
{
if
((
t
=
ReadAudioStream
(
tech_pvt
->
audio_in
,
tech_pvt
->
read_frame
.
data
,
tech_pvt
->
read_codec
.
implementation
->
samples_per_frame
)))
{
tech_pvt
->
read_frame
.
datalen
=
t
*
2
;
tech_pvt
->
read_frame
.
datalen
=
t
*
2
;
tech_pvt
->
read_frame
.
samples
=
t
;
tech_pvt
->
read_frame
.
samples
=
t
;
*
frame
=
&
tech_pvt
->
read_frame
;
*
frame
=
&
tech_pvt
->
read_frame
;
return
SWITCH_STATUS_SUCCESS
;
return
SWITCH_STATUS_SUCCESS
;
}
}
return
SWITCH_STATUS_FALSE
;
return
SWITCH_STATUS_FALSE
;
...
...
src/switch_core.c
浏览文件 @
b4e75a27
...
@@ -178,10 +178,13 @@ SWITCH_DECLARE(switch_status) switch_core_codec_init(switch_codec *codec, char *
...
@@ -178,10 +178,13 @@ SWITCH_DECLARE(switch_status) switch_core_codec_init(switch_codec *codec, char *
}
}
if
(
implementation
)
{
if
(
implementation
)
{
switch_status
status
;
codec
->
codec_interface
=
codec_interface
;
codec
->
codec_interface
=
codec_interface
;
codec
->
implementation
=
implementation
;
codec
->
implementation
=
implementation
;
codec
->
flags
=
flags
;
codec
->
flags
=
flags
;
switch_core_new_memory_pool
(
&
codec
->
memory_pool
);
if
((
status
=
switch_core_new_memory_pool
(
&
codec
->
memory_pool
))
!=
SWITCH_STATUS_SUCCESS
)
{
return
status
;
}
implementation
->
init
(
codec
,
flags
,
codec_settings
);
implementation
->
init
(
codec
,
flags
,
codec_settings
);
return
SWITCH_STATUS_SUCCESS
;
return
SWITCH_STATUS_SUCCESS
;
...
@@ -258,7 +261,7 @@ SWITCH_DECLARE(switch_status) switch_core_codec_destroy(switch_codec *codec)
...
@@ -258,7 +261,7 @@ SWITCH_DECLARE(switch_status) switch_core_codec_destroy(switch_codec *codec)
SWITCH_DECLARE
(
switch_status
)
switch_core_timer_init
(
switch_timer
*
timer
,
char
*
timer_name
,
int
interval
,
int
samples
)
SWITCH_DECLARE
(
switch_status
)
switch_core_timer_init
(
switch_timer
*
timer
,
char
*
timer_name
,
int
interval
,
int
samples
)
{
{
switch_timer_interface
*
timer_interface
;
switch_timer_interface
*
timer_interface
;
switch_status
status
;
memset
(
timer
,
0
,
sizeof
(
*
timer
));
memset
(
timer
,
0
,
sizeof
(
*
timer
));
if
(
!
(
timer_interface
=
loadable_module_get_timer_interface
(
timer_name
)))
{
if
(
!
(
timer_interface
=
loadable_module_get_timer_interface
(
timer_name
)))
{
switch_console_printf
(
SWITCH_CHANNEL_CONSOLE
,
"invalid timer %s!
\n
"
,
timer_name
);
switch_console_printf
(
SWITCH_CHANNEL_CONSOLE
,
"invalid timer %s!
\n
"
,
timer_name
);
...
@@ -269,7 +272,9 @@ SWITCH_DECLARE(switch_status) switch_core_timer_init(switch_timer *timer, char *
...
@@ -269,7 +272,9 @@ SWITCH_DECLARE(switch_status) switch_core_timer_init(switch_timer *timer, char *
timer
->
samples
=
samples
;
timer
->
samples
=
samples
;
timer
->
samplecount
=
0
;
timer
->
samplecount
=
0
;
timer
->
timer_interface
=
timer_interface
;
timer
->
timer_interface
=
timer_interface
;
switch_core_new_memory_pool
(
&
timer
->
memory_pool
);
if
((
status
=
switch_core_new_memory_pool
(
&
timer
->
memory_pool
))
!=
SWITCH_STATUS_SUCCESS
)
{
return
status
;
}
timer
->
timer_interface
->
timer_init
(
timer
);
timer
->
timer_interface
->
timer_init
(
timer
);
return
SWITCH_STATUS_SUCCESS
;
return
SWITCH_STATUS_SUCCESS
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论