Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
652dff13
提交
652dff13
authored
9月 10, 2017
作者:
José Luis Millán
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Provide the consumer with the profile to which the packet belongs
上级
00a2122f
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
55 行增加
和
9 行删除
+55
-9
Consumer.hpp
worker/include/RTC/Consumer.hpp
+3
-1
Producer.hpp
worker/include/RTC/Producer.hpp
+2
-0
ProducerListener.hpp
worker/include/RTC/ProducerListener.hpp
+1
-1
Router.hpp
worker/include/RTC/Router.hpp
+1
-1
RtpDictionaries.hpp
worker/include/RTC/RtpDictionaries.hpp
+1
-0
Transport.hpp
worker/include/RTC/Transport.hpp
+1
-1
Consumer.cpp
worker/src/RTC/Consumer.cpp
+6
-1
Producer.cpp
worker/src/RTC/Producer.cpp
+37
-1
Router.cpp
worker/src/RTC/Router.cpp
+2
-2
Transport.cpp
worker/src/RTC/Transport.cpp
+1
-1
没有找到文件。
worker/include/RTC/Consumer.hpp
浏览文件 @
652dff13
...
@@ -47,7 +47,7 @@ namespace RTC
...
@@ -47,7 +47,7 @@ namespace RTC
bool
IsEnabled
()
const
;
bool
IsEnabled
()
const
;
const
RTC
::
RtpParameters
&
GetParameters
()
const
;
const
RTC
::
RtpParameters
&
GetParameters
()
const
;
bool
IsPaused
()
const
;
bool
IsPaused
()
const
;
void
SendRtpPacket
(
RTC
::
RtpPacket
*
packet
);
void
SendRtpPacket
(
RTC
::
RtpPacket
*
packet
,
RTC
::
RtpProfile
profile
);
void
GetRtcp
(
RTC
::
RTCP
::
CompoundPacket
*
packet
,
uint64_t
now
);
void
GetRtcp
(
RTC
::
RTCP
::
CompoundPacket
*
packet
,
uint64_t
now
);
void
ReceiveNack
(
RTC
::
RTCP
::
FeedbackRtpNackPacket
*
nackPacket
);
void
ReceiveNack
(
RTC
::
RTCP
::
FeedbackRtpNackPacket
*
nackPacket
);
void
ReceiveRtcpReceiverReport
(
RTC
::
RTCP
::
ReceiverReport
*
report
);
void
ReceiveRtcpReceiverReport
(
RTC
::
RTCP
::
ReceiverReport
*
report
);
...
@@ -89,6 +89,8 @@ namespace RTC
...
@@ -89,6 +89,8 @@ namespace RTC
uint16_t
lastRecvSeqNum
{
0
};
uint16_t
lastRecvSeqNum
{
0
};
uint32_t
lastRecvRtpTimestamp
{
0
};
uint32_t
lastRecvRtpTimestamp
{
0
};
bool
syncRequired
{
true
};
bool
syncRequired
{
true
};
// RTP profiles.
RTC
::
RtpProfile
effectiveProfile
{
RTC
::
RtpProfile
::
DEFAULT
};
};
};
/* Inline methods. */
/* Inline methods. */
...
...
worker/include/RTC/Producer.hpp
浏览文件 @
652dff13
...
@@ -76,6 +76,7 @@ namespace RTC
...
@@ -76,6 +76,7 @@ namespace RTC
void
CreateRtpStream
(
RTC
::
RtpEncodingParameters
&
encoding
);
void
CreateRtpStream
(
RTC
::
RtpEncodingParameters
&
encoding
);
void
ClearRtpStreams
();
void
ClearRtpStreams
();
void
ApplyRtpMapping
(
RTC
::
RtpPacket
*
packet
)
const
;
void
ApplyRtpMapping
(
RTC
::
RtpPacket
*
packet
)
const
;
RTC
::
RtpProfile
GetRtpProfile
(
RTC
::
RtpPacket
*
packet
);
/* Pure virtual methods inherited from RTC::RtpStreamRecv::Listener. */
/* Pure virtual methods inherited from RTC::RtpStreamRecv::Listener. */
public
:
public
:
...
@@ -102,6 +103,7 @@ namespace RTC
...
@@ -102,6 +103,7 @@ namespace RTC
// Allocated by this.
// Allocated by this.
std
::
map
<
uint32_t
,
RTC
::
RtpStreamRecv
*>
rtpStreams
;
std
::
map
<
uint32_t
,
RTC
::
RtpStreamRecv
*>
rtpStreams
;
std
::
map
<
uint32_t
,
RTC
::
RtpStreamRecv
*>
mapRtxStreams
;
std
::
map
<
uint32_t
,
RTC
::
RtpStreamRecv
*>
mapRtxStreams
;
std
::
map
<
uint32_t
,
RTC
::
RtpProfile
>
rtpProfiles
;
Timer
*
fullFrameRequestBlockTimer
{
nullptr
};
Timer
*
fullFrameRequestBlockTimer
{
nullptr
};
// Others.
// Others.
std
::
vector
<
RtpEncodingParameters
>
outputEncodings
;
std
::
vector
<
RtpEncodingParameters
>
outputEncodings
;
...
...
worker/include/RTC/ProducerListener.hpp
浏览文件 @
652dff13
...
@@ -16,7 +16,7 @@ namespace RTC
...
@@ -16,7 +16,7 @@ namespace RTC
virtual
void
OnProducerRtpParametersUpdated
(
RTC
::
Producer
*
producer
)
=
0
;
virtual
void
OnProducerRtpParametersUpdated
(
RTC
::
Producer
*
producer
)
=
0
;
virtual
void
OnProducerPaused
(
RTC
::
Producer
*
producer
)
=
0
;
virtual
void
OnProducerPaused
(
RTC
::
Producer
*
producer
)
=
0
;
virtual
void
OnProducerResumed
(
RTC
::
Producer
*
producer
)
=
0
;
virtual
void
OnProducerResumed
(
RTC
::
Producer
*
producer
)
=
0
;
virtual
void
OnProducerRtpPacket
(
RTC
::
Producer
*
producer
,
RTC
::
RtpPacket
*
packet
)
=
0
;
virtual
void
OnProducerRtpPacket
(
RTC
::
Producer
*
producer
,
RTC
::
RtpPacket
*
packet
,
RTC
::
RtpProfile
profile
)
=
0
;
};
};
}
// namespace RTC
}
// namespace RTC
...
...
worker/include/RTC/Router.hpp
浏览文件 @
652dff13
...
@@ -67,7 +67,7 @@ namespace RTC
...
@@ -67,7 +67,7 @@ namespace RTC
void
OnProducerRtpParametersUpdated
(
RTC
::
Producer
*
producer
)
override
;
void
OnProducerRtpParametersUpdated
(
RTC
::
Producer
*
producer
)
override
;
void
OnProducerPaused
(
RTC
::
Producer
*
producer
)
override
;
void
OnProducerPaused
(
RTC
::
Producer
*
producer
)
override
;
void
OnProducerResumed
(
RTC
::
Producer
*
producer
)
override
;
void
OnProducerResumed
(
RTC
::
Producer
*
producer
)
override
;
void
OnProducerRtpPacket
(
RTC
::
Producer
*
producer
,
RTC
::
RtpPacket
*
packet
)
override
;
void
OnProducerRtpPacket
(
RTC
::
Producer
*
producer
,
RTC
::
RtpPacket
*
packet
,
RTC
::
RtpProfile
profile
)
override
;
/* Pure virtual methods inherited from RTC::ConsumerListener. */
/* Pure virtual methods inherited from RTC::ConsumerListener. */
public
:
public
:
...
...
worker/include/RTC/RtpDictionaries.hpp
浏览文件 @
652dff13
...
@@ -234,6 +234,7 @@ namespace RTC
...
@@ -234,6 +234,7 @@ namespace RTC
bool
active
{
true
};
bool
active
{
true
};
std
::
string
encodingId
;
std
::
string
encodingId
;
std
::
vector
<
std
::
string
>
dependencyEncodingIds
;
std
::
vector
<
std
::
string
>
dependencyEncodingIds
;
RTC
::
RtpProfile
profile
{
RTC
::
RtpProfile
::
DEFAULT
};
};
};
class
RtpHeaderExtensionParameters
class
RtpHeaderExtensionParameters
...
...
worker/include/RTC/Transport.hpp
浏览文件 @
652dff13
...
@@ -153,7 +153,7 @@ namespace RTC
...
@@ -153,7 +153,7 @@ namespace RTC
void
OnProducerRtpParametersUpdated
(
RTC
::
Producer
*
producer
)
override
;
void
OnProducerRtpParametersUpdated
(
RTC
::
Producer
*
producer
)
override
;
void
OnProducerPaused
(
RTC
::
Producer
*
producer
)
override
;
void
OnProducerPaused
(
RTC
::
Producer
*
producer
)
override
;
void
OnProducerResumed
(
RTC
::
Producer
*
producer
)
override
;
void
OnProducerResumed
(
RTC
::
Producer
*
producer
)
override
;
void
OnProducerRtpPacket
(
RTC
::
Producer
*
producer
,
RTC
::
RtpPacket
*
packet
)
override
;
void
OnProducerRtpPacket
(
RTC
::
Producer
*
producer
,
RTC
::
RtpPacket
*
packet
,
RTC
::
RtpProfile
profile
)
override
;
/* Pure virtual methods inherited from RTC::ConsumerListener. */
/* Pure virtual methods inherited from RTC::ConsumerListener. */
public
:
public
:
...
...
worker/src/RTC/Consumer.cpp
浏览文件 @
652dff13
...
@@ -245,7 +245,7 @@ namespace RTC
...
@@ -245,7 +245,7 @@ namespace RTC
this
->
retransmittedCounter
.
Reset
();
this
->
retransmittedCounter
.
Reset
();
}
}
void
Consumer
::
SendRtpPacket
(
RTC
::
RtpPacket
*
packet
)
void
Consumer
::
SendRtpPacket
(
RTC
::
RtpPacket
*
packet
,
RTC
::
RtpProfile
profile
)
{
{
MS_TRACE
();
MS_TRACE
();
...
@@ -268,6 +268,11 @@ namespace RTC
...
@@ -268,6 +268,11 @@ namespace RTC
return
;
return
;
}
}
// If the packet belongs to different profile than the one being sent, drop it.
// NOTE: This is specific to simulcast with no temporal layers.
if
(
profile
!=
this
->
effectiveProfile
)
return
;
// Check whether sequence number and timestamp sync is required.
// Check whether sequence number and timestamp sync is required.
if
(
this
->
syncRequired
)
if
(
this
->
syncRequired
)
{
{
...
...
worker/src/RTC/Producer.cpp
浏览文件 @
652dff13
...
@@ -303,13 +303,24 @@ namespace RTC
...
@@ -303,13 +303,24 @@ namespace RTC
if
(
this
->
paused
)
if
(
this
->
paused
)
return
;
return
;
RTC
::
RtpProfile
profile
;
try
{
profile
=
GetRtpProfile
(
packet
);
}
catch
(
const
MediaSoupError
&
error
)
{
return
;
}
// Apply the Producer codec payload type and extension header mapping before
// Apply the Producer codec payload type and extension header mapping before
// dispatching the packet.
// dispatching the packet.
ApplyRtpMapping
(
packet
);
ApplyRtpMapping
(
packet
);
for
(
auto
&
listener
:
this
->
listeners
)
for
(
auto
&
listener
:
this
->
listeners
)
{
{
listener
->
OnProducerRtpPacket
(
this
,
packet
);
listener
->
OnProducerRtpPacket
(
this
,
packet
,
profile
);
}
}
// Emit "rtpraw" if enabled.
// Emit "rtpraw" if enabled.
...
@@ -577,6 +588,31 @@ namespace RTC
...
@@ -577,6 +588,31 @@ namespace RTC
}
}
}
}
RTC
::
RtpProfile
Producer
::
GetRtpProfile
(
RTC
::
RtpPacket
*
packet
)
{
auto
ssrc
=
packet
->
GetSsrc
();
// The SSRC is already mapped to a profile.
if
(
this
->
rtpProfiles
.
find
(
ssrc
)
!=
this
->
rtpProfiles
.
end
())
{
return
this
->
rtpProfiles
[
ssrc
];
}
// Look for the encoding associated with the SSRC.
// NOTE: This is specific to simulcast with no temporal layers.
for
(
auto
&
encoding
:
this
->
rtpParameters
.
encodings
)
{
if
(
encoding
.
ssrc
==
ssrc
)
{
this
->
rtpProfiles
[
ssrc
]
=
encoding
.
profile
;
return
encoding
.
profile
;
}
}
MS_THROW_ERROR
(
"unknown RTP packet received [ssrc:%"
PRIu32
"]"
,
ssrc
);
}
void
Producer
::
OnRtpStreamRecvNackRequired
(
void
Producer
::
OnRtpStreamRecvNackRequired
(
RTC
::
RtpStreamRecv
*
rtpStream
,
const
std
::
vector
<
uint16_t
>&
seqNumbers
)
RTC
::
RtpStreamRecv
*
rtpStream
,
const
std
::
vector
<
uint16_t
>&
seqNumbers
)
{
{
...
...
worker/src/RTC/Router.cpp
浏览文件 @
652dff13
...
@@ -1329,7 +1329,7 @@ namespace RTC
...
@@ -1329,7 +1329,7 @@ namespace RTC
}
}
}
}
void
Router
::
OnProducerRtpPacket
(
RTC
::
Producer
*
producer
,
RTC
::
RtpPacket
*
packet
)
void
Router
::
OnProducerRtpPacket
(
RTC
::
Producer
*
producer
,
RTC
::
RtpPacket
*
packet
,
RTC
::
RtpProfile
profile
)
{
{
MS_TRACE
();
MS_TRACE
();
...
@@ -1344,7 +1344,7 @@ namespace RTC
...
@@ -1344,7 +1344,7 @@ namespace RTC
for
(
auto
*
consumer
:
consumers
)
for
(
auto
*
consumer
:
consumers
)
{
{
if
(
consumer
->
IsEnabled
())
if
(
consumer
->
IsEnabled
())
consumer
->
SendRtpPacket
(
packet
);
consumer
->
SendRtpPacket
(
packet
,
profile
);
}
}
// Update audio levels.
// Update audio levels.
...
...
worker/src/RTC/Transport.cpp
浏览文件 @
652dff13
...
@@ -1555,7 +1555,7 @@ namespace RTC
...
@@ -1555,7 +1555,7 @@ namespace RTC
// Do nothing.
// Do nothing.
}
}
void
Transport
::
OnProducerRtpPacket
(
RTC
::
Producer
*
/*producer*/
,
RTC
::
RtpPacket
*
/*packet*/
)
void
Transport
::
OnProducerRtpPacket
(
RTC
::
Producer
*
/*producer*/
,
RTC
::
RtpPacket
*
/*packet*/
,
RTC
::
RtpProfile
/*profile*/
)
{
{
// Do nothing.
// Do nothing.
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论