Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
0e5cb351
提交
0e5cb351
authored
9月 13, 2017
作者:
José Luis Millán
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Consider intermediate profiles
上级
375c1498
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
43 行增加
和
40 行删除
+43
-40
Consumer.hpp
worker/include/RTC/Consumer.hpp
+2
-1
Consumer.cpp
worker/src/RTC/Consumer.cpp
+41
-39
没有找到文件。
worker/include/RTC/Consumer.hpp
浏览文件 @
0e5cb351
...
@@ -62,7 +62,7 @@ namespace RTC
...
@@ -62,7 +62,7 @@ namespace RTC
void
FillSupportedCodecPayloadTypes
();
void
FillSupportedCodecPayloadTypes
();
void
CreateRtpStream
(
RTC
::
RtpEncodingParameters
&
encoding
);
void
CreateRtpStream
(
RTC
::
RtpEncodingParameters
&
encoding
);
void
RetransmitRtpPacket
(
RTC
::
RtpPacket
*
packet
);
void
RetransmitRtpPacket
(
RTC
::
RtpPacket
*
packet
);
void
Recalculate
Effective
Profile
();
void
Recalculate
Target
Profile
();
void
SetEffectiveProfile
(
RTC
::
RtpEncodingParameters
::
Profile
profile
);
void
SetEffectiveProfile
(
RTC
::
RtpEncodingParameters
::
Profile
profile
);
/* Pure virtual methods inherited from RTC::RtpStream::Listener. */
/* Pure virtual methods inherited from RTC::RtpStream::Listener. */
...
@@ -105,6 +105,7 @@ namespace RTC
...
@@ -105,6 +105,7 @@ namespace RTC
// RTP profiles.
// RTP profiles.
std
::
set
<
RTC
::
RtpEncodingParameters
::
Profile
>
profiles
;
std
::
set
<
RTC
::
RtpEncodingParameters
::
Profile
>
profiles
;
RTC
::
RtpEncodingParameters
::
Profile
preferredProfile
{
RTC
::
RtpEncodingParameters
::
Profile
::
DEFAULT
};
RTC
::
RtpEncodingParameters
::
Profile
preferredProfile
{
RTC
::
RtpEncodingParameters
::
Profile
::
DEFAULT
};
RTC
::
RtpEncodingParameters
::
Profile
targetProfile
{
RTC
::
RtpEncodingParameters
::
Profile
::
DEFAULT
};
RTC
::
RtpEncodingParameters
::
Profile
effectiveProfile
{
RTC
::
RtpEncodingParameters
::
Profile
::
DEFAULT
};
RTC
::
RtpEncodingParameters
::
Profile
effectiveProfile
{
RTC
::
RtpEncodingParameters
::
Profile
::
DEFAULT
};
};
};
...
...
worker/src/RTC/Consumer.cpp
浏览文件 @
0e5cb351
...
@@ -241,7 +241,7 @@ namespace RTC
...
@@ -241,7 +241,7 @@ namespace RTC
rtp
,
"profile added [profile:%s]"
,
RTC
::
RtpEncodingParameters
::
profile2String
[
profile
].
c_str
());
rtp
,
"profile added [profile:%s]"
,
RTC
::
RtpEncodingParameters
::
profile2String
[
profile
].
c_str
());
;
;
Recalculate
Effective
Profile
();
Recalculate
Target
Profile
();
}
}
void
Consumer
::
RemoveProfile
(
const
RTC
::
RtpEncodingParameters
::
Profile
profile
)
void
Consumer
::
RemoveProfile
(
const
RTC
::
RtpEncodingParameters
::
Profile
profile
)
...
@@ -262,7 +262,7 @@ namespace RTC
...
@@ -262,7 +262,7 @@ namespace RTC
RTC
::
RtpEncodingParameters
::
profile2String
[
profile
].
c_str
());
RTC
::
RtpEncodingParameters
::
profile2String
[
profile
].
c_str
());
;
;
Recalculate
Effective
Profile
();
Recalculate
Target
Profile
();
}
}
void
Consumer
::
SetPreferredProfile
(
const
RTC
::
RtpEncodingParameters
::
Profile
profile
)
void
Consumer
::
SetPreferredProfile
(
const
RTC
::
RtpEncodingParameters
::
Profile
profile
)
...
@@ -280,7 +280,7 @@ namespace RTC
...
@@ -280,7 +280,7 @@ namespace RTC
RTC
::
RtpEncodingParameters
::
profile2String
[
profile
].
c_str
());
RTC
::
RtpEncodingParameters
::
profile2String
[
profile
].
c_str
());
;
;
Recalculate
Effective
Profile
();
Recalculate
Target
Profile
();
}
}
/**
/**
...
@@ -335,19 +335,32 @@ namespace RTC
...
@@ -335,19 +335,32 @@ namespace RTC
// Check whether this is the key frame we are waiting for in order to update the effective
// Check whether this is the key frame we are waiting for in order to update the effective
// profile.
// profile.
if
(
if
(
this
->
effectiveProfile
!=
this
->
targetProfile
&&
profile
==
this
->
targetProfile
)
this
->
effectiveProfile
!=
this
->
preferredProfile
&&
profile
==
this
->
preferredProfile
&&
Codecs
::
isKeyFrame
(
this
->
rtpStream
->
GetMymeType
(),
packet
))
{
{
MS_DEBUG_TAG
(
rtp
,
"changing effective profile after receiving a key frame"
)
;
bool
isKeyFrame
=
false
;
this
->
syncRequired
=
true
;
if
(
Codecs
::
isKnown
(
this
->
rtpStream
->
GetMymeType
())
&&
this
->
rtpStream
->
ClearRetransmissionBuffer
();
Codecs
::
isKeyFrame
(
this
->
rtpStream
->
GetMymeType
(),
packet
))
{
isKeyFrame
=
true
;
MS_DEBUG_TAG
(
rtp
,
"key frame received [profile:%s]"
,
RTC
::
RtpEncodingParameters
::
profile2String
[
profile
].
c_str
());
}
// Send this packet twice.
if
(
!
Codecs
::
isKnown
(
this
->
rtpStream
->
GetMymeType
())
||
isKeyFrame
)
retransmissionNeeded
=
true
;
{
SetEffectiveProfile
(
this
->
targetProfile
);
// Send this packet twice.
retransmissionNeeded
=
true
;
// Resynchronize the stream.
this
->
syncRequired
=
true
;
SetEffectiveProfile
(
this
->
preferredProfile
);
// Calculate the new target profile.
RecalculateTargetProfile
();
}
}
}
// If the packet belongs to different profile than the one being sent, drop it.
// If the packet belongs to different profile than the one being sent, drop it.
...
@@ -368,6 +381,7 @@ namespace RTC
...
@@ -368,6 +381,7 @@ namespace RTC
this
->
maxRecvExtendedSeqNum
=
packet
->
GetExtendedSequenceNumber
();
this
->
maxRecvExtendedSeqNum
=
packet
->
GetExtendedSequenceNumber
();
this
->
maxRecvSeqNum
=
packet
->
GetSequenceNumber
();
this
->
maxRecvSeqNum
=
packet
->
GetSequenceNumber
();
this
->
rtpStream
->
ClearRetransmissionBuffer
();
this
->
syncRequired
=
false
;
this
->
syncRequired
=
false
;
MS_DEBUG_TAG
(
MS_DEBUG_TAG
(
...
@@ -634,8 +648,10 @@ namespace RTC
...
@@ -634,8 +648,10 @@ namespace RTC
delete
rtxPacket
;
delete
rtxPacket
;
}
}
void
Consumer
::
Recalculate
Effective
Profile
()
void
Consumer
::
Recalculate
Target
Profile
()
{
{
MS_TRACE
();
RTC
::
RtpEncodingParameters
::
Profile
newProfile
;
RTC
::
RtpEncodingParameters
::
Profile
newProfile
;
// If there are no profiles, select none or default, depending on whether this
// If there are no profiles, select none or default, depending on whether this
...
@@ -672,41 +688,27 @@ namespace RTC
...
@@ -672,41 +688,27 @@ namespace RTC
}
}
}
}
if
(
newProfile
==
this
->
effectiveProfile
)
this
->
targetProfile
=
newProfile
;
if
(
this
->
targetProfile
==
this
->
effectiveProfile
)
return
;
return
;
MS_DEBUG_TAG
(
rtp
,
"target profile set [profile:%s]"
,
RTC
::
RtpEncodingParameters
::
profile2String
[
this
->
targetProfile
].
c_str
());
;
if
(
IsEnabled
()
&&
!
IsPaused
())
if
(
IsEnabled
()
&&
!
IsPaused
())
{
{
/*
* - This is the first time we are setting the effective profile.
* - The current effective profile is no longer available.
* - We don't handle the key frames for the used codec.
*/
if
(
this
->
effectiveProfile
==
RTC
::
RtpEncodingParameters
::
Profile
::
DEFAULT
||
this
->
profiles
.
find
(
this
->
effectiveProfile
)
==
this
->
profiles
.
end
()
||
!
RTC
::
Codecs
::
isKnown
(
this
->
rtpStream
->
GetMymeType
()))
{
this
->
syncRequired
=
true
;
this
->
rtpStream
->
ClearRetransmissionBuffer
();
SetEffectiveProfile
(
newProfile
);
}
// Otherwise set the effective profile upon reception of a key frame.
else
{
}
RequestFullFrame
();
RequestFullFrame
();
}
}
else
{
SetEffectiveProfile
(
newProfile
);
}
}
}
void
Consumer
::
SetEffectiveProfile
(
RTC
::
RtpEncodingParameters
::
Profile
profile
)
void
Consumer
::
SetEffectiveProfile
(
RTC
::
RtpEncodingParameters
::
Profile
profile
)
{
{
MS_TRACE
();
static
const
Json
::
StaticString
JsonStringProfile
{
"profile"
};
static
const
Json
::
StaticString
JsonStringProfile
{
"profile"
};
Json
::
Value
eventData
(
Json
::
objectValue
);
Json
::
Value
eventData
(
Json
::
objectValue
);
...
@@ -715,7 +717,7 @@ namespace RTC
...
@@ -715,7 +717,7 @@ namespace RTC
MS_DEBUG_TAG
(
MS_DEBUG_TAG
(
rtp
,
rtp
,
"
new effective profile: %s
"
,
"
effective profile set [profile:%s]
"
,
RTC
::
RtpEncodingParameters
::
profile2String
[
this
->
effectiveProfile
].
c_str
());
RTC
::
RtpEncodingParameters
::
profile2String
[
this
->
effectiveProfile
].
c_str
());
;
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论