OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1191 } | 1191 } |
1192 if (media_type == MediaType::ANY || media_type == MediaType::AUDIO) { | 1192 if (media_type == MediaType::ANY || media_type == MediaType::AUDIO) { |
1193 ReadLockScoped read_lock(*send_crit_); | 1193 ReadLockScoped read_lock(*send_crit_); |
1194 for (auto& kv : audio_send_ssrcs_) { | 1194 for (auto& kv : audio_send_ssrcs_) { |
1195 if (kv.second->DeliverRtcp(packet, length)) | 1195 if (kv.second->DeliverRtcp(packet, length)) |
1196 rtcp_delivered = true; | 1196 rtcp_delivered = true; |
1197 } | 1197 } |
1198 } | 1198 } |
1199 | 1199 |
1200 if (rtcp_delivered) | 1200 if (rtcp_delivered) |
1201 event_log_->LogRtcpPacket(kIncomingPacket, media_type, packet, length); | 1201 event_log_->LogRtcpPacket(kIncomingPacket, packet, length); |
1202 | 1202 |
1203 return rtcp_delivered ? DELIVERY_OK : DELIVERY_PACKET_ERROR; | 1203 return rtcp_delivered ? DELIVERY_OK : DELIVERY_PACKET_ERROR; |
1204 } | 1204 } |
1205 | 1205 |
1206 PacketReceiver::DeliveryStatus Call::DeliverRtp(MediaType media_type, | 1206 PacketReceiver::DeliveryStatus Call::DeliverRtp(MediaType media_type, |
1207 const uint8_t* packet, | 1207 const uint8_t* packet, |
1208 size_t length, | 1208 size_t length, |
1209 const PacketTime& packet_time) { | 1209 const PacketTime& packet_time) { |
1210 TRACE_EVENT0("webrtc", "Call::DeliverRtp"); | 1210 TRACE_EVENT0("webrtc", "Call::DeliverRtp"); |
1211 | 1211 |
1212 RTC_DCHECK(media_type == MediaType::AUDIO || media_type == MediaType::VIDEO); | 1212 RTC_DCHECK(media_type == MediaType::AUDIO || media_type == MediaType::VIDEO); |
1213 | 1213 |
1214 ReadLockScoped read_lock(*receive_crit_); | 1214 ReadLockScoped read_lock(*receive_crit_); |
1215 // TODO(nisse): We should parse the RTP header only here, and pass | 1215 // TODO(nisse): We should parse the RTP header only here, and pass |
1216 // on parsed_packet to the receive streams. | 1216 // on parsed_packet to the receive streams. |
1217 rtc::Optional<RtpPacketReceived> parsed_packet = | 1217 rtc::Optional<RtpPacketReceived> parsed_packet = |
1218 ParseRtpPacket(packet, length, &packet_time); | 1218 ParseRtpPacket(packet, length, &packet_time); |
1219 | 1219 |
1220 if (!parsed_packet) | 1220 if (!parsed_packet) |
1221 return DELIVERY_PACKET_ERROR; | 1221 return DELIVERY_PACKET_ERROR; |
1222 | 1222 |
1223 NotifyBweOfReceivedPacket(*parsed_packet, media_type); | 1223 NotifyBweOfReceivedPacket(*parsed_packet, media_type); |
1224 | 1224 |
1225 if (media_type == MediaType::AUDIO) { | 1225 if (media_type == MediaType::AUDIO) { |
1226 if (audio_rtp_demuxer_.OnRtpPacket(*parsed_packet)) { | 1226 if (audio_rtp_demuxer_.OnRtpPacket(*parsed_packet)) { |
1227 received_bytes_per_second_counter_.Add(static_cast<int>(length)); | 1227 received_bytes_per_second_counter_.Add(static_cast<int>(length)); |
1228 received_audio_bytes_per_second_counter_.Add(static_cast<int>(length)); | 1228 received_audio_bytes_per_second_counter_.Add(static_cast<int>(length)); |
1229 event_log_->LogRtpHeader(kIncomingPacket, media_type, packet, length); | 1229 event_log_->LogRtpHeader(kIncomingPacket, packet, length); |
1230 return DELIVERY_OK; | 1230 return DELIVERY_OK; |
1231 } | 1231 } |
1232 } else if (media_type == MediaType::VIDEO) { | 1232 } else if (media_type == MediaType::VIDEO) { |
1233 if (video_rtp_demuxer_.OnRtpPacket(*parsed_packet)) { | 1233 if (video_rtp_demuxer_.OnRtpPacket(*parsed_packet)) { |
1234 received_bytes_per_second_counter_.Add(static_cast<int>(length)); | 1234 received_bytes_per_second_counter_.Add(static_cast<int>(length)); |
1235 received_video_bytes_per_second_counter_.Add(static_cast<int>(length)); | 1235 received_video_bytes_per_second_counter_.Add(static_cast<int>(length)); |
1236 event_log_->LogRtpHeader(kIncomingPacket, media_type, packet, length); | 1236 event_log_->LogRtpHeader(kIncomingPacket, packet, length); |
1237 return DELIVERY_OK; | 1237 return DELIVERY_OK; |
1238 } | 1238 } |
1239 } | 1239 } |
1240 return DELIVERY_UNKNOWN_SSRC; | 1240 return DELIVERY_UNKNOWN_SSRC; |
1241 } | 1241 } |
1242 | 1242 |
1243 PacketReceiver::DeliveryStatus Call::DeliverPacket( | 1243 PacketReceiver::DeliveryStatus Call::DeliverPacket( |
1244 MediaType media_type, | 1244 MediaType media_type, |
1245 const uint8_t* packet, | 1245 const uint8_t* packet, |
1246 size_t length, | 1246 size_t length, |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1293 (use_send_side_bwe && header.extension.hasTransportSequenceNumber)) { | 1293 (use_send_side_bwe && header.extension.hasTransportSequenceNumber)) { |
1294 receive_side_cc_.OnReceivedPacket( | 1294 receive_side_cc_.OnReceivedPacket( |
1295 packet.arrival_time_ms(), packet.payload_size() + packet.padding_size(), | 1295 packet.arrival_time_ms(), packet.payload_size() + packet.padding_size(), |
1296 header); | 1296 header); |
1297 } | 1297 } |
1298 } | 1298 } |
1299 | 1299 |
1300 } // namespace internal | 1300 } // namespace internal |
1301 | 1301 |
1302 } // namespace webrtc | 1302 } // namespace webrtc |
OLD | NEW |