Chromium Code Reviews| 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( |