Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Unified Diff: webrtc/pc/channelmanager.cc

Issue 2492473002: Stop caching supported codecs in WebRtcVideoEngine2 (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/pc/channelmanager.h ('k') | webrtc/pc/channelmanager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/pc/channelmanager.cc
diff --git a/webrtc/pc/channelmanager.cc b/webrtc/pc/channelmanager.cc
index 06475e9eaa26f13ec0883a1c8e8654675cbf8e9e..fb6f44f846d7acf50543ec83f491a22a84bc5b80 100644
--- a/webrtc/pc/channelmanager.cc
+++ b/webrtc/pc/channelmanager.cc
@@ -29,6 +29,9 @@
namespace cricket {
+static bool IsRtxCodec(const VideoCodec& codec) {
+ return _stricmp(kRtxCodecName, codec.name.c_str()) == 0;
tommi 2016/11/09 16:24:30 in tests, we have case sensitive comparisons for t
magjed_webrtc 2016/11/09 20:37:53 Ok, I will ask hta@ for advice. The code here is j
tommi 2016/11/09 20:59:50 There's a version of compare() that takes a const
magjed_webrtc 2016/11/09 21:15:10 Ah cool, I missed that.
+}
using rtc::Bind;
@@ -137,18 +140,13 @@ void ChannelManager::GetSupportedAudioRtpHeaderExtensions(
*ext = media_engine_->GetAudioCapabilities().header_extensions;
}
-void ChannelManager::GetSupportedVideoCodecs(
- std::vector<VideoCodec>* codecs) const {
- codecs->clear();
-
- std::vector<VideoCodec>::const_iterator it;
- for (it = media_engine_->video_codecs().begin();
- it != media_engine_->video_codecs().end(); ++it) {
- if (!enable_rtx_ && _stricmp(kRtxCodecName, it->name.c_str()) == 0) {
- continue;
- }
- codecs->push_back(*it);
+std::vector<VideoCodec> ChannelManager::GetSupportedVideoCodecs() const {
+ std::vector<VideoCodec> codecs = media_engine_->video_codecs();
+ if (!enable_rtx_) {
+ codecs.erase(std::remove_if(codecs.begin(), codecs.end(), &IsRtxCodec),
+ codecs.end());
}
+ return codecs;
}
void ChannelManager::GetSupportedVideoRtpHeaderExtensions(
« no previous file with comments | « webrtc/pc/channelmanager.h ('k') | webrtc/pc/channelmanager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698