Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
55c5f1da
提交
55c5f1da
authored
11月 20, 2014
作者:
Seven Du
提交者:
Michael Jerris
5月 28, 2015
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-7500: fix decode_video App
上级
aa654da7
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
17 行增加
和
45 行删除
+17
-45
mod_fsv.c
src/mod/applications/mod_fsv/mod_fsv.c
+17
-45
没有找到文件。
src/mod/applications/mod_fsv/mod_fsv.c
浏览文件 @
55c5f1da
...
@@ -700,10 +700,8 @@ SWITCH_STANDARD_APP(decode_video_function)
...
@@ -700,10 +700,8 @@ SWITCH_STANDARD_APP(decode_video_function)
{
{
switch_channel_t
*
channel
=
switch_core_session_get_channel
(
session
);
switch_channel_t
*
channel
=
switch_core_session_get_channel
(
session
);
switch_codec_t
*
codec
=
NULL
;
switch_codec_t
*
codec
=
NULL
;
switch_dtmf_t
dtmf
=
{
0
};
switch_frame_t
*
frame
;
switch_frame_t
*
frame
;
uint32_t
width
=
0
,
height
=
0
;
uint32_t
width
=
0
,
height
=
0
;
switch_time_t
last
=
switch_micro_time_now
();
uint32_t
max_pictures
=
0
;
uint32_t
max_pictures
=
0
;
uint32_t
decoded_pictures
=
0
;
uint32_t
decoded_pictures
=
0
;
...
@@ -728,31 +726,18 @@ SWITCH_STANDARD_APP(decode_video_function)
...
@@ -728,31 +726,18 @@ SWITCH_STANDARD_APP(decode_video_function)
goto
done
;
goto
done
;
}
}
switch_channel_set_flag
(
channel
,
CF_VIDEO_DECODED_READ
);
while
(
switch_channel_ready
(
channel
))
{
while
(
switch_channel_ready
(
channel
))
{
switch_core_session_read_video_frame
(
session
,
&
frame
,
SWITCH_IO_FLAG_NONE
,
0
);
switch_
status_t
status
=
switch_
core_session_read_video_frame
(
session
,
&
frame
,
SWITCH_IO_FLAG_NONE
,
0
);
if
(
switch_channel_test_flag
(
channel
,
CF_BREAK
))
{
if
(
switch_channel_test_flag
(
channel
,
CF_BREAK
))
{
switch_channel_clear_flag
(
channel
,
CF_BREAK
);
switch_channel_clear_flag
(
channel
,
CF_BREAK
);
break
;
break
;
}
}
switch_ivr_parse_all_events
(
session
);
if
(
!
SWITCH_READ_ACCEPTABLE
(
status
))
{
break
;
//check for dtmf interrupts
if
(
switch_channel_has_dtmf
(
channel
))
{
const
char
*
terminators
=
switch_channel_get_variable
(
channel
,
SWITCH_PLAYBACK_TERMINATORS_VARIABLE
);
switch_channel_dequeue_dtmf
(
channel
,
&
dtmf
);
if
(
terminators
&&
!
strcasecmp
(
terminators
,
"none"
))
{
terminators
=
NULL
;
}
if
(
terminators
&&
strchr
(
terminators
,
dtmf
.
digit
))
{
char
sbuf
[
2
]
=
{
dtmf
.
digit
,
'\0'
};
switch_channel_set_variable
(
channel
,
SWITCH_PLAYBACK_TERMINATOR_USED
,
sbuf
);
break
;
}
}
}
if
(
frame
&&
frame
->
datalen
>
0
)
{
if
(
frame
&&
frame
->
datalen
>
0
)
{
...
@@ -774,35 +759,22 @@ SWITCH_STANDARD_APP(decode_video_function)
...
@@ -774,35 +759,22 @@ SWITCH_STANDARD_APP(decode_video_function)
continue
;
continue
;
}
}
if
(
1
)
{
/* video part */
if
(
frame
->
img
)
{
switch_core_codec_decode_video
(
codec
,
frame
);
if
(
frame
->
img
->
d_w
>
0
&&
!
width
)
{
width
=
frame
->
img
->
d_w
;
if
((
switch_test_flag
(
frame
,
SFF_WAIT_KEY_FRAME
)))
{
switch_channel_set_variable_printf
(
channel
,
"video_width"
,
"%d"
,
width
);
switch_time_t
now
=
switch_micro_time_now
();
if
(
now
-
last
>
3000000
)
{
switch_core_session_refresh_video
(
session
);
last
=
now
;
}
continue
;
}
}
if
(
frame
->
img
)
{
if
(
frame
->
img
->
d_h
>
0
&&
!
height
)
{
if
(
frame
->
img
->
d_w
>
0
&&
!
width
)
{
height
=
frame
->
img
->
d_h
;
width
=
frame
->
img
->
d_w
;
switch_channel_set_variable_printf
(
channel
,
"video_height"
,
"%d"
,
height
);
switch_channel_set_variable_printf
(
channel
,
"video_width"
,
"%d"
,
width
);
}
}
if
(
frame
->
img
->
d_h
>
0
&&
!
height
)
{
height
=
frame
->
img
->
d_h
;
switch_channel_set_variable_printf
(
channel
,
"video_height"
,
"%d"
,
height
);
}
decoded_pictures
++
;
decoded_pictures
++
;
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_NOTICE
,
"picture#%d %dx%d
\n
"
,
decoded_pictures
,
frame
->
img
->
d_w
,
frame
->
img
->
d_h
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_NOTICE
,
"picture#%d %dx%d
\n
"
,
decoded_pictures
,
frame
->
img
->
d_w
,
frame
->
img
->
d_h
);
if
(
max_pictures
&&
(
decoded_pictures
>=
max_pictures
))
{
if
(
max_pictures
&&
(
decoded_pictures
>=
max_pictures
))
{
break
;
break
;
}
}
}
}
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论