Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
2bbca599
提交
2bbca599
authored
1月 03, 2017
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Code cleanup
上级
ddbe7e09
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
49 行增加
和
14 行删除
+49
-14
RtpSender.h
worker/include/RTC/RtpSender.h
+1
-2
Room.cpp
worker/src/RTC/Room.cpp
+4
-3
StunMessage.cpp
worker/src/RTC/StunMessage.cpp
+41
-6
UdpSocket.cpp
worker/src/RTC/UdpSocket.cpp
+1
-2
UnixStreamSocket.cpp
worker/src/handles/UnixStreamSocket.cpp
+2
-1
没有找到文件。
worker/include/RTC/RtpSender.h
浏览文件 @
2bbca599
...
@@ -66,8 +66,7 @@ namespace RTC
...
@@ -66,8 +66,7 @@ namespace RTC
std
::
unordered_map
<
uint8_t
,
uint8_t
>
mapPayloadTypes
;
std
::
unordered_map
<
uint8_t
,
uint8_t
>
mapPayloadTypes
;
// Whether this RtpSender is valid according to Peer capabilities.
// Whether this RtpSender is valid according to Peer capabilities.
bool
available
=
false
;
bool
available
=
false
;
// Sender Report holding the RTP stats.
// Sender Report holding the RTP stats
std
::
auto_ptr
<
RTC
::
RTCP
::
SenderReport
>
senderReport
;
std
::
auto_ptr
<
RTC
::
RTCP
::
SenderReport
>
senderReport
;
std
::
auto_ptr
<
RTC
::
RTCP
::
SdesChunk
>
sdesChunk
;
std
::
auto_ptr
<
RTC
::
RTCP
::
SdesChunk
>
sdesChunk
;
};
};
...
...
worker/src/RTC/Room.cpp
浏览文件 @
2bbca599
...
@@ -695,9 +695,10 @@ namespace RTC
...
@@ -695,9 +695,10 @@ namespace RTC
// Tell all the peers but the one in the argument to generate and send their RTCP.
// Tell all the peers but the one in the argument to generate and send their RTCP.
for
(
auto
it
=
this
->
peers
.
begin
();
it
!=
this
->
peers
.
end
();
it
++
)
for
(
auto
it
=
this
->
peers
.
begin
();
it
!=
this
->
peers
.
end
();
it
++
)
{
{
if
(
it
->
second
!=
peer
)
{
auto
current_peer
=
it
->
second
;
it
->
second
->
SendRtcp
();
}
if
(
current_peer
!=
peer
)
current_peer
->
SendRtcp
();
}
}
}
}
}
}
worker/src/RTC/StunMessage.cpp
浏览文件 @
2bbca599
...
@@ -132,39 +132,62 @@ namespace RTC
...
@@ -132,39 +132,62 @@ namespace RTC
switch
(
attr_type
)
switch
(
attr_type
)
{
{
case
Attribute
:
:
Username
:
case
Attribute
:
:
Username
:
{
msg
->
SetUsername
((
const
char
*
)
attr_value_pos
,
(
size_t
)
attr_length
);
msg
->
SetUsername
((
const
char
*
)
attr_value_pos
,
(
size_t
)
attr_length
);
break
;
break
;
}
case
Attribute
:
:
Priority
:
case
Attribute
:
:
Priority
:
{
msg
->
SetPriority
(
Utils
::
Byte
::
Get4Bytes
(
attr_value_pos
,
0
));
msg
->
SetPriority
(
Utils
::
Byte
::
Get4Bytes
(
attr_value_pos
,
0
));
break
;
break
;
}
case
Attribute
:
:
IceControlling
:
case
Attribute
:
:
IceControlling
:
{
msg
->
SetIceControlling
(
Utils
::
Byte
::
Get8Bytes
(
attr_value_pos
,
0
));
msg
->
SetIceControlling
(
Utils
::
Byte
::
Get8Bytes
(
attr_value_pos
,
0
));
break
;
break
;
}
case
Attribute
:
:
IceControlled
:
case
Attribute
:
:
IceControlled
:
{
msg
->
SetIceControlled
(
Utils
::
Byte
::
Get8Bytes
(
attr_value_pos
,
0
));
msg
->
SetIceControlled
(
Utils
::
Byte
::
Get8Bytes
(
attr_value_pos
,
0
));
break
;
break
;
}
case
Attribute
:
:
UseCandidate
:
case
Attribute
:
:
UseCandidate
:
{
msg
->
SetUseCandidate
();
msg
->
SetUseCandidate
();
break
;
break
;
}
case
Attribute
:
:
MessageIntegrity
:
case
Attribute
:
:
MessageIntegrity
:
{
has_message_integrity
=
true
;
has_message_integrity
=
true
;
msg
->
SetMessageIntegrity
(
attr_value_pos
);
msg
->
SetMessageIntegrity
(
attr_value_pos
);
break
;
break
;
}
case
Attribute
:
:
Fingerprint
:
case
Attribute
:
:
Fingerprint
:
{
has_fingerprint
=
true
;
has_fingerprint
=
true
;
fingerprint_attr_pos
=
pos
;
fingerprint_attr_pos
=
pos
;
fingerprint
=
Utils
::
Byte
::
Get4Bytes
(
attr_value_pos
,
0
);
fingerprint
=
Utils
::
Byte
::
Get4Bytes
(
attr_value_pos
,
0
);
msg
->
SetFingerprint
();
msg
->
SetFingerprint
();
break
;
break
;
case
Attribute
:
:
ErrorCode
:
{
}
case
Attribute
:
:
ErrorCode
:
{
uint8_t
error_class
=
Utils
::
Byte
::
Get1Byte
(
attr_value_pos
,
2
);
uint8_t
error_class
=
Utils
::
Byte
::
Get1Byte
(
attr_value_pos
,
2
);
uint8_t
error_number
=
Utils
::
Byte
::
Get1Byte
(
attr_value_pos
,
3
);
uint8_t
error_number
=
Utils
::
Byte
::
Get1Byte
(
attr_value_pos
,
3
);
uint16_t
error_code
=
(
uint16_t
)(
error_class
*
100
+
error_number
);
uint16_t
error_code
=
(
uint16_t
)(
error_class
*
100
+
error_number
);
msg
->
SetErrorCode
(
error_code
);
msg
->
SetErrorCode
(
error_code
);
break
;
break
;
}
}
default
:
default
:
break
;
;
}
}
// Set next attribute position.
// Set next attribute position.
...
@@ -415,21 +438,30 @@ namespace RTC
...
@@ -415,21 +438,30 @@ namespace RTC
if
(
this
->
hasUseCandidate
)
if
(
this
->
hasUseCandidate
)
this
->
length
+=
4
;
this
->
length
+=
4
;
if
(
add_xor_mapped_address
)
{
if
(
add_xor_mapped_address
)
switch
(
this
->
xorMappedAddress
->
sa_family
)
{
{
switch
(
this
->
xorMappedAddress
->
sa_family
)
{
case
AF_INET
:
case
AF_INET
:
{
xor_mapped_address_padded_len
=
8
;
xor_mapped_address_padded_len
=
8
;
this
->
length
+=
4
+
8
;
this
->
length
+=
4
+
8
;
break
;
break
;
}
case
AF_INET6
:
case
AF_INET6
:
{
xor_mapped_address_padded_len
=
20
;
xor_mapped_address_padded_len
=
20
;
this
->
length
+=
4
+
20
;
this
->
length
+=
4
+
20
;
break
;
break
;
}
default
:
default
:
{
MS_ERROR
(
"invalid inet family in XOR-MAPPED-ADDRESS attribute"
);
MS_ERROR
(
"invalid inet family in XOR-MAPPED-ADDRESS attribute"
);
add_xor_mapped_address
=
false
;
add_xor_mapped_address
=
false
;
break
;
}
}
}
}
}
...
@@ -522,7 +554,8 @@ namespace RTC
...
@@ -522,7 +554,8 @@ namespace RTC
uint8_t
*
attr_value
=
this
->
raw
+
pos
+
4
;
uint8_t
*
attr_value
=
this
->
raw
+
pos
+
4
;
switch
(
this
->
xorMappedAddress
->
sa_family
)
switch
(
this
->
xorMappedAddress
->
sa_family
)
{
{
case
AF_INET
:
{
case
AF_INET
:
{
// Set first byte to 0.
// Set first byte to 0.
attr_value
[
0
]
=
0
;
attr_value
[
0
]
=
0
;
// Set inet family.
// Set inet family.
...
@@ -539,6 +572,7 @@ namespace RTC
...
@@ -539,6 +572,7 @@ namespace RTC
attr_value
[
7
]
^=
StunMessage
::
magicCookie
[
3
];
attr_value
[
7
]
^=
StunMessage
::
magicCookie
[
3
];
pos
+=
4
+
8
;
pos
+=
4
+
8
;
break
;
break
;
}
}
case
AF_INET6
:
case
AF_INET6
:
...
@@ -571,6 +605,7 @@ namespace RTC
...
@@ -571,6 +605,7 @@ namespace RTC
attr_value
[
19
]
^=
this
->
transactionId
[
11
];
attr_value
[
19
]
^=
this
->
transactionId
[
11
];
pos
+=
4
+
20
;
pos
+=
4
+
20
;
break
;
break
;
}
}
}
}
...
...
worker/src/RTC/UdpSocket.cpp
浏览文件 @
2bbca599
...
@@ -128,9 +128,8 @@ namespace RTC
...
@@ -128,9 +128,8 @@ namespace RTC
MS_DEBUG_DEV
(
"port in use, trying again [port:%"
PRIu16
", attempt:%"
PRIu16
"]"
,
iterating_port
,
attempt
);
MS_DEBUG_DEV
(
"port in use, trying again [port:%"
PRIu16
", attempt:%"
PRIu16
"]"
,
iterating_port
,
attempt
);
// If we have tried all the ports in the range raise an error.
// If we have tried all the ports in the range raise an error.
if
(
iterating_port
==
initial_port
)
{
if
(
iterating_port
==
initial_port
)
MS_THROW_ERROR
(
"no more available ports for IP '%s'"
,
listen_ip
);
MS_THROW_ERROR
(
"no more available ports for IP '%s'"
,
listen_ip
);
}
continue
;
continue
;
}
}
...
...
worker/src/handles/UnixStreamSocket.cpp
浏览文件 @
2bbca599
...
@@ -134,7 +134,8 @@ void UnixStreamSocket::Close()
...
@@ -134,7 +134,8 @@ void UnixStreamSocket::Close()
MS_ABORT
(
"uv_shutdown() failed: %s"
,
uv_strerror
(
err
));
MS_ABORT
(
"uv_shutdown() failed: %s"
,
uv_strerror
(
err
));
}
}
// Otherwise directly close the socket.
// Otherwise directly close the socket.
else
{
else
{
uv_close
((
uv_handle_t
*
)
this
->
uvHandle
,
(
uv_close_cb
)
on_close
);
uv_close
((
uv_handle_t
*
)
this
->
uvHandle
,
(
uv_close_cb
)
on_close
);
}
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论