OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1151 // TODO(danilchap): Create rtx packet with extra capacity for SRTP | 1151 // TODO(danilchap): Create rtx packet with extra capacity for SRTP |
1152 // when transport interface would be updated to take buffer class. | 1152 // when transport interface would be updated to take buffer class. |
1153 std::unique_ptr<RtpPacketToSend> rtx_packet(new RtpPacketToSend( | 1153 std::unique_ptr<RtpPacketToSend> rtx_packet(new RtpPacketToSend( |
1154 &rtp_header_extension_map_, packet.size() + kRtxHeaderSize)); | 1154 &rtp_header_extension_map_, packet.size() + kRtxHeaderSize)); |
1155 // Add original RTP header. | 1155 // Add original RTP header. |
1156 rtx_packet->CopyHeaderFrom(packet); | 1156 rtx_packet->CopyHeaderFrom(packet); |
1157 { | 1157 { |
1158 rtc::CritScope lock(&send_critsect_); | 1158 rtc::CritScope lock(&send_critsect_); |
1159 if (!sending_media_) | 1159 if (!sending_media_) |
1160 return nullptr; | 1160 return nullptr; |
1161 // Replace payload type, if a specific type is set for RTX. | 1161 |
1162 // Replace payload type. | |
1162 auto kv = rtx_payload_type_map_.find(packet.PayloadType()); | 1163 auto kv = rtx_payload_type_map_.find(packet.PayloadType()); |
1163 | |
1164 // Use rtx mapping associated with media codec if we can't find one, | |
1165 // assume it's red. | |
1166 // TODO(holmer): Remove once old Chrome versions don't rely on this. | |
1167 if (kv == rtx_payload_type_map_.end()) | |
1168 kv = rtx_payload_type_map_.find(payload_type_); | |
1169 if (kv != rtx_payload_type_map_.end()) | 1164 if (kv != rtx_payload_type_map_.end()) |
danilchap
2016/11/02 13:56:52
this look like hack 'If no payload type mapping ex
brandtr
2016/11/03 12:02:48
It should be safe to reject sending it, because al
| |
1170 rtx_packet->SetPayloadType(kv->second); | 1165 rtx_packet->SetPayloadType(kv->second); |
1171 | 1166 |
1172 // Replace sequence number. | 1167 // Replace sequence number. |
1173 rtx_packet->SetSequenceNumber(sequence_number_rtx_++); | 1168 rtx_packet->SetSequenceNumber(sequence_number_rtx_++); |
1174 | 1169 |
1175 // Replace SSRC. | 1170 // Replace SSRC. |
1176 rtx_packet->SetSsrc(ssrc_rtx_); | 1171 rtx_packet->SetSsrc(ssrc_rtx_); |
1177 } | 1172 } |
1178 | 1173 |
1179 uint8_t* rtx_payload = | 1174 uint8_t* rtx_payload = |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1238 rtc::CritScope lock(&send_critsect_); | 1233 rtc::CritScope lock(&send_critsect_); |
1239 | 1234 |
1240 RtpState state; | 1235 RtpState state; |
1241 state.sequence_number = sequence_number_rtx_; | 1236 state.sequence_number = sequence_number_rtx_; |
1242 state.start_timestamp = timestamp_offset_; | 1237 state.start_timestamp = timestamp_offset_; |
1243 | 1238 |
1244 return state; | 1239 return state; |
1245 } | 1240 } |
1246 | 1241 |
1247 } // namespace webrtc | 1242 } // namespace webrtc |
OLD | NEW |