| OLD | NEW |
| 1 /* Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 1 /* Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
| 2 * | 2 * |
| 3 * Use of this source code is governed by a BSD-style license | 3 * Use of this source code is governed by a BSD-style license |
| 4 * that can be found in the LICENSE file in the root of the source | 4 * that can be found in the LICENSE file in the root of the source |
| 5 * tree. An additional intellectual property rights grant can be found | 5 * tree. An additional intellectual property rights grant can be found |
| 6 * in the file PATENTS. All contributing project authors may | 6 * in the file PATENTS. All contributing project authors may |
| 7 * be found in the AUTHORS file in the root of the source tree. | 7 * be found in the AUTHORS file in the root of the source tree. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 #include <string.h> | 10 #include <string.h> |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 bool packet_available = stream_generator_->PopPacket(&packet, index); | 56 bool packet_available = stream_generator_->PopPacket(&packet, index); |
| 57 EXPECT_TRUE(packet_available); | 57 EXPECT_TRUE(packet_available); |
| 58 if (!packet_available) | 58 if (!packet_available) |
| 59 return kGeneralError; // Return here to avoid crashes below. | 59 return kGeneralError; // Return here to avoid crashes below. |
| 60 return receiver_.InsertPacket(packet, kWidth, kHeight); | 60 return receiver_.InsertPacket(packet, kWidth, kHeight); |
| 61 } | 61 } |
| 62 | 62 |
| 63 int32_t InsertFrame(FrameType frame_type, bool complete) { | 63 int32_t InsertFrame(FrameType frame_type, bool complete) { |
| 64 int num_of_packets = complete ? 1 : 2; | 64 int num_of_packets = complete ? 1 : 2; |
| 65 stream_generator_->GenerateFrame( | 65 stream_generator_->GenerateFrame( |
| 66 frame_type, | 66 frame_type, (frame_type != kEmptyFrame) ? num_of_packets : 0, |
| 67 (frame_type != kFrameEmpty) ? num_of_packets : 0, | 67 (frame_type == kEmptyFrame) ? 1 : 0, clock_->TimeInMilliseconds()); |
| 68 (frame_type == kFrameEmpty) ? 1 : 0, | |
| 69 clock_->TimeInMilliseconds()); | |
| 70 int32_t ret = InsertPacketAndPop(0); | 68 int32_t ret = InsertPacketAndPop(0); |
| 71 if (!complete) { | 69 if (!complete) { |
| 72 // Drop the second packet. | 70 // Drop the second packet. |
| 73 VCMPacket packet; | 71 VCMPacket packet; |
| 74 stream_generator_->PopPacket(&packet, 0); | 72 stream_generator_->PopPacket(&packet, 0); |
| 75 } | 73 } |
| 76 clock_->AdvanceTimeMilliseconds(kDefaultFramePeriodMs); | 74 clock_->AdvanceTimeMilliseconds(kDefaultFramePeriodMs); |
| 77 return ret; | 75 return ret; |
| 78 } | 76 } |
| 79 | 77 |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 receiver_.ReleaseFrame(frame); | 517 receiver_.ReleaseFrame(frame); |
| 520 ++num_frames_return; | 518 ++num_frames_return; |
| 521 EXPECT_GE(kMaxWaitTime, end_time - start_time); | 519 EXPECT_GE(kMaxWaitTime, end_time - start_time); |
| 522 } else { | 520 } else { |
| 523 EXPECT_EQ(kMaxWaitTime, end_time - start_time); | 521 EXPECT_EQ(kMaxWaitTime, end_time - start_time); |
| 524 } | 522 } |
| 525 } | 523 } |
| 526 } | 524 } |
| 527 | 525 |
| 528 } // namespace webrtc | 526 } // namespace webrtc |
| OLD | NEW |