Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
1442aeb4
提交
1442aeb4
authored
7月 21, 2015
作者:
William King
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-7860 #resolve
上级
d1693662
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
60 行增加
和
60 行删除
+60
-60
switch_rtp.h
src/include/switch_rtp.h
+41
-41
switch_rtp.c
src/switch_rtp.c
+19
-19
没有找到文件。
src/include/switch_rtp.h
浏览文件 @
1442aeb4
...
...
@@ -113,56 +113,56 @@ typedef struct ice_s {
}
ice_t
;
typedef
enum
{
/* RTCP Control Packet types (PT) http://www.iana.org/assignments/rtp-parameters/rtp-parameters.xhtml#rtp-parameters-4 */
RTCP_PT_IJ
=
195
,
/* IJ: Extended inter-arrival jitter report RFC5450*/
RTCP_PT_SR
=
200
,
/* SR: sender report RFC3550 */
RTCP_PT_RR
=
201
,
/* RR: receiver report RFC3550 */
RTCP_PT_SDES
=
202
,
/* SDES: source description RFC3550 */
RTPC
_PT_BYE
=
203
,
/* BYE: goodbye RFC3550 */
RTCP_PT_APP
=
204
,
/* APP: application-defined RFC3550 */
RTCP_PT_RTPFB
=
205
,
/* RTPFB: RTCP Transport layer FB message RFC4585 */
RTCP_PT_PSFB
=
206
,
/* PSFB: RTCP Payload-specific FB message RFC4585 */
RTCP_PT_XR
=
207
,
/* XR: extended report RFC3611 */
RTCP_PT_AVB
=
208
,
/* AVB: "Standard for Layer 3 Transport Protocol for Time Sensitive Applications in Local Area Networks." Work in progress. */
RTCP_PT_RSI
=
209
,
/* RSI: Receiver Summary Information RFC5760 */
RTCP_PT_TOKEN
=
210
,
/* TOKEN: Port Mapping RFC6284 */
RTCP_PT_IDMS
=
211
,
/* IDMS: IDMS Settings RFC7272 */
RTCP_PT_LAST
=
255
/* RESERVED */
_
RTCP_PT_IJ
=
195
,
/* IJ: Extended inter-arrival jitter report RFC5450*/
_
RTCP_PT_SR
=
200
,
/* SR: sender report RFC3550 */
_
RTCP_PT_RR
=
201
,
/* RR: receiver report RFC3550 */
_
RTCP_PT_SDES
=
202
,
/* SDES: source description RFC3550 */
_RTCP
_PT_BYE
=
203
,
/* BYE: goodbye RFC3550 */
_
RTCP_PT_APP
=
204
,
/* APP: application-defined RFC3550 */
_
RTCP_PT_RTPFB
=
205
,
/* RTPFB: RTCP Transport layer FB message RFC4585 */
_
RTCP_PT_PSFB
=
206
,
/* PSFB: RTCP Payload-specific FB message RFC4585 */
_
RTCP_PT_XR
=
207
,
/* XR: extended report RFC3611 */
_
RTCP_PT_AVB
=
208
,
/* AVB: "Standard for Layer 3 Transport Protocol for Time Sensitive Applications in Local Area Networks." Work in progress. */
_
RTCP_PT_RSI
=
209
,
/* RSI: Receiver Summary Information RFC5760 */
_
RTCP_PT_TOKEN
=
210
,
/* TOKEN: Port Mapping RFC6284 */
_
RTCP_PT_IDMS
=
211
,
/* IDMS: IDMS Settings RFC7272 */
_
RTCP_PT_LAST
=
255
/* RESERVED */
}
rtcp_pt_t
;
typedef
enum
{
/* RTP SDES item types http://www.iana.org/assignments/rtp-parameters/rtp-parameters.xhtml#rtp-parameters-5 */
RTCP_SDES_END
=
0
,
/* END: end of sdes list RFC3550 */
RTCP_SDES_CNAME
=
1
,
/* CNAME: canonical name RFC3550 */
RTCP_SDES_NAME
=
2
,
/* NAME: user name RFC3550 */
RTCP_SDES_EMAIL
=
3
,
/* EMAIL: user's electronic mail address RFC3550 */
RTCP_SDES_PHONE
=
4
,
/* PHONE: user's phone number RFC3550 */
RTCP_SDES_LOC
=
5
,
/* LOC: geographic user location RFC3550 */
RTCP_SDES_TOOL
=
6
,
/* TOOL: name of application or tool RFC3550 */
RTCP_SDES_NOTE
=
7
,
/* NOTE: notice about the source RFC3550 */
RTCP_SDES_PRIV
=
8
,
/* PRIV: private extensions RFC3550 */
RTCP_SDES_H323
=
9
,
/* H323-CADDR: H.323 callable address [Vineet Kumar] */
RTCP_SDES_APSI
=
10
/* APSI: Application specific identifer RFC6776 */
_
RTCP_SDES_END
=
0
,
/* END: end of sdes list RFC3550 */
_
RTCP_SDES_CNAME
=
1
,
/* CNAME: canonical name RFC3550 */
_
RTCP_SDES_NAME
=
2
,
/* NAME: user name RFC3550 */
_
RTCP_SDES_EMAIL
=
3
,
/* EMAIL: user's electronic mail address RFC3550 */
_
RTCP_SDES_PHONE
=
4
,
/* PHONE: user's phone number RFC3550 */
_
RTCP_SDES_LOC
=
5
,
/* LOC: geographic user location RFC3550 */
_
RTCP_SDES_TOOL
=
6
,
/* TOOL: name of application or tool RFC3550 */
_
RTCP_SDES_NOTE
=
7
,
/* NOTE: notice about the source RFC3550 */
_
RTCP_SDES_PRIV
=
8
,
/* PRIV: private extensions RFC3550 */
_
RTCP_SDES_H323
=
9
,
/* H323-CADDR: H.323 callable address [Vineet Kumar] */
_
RTCP_SDES_APSI
=
10
/* APSI: Application specific identifer RFC6776 */
}
rtcp_sdes_t
;
typedef
enum
{
/* FMT Values for RTPFB Payload Types http://www.iana.org/assignments/rtp-parameters/rtp-parameters.xhtml#rtp-parameters-8 */
RTCP_RTPFB_NACK
=
1
,
/* Generic NACK: Generic negative acknowledgement RFC4585 */
RTCP_RTPFB_TMMBR
=
3
,
/* TMMBR: Temporary Maximum Media Stream Bit Rate Request RFC5104 */
RTCP_RTPFB_TMMBN
=
4
,
/* TMMBN: Temporary Maximum Media Stream Bit Rate Notification RFC5104 */
RTCP_RTPFB_SR_REQ
=
5
,
/* RTCP-SR-REQ: TCP Rapid Resynchronisation Request RFC6051*/
RTCP_RTPFB_RAMS
=
6
,
/* RAMS: Rapid Acquisition of Multicast Sessions RFC6285 */
RTCP_RTPFB_TLLEI
=
7
,
/* TLLEI: Transport-Layer Third-Party Loss Early Indication RFC6642 */
RTCP_RTPFB_ECN_FB
=
8
/* RTCP-ECN-FB: RTCP ECN Feedback RFC6679*/
_
RTCP_RTPFB_NACK
=
1
,
/* Generic NACK: Generic negative acknowledgement RFC4585 */
_
RTCP_RTPFB_TMMBR
=
3
,
/* TMMBR: Temporary Maximum Media Stream Bit Rate Request RFC5104 */
_
RTCP_RTPFB_TMMBN
=
4
,
/* TMMBN: Temporary Maximum Media Stream Bit Rate Notification RFC5104 */
_
RTCP_RTPFB_SR_REQ
=
5
,
/* RTCP-SR-REQ: TCP Rapid Resynchronisation Request RFC6051*/
_
RTCP_RTPFB_RAMS
=
6
,
/* RAMS: Rapid Acquisition of Multicast Sessions RFC6285 */
_
RTCP_RTPFB_TLLEI
=
7
,
/* TLLEI: Transport-Layer Third-Party Loss Early Indication RFC6642 */
_
RTCP_RTPFB_ECN_FB
=
8
/* RTCP-ECN-FB: RTCP ECN Feedback RFC6679*/
}
rtcp_rtpfb_t
;
typedef
enum
{
/* FMT Values for PSFB Payload Types http://www.iana.org/assignments/rtp-parameters/rtp-parameters.xhtml#rtp-parameters-9 */
RTCP_PSFB_PLI
=
1
,
/* PLI: Picture Loss Indication RFC4585 */
RTCP_PSFB_SLI
=
2
,
/* SLI: Slice Loss Indication RFC4585 */
RTCP_PSFB_RPSI
=
3
,
/* RPSI: Reference Picture Selection Indication RFC4585 */
RTCP_PSFB_FIR
=
4
,
/* FIR: Full Intra Request Command RFC5104 */
RTCP_PSFB_TSTR
=
5
,
/* TSTR: Temporal-Spatial Trade-off Request RFC5104 */
RTCP_PSFB_TSTN
=
6
,
/* TSTN: Temporal-Spatial Trade-off Notification RFC5104 */
RTCP_PSFB_VBCM
=
7
,
/* VBCM: Video Back Channel Message RFC5104 */
RTCP_PSFB_PSLEI
=
8
,
/* PSLEI: Payload-Specific Third-Party Loss Early Indication RFC6642*/
RTCP_PSFB_AFB
=
15
/* AFB Application layer FB */
_
RTCP_PSFB_PLI
=
1
,
/* PLI: Picture Loss Indication RFC4585 */
_
RTCP_PSFB_SLI
=
2
,
/* SLI: Slice Loss Indication RFC4585 */
_
RTCP_PSFB_RPSI
=
3
,
/* RPSI: Reference Picture Selection Indication RFC4585 */
_
RTCP_PSFB_FIR
=
4
,
/* FIR: Full Intra Request Command RFC5104 */
_
RTCP_PSFB_TSTR
=
5
,
/* TSTR: Temporal-Spatial Trade-off Request RFC5104 */
_
RTCP_PSFB_TSTN
=
6
,
/* TSTN: Temporal-Spatial Trade-off Notification RFC5104 */
_
RTCP_PSFB_VBCM
=
7
,
/* VBCM: Video Back Channel Message RFC5104 */
_
RTCP_PSFB_PSLEI
=
8
,
/* PSLEI: Payload-Specific Third-Party Loss Early Indication RFC6642*/
_
RTCP_PSFB_AFB
=
15
/* AFB Application layer FB */
}
rtcp_psfb_t
;
...
...
src/switch_rtp.c
浏览文件 @
1442aeb4
...
...
@@ -1969,14 +1969,14 @@ static int check_rtcp_and_ice(switch_rtp_t *rtp_session)
if
(
!
rtp_session
->
stats
.
rtcp
.
sent_pkt_count
)
{
rtp_session
->
rtcp_send_msg
.
header
.
type
=
RTCP_PT_RR
;
/* Receiver report */
rtp_session
->
rtcp_send_msg
.
header
.
type
=
_
RTCP_PT_RR
;
/* Receiver report */
rr
=
(
struct
switch_rtcp_receiver_report
*
)
rtp_session
->
rtcp_send_msg
.
body
;
rr
->
ssrc
=
htonl
(
rtp_session
->
ssrc
);
rtcp_report_block
=
&
rr
->
report_block
;
rtcp_bytes
+=
sizeof
(
struct
switch_rtcp_report_block
);
}
else
{
struct
switch_rtcp_sender_info
*
rtcp_sender_info
;
rtp_session
->
rtcp_send_msg
.
header
.
type
=
RTCP_PT_SR
;
/* Sender report */
rtp_session
->
rtcp_send_msg
.
header
.
type
=
_
RTCP_PT_SR
;
/* Sender report */
sr
=
(
struct
switch_rtcp_sender_report
*
)
rtp_session
->
rtcp_send_msg
.
body
;
sr
->
ssrc
=
htonl
(
rtp_session
->
ssrc
);
rtcp_sender_info
=
&
sr
->
sender_info
;
...
...
@@ -2006,8 +2006,8 @@ static int check_rtcp_and_ice(switch_rtp_t *rtp_session)
ext_hdr
->
version
=
2
;
ext_hdr
->
p
=
0
;
ext_hdr
->
fmt
=
RTCP_PSFB_PLI
;
ext_hdr
->
pt
=
RTCP_PT_PSFB
;
ext_hdr
->
fmt
=
_
RTCP_PSFB_PLI
;
ext_hdr
->
pt
=
_
RTCP_PT_PSFB
;
ext_hdr
->
send_ssrc
=
htonl
(
rtp_session
->
ssrc
);
ext_hdr
->
recv_ssrc
=
htonl
(
rtp_session
->
remote_ssrc
);
...
...
@@ -2027,8 +2027,8 @@ static int check_rtcp_and_ice(switch_rtp_t *rtp_session)
ext_hdr
->
version
=
2
;
ext_hdr
->
p
=
0
;
ext_hdr
->
fmt
=
RTCP_RTPFB_NACK
;
ext_hdr
->
pt
=
RTCP_PT_RTPFB
;
ext_hdr
->
fmt
=
_
RTCP_RTPFB_NACK
;
ext_hdr
->
pt
=
_
RTCP_PT_RTPFB
;
ext_hdr
->
send_ssrc
=
htonl
(
rtp_session
->
ssrc
);
ext_hdr
->
recv_ssrc
=
htonl
(
rtp_session
->
remote_ssrc
);
ext_hdr
->
length
=
htons
(
3
);
...
...
@@ -2056,8 +2056,8 @@ static int check_rtcp_and_ice(switch_rtp_t *rtp_session)
ext_hdr
->
version
=
2
;
ext_hdr
->
p
=
0
;
ext_hdr
->
fmt
=
RTCP_PSFB_FIR
;
ext_hdr
->
pt
=
RTCP_PT_PSFB
;
ext_hdr
->
fmt
=
_
RTCP_PSFB_FIR
;
ext_hdr
->
pt
=
_
RTCP_PT_PSFB
;
ext_hdr
->
send_ssrc
=
htonl
(
rtp_session
->
ssrc
);
ext_hdr
->
recv_ssrc
=
0
;
...
...
@@ -2091,18 +2091,18 @@ static int check_rtcp_and_ice(switch_rtp_t *rtp_session)
ext_hdr
->
version
=
2
;
ext_hdr
->
p
=
0
;
ext_hdr
->
pt
=
RTCP_PT_RTPFB
;
ext_hdr
->
pt
=
_
RTCP_PT_RTPFB
;
ext_hdr
->
send_ssrc
=
htonl
(
rtp_session
->
ssrc
);
ext_hdr
->
recv_ssrc
=
0
;
if
(
rtp_session
->
tmmbr
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
rtp_session
->
session
),
SWITCH_LOG_DEBUG1
,
"Sending RTCP TMMBR %u
\n
"
,
rtp_session
->
tmmbr
);
ext_hdr
->
fmt
=
RTCP_RTPFB_TMMBR
;
ext_hdr
->
fmt
=
_
RTCP_RTPFB_TMMBR
;
bps
=
rtp_session
->
tmmbr
;
rtp_session
->
tmmbr
=
0
;
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
rtp_session
->
session
),
SWITCH_LOG_DEBUG1
,
"Sending RTCP TMMBN %u
\n
"
,
rtp_session
->
tmmbr
);
ext_hdr
->
fmt
=
RTCP_RTPFB_TMMBN
;
ext_hdr
->
fmt
=
_
RTCP_RTPFB_TMMBN
;
bps
=
rtp_session
->
tmmbn
;
rtp_session
->
tmmbn
=
0
;
}
...
...
@@ -2120,7 +2120,7 @@ static int check_rtcp_and_ice(switch_rtp_t *rtp_session)
p
=
(
uint8_t
*
)
(
&
rtp_session
->
rtcp_send_msg
)
+
rtcp_bytes
;
sdes
=
(
switch_rtcp_hdr_t
*
)
p
;
sdes
->
version
=
2
;
sdes
->
type
=
RTCP_PT_SDES
;
sdes
->
type
=
_
RTCP_PT_SDES
;
sdes
->
count
=
1
;
sdes
->
p
=
0
;
p
=
(
uint8_t
*
)
(
sdes
)
+
sdes_bytes
;
...
...
@@ -2131,7 +2131,7 @@ static int check_rtcp_and_ice(switch_rtp_t *rtp_session)
p
=
(
uint8_t
*
)
(
sdes
)
+
sdes_bytes
;
unit
=
(
switch_rtcp_sdes_unit_t
*
)
p
;
unit
->
type
=
RTCP_SDES_CNAME
;
unit
->
type
=
_
RTCP_SDES_CNAME
;
snprintf
((
char
*
)
unit
->
value
,
80
,
"%x"
,
rtp_session
->
ssrc
);
unit
->
length
=
strlen
((
char
*
)
unit
->
value
);
sdes_bytes
+=
sizeof
(
switch_rtcp_sdes_unit_t
)
+
unit
->
length
;
...
...
@@ -2139,7 +2139,7 @@ static int check_rtcp_and_ice(switch_rtp_t *rtp_session)
p
+=
sizeof
(
switch_rtcp_sdes_unit_t
)
+
unit
->
length
;
unit
=
(
switch_rtcp_sdes_unit_t
*
)
p
;
unit
->
type
=
RTCP_SDES_NOTE
;
unit
->
type
=
_
RTCP_SDES_NOTE
;
snprintf
((
char
*
)
unit
->
value
,
80
,
"FreeSWITCH.org -- Come to ClueCon.com"
);
unit
->
length
=
strlen
((
char
*
)
unit
->
value
);
sdes_bytes
+=
sizeof
(
switch_rtcp_sdes_unit_t
)
+
unit
->
length
;
...
...
@@ -5590,20 +5590,20 @@ static switch_status_t process_rtcp_report(switch_rtp_t *rtp_session, rtcp_msg_t
"RTCP packet bytes %"
SWITCH_SIZE_T_FMT
" type %d pad %d
\n
"
,
bytes
,
msg
->
header
.
type
,
msg
->
header
.
p
);
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
;
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
rtp_session
->
session
),
SWITCH_LOG_DEBUG1
,
"PICKED UP XRTCP type: %d fmt: %d
\n
"
,
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
))
{
switch_core_media_gen_key_frame
(
rtp_session
->
session
);
if
(
rtp_session
->
vbw
)
{
switch_vb_reset
(
rtp_session
->
vbw
);
}
}
if
(
msg
->
header
.
type
==
RTCP_PT_RTPFB
&&
extp
->
header
.
fmt
==
RTCP_RTPFB_NACK
)
{
if
(
msg
->
header
.
type
==
_RTCP_PT_RTPFB
&&
extp
->
header
.
fmt
==
_
RTCP_RTPFB_NACK
)
{
uint32_t
*
nack
=
(
uint32_t
*
)
extp
->
body
;
int
i
;
...
...
@@ -5620,7 +5620,7 @@ static switch_status_t process_rtcp_report(switch_rtp_t *rtp_session, rtcp_msg_t
}
else
if
(
msg
->
header
.
type
==
RTCP_PT_SR
||
msg
->
header
.
type
==
RTCP_PT_RR
)
{
if
(
msg
->
header
.
type
==
_RTCP_PT_SR
||
msg
->
header
.
type
==
_
RTCP_PT_RR
)
{
struct
switch_rtcp_report_block
*
report_block
;
switch_time_t
now
;
switch_time_exp_t
now_hr
;
...
...
@@ -5634,7 +5634,7 @@ static switch_status_t process_rtcp_report(switch_rtp_t *rtp_session, rtcp_msg_t
ntp_usec
=
(
uint32_t
)(
now
-
(
sec
*
1000000
));
/* micro seconds */
lsr_now
=
(
uint32_t
)(
ntp_usec
*
0
.
065536
)
|
(
ntp_sec
&
0x0000ffff
)
<<
16
;
// 0.065536 is used for convertion from useconds
if
(
msg
->
header
.
type
==
RTCP_PT_SR
)
{
/* Sender report */
if
(
msg
->
header
.
type
==
_
RTCP_PT_SR
)
{
/* Sender report */
struct
switch_rtcp_sender_report
*
sr
=
(
struct
switch_rtcp_sender_report
*
)
msg
->
body
;
report_block
=
&
sr
->
report_block
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论