| 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 #ifndef WEBRTC_VIDEO_ENGINE_TEST_COMMON_RTP_RTCP_OBSERVER_H_ | 10 #ifndef WEBRTC_VIDEO_ENGINE_TEST_COMMON_RTP_RTCP_OBSERVER_H_ |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 PacketTransportAction on_rtp, | 119 PacketTransportAction on_rtp, |
| 120 PacketTransportAction on_rtcp, | 120 PacketTransportAction on_rtcp, |
| 121 const FakeNetworkPipe::Config& configuration) | 121 const FakeNetworkPipe::Config& configuration) |
| 122 : test::DirectTransport(configuration), | 122 : test::DirectTransport(configuration), |
| 123 crit_(lock), | 123 crit_(lock), |
| 124 observer_(observer), | 124 observer_(observer), |
| 125 on_rtp_(on_rtp), | 125 on_rtp_(on_rtp), |
| 126 on_rtcp_(on_rtcp) {} | 126 on_rtcp_(on_rtcp) {} |
| 127 | 127 |
| 128 private: | 128 private: |
| 129 bool SendRtp(const uint8_t* packet, size_t length) override { | 129 bool SendRtp(const uint8_t* packet, |
| 130 size_t length, |
| 131 const PacketOptions& options) override { |
| 130 EXPECT_FALSE(RtpHeaderParser::IsRtcp(packet, length)); | 132 EXPECT_FALSE(RtpHeaderParser::IsRtcp(packet, length)); |
| 131 Action action; | 133 Action action; |
| 132 { | 134 { |
| 133 rtc::CritScope lock(crit_); | 135 rtc::CritScope lock(crit_); |
| 134 action = (observer_->*on_rtp_)(packet, length); | 136 action = (observer_->*on_rtp_)(packet, length); |
| 135 } | 137 } |
| 136 switch (action) { | 138 switch (action) { |
| 137 case DROP_PACKET: | 139 case DROP_PACKET: |
| 138 // Drop packet silently. | 140 // Drop packet silently. |
| 139 return true; | 141 return true; |
| 140 case SEND_PACKET: | 142 case SEND_PACKET: |
| 141 return test::DirectTransport::SendRtp(packet, length); | 143 return test::DirectTransport::SendRtp(packet, length, options); |
| 142 } | 144 } |
| 143 return true; // Will never happen, makes compiler happy. | 145 return true; // Will never happen, makes compiler happy. |
| 144 } | 146 } |
| 145 | 147 |
| 146 bool SendRtcp(const uint8_t* packet, size_t length) override { | 148 bool SendRtcp(const uint8_t* packet, size_t length) override { |
| 147 EXPECT_TRUE(RtpHeaderParser::IsRtcp(packet, length)); | 149 EXPECT_TRUE(RtpHeaderParser::IsRtcp(packet, length)); |
| 148 Action action; | 150 Action action; |
| 149 { | 151 { |
| 150 rtc::CritScope lock(crit_); | 152 rtc::CritScope lock(crit_); |
| 151 action = (observer_->*on_rtcp_)(packet, length); | 153 action = (observer_->*on_rtcp_)(packet, length); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 173 const rtc::scoped_ptr<RtpHeaderParser> parser_; | 175 const rtc::scoped_ptr<RtpHeaderParser> parser_; |
| 174 PacketTransport send_transport_, receive_transport_; | 176 PacketTransport send_transport_, receive_transport_; |
| 175 | 177 |
| 176 private: | 178 private: |
| 177 unsigned int timeout_ms_; | 179 unsigned int timeout_ms_; |
| 178 }; | 180 }; |
| 179 } // namespace test | 181 } // namespace test |
| 180 } // namespace webrtc | 182 } // namespace webrtc |
| 181 | 183 |
| 182 #endif // WEBRTC_VIDEO_ENGINE_TEST_COMMON_RTP_RTCP_OBSERVER_H_ | 184 #endif // WEBRTC_VIDEO_ENGINE_TEST_COMMON_RTP_RTCP_OBSERVER_H_ |
| OLD | NEW |