提交 2260ee57 authored 作者: José Luis Millán's avatar José Luis Millán

Producer: rename activeprofiles by mapActiveProfiles

上级 27f060bf
...@@ -113,7 +113,7 @@ namespace RTC ...@@ -113,7 +113,7 @@ namespace RTC
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<RTC::RtpStreamRecv*, std::set<RTC::RtpEncodingParameters::Profile>> mapRtpStreamProfiles; std::map<RTC::RtpStreamRecv*, std::set<RTC::RtpEncodingParameters::Profile>> mapRtpStreamProfiles;
std::map<RTC::RtpEncodingParameters::Profile, const RTC::RtpStream*> activeProfiles; std::map<RTC::RtpEncodingParameters::Profile, const RTC::RtpStream*> mapActiveProfiles;
Timer* keyFrameRequestBlockTimer{ nullptr }; Timer* keyFrameRequestBlockTimer{ nullptr };
// Others. // Others.
std::vector<RtpEncodingParameters> outputEncodings; std::vector<RtpEncodingParameters> outputEncodings;
...@@ -180,7 +180,7 @@ namespace RTC ...@@ -180,7 +180,7 @@ namespace RTC
inline const std::map<RTC::RtpEncodingParameters::Profile, const RTC::RtpStream*>& Producer:: inline const std::map<RTC::RtpEncodingParameters::Profile, const RTC::RtpStream*>& Producer::
GetActiveProfiles() const GetActiveProfiles() const
{ {
return this->activeProfiles; return this->mapActiveProfiles;
} }
} // namespace RTC } // namespace RTC
......
...@@ -543,7 +543,7 @@ namespace RTC ...@@ -543,7 +543,7 @@ namespace RTC
// Add the stream to the profiles map. // Add the stream to the profiles map.
this->mapRtpStreamProfiles[rtpStream].insert(profile); this->mapRtpStreamProfiles[rtpStream].insert(profile);
// Add new profile/s into activeProfiles and notify the listener. // Add new profile/s into active profiles map and notify the listener.
AddActiveProfiles(rtpStream); AddActiveProfiles(rtpStream);
// Request a key frame since we may have lost the first packets of this stream. // Request a key frame since we may have lost the first packets of this stream.
...@@ -554,7 +554,7 @@ namespace RTC ...@@ -554,7 +554,7 @@ namespace RTC
{ {
MS_TRACE(); MS_TRACE();
// Remove the profiles related to this stream from activeProfiles and notify the listener. // Remove the profiles related to this stream from active profiles map and notify the listener.
RemoveActiveProfiles(rtpStream); RemoveActiveProfiles(rtpStream);
this->rtpStreams.erase(rtpStream->GetSsrc()); this->rtpStreams.erase(rtpStream->GetSsrc());
...@@ -609,7 +609,7 @@ namespace RTC ...@@ -609,7 +609,7 @@ namespace RTC
this->rtpStreams.clear(); this->rtpStreams.clear();
this->mapRtxStreams.clear(); this->mapRtxStreams.clear();
this->mapRtpStreamProfiles.clear(); this->mapRtpStreamProfiles.clear();
this->activeProfiles.clear(); this->mapActiveProfiles.clear();
} }
void Producer::ApplyRtpMapping(RTC::RtpPacket* packet) const void Producer::ApplyRtpMapping(RTC::RtpPacket* packet) const
...@@ -670,11 +670,11 @@ namespace RTC ...@@ -670,11 +670,11 @@ namespace RTC
for (auto& profile : profiles) for (auto& profile : profiles)
{ {
MS_ASSERT( MS_ASSERT(
this->activeProfiles.find(profile) == this->activeProfiles.end(), this->mapActiveProfiles.find(profile) == this->mapActiveProfiles.end(),
"profile already in headltyProfiles set"); "profile already in headltyProfiles set");
// Add the profile to the active profiles map. // Add the profile to the active profiles map.
this->activeProfiles[profile] = rtpStream; this->mapActiveProfiles[profile] = rtpStream;
for (auto& listener : this->listeners) for (auto& listener : this->listeners)
{ {
...@@ -691,11 +691,11 @@ namespace RTC ...@@ -691,11 +691,11 @@ namespace RTC
for (auto& profile : profiles) for (auto& profile : profiles)
{ {
MS_ASSERT( MS_ASSERT(
this->activeProfiles.find(profile) != this->activeProfiles.end(), this->mapActiveProfiles.find(profile) != this->mapActiveProfiles.end(),
"profile not in headltyProfiles"); "profile not in headltyProfiles");
// Remove the profile from the active profiles map. // Remove the profile from the active profiles map.
this->activeProfiles.erase(profile); this->mapActiveProfiles.erase(profile);
for (auto& listener : this->listeners) for (auto& listener : this->listeners)
{ {
...@@ -783,14 +783,14 @@ namespace RTC ...@@ -783,14 +783,14 @@ namespace RTC
"stream not present in mapRtpStreamProfiles"); "stream not present in mapRtpStreamProfiles");
// Single active profile present. Ignore. // Single active profile present. Ignore.
if (this->activeProfiles.size() == 1) if (this->mapActiveProfiles.size() == 1)
return; return;
// Simulcast. Check whether any RTP is being received at all. // Simulcast. Check whether any RTP is being received at all.
uint32_t totalBitrate = 0; uint32_t totalBitrate = 0;
uint64_t now = DepLibUV::GetTime(); uint64_t now = DepLibUV::GetTime();
for (auto it : this->activeProfiles) for (auto it : this->mapActiveProfiles)
{ {
auto activeRtpStream = it.second; auto activeRtpStream = it.second;
auto ssrc = activeRtpStream->GetSsrc(); auto ssrc = activeRtpStream->GetSsrc();
...@@ -808,7 +808,7 @@ namespace RTC ...@@ -808,7 +808,7 @@ namespace RTC
RemoveActiveProfiles(rtpStreamRecv); RemoveActiveProfiles(rtpStreamRecv);
// Reset stream check timer on every active stream. // Reset stream check timer on every active stream.
for (auto it : this->activeProfiles) for (auto it : this->mapActiveProfiles)
{ {
auto activeRtpStream = it.second; auto activeRtpStream = it.second;
auto ssrc = activeRtpStream->GetSsrc(); auto ssrc = activeRtpStream->GetSsrc();
...@@ -832,7 +832,7 @@ namespace RTC ...@@ -832,7 +832,7 @@ namespace RTC
// Check whether the stream is active. // Check whether the stream is active.
const RtpStream* activeRtpStream = nullptr; const RtpStream* activeRtpStream = nullptr;
for (auto it : this->activeProfiles) for (auto it : this->mapActiveProfiles)
{ {
activeRtpStream = it.second; activeRtpStream = it.second;
...@@ -840,7 +840,7 @@ namespace RTC ...@@ -840,7 +840,7 @@ namespace RTC
break; break;
} }
// Add the profiles related to this stream into activeProfiles and notify the listener. // Add the profiles related to this stream into active profiles map and notify the listener.
if (!activeRtpStream) if (!activeRtpStream)
AddActiveProfiles(rtpStreamRecv); AddActiveProfiles(rtpStreamRecv);
} }
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论