Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
bb4820f8
提交
bb4820f8
authored
6月 22, 2016
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
minor details
上级
89a03326
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
36 行增加
和
11 行删除
+36
-11
Peer.js
lib/Peer.js
+1
-0
RtpSender.js
lib/RtpSender.js
+2
-2
Peer.h
worker/include/RTC/Peer.h
+1
-0
RtpReceiver.h
worker/include/RTC/RtpReceiver.h
+1
-0
Peer.cpp
worker/src/RTC/Peer.cpp
+8
-7
RtpReceiver.cpp
worker/src/RTC/RtpReceiver.cpp
+3
-0
RtpSender.cpp
worker/src/RTC/RtpSender.cpp
+4
-2
Transport.cpp
worker/src/RTC/Transport.cpp
+16
-0
没有找到文件。
lib/Peer.js
浏览文件 @
bb4820f8
...
@@ -79,6 +79,7 @@ class Peer extends EventEmitter
...
@@ -79,6 +79,7 @@ class Peer extends EventEmitter
{
{
kind
:
data
.
kind
,
kind
:
data
.
kind
,
rtpParameters
:
data
.
rtpParameters
,
rtpParameters
:
data
.
rtpParameters
,
available
:
data
.
available
,
associatedPeer
:
associatedPeer
associatedPeer
:
associatedPeer
};
};
...
...
lib/RtpSender.js
浏览文件 @
bb4820f8
...
@@ -47,11 +47,11 @@ class RtpSender extends EventEmitter
...
@@ -47,11 +47,11 @@ class RtpSender extends EventEmitter
break
;
break
;
}
}
case
'
updateparameters
'
:
case
'
parameterschange
'
:
{
{
this
.
_data
.
rtpParameters
=
data
.
rtpParameters
;
this
.
_data
.
rtpParameters
=
data
.
rtpParameters
;
this
.
_data
.
available
=
data
.
available
;
this
.
_data
.
available
=
data
.
available
;
this
.
emit
(
'
updateparameters
'
,
data
);
this
.
emit
(
'
parameterschange
'
,
data
);
break
;
break
;
}
}
...
...
worker/include/RTC/Peer.h
浏览文件 @
bb4820f8
...
@@ -61,6 +61,7 @@ namespace RTC
...
@@ -61,6 +61,7 @@ namespace RTC
/* Pure virtual methods inherited from RTC::RtpReceiver::Listener. */
/* Pure virtual methods inherited from RTC::RtpReceiver::Listener. */
public
:
public
:
virtual
void
onRtpReceiverParameters
(
RTC
::
RtpReceiver
*
rtpReceiver
)
override
;
virtual
void
onRtpReceiverParameters
(
RTC
::
RtpReceiver
*
rtpReceiver
)
override
;
virtual
void
onRtpReceiverParametersDone
(
RTC
::
RtpReceiver
*
rtpReceiver
)
override
;
virtual
void
onRtpPacket
(
RTC
::
RtpReceiver
*
rtpReceiver
,
RTC
::
RtpPacket
*
packet
)
override
;
virtual
void
onRtpPacket
(
RTC
::
RtpReceiver
*
rtpReceiver
,
RTC
::
RtpPacket
*
packet
)
override
;
virtual
void
onRtpReceiverClosed
(
RTC
::
RtpReceiver
*
rtpReceiver
)
override
;
virtual
void
onRtpReceiverClosed
(
RTC
::
RtpReceiver
*
rtpReceiver
)
override
;
...
...
worker/include/RTC/RtpReceiver.h
浏览文件 @
bb4820f8
...
@@ -25,6 +25,7 @@ namespace RTC
...
@@ -25,6 +25,7 @@ namespace RTC
{
{
public
:
public
:
virtual
void
onRtpReceiverParameters
(
RtpReceiver
*
rtpReceiver
)
=
0
;
virtual
void
onRtpReceiverParameters
(
RtpReceiver
*
rtpReceiver
)
=
0
;
virtual
void
onRtpReceiverParametersDone
(
RTC
::
RtpReceiver
*
rtpReceiver
)
=
0
;
virtual
void
onRtpPacket
(
RtpReceiver
*
rtpReceiver
,
RTC
::
RtpPacket
*
packet
)
=
0
;
virtual
void
onRtpPacket
(
RtpReceiver
*
rtpReceiver
,
RTC
::
RtpPacket
*
packet
)
=
0
;
virtual
void
onRtpReceiverClosed
(
RtpReceiver
*
rtpReceiver
)
=
0
;
virtual
void
onRtpReceiverClosed
(
RtpReceiver
*
rtpReceiver
)
=
0
;
};
};
...
...
worker/src/RTC/Peer.cpp
浏览文件 @
bb4820f8
...
@@ -414,9 +414,7 @@ namespace RTC
...
@@ -414,9 +414,7 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
static
const
Json
::
StaticString
k_rtpSenderId
(
"rtpSenderId"
);
static
const
Json
::
StaticString
k_class
(
"class"
);
static
const
Json
::
StaticString
k_kind
(
"kind"
);
static
const
Json
::
StaticString
k_rtpParameters
(
"rtpParameters"
);
static
const
Json
::
StaticString
k_peerName
(
"peerName"
);
static
const
Json
::
StaticString
k_peerName
(
"peerName"
);
MS_ASSERT
(
this
->
rtpSenders
.
find
(
rtpSender
->
rtpSenderId
)
==
this
->
rtpSenders
.
end
(),
MS_ASSERT
(
this
->
rtpSenders
.
find
(
rtpSender
->
rtpSenderId
)
==
this
->
rtpSenders
.
end
(),
...
@@ -431,11 +429,9 @@ namespace RTC
...
@@ -431,11 +429,9 @@ namespace RTC
this
->
rtpSenders
[
rtpSender
->
rtpSenderId
]
=
rtpSender
;
this
->
rtpSenders
[
rtpSender
->
rtpSenderId
]
=
rtpSender
;
// Notify.
// Notify.
Json
::
Value
event_data
(
Json
::
objectValue
);
Json
::
Value
event_data
=
rtpSender
->
toJson
(
);
event_data
[
k_rtpSenderId
]
=
(
Json
::
UInt
)
rtpSender
->
rtpSenderId
;
event_data
[
k_class
]
=
"Peer"
;
event_data
[
k_kind
]
=
RTC
::
Media
::
GetJsonString
(
rtpSender
->
kind
);
event_data
[
k_rtpParameters
]
=
rtpSender
->
GetParameters
()
->
toJson
();
event_data
[
k_peerName
]
=
peerName
;
event_data
[
k_peerName
]
=
peerName
;
this
->
notifier
->
Emit
(
this
->
peerId
,
"newrtpsender"
,
event_data
);
this
->
notifier
->
Emit
(
this
->
peerId
,
"newrtpsender"
,
event_data
);
...
@@ -559,6 +555,11 @@ namespace RTC
...
@@ -559,6 +555,11 @@ namespace RTC
// NOTE: This may throw.
// NOTE: This may throw.
if
(
transport
)
if
(
transport
)
transport
->
AddRtpReceiver
(
rtpReceiver
);
transport
->
AddRtpReceiver
(
rtpReceiver
);
}
void
Peer
::
onRtpReceiverParametersDone
(
RTC
::
RtpReceiver
*
rtpReceiver
)
{
MS_TRACE
();
// Notify the listener (Room).
// Notify the listener (Room).
this
->
listener
->
onPeerRtpReceiverParametersDone
(
this
,
rtpReceiver
);
this
->
listener
->
onPeerRtpReceiverParametersDone
(
this
,
rtpReceiver
);
...
...
worker/src/RTC/RtpReceiver.cpp
浏览文件 @
bb4820f8
...
@@ -145,6 +145,9 @@ namespace RTC
...
@@ -145,6 +145,9 @@ namespace RTC
// Fill RTP parameters.
// Fill RTP parameters.
FillRtpParameters
();
FillRtpParameters
();
// And notify again.
this
->
listener
->
onRtpReceiverParametersDone
(
this
);
break
;
break
;
}
}
...
...
worker/src/RTC/RtpSender.cpp
浏览文件 @
bb4820f8
...
@@ -106,6 +106,7 @@ namespace RTC
...
@@ -106,6 +106,7 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
static
const
Json
::
StaticString
k_class
(
"class"
);
static
const
Json
::
StaticString
k_rtpParameters
(
"rtpParameters"
);
static
const
Json
::
StaticString
k_rtpParameters
(
"rtpParameters"
);
static
const
Json
::
StaticString
k_available
(
"available"
);
static
const
Json
::
StaticString
k_available
(
"available"
);
...
@@ -124,15 +125,16 @@ namespace RTC
...
@@ -124,15 +125,16 @@ namespace RTC
// For now make it easy:
// For now make it easy:
this
->
available
=
true
;
this
->
available
=
true
;
// Emit "
updateparameters
" if those are new parameters.
// Emit "
parameterschange
" if those are new parameters.
if
(
previousRtpParameters
)
if
(
previousRtpParameters
)
{
{
Json
::
Value
event_data
(
Json
::
objectValue
);
Json
::
Value
event_data
(
Json
::
objectValue
);
event_data
[
k_class
]
=
"RtpSender"
;
event_data
[
k_rtpParameters
]
=
this
->
rtpParameters
->
toJson
();
event_data
[
k_rtpParameters
]
=
this
->
rtpParameters
->
toJson
();
event_data
[
k_available
]
=
this
->
available
;
event_data
[
k_available
]
=
this
->
available
;
this
->
notifier
->
Emit
(
this
->
rtpSenderId
,
"
updateparameters
"
,
event_data
);
this
->
notifier
->
Emit
(
this
->
rtpSenderId
,
"
parameterschange
"
,
event_data
);
}
}
}
}
}
}
worker/src/RTC/Transport.cpp
浏览文件 @
bb4820f8
...
@@ -776,6 +776,7 @@ namespace RTC
...
@@ -776,6 +776,7 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
static
const
Json
::
StaticString
k_class
(
"class"
);
static
const
Json
::
StaticString
k_iceSelectedTuple
(
"iceSelectedTuple"
);
static
const
Json
::
StaticString
k_iceSelectedTuple
(
"iceSelectedTuple"
);
Json
::
Value
event_data
(
Json
::
objectValue
);
Json
::
Value
event_data
(
Json
::
objectValue
);
...
@@ -791,6 +792,7 @@ namespace RTC
...
@@ -791,6 +792,7 @@ namespace RTC
this
->
selectedTuple
=
tuple
;
this
->
selectedTuple
=
tuple
;
// Notify.
// Notify.
event_data
[
k_class
]
=
"Transport"
;
event_data
[
k_iceSelectedTuple
]
=
tuple
->
toJson
();
event_data
[
k_iceSelectedTuple
]
=
tuple
->
toJson
();
this
->
notifier
->
Emit
(
this
->
transportId
,
"iceselectedtuplechange"
,
event_data
);
this
->
notifier
->
Emit
(
this
->
transportId
,
"iceselectedtuplechange"
,
event_data
);
}
}
...
@@ -799,6 +801,7 @@ namespace RTC
...
@@ -799,6 +801,7 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
static
const
Json
::
StaticString
k_class
(
"class"
);
static
const
Json
::
StaticString
k_iceState
(
"iceState"
);
static
const
Json
::
StaticString
k_iceState
(
"iceState"
);
static
const
Json
::
StaticString
v_connected
(
"connected"
);
static
const
Json
::
StaticString
v_connected
(
"connected"
);
...
@@ -807,6 +810,7 @@ namespace RTC
...
@@ -807,6 +810,7 @@ namespace RTC
MS_DEBUG
(
"ICE connected"
);
MS_DEBUG
(
"ICE connected"
);
// Notify.
// Notify.
event_data
[
k_class
]
=
"Transport"
;
event_data
[
k_iceState
]
=
v_connected
;
event_data
[
k_iceState
]
=
v_connected
;
this
->
notifier
->
Emit
(
this
->
transportId
,
"icestatechange"
,
event_data
);
this
->
notifier
->
Emit
(
this
->
transportId
,
"icestatechange"
,
event_data
);
...
@@ -818,6 +822,7 @@ namespace RTC
...
@@ -818,6 +822,7 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
static
const
Json
::
StaticString
k_class
(
"class"
);
static
const
Json
::
StaticString
k_iceState
(
"iceState"
);
static
const
Json
::
StaticString
k_iceState
(
"iceState"
);
static
const
Json
::
StaticString
v_completed
(
"completed"
);
static
const
Json
::
StaticString
v_completed
(
"completed"
);
...
@@ -826,6 +831,7 @@ namespace RTC
...
@@ -826,6 +831,7 @@ namespace RTC
MS_DEBUG
(
"ICE completed"
);
MS_DEBUG
(
"ICE completed"
);
// Notify.
// Notify.
event_data
[
k_class
]
=
"Transport"
;
event_data
[
k_iceState
]
=
v_completed
;
event_data
[
k_iceState
]
=
v_completed
;
this
->
notifier
->
Emit
(
this
->
transportId
,
"icestatechange"
,
event_data
);
this
->
notifier
->
Emit
(
this
->
transportId
,
"icestatechange"
,
event_data
);
...
@@ -837,6 +843,7 @@ namespace RTC
...
@@ -837,6 +843,7 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
static
const
Json
::
StaticString
k_class
(
"class"
);
static
const
Json
::
StaticString
k_iceState
(
"iceState"
);
static
const
Json
::
StaticString
k_iceState
(
"iceState"
);
static
const
Json
::
StaticString
v_disconnected
(
"disconnected"
);
static
const
Json
::
StaticString
v_disconnected
(
"disconnected"
);
...
@@ -848,6 +855,7 @@ namespace RTC
...
@@ -848,6 +855,7 @@ namespace RTC
this
->
selectedTuple
=
nullptr
;
this
->
selectedTuple
=
nullptr
;
// Notify.
// Notify.
event_data
[
k_class
]
=
"Transport"
;
event_data
[
k_iceState
]
=
v_disconnected
;
event_data
[
k_iceState
]
=
v_disconnected
;
this
->
notifier
->
Emit
(
this
->
transportId
,
"icestatechange"
,
event_data
);
this
->
notifier
->
Emit
(
this
->
transportId
,
"icestatechange"
,
event_data
);
...
@@ -859,6 +867,7 @@ namespace RTC
...
@@ -859,6 +867,7 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
static
const
Json
::
StaticString
k_class
(
"class"
);
static
const
Json
::
StaticString
k_dtlsState
(
"dtlsState"
);
static
const
Json
::
StaticString
k_dtlsState
(
"dtlsState"
);
static
const
Json
::
StaticString
v_connecting
(
"connecting"
);
static
const
Json
::
StaticString
v_connecting
(
"connecting"
);
...
@@ -867,6 +876,7 @@ namespace RTC
...
@@ -867,6 +876,7 @@ namespace RTC
MS_DEBUG
(
"DTLS connecting"
);
MS_DEBUG
(
"DTLS connecting"
);
// Notify.
// Notify.
event_data
[
k_class
]
=
"Transport"
;
event_data
[
k_dtlsState
]
=
v_connecting
;
event_data
[
k_dtlsState
]
=
v_connecting
;
this
->
notifier
->
Emit
(
this
->
transportId
,
"dtlsstatechange"
,
event_data
);
this
->
notifier
->
Emit
(
this
->
transportId
,
"dtlsstatechange"
,
event_data
);
}
}
...
@@ -875,6 +885,7 @@ namespace RTC
...
@@ -875,6 +885,7 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
static
const
Json
::
StaticString
k_class
(
"class"
);
static
const
Json
::
StaticString
k_dtlsState
(
"dtlsState"
);
static
const
Json
::
StaticString
k_dtlsState
(
"dtlsState"
);
static
const
Json
::
StaticString
v_connected
(
"connected"
);
static
const
Json
::
StaticString
v_connected
(
"connected"
);
static
const
Json
::
StaticString
k_dtlsRemoteCert
(
"dtlsRemoteCert"
);
static
const
Json
::
StaticString
k_dtlsRemoteCert
(
"dtlsRemoteCert"
);
...
@@ -919,6 +930,7 @@ namespace RTC
...
@@ -919,6 +930,7 @@ namespace RTC
}
}
// Notify.
// Notify.
event_data
[
k_class
]
=
"Transport"
;
event_data
[
k_dtlsState
]
=
v_connected
;
event_data
[
k_dtlsState
]
=
v_connected
;
event_data
[
k_dtlsRemoteCert
]
=
remoteCert
;
event_data
[
k_dtlsRemoteCert
]
=
remoteCert
;
this
->
notifier
->
Emit
(
this
->
transportId
,
"dtlsstatechange"
,
event_data
);
this
->
notifier
->
Emit
(
this
->
transportId
,
"dtlsstatechange"
,
event_data
);
...
@@ -928,6 +940,7 @@ namespace RTC
...
@@ -928,6 +940,7 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
static
const
Json
::
StaticString
k_class
(
"class"
);
static
const
Json
::
StaticString
k_dtlsState
(
"dtlsState"
);
static
const
Json
::
StaticString
k_dtlsState
(
"dtlsState"
);
static
const
Json
::
StaticString
v_failed
(
"failed"
);
static
const
Json
::
StaticString
v_failed
(
"failed"
);
...
@@ -936,6 +949,7 @@ namespace RTC
...
@@ -936,6 +949,7 @@ namespace RTC
MS_DEBUG
(
"DTLS failed"
);
MS_DEBUG
(
"DTLS failed"
);
// Notify.
// Notify.
event_data
[
k_class
]
=
"Transport"
;
event_data
[
k_dtlsState
]
=
v_failed
;
event_data
[
k_dtlsState
]
=
v_failed
;
this
->
notifier
->
Emit
(
this
->
transportId
,
"dtlsstatechange"
,
event_data
);
this
->
notifier
->
Emit
(
this
->
transportId
,
"dtlsstatechange"
,
event_data
);
...
@@ -947,6 +961,7 @@ namespace RTC
...
@@ -947,6 +961,7 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
static
const
Json
::
StaticString
k_class
(
"class"
);
static
const
Json
::
StaticString
k_dtlsState
(
"dtlsState"
);
static
const
Json
::
StaticString
k_dtlsState
(
"dtlsState"
);
static
const
Json
::
StaticString
v_closed
(
"closed"
);
static
const
Json
::
StaticString
v_closed
(
"closed"
);
...
@@ -955,6 +970,7 @@ namespace RTC
...
@@ -955,6 +970,7 @@ namespace RTC
MS_DEBUG
(
"DTLS remotely closed"
);
MS_DEBUG
(
"DTLS remotely closed"
);
// Notify.
// Notify.
event_data
[
k_class
]
=
"Transport"
;
event_data
[
k_dtlsState
]
=
v_closed
;
event_data
[
k_dtlsState
]
=
v_closed
;
this
->
notifier
->
Emit
(
this
->
transportId
,
"dtlsstatechange"
,
event_data
);
this
->
notifier
->
Emit
(
this
->
transportId
,
"dtlsstatechange"
,
event_data
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论