Index: webrtc/media/engine/webrtcvideoengine2.cc |
diff --git a/webrtc/media/engine/webrtcvideoengine2.cc b/webrtc/media/engine/webrtcvideoengine2.cc |
index 3cacc7da82ba3ee32cdfa69abf271635df9ec98b..0a3c737ffa8c551d1e3956eef633285543750d91 100644 |
--- a/webrtc/media/engine/webrtcvideoengine2.cc |
+++ b/webrtc/media/engine/webrtcvideoengine2.cc |
@@ -638,7 +638,7 @@ static std::vector<VideoCodec> GetSupportedCodecs( |
out << ", "; |
} |
// Don't add internally-supported codecs twice. |
- if (IsCodecSupported(supported_codecs, codec)) |
+ if (FindMatchingCodec(supported_codecs, codec)) |
continue; |
// External video encoders are given payloads 120-127. This also means that |
@@ -700,7 +700,12 @@ WebRtcVideoChannel2::SelectSendVideoCodec( |
GetSupportedCodecs(external_encoder_factory_); |
// Select the first remote codec that is supported locally. |
for (const VideoCodecSettings& remote_mapped_codec : remote_mapped_codecs) { |
- if (IsCodecSupported(local_supported_codecs, remote_mapped_codec.codec)) |
+ // For H264, we will limit the encode level to the remote offered level |
+ // regardless if level asymmetry is allowed or not. This is strictly not |
+ // following the spec in https://tools.ietf.org/html/rfc6184#section-8.2.2 |
+ // since we should limit the encode level to the lower of local and remote |
+ // level when level asymmetry is not allowed. |
+ if (FindMatchingCodec(local_supported_codecs, remote_mapped_codec.codec)) |
return rtc::Optional<VideoCodecSettings>(remote_mapped_codec); |
} |
// No remote codec was supported. |
@@ -969,7 +974,7 @@ bool WebRtcVideoChannel2::GetChangedRecvParameters( |
const std::vector<VideoCodec> local_supported_codecs = |
GetSupportedCodecs(external_encoder_factory_); |
for (const VideoCodecSettings& mapped_codec : mapped_codecs) { |
- if (!IsCodecSupported(local_supported_codecs, mapped_codec.codec)) { |
+ if (!FindMatchingCodec(local_supported_codecs, mapped_codec.codec)) { |
LOG(LS_ERROR) << "SetRecvParameters called with unsupported video codec: " |
<< mapped_codec.codec.ToString(); |
return false; |