Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
11448edd
提交
11448edd
authored
1月 24, 2015
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-7499: mod vid refresh stuff
上级
50e30fbe
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
32 行增加
和
18 行删除
+32
-18
switch_core_media.c
src/switch_core_media.c
+10
-6
switch_rtp.c
src/switch_rtp.c
+22
-12
没有找到文件。
src/switch_core_media.c
浏览文件 @
11448edd
...
...
@@ -48,7 +48,7 @@ static void switch_core_media_set_r_sdp_codec_string(switch_core_session_t *sess
#define MAX_CODEC_CHECK_FRAMES 50//x:mod_sofia.h
#define MAX_MISMATCH_FRAMES 5//x:mod_sofia.h
#define type2str(type) type == SWITCH_MEDIA_TYPE_VIDEO ? "video" : "audio"
#define VIDEO_REFRESH_FREQ
25
0000
#define VIDEO_REFRESH_FREQ
100
0000
typedef
enum
{
SMF_INIT
=
(
1
<<
0
),
...
...
@@ -8107,10 +8107,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_receive_message(switch_core_se
case
SWITCH_MESSAGE_INDICATE_VIDEO_REFRESH_REQ
:
{
if
(
v_engine
->
rtp_session
)
{
if
(
switch_rtp_test_flag
(
v_engine
->
rtp_session
,
SWITCH_RTP_FLAG_FIR
))
{
switch_rtp_video_refresh
(
v_engine
->
rtp_session
);
}
else
if
(
switch_rtp_test_flag
(
v_engine
->
rtp_session
,
SWITCH_RTP_FLAG_PLI
))
{
if
(
switch_rtp_test_flag
(
v_engine
->
rtp_session
,
SWITCH_RTP_FLAG_PLI
))
{
switch_rtp_video_loss
(
v_engine
->
rtp_session
);
}
else
if
(
switch_rtp_test_flag
(
v_engine
->
rtp_session
,
SWITCH_RTP_FLAG_FIR
))
{
switch_rtp_video_refresh
(
v_engine
->
rtp_session
);
}
}
}
...
...
@@ -9950,7 +9950,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_video_frame(switch_core
}
if
(
switch_channel_test_flag
(
session
->
channel
,
CF_VIDEO_DECODED_READ
))
{
switch_status_t
decode_status
=
switch_core_codec_decode_video
((
*
frame
)
->
codec
,
*
frame
);
switch_status_t
decode_status
;
(
*
frame
)
->
img
=
NULL
;
decode_status
=
switch_core_codec_decode_video
((
*
frame
)
->
codec
,
*
frame
);
if
((
*
frame
)
->
img
&&
switch_channel_test_flag
(
session
->
channel
,
CF_VIDEO_DEBUG_READ
))
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_INFO
,
"IMAGE %dx%d %dx%d
\n
"
,
...
...
@@ -9962,7 +9966,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_video_frame(switch_core
switch_clear_flag
((
*
frame
),
SFF_WAIT_KEY_FRAME
);
}
if
(
decode_status
==
SWITCH_STATUS_MORE_DATA
)
{
if
(
decode_status
==
SWITCH_STATUS_MORE_DATA
||
!
(
*
frame
)
->
img
)
{
goto
top
;
}
}
...
...
src/switch_rtp.c
浏览文件 @
11448edd
...
...
@@ -1919,7 +1919,7 @@ static int check_rtcp_and_ice(switch_rtp_t *rtp_session)
ext_hdr
->
length
=
htons
((
uint8_t
)(
sizeof
(
switch_rtcp_ext_hdr_t
)
/
4
)
-
1
);
rtcp_bytes
+=
sizeof
(
switch_rtcp_ext_hdr_t
);
rtp_session
->
pli_count
=
0
;
rtp_session
->
pli_count
--
;
}
if
(
rtp_session
->
flags
[
SWITCH_RTP_FLAG_NACK
]
&&
rtp_session
->
cur_nack
)
{
...
...
@@ -1963,17 +1963,19 @@ static int check_rtcp_and_ice(switch_rtp_t *rtp_session)
ext_hdr
->
pt
=
206
;
ext_hdr
->
send_ssrc
=
htonl
(
rtp_session
->
ssrc
);
ext_hdr
->
recv_ssrc
=
htonl
(
rtp_session
->
remote_ssrc
)
;
ext_hdr
->
recv_ssrc
=
0
;
fir
->
ssrc
=
htonl
(
rtp_session
->
remote_ssrc
);
fir
->
seq
=
++
rtp_session
->
fir_seq
;
fir
->
seq
=
rtp_session
->
fir_seq
;
fir
->
r1
=
fir
->
r2
=
fir
->
r3
=
0
;
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
rtp_session
->
session
),
SWITCH_LOG_DEBUG
,
"Sending RTCP FIR SEQ %d
\n\n
"
,
rtp_session
->
fir_seq
-
1
);
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
rtp_session
->
session
),
SWITCH_LOG_DEBUG
,
"Sending RTCP FIR SEQ %d
\n
"
,
rtp_session
->
fir_seq
);
rtp_session
->
fir_seq
++
;
ext_hdr
->
length
=
htons
((
uint8_t
)((
sizeof
(
switch_rtcp_ext_hdr_t
)
+
sizeof
(
rtcp_fir_t
))
/
4
)
-
1
);
rtcp_bytes
+=
sizeof
(
switch_rtcp_ext_hdr_t
)
+
sizeof
(
rtcp_fir_t
);
rtp_session
->
fir_count
=
0
;
rtp_session
->
fir_count
--
;
}
}
...
...
@@ -3520,7 +3522,7 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_create(switch_rtp_t **new_rtp_session
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
rtp_session
->
session
),
SWITCH_LOG_DEBUG
,
"Starting video timer.
\n
"
);
}
switch_vb_create
(
&
rtp_session
->
vb
,
5
,
30
);
switch_vb_create
(
&
rtp_session
->
vb
,
5
,
30
,
rtp_session
->
pool
);
//switch_vb_debug_level(rtp_session->vb, 10);
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
rtp_session
->
session
),
SWITCH_LOG_DEBUG
,
"Starting video buffer.
\n
"
);
...
...
@@ -3822,6 +3824,7 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_debug_jitter_buffer(switch_rtp_t *rtp
if
(
x
<
0
)
x
=
0
;
switch_vb_debug_level
(
rtp_session
->
vb
,
x
);
}
return
SWITCH_STATUS_SUCCESS
;
...
...
@@ -3938,6 +3941,16 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_activate_ice(switch_rtp_t *rtp_sessio
if
(
proto
==
IPR_RTP
)
{
ice
=
&
rtp_session
->
ice
;
if
(
ice
->
ready
)
{
if
(
rtp_session
->
vb
)
{
switch_vb_reset
(
rtp_session
->
vb
);
}
if
(
rtp_session
->
vbw
)
{
switch_vb_reset
(
rtp_session
->
vbw
);
}
}
}
else
{
ice
=
&
rtp_session
->
rtcp_ice
;
}
...
...
@@ -4025,10 +4038,8 @@ SWITCH_DECLARE(void) switch_rtp_video_refresh(switch_rtp_t *rtp_session)
return
;
}
if
(
rtp_session
->
flags
[
SWITCH_RTP_FLAG_VIDEO
]
&&
(
rtp_session
->
ice
.
ice_user
||
rtp_session
->
flags
[
SWITCH_RTP_FLAG_FIR
]))
{
if
(
rtp_session
->
flags
[
SWITCH_RTP_FLAG_VIDEO
]
&&
(
rtp_session
->
ice
.
ice_user
||
rtp_session
->
flags
[
SWITCH_RTP_FLAG_FIR
]))
{
rtp_session
->
fir_count
++
;
}
}
...
...
@@ -4038,8 +4049,7 @@ SWITCH_DECLARE(void) switch_rtp_video_loss(switch_rtp_t *rtp_session)
return
;
}
if
(
rtp_session
->
flags
[
SWITCH_RTP_FLAG_VIDEO
]
&&
(
rtp_session
->
ice
.
ice_user
||
rtp_session
->
flags
[
SWITCH_RTP_FLAG_PLI
]))
{
if
(
rtp_session
->
flags
[
SWITCH_RTP_FLAG_VIDEO
]
&&
(
rtp_session
->
ice
.
ice_user
||
rtp_session
->
flags
[
SWITCH_RTP_FLAG_PLI
]))
{
rtp_session
->
pli_count
++
;
}
}
...
...
@@ -6943,7 +6953,7 @@ static int rtp_common_write(switch_rtp_t *rtp_session,
if
(
rtp_session
->
flags
[
SWITCH_RTP_FLAG_NACK
])
{
if
(
!
rtp_session
->
vbw
)
{
switch_vb_create
(
&
rtp_session
->
vbw
,
5
,
5
);
switch_vb_create
(
&
rtp_session
->
vbw
,
5
,
5
,
rtp_session
->
pool
);
//switch_vb_debug_level(rtp_session->vbw, 10);
}
switch_vb_put_packet
(
rtp_session
->
vbw
,
(
switch_rtp_packet_t
*
)
send_msg
,
bytes
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论