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

Side by Side Diff: webrtc/call/call.cc

Issue 2784543002: Revert of Don't hardcode MediaType::ANY in FakeNetworkPipe. (Closed)
Patch Set: Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « webrtc/call/bitrate_estimator_tests.cc ('k') | webrtc/call/call_perf_tests.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1154 matching lines...) Expand 10 before | Expand all | Expand 10 after
1165 1165
1166 return rtcp_delivered ? DELIVERY_OK : DELIVERY_PACKET_ERROR; 1166 return rtcp_delivered ? DELIVERY_OK : DELIVERY_PACKET_ERROR;
1167 } 1167 }
1168 1168
1169 PacketReceiver::DeliveryStatus Call::DeliverRtp(MediaType media_type, 1169 PacketReceiver::DeliveryStatus Call::DeliverRtp(MediaType media_type,
1170 const uint8_t* packet, 1170 const uint8_t* packet,
1171 size_t length, 1171 size_t length,
1172 const PacketTime& packet_time) { 1172 const PacketTime& packet_time) {
1173 TRACE_EVENT0("webrtc", "Call::DeliverRtp"); 1173 TRACE_EVENT0("webrtc", "Call::DeliverRtp");
1174 1174
1175 RTC_DCHECK(media_type == MediaType::AUDIO || media_type == MediaType::VIDEO);
1176
1177 ReadLockScoped read_lock(*receive_crit_); 1175 ReadLockScoped read_lock(*receive_crit_);
1178 // TODO(nisse): We should parse the RTP header only here, and pass 1176 // TODO(nisse): We should parse the RTP header only here, and pass
1179 // on parsed_packet to the receive streams. 1177 // on parsed_packet to the receive streams.
1180 rtc::Optional<RtpPacketReceived> parsed_packet = 1178 rtc::Optional<RtpPacketReceived> parsed_packet =
1181 ParseRtpPacket(packet, length, packet_time); 1179 ParseRtpPacket(packet, length, packet_time);
1182 1180
1183 if (!parsed_packet) 1181 if (!parsed_packet)
1184 return DELIVERY_PACKET_ERROR; 1182 return DELIVERY_PACKET_ERROR;
1185 1183
1186 NotifyBweOfReceivedPacket(*parsed_packet, media_type); 1184 NotifyBweOfReceivedPacket(*parsed_packet, media_type);
1187 1185
1188 uint32_t ssrc = parsed_packet->Ssrc(); 1186 uint32_t ssrc = parsed_packet->Ssrc();
1189 1187
1190 if (media_type == MediaType::AUDIO) { 1188 if (media_type == MediaType::ANY || media_type == MediaType::AUDIO) {
1191 auto it = audio_receive_ssrcs_.find(ssrc); 1189 auto it = audio_receive_ssrcs_.find(ssrc);
1192 if (it != audio_receive_ssrcs_.end()) { 1190 if (it != audio_receive_ssrcs_.end()) {
1193 received_bytes_per_second_counter_.Add(static_cast<int>(length)); 1191 received_bytes_per_second_counter_.Add(static_cast<int>(length));
1194 received_audio_bytes_per_second_counter_.Add(static_cast<int>(length)); 1192 received_audio_bytes_per_second_counter_.Add(static_cast<int>(length));
1195 it->second->OnRtpPacket(*parsed_packet); 1193 it->second->OnRtpPacket(*parsed_packet);
1196 event_log_->LogRtpHeader(kIncomingPacket, media_type, packet, length); 1194 event_log_->LogRtpHeader(kIncomingPacket, media_type, packet, length);
1197 return DELIVERY_OK; 1195 return DELIVERY_OK;
1198 } 1196 }
1199 } 1197 }
1200 if (media_type == MediaType::VIDEO) { 1198 if (media_type == MediaType::ANY || media_type == MediaType::VIDEO) {
1201 auto it = video_receive_ssrcs_.find(ssrc); 1199 auto it = video_receive_ssrcs_.find(ssrc);
1202 if (it != video_receive_ssrcs_.end()) { 1200 if (it != video_receive_ssrcs_.end()) {
1203 received_bytes_per_second_counter_.Add(static_cast<int>(length)); 1201 received_bytes_per_second_counter_.Add(static_cast<int>(length));
1204 received_video_bytes_per_second_counter_.Add(static_cast<int>(length)); 1202 received_video_bytes_per_second_counter_.Add(static_cast<int>(length));
1205 it->second->OnRtpPacket(*parsed_packet); 1203 it->second->OnRtpPacket(*parsed_packet);
1206 1204
1207 // Deliver media packets to FlexFEC subsystem. 1205 // Deliver media packets to FlexFEC subsystem.
1208 auto it_bounds = flexfec_receive_ssrcs_media_.equal_range(ssrc); 1206 auto it_bounds = flexfec_receive_ssrcs_media_.equal_range(ssrc);
1209 for (auto it = it_bounds.first; it != it_bounds.second; ++it) 1207 for (auto it = it_bounds.first; it != it_bounds.second; ++it)
1210 it->second->OnRtpPacket(*parsed_packet); 1208 it->second->OnRtpPacket(*parsed_packet);
1211 1209
1212 event_log_->LogRtpHeader(kIncomingPacket, media_type, packet, length); 1210 event_log_->LogRtpHeader(kIncomingPacket, media_type, packet, length);
1213 return DELIVERY_OK; 1211 return DELIVERY_OK;
1214 } 1212 }
1215 } 1213 }
1216 if (media_type == MediaType::VIDEO) { 1214 if (media_type == MediaType::ANY || media_type == MediaType::VIDEO) {
1217 received_bytes_per_second_counter_.Add(static_cast<int>(length)); 1215 received_bytes_per_second_counter_.Add(static_cast<int>(length));
1218 // TODO(brandtr): Update here when FlexFEC supports protecting audio. 1216 // TODO(brandtr): Update here when FlexFEC supports protecting audio.
1219 received_video_bytes_per_second_counter_.Add(static_cast<int>(length)); 1217 received_video_bytes_per_second_counter_.Add(static_cast<int>(length));
1220 auto it = flexfec_receive_ssrcs_protection_.find(ssrc); 1218 auto it = flexfec_receive_ssrcs_protection_.find(ssrc);
1221 if (it != flexfec_receive_ssrcs_protection_.end()) { 1219 if (it != flexfec_receive_ssrcs_protection_.end()) {
1222 it->second->OnRtpPacket(*parsed_packet); 1220 it->second->OnRtpPacket(*parsed_packet);
1223 event_log_->LogRtpHeader(kIncomingPacket, media_type, packet, length); 1221 event_log_->LogRtpHeader(kIncomingPacket, media_type, packet, length);
1224 return DELIVERY_OK; 1222 return DELIVERY_OK;
1225 } 1223 }
1226 } 1224 }
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
1279 if (media_type != MediaType::AUDIO || 1277 if (media_type != MediaType::AUDIO ||
1280 (use_send_side_bwe && header.extension.hasTransportSequenceNumber)) { 1278 (use_send_side_bwe && header.extension.hasTransportSequenceNumber)) {
1281 receive_side_cc_.OnReceivedPacket( 1279 receive_side_cc_.OnReceivedPacket(
1282 packet.arrival_time_ms(), packet.payload_size() + packet.padding_size(), 1280 packet.arrival_time_ms(), packet.payload_size() + packet.padding_size(),
1283 header); 1281 header);
1284 } 1282 }
1285 } 1283 }
1286 1284
1287 } // namespace internal 1285 } // namespace internal
1288 } // namespace webrtc 1286 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/call/bitrate_estimator_tests.cc ('k') | webrtc/call/call_perf_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698