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
6a95562d
Commit
6a95562d
authored
Apr 01, 2021
by
ziyue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
稍微调整
parent
fd23a87c
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
20 行增加
和
46 行删除
+20
-46
webrtc/Sdp.cpp
+2
-2
webrtc/WebRtcTransport.cpp
+18
-42
webrtc/WebRtcTransport.h
+0
-2
没有找到文件。
webrtc/Sdp.cpp
查看文件 @
6a95562d
...
...
@@ -1148,7 +1148,7 @@ RtcMedia *RtcSession::getMedia(TrackType type){
void
RtcConfigure
::
RtcTrackConfigure
::
setDefaultSetting
(
TrackType
type
){
enable
=
true
;
rtcp_mux
=
true
;
rtcp_rsize
=
tru
e
;
rtcp_rsize
=
fals
e
;
group_bundle
=
true
;
unified_plan
=
false
;
support_rtx
=
true
;
...
...
@@ -1176,7 +1176,7 @@ void RtcConfigure::RtcTrackConfigure::setDefaultSetting(TrackType type){
break
;
}
case
TrackApplication
:
{
enable
=
tru
e
;
enable
=
fals
e
;
break
;
}
default
:
break
;
...
...
webrtc/WebRtcTransport.cpp
查看文件 @
6a95562d
...
...
@@ -103,53 +103,29 @@ std::string WebRtcTransport::getAnswerSdp(const string &offer){
}
else
{
throw
std
::
invalid_argument
(
"支持group BUNDLE模式"
);
}
SdpAttrCandidate
candidate
;
candidate
.
foundation
=
"udpcandidate"
;
candidate
.
component
=
1
;
candidate
.
transport
=
"udp"
;
candidate
.
priority
=
getSSRC
();
candidate
.
address
=
getIP
();
candidate
.
port
=
getPort
();
candidate
.
type
=
"host"
;
for
(
auto
&
m
:
_answer_sdp
->
media
)
{
m
.
candidate
.
emplace_back
(
candidate
);
m
.
port
=
getPort
();
m
.
rtcp_addr
.
address
=
getIP
();
m
.
rtcp_addr
.
port
=
getPort
();
m
.
addr
.
address
=
getIP
();
}
_answer_sdp
->
connection
.
address
=
getIP
();
auto
str
=
_answer_sdp
->
toString
();
InfoL
<<
"
\r\n
"
<<
str
;
return
str
;
}
std
::
string
WebRtcTransport
::
getOfferSdp
()
{
RTC
::
DtlsTransport
::
Fingerprint
remote_fingerprint
;
remote_fingerprint
.
algorithm
=
RTC
::
DtlsTransport
::
GetFingerprintAlgorithm
(
"sha-256"
);
remote_fingerprint
.
value
=
""
;
dtls_transport_
->
SetRemoteFingerprint
(
remote_fingerprint
);
char
sdp
[
1024
*
10
]
=
{
0
};
auto
ssrc
=
getSSRC
();
auto
ip
=
getIP
();
auto
pt
=
getPayloadType
();
auto
port
=
getPort
();
sprintf
(
sdp
,
"v=0
\r\n
"
"o=- 1495799811084970 1495799811084970 IN IP4 %s
\r\n
"
"s=Streaming Test
\r\n
"
"t=0 0
\r\n
"
"a=group:BUNDLE video
\r\n
"
"a=msid-semantic: WMS janus
\r\n
"
"m=video %u RTP/SAVPF %u
\r\n
"
"c=IN IP4 %s
\r\n
"
"a=mid:video
\r\n
"
"a=sendonly
\r\n
"
"a=rtcp-mux
\r\n
"
"a=ice-lite
\r\n
"
"a=ice-ufrag:%s
\r\n
"
"a=ice-pwd:%s
\r\n
"
"a=ice-options:trickle
\r\n
"
"a=fingerprint:sha-256 %s
\r\n
"
"a=setup:actpass
\r\n
"
"a=connection:new
\r\n
"
"a=rtpmap:%u H264/90000
\r\n
"
"a=ssrc:%u cname:janusvideo
\r\n
"
"a=ssrc:%u msid:janus janusv0
\r\n
"
"a=ssrc:%u mslabel:janus
\r\n
"
"a=ssrc:%u label:janusv0
\r\n
"
"a=candidate:%s 1 udp %u %s %u typ %s
\r\n
"
,
ip
.
c_str
(),
port
,
pt
,
ip
.
c_str
(),
ice_server_
->
GetUsernameFragment
().
c_str
(),
ice_server_
->
GetPassword
().
c_str
(),
""
,
pt
,
ssrc
,
ssrc
,
ssrc
,
ssrc
,
"4"
,
ssrc
,
ip
.
c_str
(),
port
,
"host"
);
return
sdp
;
}
bool
is_dtls
(
char
*
buf
)
{
return
((
*
buf
>
19
)
&&
(
*
buf
<
64
));
}
...
...
webrtc/WebRtcTransport.h
查看文件 @
6a95562d
...
...
@@ -20,8 +20,6 @@ public:
std
::
string
getAnswerSdp
(
const
string
&
offer
);
std
::
string
getOfferSdp
();
/// 收到udp数据
/// \param buf
/// \param len
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论