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

Unified Diff: webrtc/call/call.cc

Issue 2774463003: Don't hardcode MediaType::ANY in FakeNetworkPipe. (Closed)
Patch Set: Update FakeCall::DeliverPacket, for consistency with Call::DeliverRtp. Created 3 years, 9 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
« no previous file with comments | « webrtc/call/bitrate_estimator_tests.cc ('k') | webrtc/call/call_perf_tests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/call/call.cc
diff --git a/webrtc/call/call.cc b/webrtc/call/call.cc
index 6e620b6a6eda0889441f43811f32e6d37db7e12b..9be5d2ee70fc78d5373a6944cbf5b5fb6006964c 100644
--- a/webrtc/call/call.cc
+++ b/webrtc/call/call.cc
@@ -1172,6 +1172,8 @@ PacketReceiver::DeliveryStatus Call::DeliverRtp(MediaType media_type,
const PacketTime& packet_time) {
TRACE_EVENT0("webrtc", "Call::DeliverRtp");
+ RTC_DCHECK(media_type == MediaType::AUDIO || media_type == MediaType::VIDEO);
+
ReadLockScoped read_lock(*receive_crit_);
// TODO(nisse): We should parse the RTP header only here, and pass
// on parsed_packet to the receive streams.
@@ -1185,7 +1187,7 @@ PacketReceiver::DeliveryStatus Call::DeliverRtp(MediaType media_type,
uint32_t ssrc = parsed_packet->Ssrc();
- if (media_type == MediaType::ANY || media_type == MediaType::AUDIO) {
+ if (media_type == MediaType::AUDIO) {
auto it = audio_receive_ssrcs_.find(ssrc);
if (it != audio_receive_ssrcs_.end()) {
received_bytes_per_second_counter_.Add(static_cast<int>(length));
@@ -1195,7 +1197,7 @@ PacketReceiver::DeliveryStatus Call::DeliverRtp(MediaType media_type,
return DELIVERY_OK;
}
}
- if (media_type == MediaType::ANY || media_type == MediaType::VIDEO) {
+ if (media_type == MediaType::VIDEO) {
auto it = video_receive_ssrcs_.find(ssrc);
if (it != video_receive_ssrcs_.end()) {
received_bytes_per_second_counter_.Add(static_cast<int>(length));
@@ -1211,7 +1213,7 @@ PacketReceiver::DeliveryStatus Call::DeliverRtp(MediaType media_type,
return DELIVERY_OK;
}
}
- if (media_type == MediaType::ANY || media_type == MediaType::VIDEO) {
+ if (media_type == MediaType::VIDEO) {
received_bytes_per_second_counter_.Add(static_cast<int>(length));
// TODO(brandtr): Update here when FlexFEC supports protecting audio.
received_video_bytes_per_second_counter_.Add(static_cast<int>(length));
« 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