Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
0fa449d5
提交
0fa449d5
authored
3月 27, 2016
作者:
Seven Du
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-8749 #resolve #comment please test
上级
22d2d3ac
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
74 行增加
和
6 行删除
+74
-6
switch_types.h
src/include/switch_types.h
+2
-1
avformat.c
src/mod/applications/mod_av/avformat.c
+68
-5
mod_conference.c
src/mod/applications/mod_conference/mod_conference.c
+1
-0
switch_ivr.c
src/switch_ivr.c
+3
-0
没有找到文件。
src/include/switch_types.h
浏览文件 @
0fa449d5
...
...
@@ -2600,7 +2600,8 @@ typedef enum {
}
switch_vid_spy_fmt_t
;
typedef
enum
{
SCFC_FLUSH_AUDIO
SCFC_FLUSH_AUDIO
,
SCFC_PAUSE_READ
}
switch_file_command_t
;
SWITCH_END_EXTERN_C
...
...
src/mod/applications/mod_av/avformat.c
浏览文件 @
0fa449d5
...
...
@@ -1265,6 +1265,7 @@ struct av_file_context {
int
read_fps
;
switch_time_t
last_vid_push
;
int64_t
seek_ts
;
switch_bool_t
read_paused
;
};
typedef
struct
av_file_context
av_file_context_t
;
...
...
@@ -1434,7 +1435,7 @@ static void *SWITCH_THREAD_FUNC file_read_thread_run(switch_thread_t *thread, vo
// if (context->has_audio) stream_id = context->audio_st.st->index;
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"seeking to %"
SWITCH_INT64_T_FMT
"
\n
"
,
context
->
seek_ts
);
avformat_seek_file
(
context
->
fc
,
stream_id
,
0
,
context
->
seek_ts
,
INT64_MAX
,
0
);
context
->
seek_ts
=
-
1
;
context
->
seek_ts
=
-
2
;
context
->
video_st
.
next_pts
=
0
;
context
->
video_start_time
=
0
;
...
...
@@ -1964,6 +1965,15 @@ static switch_status_t av_file_command(switch_file_handle_t *handle, switch_file
switch_buffer_zero
(
context
->
audio_buffer
);
switch_mutex_unlock
(
context
->
mutex
);
break
;
case
SCFC_PAUSE_READ
:
if
(
context
->
read_paused
)
{
context
->
read_paused
=
SWITCH_FALSE
;
context
->
video_st
.
next_pts
=
0
;
context
->
video_start_time
=
0
;
}
else
{
context
->
read_paused
=
SWITCH_TRUE
;
}
break
;
default:
break
;
}
...
...
@@ -2138,6 +2148,63 @@ static switch_status_t av_file_read_video(switch_file_handle_t *handle, switch_f
do_fl
=
1
;
}
if
(
!
context
->
file_read_thread_running
&&
switch_queue_size
(
context
->
eh
.
video_queue
)
==
0
)
{
return
SWITCH_STATUS_FALSE
;
}
if
(
context
->
read_paused
)
{
int
sanity
=
10
;
if
(
context
->
seek_ts
==
-
2
)
{
// just seeked, try read a new img
again1:
status
=
switch_queue_trypop
(
context
->
eh
.
video_queue
,
&
pop
);
if
(
pop
&&
status
==
SWITCH_STATUS_SUCCESS
)
{
context
->
seek_ts
=
-
1
;
switch_img_free
(
&
context
->
last_img
);
context
->
last_img
=
(
switch_image_t
*
)
pop
;
switch_img_copy
(
context
->
last_img
,
&
frame
->
img
);
context
->
vid_ready
=
1
;
return
SWITCH_STATUS_SUCCESS
;
}
if
(
context
->
last_img
)
{
// repeat the last img
switch_img_copy
(
context
->
last_img
,
&
frame
->
img
);
context
->
vid_ready
=
1
;
context
->
seek_ts
=
-
1
;
return
SWITCH_STATUS_SUCCESS
;
}
if
((
flags
&
SVR_BLOCK
)
&&
sanity
--
>
0
)
{
switch_yield
(
10000
);
goto
again1
;
}
return
SWITCH_STATUS_BREAK
;
}
if
(
context
->
last_img
)
{
// repeat the last img
if
((
flags
&
SVR_BLOCK
))
switch_yield
(
100000
);
switch_img_copy
(
context
->
last_img
,
&
frame
->
img
);
context
->
vid_ready
=
1
;
return
SWITCH_STATUS_SUCCESS
;
}
if
((
flags
&
SVR_BLOCK
))
{
status
=
switch_queue_pop
(
context
->
eh
.
video_queue
,
&
pop
);
}
else
{
status
=
switch_queue_trypop
(
context
->
eh
.
video_queue
,
&
pop
);
}
if
(
pop
&&
status
==
SWITCH_STATUS_SUCCESS
)
{
context
->
last_img
=
(
switch_image_t
*
)
pop
;
switch_img_copy
(
context
->
last_img
,
&
frame
->
img
);
context
->
vid_ready
=
1
;
return
SWITCH_STATUS_SUCCESS
;
}
return
SWITCH_STATUS_BREAK
;
}
if
(
context
->
last_img
)
{
if
(
mst
->
next_pts
&&
(
switch_time_now
()
-
mst
->
next_pts
>
max_delta
))
{
switch_img_free
(
&
context
->
last_img
);
// too late
...
...
@@ -2159,10 +2226,6 @@ static switch_status_t av_file_read_video(switch_file_handle_t *handle, switch_f
}
}
if
(
!
context
->
file_read_thread_running
&&
switch_queue_size
(
context
->
eh
.
video_queue
)
==
0
)
{
return
SWITCH_STATUS_FALSE
;
}
if
(
st
->
codec
->
time_base
.
num
)
{
ticks
=
st
->
parser
?
st
->
parser
->
repeat_pict
+
1
:
st
->
codec
->
ticks_per_frame
;
// mst->next_pts += ((int64_t)AV_TIME_BASE * st->codec->time_base.num * ticks) / st->codec->time_base.den;
...
...
src/mod/applications/mod_conference/mod_conference.c
浏览文件 @
0fa449d5
...
...
@@ -1254,6 +1254,7 @@ void conference_xlist(conference_obj_t *conference, switch_xml_t x_conference, i
void
conference_fnode_toggle_pause
(
conference_file_node_t
*
fnode
,
switch_stream_handle_t
*
stream
)
{
if
(
fnode
)
{
switch_core_file_command
(
&
fnode
->
fh
,
SCFC_PAUSE_READ
);
if
(
switch_test_flag
(
fnode
,
NFLAG_PAUSE
))
{
stream
->
write_function
(
stream
,
"+OK Resume
\n
"
);
switch_clear_flag
(
fnode
,
NFLAG_PAUSE
);
...
...
src/switch_ivr.c
浏览文件 @
0fa449d5
...
...
@@ -3878,6 +3878,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_process_fh(switch_core_session_t *ses
}
else
{
switch_set_flag_locked
(
fhp
,
SWITCH_FILE_PAUSE
);
}
switch_core_file_command
(
fhp
,
SCFC_PAUSE_READ
);
return
SWITCH_STATUS_SUCCESS
;
}
else
if
(
!
strcasecmp
(
cmd
,
"stop"
))
{
switch_set_flag_locked
(
fhp
,
SWITCH_FILE_DONE
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论