Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
42e7b81b
提交
42e7b81b
authored
4月 08, 2015
作者:
Anthony Minessale
提交者:
Michael Jerris
5月 28, 2015
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-7500 FS-7508: move debug logging to DEBUG1
上级
69013297
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
16 行增加
和
16 行删除
+16
-16
mod_vpx.c
src/mod/codecs/mod_vpx/mod_vpx.c
+7
-7
switch_rtp.c
src/switch_rtp.c
+9
-9
没有找到文件。
src/mod/codecs/mod_vpx/mod_vpx.c
浏览文件 @
42e7b81b
...
@@ -320,7 +320,7 @@ static switch_status_t init_encoder(switch_codec_t *codec)
...
@@ -320,7 +320,7 @@ static switch_status_t init_encoder(switch_codec_t *codec)
context
->
pkt
=
NULL
;
context
->
pkt
=
NULL
;
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
codec
->
session
),
SWITCH_LOG_
NOTICE
,
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
codec
->
session
),
SWITCH_LOG_
DEBUG1
,
"VPX reset encoder picture from %dx%d to %dx%d %u BW
\n
"
,
"VPX reset encoder picture from %dx%d to %dx%d %u BW
\n
"
,
config
->
g_w
,
config
->
g_h
,
context
->
codec_settings
.
video
.
width
,
context
->
codec_settings
.
video
.
height
,
context
->
bandwidth
);
config
->
g_w
,
config
->
g_h
,
context
->
codec_settings
.
video
.
width
,
context
->
codec_settings
.
video
.
height
,
context
->
bandwidth
);
...
@@ -640,7 +640,7 @@ static switch_status_t switch_vpx_encode(switch_codec_t *codec, switch_frame_t *
...
@@ -640,7 +640,7 @@ static switch_status_t switch_vpx_encode(switch_codec_t *codec, switch_frame_t *
// force generate a key frame
// force generate a key frame
if
(
!
context
->
last_key_frame
||
(
now
-
context
->
last_key_frame
)
>
KEY_FRAME_MIN_FREQ
)
{
if
(
!
context
->
last_key_frame
||
(
now
-
context
->
last_key_frame
)
>
KEY_FRAME_MIN_FREQ
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_
NOTICE
,
"VPX KEYFRAME GENERATED
\n
"
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_
DEBUG1
,
"VPX KEYFRAME GENERATED
\n
"
);
vpx_flags
|=
VPX_EFLAG_FORCE_KF
;
vpx_flags
|=
VPX_EFLAG_FORCE_KF
;
context
->
need_key_frame
=
0
;
context
->
need_key_frame
=
0
;
context
->
last_key_frame
=
now
;
context
->
last_key_frame
=
now
;
...
@@ -700,7 +700,7 @@ static switch_status_t buffer_vp8_packets(vpx_context_t *context, switch_frame_t
...
@@ -700,7 +700,7 @@ static switch_status_t buffer_vp8_packets(vpx_context_t *context, switch_frame_t
if
(
!
switch_buffer_inuse
(
context
->
vpx_packet_buffer
)
&&
!
S
)
{
if
(
!
switch_buffer_inuse
(
context
->
vpx_packet_buffer
)
&&
!
S
)
{
if
(
context
->
got_key_frame
>
0
)
{
if
(
context
->
got_key_frame
>
0
)
{
context
->
got_key_frame
=
0
;
context
->
got_key_frame
=
0
;
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_
WARNING
,
"packet loss?
\n
"
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_
DEBUG2
,
"packet loss?
\n
"
);
}
}
return
SWITCH_STATUS_MORE_DATA
;
return
SWITCH_STATUS_MORE_DATA
;
}
}
...
@@ -718,7 +718,7 @@ static switch_status_t buffer_vp8_packets(vpx_context_t *context, switch_frame_t
...
@@ -718,7 +718,7 @@ static switch_status_t buffer_vp8_packets(vpx_context_t *context, switch_frame_t
}
}
if
(
context
->
last_received_timestamp
!=
frame
->
timestamp
)
{
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_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_
DEBUG2
,
"wrong timestamp %u, expect %u, packet loss?
\n
"
,
frame
->
timestamp
,
context
->
last_received_timestamp
);
switch_buffer_zero
(
context
->
vpx_packet_buffer
);
switch_buffer_zero
(
context
->
vpx_packet_buffer
);
return
SWITCH_STATUS_RESTART
;
return
SWITCH_STATUS_RESTART
;
}
}
...
@@ -737,12 +737,12 @@ static switch_status_t buffer_vp9_packets(vpx_context_t *context, switch_frame_t
...
@@ -737,12 +737,12 @@ static switch_status_t buffer_vp9_packets(vpx_context_t *context, switch_frame_t
if
(
switch_buffer_inuse
(
context
->
vpx_packet_buffer
))
{
// middle packet
if
(
switch_buffer_inuse
(
context
->
vpx_packet_buffer
))
{
// middle packet
if
(
IS_VP9_START_PKT
(
*
vp9
))
{
if
(
IS_VP9_START_PKT
(
*
vp9
))
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_
WARNING
,
"got invalid vp9 packet, packet loss? resetting buffer
\n
"
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_
DEBUG1
,
"got invalid vp9 packet, packet loss? resetting buffer
\n
"
);
switch_buffer_zero
(
context
->
vpx_packet_buffer
);
switch_buffer_zero
(
context
->
vpx_packet_buffer
);
}
}
}
else
{
// start packet
}
else
{
// start packet
if
(
!
IS_VP9_START_PKT
(
*
vp9
))
{
if
(
!
IS_VP9_START_PKT
(
*
vp9
))
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_
WARNING
,
"got invalid vp9 packet, packet loss? waiting for a start packet
\n
"
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_
DEBUG1
,
"got invalid vp9 packet, packet loss? waiting for a start packet
\n
"
);
goto
end
;
goto
end
;
}
}
}
}
...
@@ -805,7 +805,7 @@ static switch_status_t switch_vpx_decode(switch_codec_t *codec, switch_frame_t *
...
@@ -805,7 +805,7 @@ static switch_status_t switch_vpx_decode(switch_codec_t *codec, switch_frame_t *
}
}
}
else
if
(
context
->
got_key_frame
<=
0
)
{
}
else
if
(
context
->
got_key_frame
<=
0
)
{
if
((
--
context
->
got_key_frame
%
200
)
==
0
)
{
if
((
--
context
->
got_key_frame
%
200
)
==
0
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_
WARNING
,
"Waiting for key frame %d
\n
"
,
context
->
got_key_frame
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_
DEBUG1
,
"Waiting for key frame %d
\n
"
,
context
->
got_key_frame
);
}
}
switch_goto_status
(
SWITCH_STATUS_MORE_DATA
,
end
);
switch_goto_status
(
SWITCH_STATUS_MORE_DATA
,
end
);
}
}
...
...
src/switch_rtp.c
浏览文件 @
42e7b81b
...
@@ -1913,7 +1913,7 @@ static int check_rtcp_and_ice(switch_rtp_t *rtp_session)
...
@@ -1913,7 +1913,7 @@ static int check_rtcp_and_ice(switch_rtp_t *rtp_session)
ext_hdr
->
send_ssrc
=
htonl
(
rtp_session
->
ssrc
);
ext_hdr
->
send_ssrc
=
htonl
(
rtp_session
->
ssrc
);
ext_hdr
->
recv_ssrc
=
htonl
(
rtp_session
->
remote_ssrc
);
ext_hdr
->
recv_ssrc
=
htonl
(
rtp_session
->
remote_ssrc
);
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
rtp_session
->
session
),
SWITCH_LOG_DEBUG
,
"Sending RTCP PLI
\n
"
);
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
rtp_session
->
session
),
SWITCH_LOG_DEBUG
1
,
"Sending RTCP PLI
\n
"
);
ext_hdr
->
length
=
htons
((
uint8_t
)(
sizeof
(
switch_rtcp_ext_hdr_t
)
/
4
)
-
1
);
ext_hdr
->
length
=
htons
((
uint8_t
)(
sizeof
(
switch_rtcp_ext_hdr_t
)
/
4
)
-
1
);
rtcp_bytes
+=
sizeof
(
switch_rtcp_ext_hdr_t
);
rtcp_bytes
+=
sizeof
(
switch_rtcp_ext_hdr_t
);
...
@@ -1937,7 +1937,7 @@ static int check_rtcp_and_ice(switch_rtp_t *rtp_session)
...
@@ -1937,7 +1937,7 @@ static int check_rtcp_and_ice(switch_rtp_t *rtp_session)
nack
=
(
uint32_t
*
)
p
;
nack
=
(
uint32_t
*
)
p
;
*
nack
=
rtp_session
->
cur_nack
;
*
nack
=
rtp_session
->
cur_nack
;
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
rtp_session
->
session
),
SWITCH_LOG_DEBUG
,
"Sending RTCP NACK %u
\n
"
,
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
rtp_session
->
session
),
SWITCH_LOG_DEBUG
1
,
"Sending RTCP NACK %u
\n
"
,
ntohs
(
*
nack
&
0xFFFF
));
ntohs
(
*
nack
&
0xFFFF
));
rtcp_bytes
+=
sizeof
(
switch_rtcp_ext_hdr_t
)
+
sizeof
(
rtp_session
->
cur_nack
);
rtcp_bytes
+=
sizeof
(
switch_rtcp_ext_hdr_t
)
+
sizeof
(
rtp_session
->
cur_nack
);
...
@@ -1967,7 +1967,7 @@ static int check_rtcp_and_ice(switch_rtp_t *rtp_session)
...
@@ -1967,7 +1967,7 @@ static int check_rtcp_and_ice(switch_rtp_t *rtp_session)
fir
->
seq
=
rtp_session
->
fir_seq
;
fir
->
seq
=
rtp_session
->
fir_seq
;
fir
->
r1
=
fir
->
r2
=
fir
->
r3
=
0
;
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
"
,
rtp_session
->
fir_seq
);
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
rtp_session
->
session
),
SWITCH_LOG_DEBUG
1
,
"Sending RTCP FIR SEQ %d
\n
"
,
rtp_session
->
fir_seq
);
rtp_session
->
fir_seq
++
;
rtp_session
->
fir_seq
++
;
...
@@ -5103,7 +5103,7 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t
...
@@ -5103,7 +5103,7 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t
stat
=
srtp_unprotect
(
rtp_session
->
recv_ctx
[
rtp_session
->
srtp_idx_rtp
],
&
rtp_session
->
recv_msg
.
header
,
&
sbytes
);
stat
=
srtp_unprotect
(
rtp_session
->
recv_ctx
[
rtp_session
->
srtp_idx_rtp
],
&
rtp_session
->
recv_msg
.
header
,
&
sbytes
);
if
(
rtp_session
->
flags
[
SWITCH_RTP_FLAG_NACK
]
&&
stat
==
err_status_replay_fail
)
{
if
(
rtp_session
->
flags
[
SWITCH_RTP_FLAG_NACK
]
&&
stat
==
err_status_replay_fail
)
{
/* false alarm nack */
/* false alarm nack */
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
rtp_session
->
session
),
SWITCH_LOG_DEBUG
,
"REPLAY ERR, FALSE NACK
\n
"
);
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
rtp_session
->
session
),
SWITCH_LOG_DEBUG
1
,
"REPLAY ERR, FALSE NACK
\n
"
);
stat
=
0
;
stat
=
0
;
sbytes
=
0
;
sbytes
=
0
;
*
bytes
=
0
;
*
bytes
=
0
;
...
@@ -5299,7 +5299,7 @@ static void handle_nack(switch_rtp_t *rtp_session, uint32_t nack)
...
@@ -5299,7 +5299,7 @@ static void handle_nack(switch_rtp_t *rtp_session, uint32_t nack)
my_host
=
switch_get_addr
(
bufc
,
sizeof
(
bufc
),
rtp_session
->
local_addr
);
my_host
=
switch_get_addr
(
bufc
,
sizeof
(
bufc
),
rtp_session
->
local_addr
);
}
}
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
rtp_session
->
session
),
SWITCH_LOG_DEBUG
,
"Got NACK [%u][0x%x] for seq %u
\n
"
,
nack
,
nack
,
ntohs
(
seq
));
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
rtp_session
->
session
),
SWITCH_LOG_DEBUG
1
,
"Got NACK [%u][0x%x] for seq %u
\n
"
,
nack
,
nack
,
ntohs
(
seq
));
if
(
switch_vb_get_packet_by_seq
(
rtp_session
->
vbw
,
seq
,
(
switch_rtp_packet_t
*
)
send_msg
,
&
bytes
)
==
SWITCH_STATUS_SUCCESS
)
{
if
(
switch_vb_get_packet_by_seq
(
rtp_session
->
vbw
,
seq
,
(
switch_rtp_packet_t
*
)
send_msg
,
&
bytes
)
==
SWITCH_STATUS_SUCCESS
)
{
...
@@ -5317,13 +5317,13 @@ static void handle_nack(switch_rtp_t *rtp_session, uint32_t nack)
...
@@ -5317,13 +5317,13 @@ static void handle_nack(switch_rtp_t *rtp_session, uint32_t nack)
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "RE----SEND %u\n", ntohs(send_msg->header.seq));
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "RE----SEND %u\n", ntohs(send_msg->header.seq));
switch_rtp_write_raw
(
rtp_session
,
(
void
*
)
send_msg
,
&
bytes
,
SWITCH_FALSE
);
switch_rtp_write_raw
(
rtp_session
,
(
void
*
)
send_msg
,
&
bytes
,
SWITCH_FALSE
);
}
else
{
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
rtp_session
->
session
),
SWITCH_LOG_DEBUG
,
"Cannot send NACK for seq %u
\n
"
,
ntohs
(
seq
));
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
rtp_session
->
session
),
SWITCH_LOG_DEBUG
1
,
"Cannot send NACK for seq %u
\n
"
,
ntohs
(
seq
));
}
}
blp
=
ntohs
(
blp
);
blp
=
ntohs
(
blp
);
for
(
i
=
0
;
i
<
16
;
i
++
)
{
for
(
i
=
0
;
i
<
16
;
i
++
)
{
if
(
blp
&
(
1
<<
i
))
{
if
(
blp
&
(
1
<<
i
))
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
rtp_session
->
session
),
SWITCH_LOG_DEBUG
,
"Also Got NACK for seq %u
\n
"
,
ntohs
(
seq
)
+
i
+
1
);
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
rtp_session
->
session
),
SWITCH_LOG_DEBUG
1
,
"Also Got NACK for seq %u
\n
"
,
ntohs
(
seq
)
+
i
+
1
);
if
(
switch_vb_get_packet_by_seq
(
rtp_session
->
vbw
,
htons
(
ntohs
(
seq
)
+
i
+
1
),
(
switch_rtp_packet_t
*
)
&
send_msg
,
&
bytes
)
==
SWITCH_STATUS_SUCCESS
)
{
if
(
switch_vb_get_packet_by_seq
(
rtp_session
->
vbw
,
htons
(
ntohs
(
seq
)
+
i
+
1
),
(
switch_rtp_packet_t
*
)
&
send_msg
,
&
bytes
)
==
SWITCH_STATUS_SUCCESS
)
{
if
(
rtp_session
->
flags
[
SWITCH_RTP_FLAG_DEBUG_RTP_WRITE
])
{
if
(
rtp_session
->
flags
[
SWITCH_RTP_FLAG_DEBUG_RTP_WRITE
])
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG_CLEAN
(
rtp_session
->
session
),
SWITCH_LOG_CONSOLE
,
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG_CLEAN
(
rtp_session
->
session
),
SWITCH_LOG_CONSOLE
,
...
@@ -5339,7 +5339,7 @@ static void handle_nack(switch_rtp_t *rtp_session, uint32_t nack)
...
@@ -5339,7 +5339,7 @@ static void handle_nack(switch_rtp_t *rtp_session, uint32_t nack)
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "RE----SEND %u\n", ntohs(send_msg->header.seq));
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "RE----SEND %u\n", ntohs(send_msg->header.seq));
switch_rtp_write_raw
(
rtp_session
,
(
void
*
)
&
send_msg
,
&
bytes
,
SWITCH_FALSE
);
switch_rtp_write_raw
(
rtp_session
,
(
void
*
)
&
send_msg
,
&
bytes
,
SWITCH_FALSE
);
}
else
{
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
rtp_session
->
session
),
SWITCH_LOG_DEBUG
,
"Cannot send NACK for seq %u
\n
"
,
ntohs
(
seq
)
+
i
);
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
rtp_session
->
session
),
SWITCH_LOG_DEBUG
1
,
"Cannot send NACK for seq %u
\n
"
,
ntohs
(
seq
)
+
i
);
}
}
}
}
}
}
...
@@ -5356,7 +5356,7 @@ static switch_status_t process_rtcp_report(switch_rtp_t *rtp_session, rtcp_msg_t
...
@@ -5356,7 +5356,7 @@ static switch_status_t process_rtcp_report(switch_rtp_t *rtp_session, rtcp_msg_t
if
(
rtp_session
->
flags
[
SWITCH_RTP_FLAG_VIDEO
]
&&
(
msg
->
header
.
type
==
RTCP_PT_RTPFB
||
msg
->
header
.
type
==
RTCP_PT_PSFB
))
{
if
(
rtp_session
->
flags
[
SWITCH_RTP_FLAG_VIDEO
]
&&
(
msg
->
header
.
type
==
RTCP_PT_RTPFB
||
msg
->
header
.
type
==
RTCP_PT_PSFB
))
{
rtcp_ext_msg_t
*
extp
=
(
rtcp_ext_msg_t
*
)
msg
;
rtcp_ext_msg_t
*
extp
=
(
rtcp_ext_msg_t
*
)
msg
;
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
rtp_session
->
session
),
SWITCH_LOG_DEBUG
,
"PICKED UP XRTCP type: %d fmt: %d
\n
"
,
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
rtp_session
->
session
),
SWITCH_LOG_DEBUG
1
,
"PICKED UP XRTCP type: %d fmt: %d
\n
"
,
msg
->
header
.
type
,
extp
->
header
.
fmt
);
msg
->
header
.
type
,
extp
->
header
.
fmt
);
if
(
msg
->
header
.
type
==
RTCP_PT_PSFB
&&
(
extp
->
header
.
fmt
==
RTCP_PSFB_FIR
||
extp
->
header
.
fmt
==
RTCP_PSFB_PLI
))
{
if
(
msg
->
header
.
type
==
RTCP_PT_PSFB
&&
(
extp
->
header
.
fmt
==
RTCP_PSFB_FIR
||
extp
->
header
.
fmt
==
RTCP_PSFB_PLI
))
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论