| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 |
| 11 #include "webrtc/modules/rtp_rtcp/test/testAPI/test_api.h" | 11 #include "webrtc/modules/rtp_rtcp/test/testAPI/test_api.h" |
| 12 | 12 |
| 13 #include <algorithm> | 13 #include <algorithm> |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "webrtc/test/null_transport.h" | 16 #include "webrtc/test/null_transport.h" |
| 17 | 17 |
| 18 using namespace webrtc; | 18 namespace webrtc { |
| 19 | 19 |
| 20 namespace webrtc { | |
| 21 void LoopBackTransport::SetSendModule(RtpRtcp* rtp_rtcp_module, | 20 void LoopBackTransport::SetSendModule(RtpRtcp* rtp_rtcp_module, |
| 22 RTPPayloadRegistry* payload_registry, | 21 RTPPayloadRegistry* payload_registry, |
| 23 RtpReceiver* receiver, | 22 RtpReceiver* receiver, |
| 24 ReceiveStatistics* receive_statistics) { | 23 ReceiveStatistics* receive_statistics) { |
| 25 rtp_rtcp_module_ = rtp_rtcp_module; | 24 rtp_rtcp_module_ = rtp_rtcp_module; |
| 26 rtp_payload_registry_ = payload_registry; | 25 rtp_payload_registry_ = payload_registry; |
| 27 rtp_receiver_ = receiver; | 26 rtp_receiver_ = receiver; |
| 28 receive_statistics_ = receive_statistics; | 27 receive_statistics_ = receive_statistics; |
| 29 } | 28 } |
| 30 | 29 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 int32_t TestRtpReceiver::OnReceivedPayloadData( | 69 int32_t TestRtpReceiver::OnReceivedPayloadData( |
| 71 const uint8_t* payload_data, | 70 const uint8_t* payload_data, |
| 72 const size_t payload_size, | 71 const size_t payload_size, |
| 73 const webrtc::WebRtcRTPHeader* rtp_header) { | 72 const webrtc::WebRtcRTPHeader* rtp_header) { |
| 74 EXPECT_LE(payload_size, sizeof(payload_data_)); | 73 EXPECT_LE(payload_size, sizeof(payload_data_)); |
| 75 memcpy(payload_data_, payload_data, payload_size); | 74 memcpy(payload_data_, payload_data, payload_size); |
| 76 memcpy(&rtp_header_, rtp_header, sizeof(rtp_header_)); | 75 memcpy(&rtp_header_, rtp_header, sizeof(rtp_header_)); |
| 77 payload_size_ = payload_size; | 76 payload_size_ = payload_size; |
| 78 return 0; | 77 return 0; |
| 79 } | 78 } |
| 80 } // namespace webrtc | |
| 81 | 79 |
| 82 class RtpRtcpAPITest : public ::testing::Test { | 80 class RtpRtcpAPITest : public ::testing::Test { |
| 83 protected: | 81 protected: |
| 84 RtpRtcpAPITest() : fake_clock_(123456) { | 82 RtpRtcpAPITest() : fake_clock_(123456) { |
| 85 test_csrcs_.push_back(1234); | 83 test_csrcs_.push_back(1234); |
| 86 test_csrcs_.push_back(2345); | 84 test_csrcs_.push_back(2345); |
| 87 test_ssrc_ = 3456; | 85 test_ssrc_ = 3456; |
| 88 test_timestamp_ = 4567; | 86 test_timestamp_ = 4567; |
| 89 test_sequence_number_ = 2345; | 87 test_sequence_number_ = 2345; |
| 90 } | 88 } |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 RTPHeader rtx_header; | 179 RTPHeader rtx_header; |
| 182 rtx_header.ssrc = kRtxSsrc; | 180 rtx_header.ssrc = kRtxSsrc; |
| 183 rtx_header.payloadType = kRtxPayloadType; | 181 rtx_header.payloadType = kRtxPayloadType; |
| 184 EXPECT_TRUE(rtp_payload_registry_->IsRtx(rtx_header)); | 182 EXPECT_TRUE(rtp_payload_registry_->IsRtx(rtx_header)); |
| 185 rtx_header.ssrc = 0; | 183 rtx_header.ssrc = 0; |
| 186 EXPECT_FALSE(rtp_payload_registry_->IsRtx(rtx_header)); | 184 EXPECT_FALSE(rtp_payload_registry_->IsRtx(rtx_header)); |
| 187 rtx_header.ssrc = kRtxSsrc; | 185 rtx_header.ssrc = kRtxSsrc; |
| 188 rtx_header.payloadType = 0; | 186 rtx_header.payloadType = 0; |
| 189 EXPECT_TRUE(rtp_payload_registry_->IsRtx(rtx_header)); | 187 EXPECT_TRUE(rtp_payload_registry_->IsRtx(rtx_header)); |
| 190 } | 188 } |
| 189 |
| 190 } // namespace webrtc |
| OLD | NEW |