提交 d492ad8f authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

Consumer::GetPreferredProfile(): if neither Consumer preferred profile nor…

Consumer::GetPreferredProfile(): if neither Consumer preferred profile nor source preferred profile are 'default', return the Consumer's one.
上级 ce118f7a
...@@ -149,16 +149,23 @@ namespace RTC ...@@ -149,16 +149,23 @@ namespace RTC
inline RTC::RtpEncodingParameters::Profile Consumer::GetPreferredProfile() const inline RTC::RtpEncodingParameters::Profile Consumer::GetPreferredProfile() const
{ {
// If Consumer preferred profile and source (Producer) preferred profile
// are the same, that's.
if (this->preferredProfile == this->sourcePreferredProfile) if (this->preferredProfile == this->sourcePreferredProfile)
return this->preferredProfile; return this->preferredProfile;
// If Consumer preferred profile is 'default', use whichever the source
// preferred profile is.
if (this->preferredProfile == RTC::RtpEncodingParameters::Profile::DEFAULT) if (this->preferredProfile == RTC::RtpEncodingParameters::Profile::DEFAULT)
return this->sourcePreferredProfile; return this->sourcePreferredProfile;
// If source preferred profile is 'default', use whichever the Consumer
// preferred profile is.
if (this->sourcePreferredProfile == RTC::RtpEncodingParameters::Profile::DEFAULT) if (this->sourcePreferredProfile == RTC::RtpEncodingParameters::Profile::DEFAULT)
return this->preferredProfile; return this->preferredProfile;
return std::min(this->preferredProfile, this->sourcePreferredProfile); // Otherwise the Consumer preferred profile is chosen.
return this->preferredProfile;
} }
inline uint32_t Consumer::GetTransmissionRate(uint64_t now) inline uint32_t Consumer::GetTransmissionRate(uint64_t now)
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论