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

Unified Diff: webrtc/media/engine/webrtcvideoengine2.cc

Issue 2497773003: Use different RTX payload types for different H264 profiles (Closed)
Patch Set: Fix bug and add test. 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
Index: webrtc/media/engine/webrtcvideoengine2.cc
diff --git a/webrtc/media/engine/webrtcvideoengine2.cc b/webrtc/media/engine/webrtcvideoengine2.cc
index 7e06ea5fdc30071c71a0315af1a9e6778c1e1084..c43dff80d3d140f87334f482df5ae266026c4832 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/videoencodersoftwarefallbackwrapper.h"
@@ -404,7 +405,21 @@ 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;
+ // In H.264, we only support rtx for constrained baseline and constrained
+ // high profile.
+ if (profile == webrtc::H264::kProfileConstrainedBaseline) {
+ rtx_payload_type = kDefaultRtxH264ConstrainedBaselinePlType;
+ } else if (profile == webrtc::H264::kProfileConstrainedHigh) {
+ rtx_payload_type = kDefaultRtxH264ConstrainedHighPlType;
+ } else {
+ return;
+ }
} else if (CodecNamesEq(codec.name, kRedCodecName)) {
rtx_payload_type = kDefaultRtxRedPlType;
} else {
« no previous file with comments | « webrtc/media/engine/payload_type_mapper_unittest.cc ('k') | webrtc/media/engine/webrtcvideoengine2_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698