| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 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 11 matching lines...) Expand all Loading... |
| 22 #include "webrtc/system_wrappers/interface/clock.h" | 22 #include "webrtc/system_wrappers/interface/clock.h" |
| 23 #include "webrtc/system_wrappers/interface/metrics.h" | 23 #include "webrtc/system_wrappers/interface/metrics.h" |
| 24 #include "webrtc/test/histogram.h" | 24 #include "webrtc/test/histogram.h" |
| 25 | 25 |
| 26 namespace webrtc { | 26 namespace webrtc { |
| 27 | 27 |
| 28 class TestBasicJitterBuffer : public ::testing::Test { | 28 class TestBasicJitterBuffer : public ::testing::Test { |
| 29 protected: | 29 protected: |
| 30 virtual void SetUp() { | 30 virtual void SetUp() { |
| 31 clock_.reset(new SimulatedClock(0)); | 31 clock_.reset(new SimulatedClock(0)); |
| 32 jitter_buffer_.reset( | 32 jitter_buffer_.reset(new VCMJitterBuffer( |
| 33 new VCMJitterBuffer(clock_.get(), &event_factory_)); | 33 clock_.get(), |
| 34 rtc::scoped_ptr<EventWrapper>(event_factory_.CreateEvent()))); |
| 34 jitter_buffer_->Start(); | 35 jitter_buffer_->Start(); |
| 35 seq_num_ = 1234; | 36 seq_num_ = 1234; |
| 36 timestamp_ = 0; | 37 timestamp_ = 0; |
| 37 size_ = 1400; | 38 size_ = 1400; |
| 38 // Data vector - 0, 0, 0x80, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0x80, 3.... | 39 // Data vector - 0, 0, 0x80, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0x80, 3.... |
| 39 data_[0] = 0; | 40 data_[0] = 0; |
| 40 data_[1] = 0; | 41 data_[1] = 0; |
| 41 data_[2] = 0x80; | 42 data_[2] = 0x80; |
| 42 int count = 3; | 43 int count = 3; |
| 43 for (unsigned int i = 3; i < sizeof(data_) - 3; ++i) { | 44 for (unsigned int i = 3; i < sizeof(data_) - 3; ++i) { |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 | 122 |
| 122 | 123 |
| 123 class TestRunningJitterBuffer : public ::testing::Test { | 124 class TestRunningJitterBuffer : public ::testing::Test { |
| 124 protected: | 125 protected: |
| 125 enum { kDataBufferSize = 10 }; | 126 enum { kDataBufferSize = 10 }; |
| 126 | 127 |
| 127 virtual void SetUp() { | 128 virtual void SetUp() { |
| 128 clock_.reset(new SimulatedClock(0)); | 129 clock_.reset(new SimulatedClock(0)); |
| 129 max_nack_list_size_ = 150; | 130 max_nack_list_size_ = 150; |
| 130 oldest_packet_to_nack_ = 250; | 131 oldest_packet_to_nack_ = 250; |
| 131 jitter_buffer_ = new VCMJitterBuffer(clock_.get(), &event_factory_); | 132 jitter_buffer_ = new VCMJitterBuffer( |
| 133 clock_.get(), |
| 134 rtc::scoped_ptr<EventWrapper>(event_factory_.CreateEvent())); |
| 132 stream_generator_ = new StreamGenerator(0, clock_->TimeInMilliseconds()); | 135 stream_generator_ = new StreamGenerator(0, clock_->TimeInMilliseconds()); |
| 133 jitter_buffer_->Start(); | 136 jitter_buffer_->Start(); |
| 134 jitter_buffer_->SetNackSettings(max_nack_list_size_, | 137 jitter_buffer_->SetNackSettings(max_nack_list_size_, |
| 135 oldest_packet_to_nack_, 0); | 138 oldest_packet_to_nack_, 0); |
| 136 memset(data_buffer_, 0, kDataBufferSize); | 139 memset(data_buffer_, 0, kDataBufferSize); |
| 137 } | 140 } |
| 138 | 141 |
| 139 virtual void TearDown() { | 142 virtual void TearDown() { |
| 140 jitter_buffer_->Stop(); | 143 jitter_buffer_->Stop(); |
| 141 delete stream_generator_; | 144 delete stream_generator_; |
| (...skipping 2053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2195 | 2198 |
| 2196 // Stream should be decodable from this point. | 2199 // Stream should be decodable from this point. |
| 2197 clock_->AdvanceTimeMilliseconds(kDefaultFramePeriodMs); | 2200 clock_->AdvanceTimeMilliseconds(kDefaultFramePeriodMs); |
| 2198 InsertFrame(kVideoFrameDelta); | 2201 InsertFrame(kVideoFrameDelta); |
| 2199 EXPECT_TRUE(DecodeCompleteFrame()); | 2202 EXPECT_TRUE(DecodeCompleteFrame()); |
| 2200 nack_list = jitter_buffer_->GetNackList(&extended); | 2203 nack_list = jitter_buffer_->GetNackList(&extended); |
| 2201 EXPECT_EQ(0u, nack_list.size()); | 2204 EXPECT_EQ(0u, nack_list.size()); |
| 2202 } | 2205 } |
| 2203 | 2206 |
| 2204 } // namespace webrtc | 2207 } // namespace webrtc |
| OLD | NEW |