Index: webrtc/media/engine/webrtcvideoengine2.cc |
diff --git a/webrtc/media/engine/webrtcvideoengine2.cc b/webrtc/media/engine/webrtcvideoengine2.cc |
index 2ebbd78e9861e837e0a37335794c3a0a7aef1be5..0b8c761170a38d3f19d12870bc68ac287ceeac70 100644 |
--- a/webrtc/media/engine/webrtcvideoengine2.cc |
+++ b/webrtc/media/engine/webrtcvideoengine2.cc |
@@ -22,6 +22,7 @@ |
#include "webrtc/base/timeutils.h" |
#include "webrtc/base/trace_event.h" |
#include "webrtc/call.h" |
+#include "webrtc/common_video/h264/profile_level_id.h" |
#include "webrtc/media/engine/constants.h" |
#include "webrtc/media/engine/simulcast.h" |
#include "webrtc/media/engine/webrtcmediaengine.h" |
@@ -403,7 +404,18 @@ void AddCodecAndMaybeRtxCodec(const VideoCodec& codec, |
} else if (CodecNamesEq(codec.name, kVp9CodecName)) { |
rtx_payload_type = kDefaultRtxVp9PlType; |
} else if (CodecNamesEq(codec.name, kH264CodecName)) { |
- rtx_payload_type = kDefaultRtxH264PlType; |
+ // Parse H264 profile. |
+ const rtc::Optional<webrtc::H264::ProfileLevelId> profile_level_id = |
+ webrtc::H264::ParseSdpProfileLevelId(codec.params); |
+ if (!profile_level_id) |
+ return; |
+ const webrtc::H264::Profile profile = profile_level_id->profile; |
+ // Only supported rtx for constrained baseline and constrained high profile. |
hta-webrtc
2016/11/15 10:41:07
Grammar nit: "In H.264, we only support rtx for co
magjed_webrtc
2016/11/15 17:48:04
Done.
|
+ if (profile == webrtc::H264::kProfileConstrainedBaseline) { |
+ rtx_payload_type = kDefaultRtxH264ConstrainedBaselinePlType; |
+ } else if (profile == webrtc::H264::kProfileConstrainedHigh) { |
+ rtx_payload_type = kDefaultRtxH264ConstrainedHighPlType; |
+ } |
hta-webrtc
2016/11/15 10:41:07
"Else" missing - if this is neither of the two abo
magjed_webrtc
2016/11/15 17:48:04
Done.
|
} else if (CodecNamesEq(codec.name, kRedCodecName)) { |
rtx_payload_type = kDefaultRtxRedPlType; |
} else { |