OLD | NEW |
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 Loading... |
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 |
523 uint32_t ssrc; | 526 uint32_t ssrc; |
524 if (!GetRtpSsrc(packet, length, &ssrc)) | 527 if (!GetRtpSsrc(packet, length, &ssrc)) |
525 return DELIVERY_PACKET_ERROR; | 528 return DELIVERY_PACKET_ERROR; |
526 | 529 |
527 if (media_type == webrtc::MediaType::ANY || | 530 if (media_type == webrtc::MediaType::VIDEO) { |
528 media_type == webrtc::MediaType::VIDEO) { | |
529 for (auto receiver : video_receive_streams_) { | 531 for (auto receiver : video_receive_streams_) { |
530 if (receiver->GetConfig().rtp.remote_ssrc == ssrc) | 532 if (receiver->GetConfig().rtp.remote_ssrc == ssrc) |
531 return DELIVERY_OK; | 533 return DELIVERY_OK; |
532 } | 534 } |
533 } | 535 } |
534 if (media_type == webrtc::MediaType::ANY || | 536 if (media_type == webrtc::MediaType::AUDIO) { |
535 media_type == webrtc::MediaType::AUDIO) { | |
536 for (auto receiver : audio_receive_streams_) { | 537 for (auto receiver : audio_receive_streams_) { |
537 if (receiver->GetConfig().rtp.remote_ssrc == ssrc) { | 538 if (receiver->GetConfig().rtp.remote_ssrc == ssrc) { |
538 receiver->DeliverRtp(packet, length, packet_time); | 539 receiver->DeliverRtp(packet, length, packet_time); |
539 return DELIVERY_OK; | 540 return DELIVERY_OK; |
540 } | 541 } |
541 } | 542 } |
542 } | 543 } |
543 return DELIVERY_UNKNOWN_SSRC; | 544 return DELIVERY_UNKNOWN_SSRC; |
544 } | 545 } |
545 | 546 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 } | 598 } |
598 | 599 |
599 void FakeCall::OnSentPacket(const rtc::SentPacket& sent_packet) { | 600 void FakeCall::OnSentPacket(const rtc::SentPacket& sent_packet) { |
600 last_sent_packet_ = sent_packet; | 601 last_sent_packet_ = sent_packet; |
601 if (sent_packet.packet_id >= 0) { | 602 if (sent_packet.packet_id >= 0) { |
602 last_sent_nonnegative_packet_id_ = sent_packet.packet_id; | 603 last_sent_nonnegative_packet_id_ = sent_packet.packet_id; |
603 } | 604 } |
604 } | 605 } |
605 | 606 |
606 } // namespace cricket | 607 } // namespace cricket |
OLD | NEW |