| 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()) | 1164 if (kv == rtx_payload_type_map_.end()) |
| 1168 kv = rtx_payload_type_map_.find(payload_type_); | 1165 return nullptr; |
| 1169 if (kv != rtx_payload_type_map_.end()) | 1166 rtx_packet->SetPayloadType(kv->second); |
| 1170 rtx_packet->SetPayloadType(kv->second); | |
| 1171 | 1167 |
| 1172 // Replace sequence number. | 1168 // Replace sequence number. |
| 1173 rtx_packet->SetSequenceNumber(sequence_number_rtx_++); | 1169 rtx_packet->SetSequenceNumber(sequence_number_rtx_++); |
| 1174 | 1170 |
| 1175 // Replace SSRC. | 1171 // Replace SSRC. |
| 1176 rtx_packet->SetSsrc(ssrc_rtx_); | 1172 rtx_packet->SetSsrc(ssrc_rtx_); |
| 1177 } | 1173 } |
| 1178 | 1174 |
| 1179 uint8_t* rtx_payload = | 1175 uint8_t* rtx_payload = |
| 1180 rtx_packet->AllocatePayload(packet.payload_size() + kRtxHeaderSize); | 1176 rtx_packet->AllocatePayload(packet.payload_size() + kRtxHeaderSize); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1238 rtc::CritScope lock(&send_critsect_); | 1234 rtc::CritScope lock(&send_critsect_); |
| 1239 | 1235 |
| 1240 RtpState state; | 1236 RtpState state; |
| 1241 state.sequence_number = sequence_number_rtx_; | 1237 state.sequence_number = sequence_number_rtx_; |
| 1242 state.start_timestamp = timestamp_offset_; | 1238 state.start_timestamp = timestamp_offset_; |
| 1243 | 1239 |
| 1244 return state; | 1240 return state; |
| 1245 } | 1241 } |
| 1246 | 1242 |
| 1247 } // namespace webrtc | 1243 } // namespace webrtc |
| OLD | NEW |