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

Side by Side Diff: webrtc/media/engine/fakewebrtccall.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/rampup_tests.cc ('k') | webrtc/test/call_test.h » ('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) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 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 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 webrtc::PacketReceiver* FakeCall::Receiver() { 513 webrtc::PacketReceiver* FakeCall::Receiver() {
514 return this; 514 return this;
515 } 515 }
516 516
517 FakeCall::DeliveryStatus FakeCall::DeliverPacket( 517 FakeCall::DeliveryStatus FakeCall::DeliverPacket(
518 webrtc::MediaType media_type, 518 webrtc::MediaType media_type,
519 const uint8_t* packet, 519 const uint8_t* packet,
520 size_t length, 520 size_t length,
521 const webrtc::PacketTime& packet_time) { 521 const webrtc::PacketTime& packet_time) {
522 EXPECT_GE(length, 12u); 522 EXPECT_GE(length, 12u);
523 RTC_DCHECK(media_type == webrtc::MediaType::AUDIO ||
524 media_type == webrtc::MediaType::VIDEO);
525
526 uint32_t ssrc; 523 uint32_t ssrc;
527 if (!GetRtpSsrc(packet, length, &ssrc)) 524 if (!GetRtpSsrc(packet, length, &ssrc))
528 return DELIVERY_PACKET_ERROR; 525 return DELIVERY_PACKET_ERROR;
529 526
530 if (media_type == webrtc::MediaType::VIDEO) { 527 if (media_type == webrtc::MediaType::ANY ||
528 media_type == webrtc::MediaType::VIDEO) {
531 for (auto receiver : video_receive_streams_) { 529 for (auto receiver : video_receive_streams_) {
532 if (receiver->GetConfig().rtp.remote_ssrc == ssrc) 530 if (receiver->GetConfig().rtp.remote_ssrc == ssrc)
533 return DELIVERY_OK; 531 return DELIVERY_OK;
534 } 532 }
535 } 533 }
536 if (media_type == webrtc::MediaType::AUDIO) { 534 if (media_type == webrtc::MediaType::ANY ||
535 media_type == webrtc::MediaType::AUDIO) {
537 for (auto receiver : audio_receive_streams_) { 536 for (auto receiver : audio_receive_streams_) {
538 if (receiver->GetConfig().rtp.remote_ssrc == ssrc) { 537 if (receiver->GetConfig().rtp.remote_ssrc == ssrc) {
539 receiver->DeliverRtp(packet, length, packet_time); 538 receiver->DeliverRtp(packet, length, packet_time);
540 return DELIVERY_OK; 539 return DELIVERY_OK;
541 } 540 }
542 } 541 }
543 } 542 }
544 return DELIVERY_UNKNOWN_SSRC; 543 return DELIVERY_UNKNOWN_SSRC;
545 } 544 }
546 545
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 } 597 }
599 598
600 void FakeCall::OnSentPacket(const rtc::SentPacket& sent_packet) { 599 void FakeCall::OnSentPacket(const rtc::SentPacket& sent_packet) {
601 last_sent_packet_ = sent_packet; 600 last_sent_packet_ = sent_packet;
602 if (sent_packet.packet_id >= 0) { 601 if (sent_packet.packet_id >= 0) {
603 last_sent_nonnegative_packet_id_ = sent_packet.packet_id; 602 last_sent_nonnegative_packet_id_ = sent_packet.packet_id;
604 } 603 }
605 } 604 }
606 605
607 } // namespace cricket 606 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/call/rampup_tests.cc ('k') | webrtc/test/call_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698