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

Unified Diff: webrtc/pc/channelmanager.cc

Issue 2489173004: Revert of 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 fb6f44f846d7acf50543ec83f491a22a84bc5b80..06475e9eaa26f13ec0883a1c8e8654675cbf8e9e 100644
--- a/webrtc/pc/channelmanager.cc
+++ b/webrtc/pc/channelmanager.cc
@@ -29,9 +29,6 @@
namespace cricket {
-static bool IsRtxCodec(const VideoCodec& codec) {
- return _stricmp(kRtxCodecName, codec.name.c_str()) == 0;
-}
using rtc::Bind;
@@ -140,13 +137,18 @@
*ext = media_engine_->GetAudioCapabilities().header_extensions;
}
-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::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);
+ }
}
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