Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
ZLMediaKit
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
张翔宇
ZLMediaKit
Commits
d4ce5b00
Commit
d4ce5b00
authored
May 10, 2021
by
xia-chu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加ssrc相关的方法
parent
985fe310
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
23 行增加
和
0 行删除
+23
-0
webrtc/Sdp.cpp
+18
-0
webrtc/Sdp.h
+5
-0
没有找到文件。
webrtc/Sdp.cpp
查看文件 @
d4ce5b00
...
...
@@ -1290,6 +1290,9 @@ void RtcMedia::checkValid() const{
CHECK
(
!
proto
.
empty
());
CHECK
(
direction
!=
RtpDirection
::
invalid
||
type
==
TrackApplication
);
CHECK
(
!
plan
.
empty
()
||
type
==
TrackApplication
);
}
void
RtcMedia
::
checkValidSSRC
()
const
{
bool
send_rtp
=
(
direction
==
RtpDirection
::
sendonly
||
direction
==
RtpDirection
::
sendrecv
);
if
(
rtp_rids
.
empty
()
&&
rtp_ssrc_sim
.
empty
())
{
//非simulcast时,检查有没有指定rtp ssrc
...
...
@@ -1318,6 +1321,12 @@ void RtcSession::checkValid() const{
}
}
void
RtcSession
::
checkValidSSRC
()
const
{
for
(
auto
&
item
:
media
)
{
item
.
checkValidSSRC
();
}
}
const
RtcMedia
*
RtcSession
::
getMedia
(
TrackType
type
)
const
{
for
(
auto
&
m
:
media
){
if
(
m
.
type
==
type
){
...
...
@@ -1327,6 +1336,15 @@ const RtcMedia *RtcSession::getMedia(TrackType type) const{
return
nullptr
;
}
bool
RtcSession
::
haveSSRC
()
const
{
for
(
auto
&
m
:
media
)
{
if
(
!
m
.
rtp_rtx_ssrc
.
empty
())
{
return
true
;
}
}
return
false
;
}
bool
RtcSession
::
supportRtcpFb
(
const
string
&
name
,
TrackType
type
)
const
{
auto
media
=
getMedia
(
type
);
if
(
!
media
)
{
...
...
webrtc/Sdp.h
查看文件 @
d4ce5b00
...
...
@@ -640,6 +640,8 @@ public:
uint32_t
sctp_port
{
0
};
void
checkValid
()
const
;
//offer sdp,如果指定了发送rtp,那么应该指定ssrc
void
checkValidSSRC
()
const
;
const
RtcCodecPlan
*
getPlan
(
uint8_t
pt
)
const
;
const
RtcCodecPlan
*
getPlan
(
const
char
*
codec
)
const
;
const
RtcCodecPlan
*
getRelatedRtxPlan
(
uint8_t
pt
)
const
;
...
...
@@ -662,9 +664,12 @@ public:
void
loadFrom
(
const
string
&
sdp
,
bool
check
=
true
);
void
checkValid
()
const
;
//offer sdp,如果指定了发送rtp,那么应该指定ssrc
void
checkValidSSRC
()
const
;
string
toString
()
const
;
string
toRtspSdp
()
const
;
const
RtcMedia
*
getMedia
(
TrackType
type
)
const
;
bool
haveSSRC
()
const
;
bool
supportRtcpFb
(
const
string
&
name
,
TrackType
type
=
TrackType
::
TrackVideo
)
const
;
private
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论