| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 ASSERT_EQ(picture_id, frames_[index]->picture_id); | 156 ASSERT_EQ(picture_id, frames_[index]->picture_id); |
| 157 ASSERT_EQ(spatial_layer, frames_[index]->spatial_layer); | 157 ASSERT_EQ(spatial_layer, frames_[index]->spatial_layer); |
| 158 } | 158 } |
| 159 | 159 |
| 160 void CheckNoFrame(size_t index) { | 160 void CheckNoFrame(size_t index) { |
| 161 rtc::CritScope lock(&crit_); | 161 rtc::CritScope lock(&crit_); |
| 162 ASSERT_LT(index, frames_.size()); | 162 ASSERT_LT(index, frames_.size()); |
| 163 ASSERT_FALSE(frames_[index]); | 163 ASSERT_FALSE(frames_[index]); |
| 164 } | 164 } |
| 165 | 165 |
| 166 static bool ExtractLoop(void* obj) { | 166 static void ExtractLoop(void* obj) { |
| 167 TestFrameBuffer2* tfb = static_cast<TestFrameBuffer2*>(obj); | 167 TestFrameBuffer2* tfb = static_cast<TestFrameBuffer2*>(obj); |
| 168 while (true) { | 168 while (true) { |
| 169 tfb->trigger_extract_event_.Wait(rtc::Event::kForever); | 169 tfb->trigger_extract_event_.Wait(rtc::Event::kForever); |
| 170 { | 170 { |
| 171 rtc::CritScope lock(&tfb->crit_); | 171 rtc::CritScope lock(&tfb->crit_); |
| 172 tfb->crit_acquired_event_.Set(); | 172 tfb->crit_acquired_event_.Set(); |
| 173 if (tfb->tear_down_) | 173 if (tfb->tear_down_) |
| 174 return false; | 174 return; |
| 175 | 175 |
| 176 std::unique_ptr<FrameObject> frame; | 176 std::unique_ptr<FrameObject> frame; |
| 177 FrameBuffer::ReturnReason res = | 177 FrameBuffer::ReturnReason res = |
| 178 tfb->buffer_.NextFrame(tfb->max_wait_time_, &frame); | 178 tfb->buffer_.NextFrame(tfb->max_wait_time_, &frame); |
| 179 if (res != FrameBuffer::ReturnReason::kStopped) | 179 if (res != FrameBuffer::ReturnReason::kStopped) |
| 180 tfb->frames_.emplace_back(std::move(frame)); | 180 tfb->frames_.emplace_back(std::move(frame)); |
| 181 } | 181 } |
| 182 } | 182 } |
| 183 } | 183 } |
| 184 | 184 |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 // Jump back in pid but increase ts. | 432 // Jump back in pid but increase ts. |
| 433 EXPECT_EQ(pid - 1, InsertFrame(pid - 1, 0, ts + 2, false)); | 433 EXPECT_EQ(pid - 1, InsertFrame(pid - 1, 0, ts + 2, false)); |
| 434 ExtractFrame(); | 434 ExtractFrame(); |
| 435 ExtractFrame(); | 435 ExtractFrame(); |
| 436 CheckFrame(1, pid - 1, 0); | 436 CheckFrame(1, pid - 1, 0); |
| 437 CheckNoFrame(2); | 437 CheckNoFrame(2); |
| 438 } | 438 } |
| 439 | 439 |
| 440 } // namespace video_coding | 440 } // namespace video_coding |
| 441 } // namespace webrtc | 441 } // namespace webrtc |
| OLD | NEW |