Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
dc17932a
提交
dc17932a
authored
3月 29, 2015
作者:
Seven Du
提交者:
Michael Jerris
5月 28, 2015
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-7508: restart on ts mismatch and add some logs to track packet loss
上级
216850c1
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
15 行增加
和
4 行删除
+15
-4
mod_vpx.c
src/mod/codecs/mod_vpx/mod_vpx.c
+15
-4
没有找到文件。
src/mod/codecs/mod_vpx/mod_vpx.c
浏览文件 @
dc17932a
...
...
@@ -183,9 +183,10 @@ static inline int IS_VP8_KEY_FRAME(uint8_t *data)
if
(
X
&
0x30
)
data
++
;
// T/K
}
if
(
S
&&
PID
==
0
)
{
if
(
S
&&
(
PID
==
0
)
)
{
return
__IS_VP8_KEY_FRAME
(
*
data
);
}
else
{
if
(
PID
>
0
)
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"PID: %d
\n
"
,
PID
);
return
0
;
}
}
...
...
@@ -225,7 +226,7 @@ struct vpx_context {
uint8_t
decoder_init
;
switch_buffer_t
*
vpx_packet_buffer
;
int
got_key_frame
;
switch_size
_t
last_received_timestamp
;
uint32
_t
last_received_timestamp
;
switch_bool_t
last_received_complete_picture
;
int
need_key_frame
;
int
need_encoder_reset
;
...
...
@@ -691,12 +692,14 @@ static switch_status_t buffer_vp8_packets(vpx_context_t *context, switch_frame_t
if
(
!
switch_buffer_inuse
(
context
->
vpx_packet_buffer
)
&&
!
S
)
{
if
(
context
->
got_key_frame
>
0
)
{
context
->
got_key_frame
=
0
;
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_WARNING
,
"packet loss?
\n
"
);
}
return
SWITCH_STATUS_MORE_DATA
;
}
if
(
S
)
{
switch_buffer_zero
(
context
->
vpx_packet_buffer
);
context
->
last_received_timestamp
=
frame
->
timestamp
;
}
len
=
frame
->
datalen
-
(
data
-
(
uint8_t
*
)
frame
->
data
);
...
...
@@ -706,6 +709,12 @@ static switch_status_t buffer_vp8_packets(vpx_context_t *context, switch_frame_t
return
SWITCH_STATUS_RESTART
;
}
if
(
context
->
last_received_timestamp
!=
frame
->
timestamp
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_WARNING
,
"wrong timestamp %u, expect %u, packet loss?
\n
"
,
frame
->
timestamp
,
context
->
last_received_timestamp
);
switch_buffer_zero
(
context
->
vpx_packet_buffer
);
return
SWITCH_STATUS_RESTART
;
}
switch_buffer_write
(
context
->
vpx_packet_buffer
,
data
,
len
);
return
SWITCH_STATUS_SUCCESS
;
}
...
...
@@ -755,6 +764,8 @@ static switch_status_t switch_vpx_decode(switch_codec_t *codec, switch_frame_t *
is_keyframe
=
IS_VP8_KEY_FRAME
((
uint8_t
*
)
frame
->
data
);
}
// if (is_keyframe) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "got key %d\n", is_keyframe);
if
(
context
->
need_decoder_reset
!=
0
)
{
vpx_codec_destroy
(
&
context
->
decoder
);
context
->
decoder_init
=
0
;
...
...
@@ -775,7 +786,7 @@ static switch_status_t switch_vpx_decode(switch_codec_t *codec, switch_frame_t *
// switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "len: %d ts: %u mark:%d\n", frame->datalen, frame->timestamp, frame->m);
context
->
last_received_timestamp
=
frame
->
timestamp
;
//
context->last_received_timestamp = frame->timestamp;
context
->
last_received_complete_picture
=
frame
->
m
?
SWITCH_TRUE
:
SWITCH_FALSE
;
if
(
is_keyframe
)
{
...
...
@@ -786,7 +797,7 @@ static switch_status_t switch_vpx_decode(switch_codec_t *codec, switch_frame_t *
}
}
else
if
(
context
->
got_key_frame
<=
0
)
{
if
((
--
context
->
got_key_frame
%
200
)
==
0
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_WARNING
,
"Waiting for key frame
\n
"
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_WARNING
,
"Waiting for key frame
%d
\n
"
,
context
->
got_key_frame
);
}
switch_goto_status
(
SWITCH_STATUS_MORE_DATA
,
end
);
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论