| 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_TEST_RTP_RTCP_OBSERVER_H_ | 10 #ifndef WEBRTC_TEST_RTP_RTCP_OBSERVER_H_ |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "webrtc/video_send_stream.h" | 25 #include "webrtc/video_send_stream.h" |
| 26 | 26 |
| 27 namespace { | 27 namespace { |
| 28 const int kShortTimeoutMs = 500; | 28 const int kShortTimeoutMs = 500; |
| 29 } | 29 } |
| 30 | 30 |
| 31 namespace webrtc { | 31 namespace webrtc { |
| 32 namespace test { | 32 namespace test { |
| 33 | 33 |
| 34 class PacketTransport; | 34 class PacketTransport; |
| 35 class SingleThreadedTaskQueueForTesting; |
| 35 | 36 |
| 36 class RtpRtcpObserver { | 37 class RtpRtcpObserver { |
| 37 public: | 38 public: |
| 38 enum Action { | 39 enum Action { |
| 39 SEND_PACKET, | 40 SEND_PACKET, |
| 40 DROP_PACKET, | 41 DROP_PACKET, |
| 41 }; | 42 }; |
| 42 | 43 |
| 43 virtual ~RtpRtcpObserver() {} | 44 virtual ~RtpRtcpObserver() {} |
| 44 | 45 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 const std::unique_ptr<RtpHeaderParser> parser_; | 85 const std::unique_ptr<RtpHeaderParser> parser_; |
| 85 | 86 |
| 86 private: | 87 private: |
| 87 const int timeout_ms_; | 88 const int timeout_ms_; |
| 88 }; | 89 }; |
| 89 | 90 |
| 90 class PacketTransport : public test::DirectTransport { | 91 class PacketTransport : public test::DirectTransport { |
| 91 public: | 92 public: |
| 92 enum TransportType { kReceiver, kSender }; | 93 enum TransportType { kReceiver, kSender }; |
| 93 | 94 |
| 94 PacketTransport(Call* send_call, | 95 PacketTransport(SingleThreadedTaskQueueForTesting* task_queue, |
| 96 Call* send_call, |
| 95 RtpRtcpObserver* observer, | 97 RtpRtcpObserver* observer, |
| 96 TransportType transport_type, | 98 TransportType transport_type, |
| 97 const std::map<uint8_t, MediaType>& payload_type_map, | 99 const std::map<uint8_t, MediaType>& payload_type_map, |
| 98 const FakeNetworkPipe::Config& configuration) | 100 const FakeNetworkPipe::Config& configuration) |
| 99 : test::DirectTransport(configuration, send_call, payload_type_map), | 101 : test::DirectTransport(task_queue, |
| 102 configuration, |
| 103 send_call, |
| 104 payload_type_map), |
| 100 observer_(observer), | 105 observer_(observer), |
| 101 transport_type_(transport_type) {} | 106 transport_type_(transport_type) {} |
| 102 | 107 |
| 103 private: | 108 private: |
| 104 bool SendRtp(const uint8_t* packet, | 109 bool SendRtp(const uint8_t* packet, |
| 105 size_t length, | 110 size_t length, |
| 106 const PacketOptions& options) override { | 111 const PacketOptions& options) override { |
| 107 EXPECT_FALSE(RtpHeaderParser::IsRtcp(packet, length)); | 112 EXPECT_FALSE(RtpHeaderParser::IsRtcp(packet, length)); |
| 108 RtpRtcpObserver::Action action; | 113 RtpRtcpObserver::Action action; |
| 109 { | 114 { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 return true; // Will never happen, makes compiler happy. | 148 return true; // Will never happen, makes compiler happy. |
| 144 } | 149 } |
| 145 | 150 |
| 146 RtpRtcpObserver* const observer_; | 151 RtpRtcpObserver* const observer_; |
| 147 TransportType transport_type_; | 152 TransportType transport_type_; |
| 148 }; | 153 }; |
| 149 } // namespace test | 154 } // namespace test |
| 150 } // namespace webrtc | 155 } // namespace webrtc |
| 151 | 156 |
| 152 #endif // WEBRTC_TEST_RTP_RTCP_OBSERVER_H_ | 157 #endif // WEBRTC_TEST_RTP_RTCP_OBSERVER_H_ |
| OLD | NEW |