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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 const webrtc::AudioReceiveStream::Config& | 60 const webrtc::AudioReceiveStream::Config& |
61 FakeAudioReceiveStream::GetConfig() const { | 61 FakeAudioReceiveStream::GetConfig() const { |
62 return config_; | 62 return config_; |
63 } | 63 } |
64 | 64 |
65 void FakeAudioReceiveStream::SetStats( | 65 void FakeAudioReceiveStream::SetStats( |
66 const webrtc::AudioReceiveStream::Stats& stats) { | 66 const webrtc::AudioReceiveStream::Stats& stats) { |
67 stats_ = stats; | 67 stats_ = stats; |
68 } | 68 } |
69 | 69 |
70 void FakeAudioReceiveStream::IncrementReceivedPackets() { | 70 bool FakeAudioReceiveStream::VerifyLastPacket(const uint8_t* data, |
71 received_packets_++; | 71 size_t length) const { |
| 72 return last_packet_ == rtc::Buffer(data, length); |
| 73 } |
| 74 |
| 75 bool FakeAudioReceiveStream::DeliverRtp(const uint8_t* packet, |
| 76 size_t length, |
| 77 const webrtc::PacketTime& packet_time) { |
| 78 ++received_packets_; |
| 79 last_packet_.SetData(packet, length); |
| 80 return true; |
| 81 } |
| 82 |
| 83 bool FakeAudioReceiveStream::DeliverRtcp(const uint8_t* packet, size_t length) { |
| 84 return true; |
72 } | 85 } |
73 | 86 |
74 webrtc::AudioReceiveStream::Stats FakeAudioReceiveStream::GetStats() const { | 87 webrtc::AudioReceiveStream::Stats FakeAudioReceiveStream::GetStats() const { |
75 return stats_; | 88 return stats_; |
76 } | 89 } |
77 | 90 |
78 void FakeAudioReceiveStream::SetSink( | 91 void FakeAudioReceiveStream::SetSink( |
79 std::unique_ptr<webrtc::AudioSinkInterface> sink) { | 92 std::unique_ptr<webrtc::AudioSinkInterface> sink) { |
80 sink_ = std::move(sink); | 93 sink_ = std::move(sink); |
81 } | 94 } |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 media_type == webrtc::MediaType::VIDEO) { | 415 media_type == webrtc::MediaType::VIDEO) { |
403 for (auto receiver : video_receive_streams_) { | 416 for (auto receiver : video_receive_streams_) { |
404 if (receiver->GetConfig().rtp.remote_ssrc == ssrc) | 417 if (receiver->GetConfig().rtp.remote_ssrc == ssrc) |
405 return DELIVERY_OK; | 418 return DELIVERY_OK; |
406 } | 419 } |
407 } | 420 } |
408 if (media_type == webrtc::MediaType::ANY || | 421 if (media_type == webrtc::MediaType::ANY || |
409 media_type == webrtc::MediaType::AUDIO) { | 422 media_type == webrtc::MediaType::AUDIO) { |
410 for (auto receiver : audio_receive_streams_) { | 423 for (auto receiver : audio_receive_streams_) { |
411 if (receiver->GetConfig().rtp.remote_ssrc == ssrc) { | 424 if (receiver->GetConfig().rtp.remote_ssrc == ssrc) { |
412 receiver->IncrementReceivedPackets(); | 425 receiver->DeliverRtp(packet, length, packet_time); |
413 return DELIVERY_OK; | 426 return DELIVERY_OK; |
414 } | 427 } |
415 } | 428 } |
416 } | 429 } |
417 return DELIVERY_UNKNOWN_SSRC; | 430 return DELIVERY_UNKNOWN_SSRC; |
418 } | 431 } |
419 | 432 |
420 void FakeCall::SetStats(const webrtc::Call::Stats& stats) { | 433 void FakeCall::SetStats(const webrtc::Call::Stats& stats) { |
421 stats_ = stats; | 434 stats_ = stats; |
422 } | 435 } |
(...skipping 28 matching lines...) Expand all Loading... |
451 case webrtc::MediaType::ANY: | 464 case webrtc::MediaType::ANY: |
452 ADD_FAILURE() | 465 ADD_FAILURE() |
453 << "SignalChannelNetworkState called with unknown parameter."; | 466 << "SignalChannelNetworkState called with unknown parameter."; |
454 } | 467 } |
455 } | 468 } |
456 | 469 |
457 void FakeCall::OnSentPacket(const rtc::SentPacket& sent_packet) { | 470 void FakeCall::OnSentPacket(const rtc::SentPacket& sent_packet) { |
458 last_sent_packet_ = sent_packet; | 471 last_sent_packet_ = sent_packet; |
459 } | 472 } |
460 } // namespace cricket | 473 } // namespace cricket |
OLD | NEW |