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

Unified Diff: webrtc/modules/rtp_rtcp/source/rtp_payload_registry.cc

Issue 1649493004: Support multiple rtx codecs. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase. Created 4 years, 11 months 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/modules/rtp_rtcp/source/rtp_payload_registry.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_payload_registry.cc b/webrtc/modules/rtp_rtcp/source/rtp_payload_registry.cc
index ce0bcd7fed9d9442033086fa79f428a035646db1..a862f1a9dcf7ecf06501e7bd1082004bd0f0d91e 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_payload_registry.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_payload_registry.cc
@@ -25,7 +25,6 @@ RTPPayloadRegistry::RTPPayloadRegistry(RTPPayloadStrategy* rtp_payload_strategy)
last_received_media_payload_type_(-1),
rtx_(false),
rtx_payload_type_(-1),
- use_rtx_payload_mapping_on_restore_(false),
ssrc_rtx_(0) {}
RTPPayloadRegistry::~RTPPayloadRegistry() {
@@ -271,21 +270,18 @@ bool RTPPayloadRegistry::RestoreOriginalPacket(uint8_t* restored_packet,
int associated_payload_type;
auto apt_mapping = rtx_payload_type_map_.find(header.payloadType);
- if (use_rtx_payload_mapping_on_restore_ &&
- apt_mapping != rtx_payload_type_map_.end()) {
- associated_payload_type = apt_mapping->second;
- } else {
- // In the future, this will be a bug. For now, just assume this RTX packet
- // matches the last non-RTX payload type we received. There are cases where
- // this could break, especially where RTX is sent outside of NACKing (e.g.
- // padding with redundant payloads).
- if (rtx_payload_type_ == -1 || incoming_payload_type_ == -1) {
- LOG(LS_WARNING) << "Incorrect RTX configuration, dropping packet.";
- return false;
- }
- associated_payload_type = incoming_payload_type_;
+ if (apt_mapping == rtx_payload_type_map_.end())
+ return false;
+ associated_payload_type = apt_mapping->second;
+ if (red_payload_type_ != -1) {
+ // Assume red will be used if it's configured.
+ // This is a workaround for a Chrome sdp bug where rtx is associated
+ // with the media codec even though media is sent over red.
+ // TODO(holmer): Remove once the Chrome versions exposing this bug are
+ // old enough, which should be once Chrome Stable reaches M53 as this
+ // work-around went into M50.
+ associated_payload_type = red_payload_type_;
}
-
restored_packet[1] = static_cast<uint8_t>(associated_payload_type);
if (header.markerBit) {
restored_packet[1] |= kRtpMarkerBitMask; // Marker bit is set.
« no previous file with comments | « webrtc/modules/rtp_rtcp/include/rtp_rtcp.h ('k') | webrtc/modules/rtp_rtcp/source/rtp_payload_registry_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698