| 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 | 10 |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 VideoCodec codec_; | 199 VideoCodec codec_; |
| 200 | 200 |
| 201 void SendFrame(const RtpRtcpModule* module, uint8_t tid) { | 201 void SendFrame(const RtpRtcpModule* module, uint8_t tid) { |
| 202 RTPVideoHeaderVP8 vp8_header = {}; | 202 RTPVideoHeaderVP8 vp8_header = {}; |
| 203 vp8_header.temporalIdx = tid; | 203 vp8_header.temporalIdx = tid; |
| 204 RTPVideoHeader rtp_video_header = { | 204 RTPVideoHeader rtp_video_header = { |
| 205 codec_.width, codec_.height, kVideoRotation_0, {-1, -1}, true, 0, | 205 codec_.width, codec_.height, kVideoRotation_0, {-1, -1}, true, 0, |
| 206 kRtpVideoVp8, {vp8_header}}; | 206 kRtpVideoVp8, {vp8_header}}; |
| 207 | 207 |
| 208 const uint8_t payload[100] = {0}; | 208 const uint8_t payload[100] = {0}; |
| 209 EXPECT_EQ(0, module->impl_->SendOutgoingData(kVideoFrameKey, | 209 EXPECT_EQ(true, module->impl_->SendOutgoingData( |
| 210 codec_.plType, | 210 kVideoFrameKey, codec_.plType, 0, 0, payload, |
| 211 0, | 211 sizeof(payload), nullptr, &rtp_video_header, nullptr)); |
| 212 0, | |
| 213 payload, | |
| 214 sizeof(payload), | |
| 215 NULL, | |
| 216 &rtp_video_header)); | |
| 217 } | 212 } |
| 218 | 213 |
| 219 void IncomingRtcpNack(const RtpRtcpModule* module, uint16_t sequence_number) { | 214 void IncomingRtcpNack(const RtpRtcpModule* module, uint16_t sequence_number) { |
| 220 bool sender = module->impl_->SSRC() == kSenderSsrc; | 215 bool sender = module->impl_->SSRC() == kSenderSsrc; |
| 221 rtcp::Nack nack; | 216 rtcp::Nack nack; |
| 222 uint16_t list[1]; | 217 uint16_t list[1]; |
| 223 list[0] = sequence_number; | 218 list[0] = sequence_number; |
| 224 const uint16_t kListLength = sizeof(list) / sizeof(list[0]); | 219 const uint16_t kListLength = sizeof(list) / sizeof(list[0]); |
| 225 nack.From(sender ? kReceiverSsrc : kSenderSsrc); | 220 nack.From(sender ? kReceiverSsrc : kSenderSsrc); |
| 226 nack.To(sender ? kSenderSsrc : kReceiverSsrc); | 221 nack.To(sender ? kSenderSsrc : kReceiverSsrc); |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 EXPECT_EQ(6U, receiver_.RtcpSent().unique_nack_requests); | 550 EXPECT_EQ(6U, receiver_.RtcpSent().unique_nack_requests); |
| 556 EXPECT_THAT(receiver_.LastNackListSent(), ElementsAre(11, 18, 20, 21)); | 551 EXPECT_THAT(receiver_.LastNackListSent(), ElementsAre(11, 18, 20, 21)); |
| 557 | 552 |
| 558 // Send module receives the request. | 553 // Send module receives the request. |
| 559 EXPECT_EQ(2U, sender_.RtcpReceived().nack_packets); | 554 EXPECT_EQ(2U, sender_.RtcpReceived().nack_packets); |
| 560 EXPECT_EQ(8U, sender_.RtcpReceived().nack_requests); | 555 EXPECT_EQ(8U, sender_.RtcpReceived().nack_requests); |
| 561 EXPECT_EQ(6U, sender_.RtcpReceived().unique_nack_requests); | 556 EXPECT_EQ(6U, sender_.RtcpReceived().unique_nack_requests); |
| 562 EXPECT_EQ(75, sender_.RtcpReceived().UniqueNackRequestsInPercent()); | 557 EXPECT_EQ(75, sender_.RtcpReceived().UniqueNackRequestsInPercent()); |
| 563 } | 558 } |
| 564 } // namespace webrtc | 559 } // namespace webrtc |
| OLD | NEW |