| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 RtcpCastMessage cast_feedback(1); | 487 RtcpCastMessage cast_feedback(1); |
| 488 cast_feedback.media_ssrc = 2; | 488 cast_feedback.media_ssrc = 2; |
| 489 cast_feedback.ack_frame_id = 0; | 489 cast_feedback.ack_frame_id = 0; |
| 490 video_sender_->OnReceivedCastFeedback(cast_feedback); | 490 video_sender_->OnReceivedCastFeedback(cast_feedback); |
| 491 | 491 |
| 492 transport_.SetPause(false); | 492 transport_.SetPause(false); |
| 493 RunTasks(33); | 493 RunTasks(33); |
| 494 EXPECT_EQ(0, transport_.number_of_rtp_packets()); | 494 EXPECT_EQ(0, transport_.number_of_rtp_packets()); |
| 495 } | 495 } |
| 496 | 496 |
| 497 TEST_F(VideoSenderTest, NAcksCancelRetransmits) { | |
| 498 InitEncoder(false); | |
| 499 transport_.SetPause(true); | |
| 500 // Send two video frames. | |
| 501 scoped_refptr<media::VideoFrame> video_frame = GetLargeNewVideoFrame(); | |
| 502 video_sender_->InsertRawVideoFrame(video_frame, testing_clock_->NowTicks()); | |
| 503 RunTasks(33); | |
| 504 video_frame = GetLargeNewVideoFrame(); | |
| 505 video_sender_->InsertRawVideoFrame(video_frame, testing_clock_->NowTicks()); | |
| 506 RunTasks(33); | |
| 507 | |
| 508 // Frames should be in buffer, waiting. Now let's ack the first one and nack | |
| 509 // one packet in the second one. | |
| 510 RtcpCastMessage cast_feedback(1); | |
| 511 cast_feedback.media_ssrc = 2; | |
| 512 cast_feedback.ack_frame_id = 0; | |
| 513 PacketIdSet missing_packets; | |
| 514 missing_packets.insert(0); | |
| 515 cast_feedback.missing_frames_and_packets[1] = missing_packets; | |
| 516 video_sender_->OnReceivedCastFeedback(cast_feedback); | |
| 517 | |
| 518 transport_.SetPause(false); | |
| 519 RunTasks(33); | |
| 520 // Only one packet should be retransmitted. | |
| 521 EXPECT_EQ(1, transport_.number_of_rtp_packets()); | |
| 522 } | |
| 523 | |
| 524 } // namespace cast | 497 } // namespace cast |
| 525 } // namespace media | 498 } // namespace media |
| OLD | NEW |