OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // The bulk of this file is support code; sorry about that. Here's an overview | 5 // The bulk of this file is support code; sorry about that. Here's an overview |
6 // to hopefully help readers of this code: | 6 // to hopefully help readers of this code: |
7 // - RenderingHelper is charged with interacting with X11/{EGL/GLES2,GLX/GL} or | 7 // - RenderingHelper is charged with interacting with X11/{EGL/GLES2,GLX/GL} or |
8 // Win/EGL. | 8 // Win/EGL. |
9 // - ClientState is an enum for the state of the decode client used by the test. | 9 // - ClientState is an enum for the state of the decode client used by the test. |
10 // - ClientStateNotification is a barrier abstraction that allows the test code | 10 // - ClientStateNotification is a barrier abstraction that allows the test code |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 START_OF_STREAM_RESET = -3, | 136 START_OF_STREAM_RESET = -3, |
137 MID_STREAM_RESET = -2, | 137 MID_STREAM_RESET = -2, |
138 END_OF_STREAM_RESET = -1 | 138 END_OF_STREAM_RESET = -1 |
139 }; | 139 }; |
140 | 140 |
141 const int kMaxResetAfterFrameNum = 100; | 141 const int kMaxResetAfterFrameNum = 100; |
142 const int kMaxFramesToDelayReuse = 64; | 142 const int kMaxFramesToDelayReuse = 64; |
143 const base::TimeDelta kReuseDelay = base::TimeDelta::FromSeconds(1); | 143 const base::TimeDelta kReuseDelay = base::TimeDelta::FromSeconds(1); |
144 // Simulate WebRTC and call VDA::Decode 30 times per second. | 144 // Simulate WebRTC and call VDA::Decode 30 times per second. |
145 const int kWebRtcDecodeCallsPerSecond = 30; | 145 const int kWebRtcDecodeCallsPerSecond = 30; |
| 146 // Simulate an adjustment to a larger number of pictures to make sure the |
| 147 // decoder supports an upwards adjustment. |
| 148 const int kExtraPictureBuffers = 2; |
146 | 149 |
147 struct TestVideoFile { | 150 struct TestVideoFile { |
148 explicit TestVideoFile(base::FilePath::StringType file_name) | 151 explicit TestVideoFile(base::FilePath::StringType file_name) |
149 : file_name(file_name), | 152 : file_name(file_name), |
150 width(-1), | 153 width(-1), |
151 height(-1), | 154 height(-1), |
152 num_frames(-1), | 155 num_frames(-1), |
153 num_fragments(-1), | 156 num_fragments(-1), |
154 min_fps_render(-1), | 157 min_fps_render(-1), |
155 min_fps_no_render(-1), | 158 min_fps_no_render(-1), |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 } | 611 } |
609 | 612 |
610 void GLRenderingVDAClient::ProvidePictureBuffers( | 613 void GLRenderingVDAClient::ProvidePictureBuffers( |
611 uint32 requested_num_of_buffers, | 614 uint32 requested_num_of_buffers, |
612 const gfx::Size& dimensions, | 615 const gfx::Size& dimensions, |
613 uint32 texture_target) { | 616 uint32 texture_target) { |
614 if (decoder_deleted()) | 617 if (decoder_deleted()) |
615 return; | 618 return; |
616 std::vector<media::PictureBuffer> buffers; | 619 std::vector<media::PictureBuffer> buffers; |
617 | 620 |
| 621 requested_num_of_buffers += kExtraPictureBuffers; |
| 622 |
618 texture_target_ = texture_target; | 623 texture_target_ = texture_target; |
619 for (uint32 i = 0; i < requested_num_of_buffers; ++i) { | 624 for (uint32 i = 0; i < requested_num_of_buffers; ++i) { |
620 uint32 texture_id; | 625 uint32 texture_id; |
621 base::WaitableEvent done(false, false); | 626 base::WaitableEvent done(false, false); |
622 rendering_helper_->CreateTexture( | 627 rendering_helper_->CreateTexture( |
623 texture_target_, &texture_id, dimensions, &done); | 628 texture_target_, &texture_id, dimensions, &done); |
624 done.Wait(); | 629 done.Wait(); |
625 | 630 |
626 int32 picture_buffer_id = next_picture_buffer_id_++; | 631 int32 picture_buffer_id = next_picture_buffer_id_++; |
627 CHECK(active_textures_ | 632 CHECK(active_textures_ |
(...skipping 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1642 content::VaapiWrapper::PreSandboxInitialization(); | 1647 content::VaapiWrapper::PreSandboxInitialization(); |
1643 #endif | 1648 #endif |
1644 | 1649 |
1645 content::g_env = | 1650 content::g_env = |
1646 reinterpret_cast<content::VideoDecodeAcceleratorTestEnvironment*>( | 1651 reinterpret_cast<content::VideoDecodeAcceleratorTestEnvironment*>( |
1647 testing::AddGlobalTestEnvironment( | 1652 testing::AddGlobalTestEnvironment( |
1648 new content::VideoDecodeAcceleratorTestEnvironment())); | 1653 new content::VideoDecodeAcceleratorTestEnvironment())); |
1649 | 1654 |
1650 return RUN_ALL_TESTS(); | 1655 return RUN_ALL_TESTS(); |
1651 } | 1656 } |
OLD | NEW |