Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
dd1c14cf
提交
dd1c14cf
authored
2月 15, 2008
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@7623
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
a7997d67
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
239 行增加
和
233 行删除
+239
-233
mod_conference.c
src/mod/applications/mod_conference/mod_conference.c
+239
-233
没有找到文件。
src/mod/applications/mod_conference/mod_conference.c
浏览文件 @
dd1c14cf
...
...
@@ -855,6 +855,7 @@ static void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t * thread,
switch_set_flag
(
conference
,
CFLAG_DESTRUCT
);
break
;
}
switch_mutex_lock
(
conference
->
mutex
);
has_file_data
=
ready
=
total
=
0
;
...
...
@@ -919,11 +920,13 @@ static void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t * thread,
}
else
if
(
!
conference
->
async_fnode
->
done
)
{
file_sample_len
=
samples
;
switch_core_file_read
(
&
conference
->
async_fnode
->
fh
,
async_file_frame
,
&
file_sample_len
);
if
(
file_sample_len
<=
0
)
{
conference
->
async_fnode
->
done
++
;
}
else
{
if
(
has_file_data
)
{
switch_size_t
x
;
for
(
x
=
0
;
x
<
file_sample_len
;
x
++
)
{
int32_t
z
;
int16_t
*
bptr
,
*
muxed
;
...
...
@@ -945,6 +948,7 @@ static void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t * thread,
if
(
ready
||
has_file_data
)
{
//int nt = 0;
/* Build a muxed frame for every member that contains the mixed audio of everyone else */
for
(
omember
=
conference
->
members
;
omember
;
omember
=
omember
->
next
)
{
if
(
has_file_data
&&
file_sample_len
)
{
uint32_t
sample_bytes
=
file_sample_len
*
2
;
...
...
@@ -1020,7 +1024,6 @@ static void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t * thread,
#endif
}
}
/* Go back and write each member his dedicated copy of the audio frame that does not contain his own audio. */
for
(
imember
=
conference
->
members
;
imember
;
imember
=
imember
->
next
)
{
if
(
switch_test_flag
(
imember
,
MFLAG_RUNNING
))
{
...
...
@@ -1648,13 +1651,15 @@ static void conference_loop_output(conference_member_t * member)
uint32_t
samples
=
switch_bytes_per_frame
(
member
->
conference
->
rate
,
interval
);
uint32_t
csamples
=
samples
;
uint32_t
tsamples
=
member
->
orig_read_codec
->
implementation
->
samples_per_frame
;
uint32_t
flush_len
=
member
->
read_codec
.
implementation
->
bytes_per_frame
*
4
;
uint32_t
flush_len
=
0
;
uint32_t
low_count
=
0
,
bytes
=
samples
*
2
;
call_list_t
*
call_list
=
NULL
,
*
cp
=
NULL
;
switch_assert
(
member
->
conference
!=
NULL
);
if
(
switch_core_timer_init
(
&
timer
,
member
->
conference
->
timer_name
,
interval
,
tsamples
,
NULL
)
!=
SWITCH_STATUS_SUCCESS
)
{
flush_len
=
switch_bytes_per_frame
(
member
->
conference
->
rate
,
member
->
conference
->
interval
)
*
2
;
if
(
switch_core_timer_init
(
&
timer
,
member
->
conference
->
timer_name
,
interval
,
tsamples
,
NULL
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Timer Setup Failed. Conference Cannot Start
\n
"
);
return
;
}
...
...
@@ -1846,7 +1851,7 @@ static void conference_loop_output(conference_member_t * member)
}
}
}
}
else
{
/* send the conferecne frame to the call leg */
}
else
{
switch_buffer_t
*
use_buffer
=
NULL
;
uint32_t
mux_used
=
(
uint32_t
)
switch_buffer_inuse
(
member
->
mux_buffer
);
...
...
@@ -1856,26 +1861,17 @@ static void conference_loop_output(conference_member_t * member)
/* partial frame sitting around this long is useless and builds delay */
switch_set_flag_locked
(
member
,
MFLAG_FLUSH_BUFFER
);
}
mux_used
=
0
;
}
else
if
(
mux_used
>
flush_len
)
{
/* getting behind, clear the buffer */
switch_set_flag_locked
(
member
,
MFLAG_FLUSH_BUFFER
);
}
}
if
(
switch_test_flag
(
member
,
MFLAG_FLUSH_BUFFER
))
{
if
(
mux_used
)
{
switch_mutex_lock
(
member
->
audio_out_mutex
);
switch_buffer_zero
(
member
->
mux_buffer
);
switch_mutex_unlock
(
member
->
audio_out_mutex
);
mux_used
=
0
;
}
switch_clear_flag_locked
(
member
,
MFLAG_FLUSH_BUFFER
);
}
use_timer
=
1
;
if
(
mux_used
)
{
if
(
mux_used
>=
bytes
)
{
/* Flush the output buffer and write all the data (presumably muxed) back to the channel */
switch_mutex_lock
(
member
->
audio_out_mutex
);
write_frame
.
data
=
data
;
...
...
@@ -1895,8 +1891,6 @@ static void conference_loop_output(conference_member_t * member)
}
switch_mutex_unlock
(
member
->
audio_out_mutex
);
}
else
{
if
(
switch_test_flag
(
member
,
MFLAG_WASTE_BANDWIDTH
))
{
if
(
member
->
conference
->
comfort_noise_level
)
{
...
...
@@ -1912,10 +1906,21 @@ static void conference_loop_output(conference_member_t * member)
}
}
if
(
switch_test_flag
(
member
,
MFLAG_FLUSH_BUFFER
))
{
if
(
switch_buffer_inuse
(
member
->
mux_buffer
))
{
switch_mutex_lock
(
member
->
audio_out_mutex
);
switch_buffer_zero
(
member
->
mux_buffer
);
switch_mutex_unlock
(
member
->
audio_out_mutex
);
}
switch_clear_flag_locked
(
member
,
MFLAG_FLUSH_BUFFER
);
}
switch_mutex_unlock
(
member
->
flag_mutex
);
if
(
use_timer
)
{
switch_core_timer_next
(
&
timer
);
}
else
{
switch_yield
(
1000
);
}
}
/* Rinse ... Repeat */
...
...
@@ -2326,7 +2331,7 @@ static switch_status_t conference_member_play_file(conference_member_t * member,
switch_mutex_unlock
(
member
->
flag_mutex
);
status
=
SWITCH_STATUS_SUCCESS
;
done:
done:
switch_safe_free
(
expanded
);
switch_safe_free
(
dfile
);
...
...
@@ -4247,6 +4252,7 @@ SWITCH_STANDARD_APP(conference_function)
NULL
,
read_codec
->
implementation
->
actual_samples_per_second
,
read_codec
->
implementation
->
microseconds_per_frame
/
1000
,
//conference->interval,
1
,
SWITCH_CODEC_FLAG_ENCODE
|
SWITCH_CODEC_FLAG_DECODE
,
NULL
,
member
.
pool
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Raw Codec Activation Success L16@%uhz 1 channel %dms
\n
"
,
...
...
@@ -4260,7 +4266,7 @@ SWITCH_STANDARD_APP(conference_function)
goto
done
;
}
member
.
frame_size
=
switch_bytes_per_frame
(
conference
->
rate
,
conference
->
interval
)
*
4
;
member
.
frame_size
=
SWITCH_RECOMMENDED_BUFFER_SIZE
;
member
.
frame
=
switch_core_alloc
(
member
.
pool
,
member
.
frame_size
);
member
.
mux_frame
=
switch_core_alloc
(
member
.
pool
,
member
.
frame_size
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论