Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
f0eefb7a
提交
f0eefb7a
authored
7月 01, 2015
作者:
Anthony Minessale
提交者:
Brian West
7月 01, 2015
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-7753 #resolve
上级
3274853b
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
67 行增加
和
26 行删除
+67
-26
mod_local_stream.c
src/mod/formats/mod_local_stream/mod_local_stream.c
+9
-0
switch_ivr_bridge.c
src/switch_ivr_bridge.c
+58
-26
没有找到文件。
src/mod/formats/mod_local_stream/mod_local_stream.c
浏览文件 @
f0eefb7a
...
...
@@ -69,6 +69,7 @@ struct local_stream_context {
int
last_w
;
int
last_h
;
int
serno
;
int
pop_count
;
switch_image_t
*
banner_img
;
switch_time_t
banner_timeout
;
struct
local_stream_context
*
next
;
...
...
@@ -814,6 +815,13 @@ static switch_status_t local_stream_file_read_video(switch_file_handle_t *handle
got_img:
if
(
context
->
pop_count
>
0
)
{
switch_rgb_color_t
bgcolor
=
{
0
};
switch_color_set_rgb
(
&
bgcolor
,
"#000000"
);
switch_img_fill
(
frame
->
img
,
0
,
0
,
frame
->
img
->
d_w
,
frame
->
img
->
d_h
,
&
bgcolor
);
context
->
pop_count
--
;
}
now
=
switch_micro_time_now
();
if
(
context
->
banner_img
)
{
...
...
@@ -826,6 +834,7 @@ static switch_status_t local_stream_file_read_video(switch_file_handle_t *handle
switch_img_free
(
&
context
->
banner_img
);
context
->
banner_timeout
=
0
;
context
->
serno
=
context
->
source
->
serno
;
context
->
pop_count
=
5
;
}
if
(
context
->
source
->
banner_txt
)
{
...
...
src/switch_ivr_bridge.c
浏览文件 @
f0eefb7a
...
...
@@ -56,6 +56,10 @@ static void video_bridge_thread(switch_core_session_t *session, void *obj)
int
set_decoded_read
=
0
,
refresh_timer
=
0
,
playing_file
=
0
;
switch_frame_t
fr
=
{
0
};
unsigned
char
*
buf
=
NULL
;
int
send_blank
=
0
;
int
refresh_cnt
=
300
;
int
blank_cnt
=
30
;
switch_image_t
*
blank_img
=
NULL
;
vh
->
up
=
1
;
...
...
@@ -65,7 +69,7 @@ static void video_bridge_thread(switch_core_session_t *session, void *obj)
switch_core_session_request_video_refresh
(
vh
->
session_a
);
switch_core_session_request_video_refresh
(
vh
->
session_b
);
refresh_timer
=
5
;
refresh_timer
=
refresh_cnt
;
while
(
switch_channel_up_nosig
(
channel
)
&&
switch_channel_up_nosig
(
b_channel
)
&&
vh
->
up
==
1
)
{
if
(
switch_channel_media_up
(
channel
))
{
...
...
@@ -81,7 +85,7 @@ static void video_bridge_thread(switch_core_session_t *session, void *obj)
if
(
set_decoded_read
)
{
switch_channel_clear_flag_recursive
(
channel
,
CF_VIDEO_DECODED_READ
);
set_decoded_read
=
0
;
refresh_timer
=
5
;
refresh_timer
=
refresh_cnt
;
}
}
}
else
{
...
...
@@ -89,30 +93,60 @@ static void video_bridge_thread(switch_core_session_t *session, void *obj)
switch_channel_test_flag
(
b_channel
,
CF_VIDEO_DECODED_READ
))
{
switch_channel_set_flag_recursive
(
channel
,
CF_VIDEO_DECODED_READ
);
set_decoded_read
=
1
;
refresh_timer
=
5
;
refresh_timer
=
refresh_cnt
;
}
}
if
(
refresh_timer
)
{
if
(
refresh_timer
>
0
&&
(
refresh_timer
%
100
)
==
0
)
{
switch_core_session_request_video_refresh
(
vh
->
session_a
);
switch_core_session_request_video_refresh
(
vh
->
session_b
);
switch_core_media_gen_key_frame
(
vh
->
session_a
);
switch_core_media_gen_key_frame
(
vh
->
session_b
);
}
refresh_timer
--
;
}
if
(
send_blank
)
{
send_blank
--
;
fr
.
img
=
blank_img
;
switch_core_media_gen_key_frame
(
session
);
switch_core_session_write_video_frame
(
session
,
&
fr
,
SWITCH_IO_FLAG_NONE
,
0
);
switch_yield
(
30000
);
continue
;
}
if
((
fh
=
switch_core_media_get_video_file
(
session
,
SWITCH_RW_WRITE
))
&&
switch_test_flag
(
fh
,
SWITCH_FILE_OPEN
))
{
switch_status_t
wstatus
;
if
(
!
playing_file
)
{
playing_file
=
1
;
}
if
(
!
buf
)
{
int
buflen
=
SWITCH_RTP_MAX_BUF_LEN
;
buf
=
switch_core_session_alloc
(
session
,
buflen
);
fr
.
packet
=
buf
;
fr
.
packetlen
=
buflen
;
fr
.
data
=
buf
+
12
;
fr
.
buflen
=
buflen
-
12
;
switch_core_media_gen_key_frame
(
session
);
}
wstatus
=
switch_core_file_read_video
(
fh
,
&
fr
,
SVR_BLOCK
);
wstatus
=
switch_core_file_read_video
(
fh
,
&
fr
,
SVR_FLUSH
|
SVR_BLOCK
);
if
(
!
blank_img
&&
fr
.
img
)
{
switch_rgb_color_t
bgcolor
=
{
0
};
blank_img
=
switch_img_alloc
(
NULL
,
SWITCH_IMG_FMT_I420
,
fr
.
img
->
d_w
,
fr
.
img
->
d_h
,
1
);
switch_color_set_rgb
(
&
bgcolor
,
"#000000"
);
switch_img_fill
(
blank_img
,
0
,
0
,
blank_img
->
d_w
,
blank_img
->
d_h
,
&
bgcolor
);
}
if
(
!
playing_file
)
{
playing_file
=
1
;
switch_core_media_gen_key_frame
(
session
);
send_blank
=
blank_cnt
;
refresh_timer
=
refresh_cnt
;
switch_channel_video_sync
(
channel
);
switch_channel_video_sync
(
b_channel
);
continue
;
}
if
(
wstatus
==
SWITCH_STATUS_SUCCESS
)
{
switch_core_session_write_video_frame
(
session
,
&
fr
,
SWITCH_IO_FLAG_NONE
,
0
);
...
...
@@ -127,20 +161,12 @@ static void video_bridge_thread(switch_core_session_t *session, void *obj)
if
(
playing_file
)
{
playing_file
=
0
;
s
witch_core_session_request_video_refresh
(
vh
->
session_a
)
;
switch_core_session_request_video_refresh
(
vh
->
session_b
)
;
s
end_blank
=
blank_cnt
;
refresh_timer
=
refresh_cnt
;
switch_channel_video_sync
(
channel
);
refresh_timer
=
5
;
switch_channel_video_sync
(
b_channel
)
;
}
if
(
refresh_timer
)
{
if
(
--
refresh_timer
==
0
)
{
switch_core_session_request_video_refresh
(
vh
->
session_a
);
switch_core_session_request_video_refresh
(
vh
->
session_b
);
}
}
status
=
switch_core_session_read_video_frame
(
vh
->
session_a
,
&
read_frame
,
SWITCH_IO_FLAG_NONE
,
0
);
if
(
!
SWITCH_READ_ACCEPTABLE
(
status
))
{
...
...
@@ -150,14 +176,18 @@ static void video_bridge_thread(switch_core_session_t *session, void *obj)
if
(
switch_test_flag
(
read_frame
,
SFF_CNG
))
{
switch_core_session_request_video_refresh
(
vh
->
session_a
);
continue
;
}
}
if
(
switch_channel_test_flag
(
channel
,
CF_LEG_HOLDING
)
||
switch_channel_test_flag
(
b_channel
,
CF_VIDEO_READ_FILE_ATTACHED
))
{
switch_channel_video_sync
(
channel
);
switch_core_session_write_video_frame
(
session
,
read_frame
,
SWITCH_IO_FLAG_NONE
,
0
);
continue
;
}
if
(
switch_channel_media_up
(
b_channel
))
{
if
(
switch_core_session_write_video_frame
(
vh
->
session_b
,
read_frame
,
SWITCH_IO_FLAG_NONE
,
0
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_cond_next
();
...
...
@@ -166,6 +196,8 @@ static void video_bridge_thread(switch_core_session_t *session, void *obj)
}
}
switch_img_free
(
&
blank_img
);
if
(
set_decoded_read
)
{
switch_channel_clear_flag_recursive
(
channel
,
CF_VIDEO_DECODED_READ
);
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论