OLD | NEW |
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 #include "webrtc/test/direct_transport.h" | 10 #include "webrtc/test/direct_transport.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 // Constructor updates |next_scheduled_task_|, so it's guaranteed to | 87 // Constructor updates |next_scheduled_task_|, so it's guaranteed to |
88 // be initialized. | 88 // be initialized. |
89 task_queue_->CancelTask(next_scheduled_task_); | 89 task_queue_->CancelTask(next_scheduled_task_); |
90 } | 90 } |
91 | 91 |
92 void DirectTransport::SetConfig(const FakeNetworkPipe::Config& config) { | 92 void DirectTransport::SetConfig(const FakeNetworkPipe::Config& config) { |
93 fake_network_.SetConfig(config); | 93 fake_network_.SetConfig(config); |
94 } | 94 } |
95 | 95 |
96 void DirectTransport::StopSending() { | 96 void DirectTransport::StopSending() { |
| 97 RTC_DCHECK_CALLED_SEQUENTIALLY(&sequence_checker_); |
97 task_queue_->CancelTask(next_scheduled_task_); | 98 task_queue_->CancelTask(next_scheduled_task_); |
98 } | 99 } |
99 | 100 |
100 void DirectTransport::SetReceiver(PacketReceiver* receiver) { | 101 void DirectTransport::SetReceiver(PacketReceiver* receiver) { |
101 RTC_DCHECK_CALLED_SEQUENTIALLY(&sequence_checker_); | 102 RTC_DCHECK_CALLED_SEQUENTIALLY(&sequence_checker_); |
102 fake_network_.SetReceiver(receiver); | 103 fake_network_.SetReceiver(receiver); |
103 } | 104 } |
104 | 105 |
105 bool DirectTransport::SendRtp(const uint8_t* data, | 106 bool DirectTransport::SendRtp(const uint8_t* data, |
106 size_t length, | 107 size_t length, |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 | 145 |
145 fake_network_.Process(); | 146 fake_network_.Process(); |
146 | 147 |
147 int64_t delay_ms = fake_network_.TimeUntilNextProcess(); | 148 int64_t delay_ms = fake_network_.TimeUntilNextProcess(); |
148 next_scheduled_task_ = task_queue_->PostDelayedTask([this]() { | 149 next_scheduled_task_ = task_queue_->PostDelayedTask([this]() { |
149 SendPackets(); | 150 SendPackets(); |
150 }, delay_ms); | 151 }, delay_ms); |
151 } | 152 } |
152 } // namespace test | 153 } // namespace test |
153 } // namespace webrtc | 154 } // namespace webrtc |
OLD | NEW |