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
6d16ae91
Commit
6d16ae91
authored
Mar 30, 2021
by
ziyue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加rtc配置类
parent
2065b6fe
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
124 行增加
和
0 行删除
+124
-0
webrtc/Sdp.cpp
+80
-0
webrtc/Sdp.h
+44
-0
没有找到文件。
webrtc/Sdp.cpp
查看文件 @
6d16ae91
...
...
@@ -493,6 +493,7 @@ void SdpAttrExtmap::parse(const string &str) {
if
(
sscanf
(
str
.
data
(),
"%"
SCNd32
" %127s"
,
&
index
,
buf
)
!=
2
)
{
SDP_THROW
();
}
direction
=
RtpDirection
::
sendrecv
;
}
else
{
direction
=
getRtpDirection
(
direction_buf
);
}
...
...
@@ -1076,4 +1077,82 @@ void RtcSession::checkValid() const{
for
(
auto
&
item
:
media
)
{
item
.
checkValid
();
}
}
void
RtcConfigure
::
RtcTrackConfigure
::
setDefaultSetting
(
TrackType
type
){
enable
=
true
;
rtcp_mux
=
true
;
rtcp_rsize
=
false
;
group_bundle
=
true
;
unified_plan
=
false
;
support_rtx
=
true
;
support_red
=
false
;
support_ulpfec
=
false
;
support_simulcast
=
false
;
ice_lite
=
true
;
ice_trickle
=
true
;
ice_renomination
=
false
;
switch
(
type
)
{
case
TrackVideo
:
{
preferred_codec
=
{
CodecAAC
,
CodecOpus
,
CodecG711U
,
CodecG711A
};
rtcp_fb
=
{
"transport-cc"
};
extmap
=
{
"1 urn:ietf:params:rtp-hdrext:ssrc-audio-level"
};
break
;
}
case
TrackAudio
:
{
preferred_codec
=
{
CodecH264
,
CodecH265
};
rtcp_fb
=
{
"nack"
,
"ccm fir"
,
"nack pli"
,
"goog-remb"
,
"transport-cc"
};
extmap
=
{
"2 urn:ietf:params:rtp-hdrext:toffset"
,
"3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time"
,
"4 urn:3gpp:video-orientation"
,
"5 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01"
,
"6 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay"
};
break
;
}
case
TrackApplication
:
{
enable
=
false
;
break
;
}
default
:
break
;
}
}
void
RtcConfigure
::
setDefaultSetting
(
string
ice_ufrag
,
string
ice_pwd
,
DtlsRole
role
,
RtpDirection
direction
,
const
SdpAttrFingerprint
&
fingerprint
)
{
video
.
setDefaultSetting
(
TrackVideo
);
audio
.
setDefaultSetting
(
TrackAudio
);
application
.
setDefaultSetting
(
TrackApplication
);
video
.
ice_ufrag
=
audio
.
ice_ufrag
=
application
.
ice_ufrag
=
ice_ufrag
;
video
.
ice_pwd
=
audio
.
ice_pwd
=
application
.
ice_pwd
=
ice_ufrag
;
video
.
role
=
audio
.
role
=
application
.
role
=
role
;
video
.
direction
=
audio
.
direction
=
application
.
direction
=
direction
;
video
.
fingerprint
=
audio
.
fingerprint
=
application
.
fingerprint
=
fingerprint
;
}
void
RtcConfigure
::
addCandidate
(
const
SdpAttrCandidate
&
candidate
,
TrackType
type
)
{
switch
(
type
)
{
case
TrackAudio
:
{
audio
.
candidate
.
emplace_back
(
candidate
);
break
;
}
case
TrackVideo
:
{
video
.
candidate
.
emplace_back
(
candidate
);
break
;
}
case
TrackApplication
:
{
application
.
candidate
.
emplace_back
(
candidate
);
break
;
}
default
:
{
audio
.
candidate
.
emplace_back
(
candidate
);
video
.
candidate
.
emplace_back
(
candidate
);
application
.
candidate
.
emplace_back
(
candidate
);
break
;
}
}
}
\ No newline at end of file
webrtc/Sdp.h
查看文件 @
6d16ae91
...
...
@@ -609,5 +609,49 @@ public:
void
checkValid
()
const
;
};
class
RtcConfigure
{
public
:
class
RtcTrackConfigure
{
public
:
bool
enable
;
bool
rtcp_mux
;
bool
rtcp_rsize
;
bool
group_bundle
;
bool
unified_plan
;
bool
support_rtx
;
bool
support_red
;
bool
support_ulpfec
;
bool
support_simulcast
;
bool
ice_lite
;
bool
ice_trickle
;
bool
ice_renomination
;
string
ice_ufrag
;
string
ice_pwd
;
DtlsRole
role
{
DtlsRole
::
invalid
};
RtpDirection
direction
{
RtpDirection
::
invalid
};
SdpAttrFingerprint
fingerprint
;
vector
<
string
>
rtcp_fb
;
vector
<
CodecId
>
preferred_codec
;
vector
<
string
>
extmap
;
vector
<
SdpAttrCandidate
>
candidate
;
void
setDefaultSetting
(
TrackType
type
);
};
RtcTrackConfigure
video
;
RtcTrackConfigure
audio
;
RtcTrackConfigure
application
;
void
setDefaultSetting
(
string
ice_ufrag
,
string
ice_pwd
,
DtlsRole
role
,
RtpDirection
direction
,
const
SdpAttrFingerprint
&
fingerprint
);
void
addCandidate
(
const
SdpAttrCandidate
&
candidate
,
TrackType
type
=
TrackInvalid
);
};
#endif //ZLMEDIAKIT_SDP_H
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论