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 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 media::PictureBuffer* picture_buffer = | 478 media::PictureBuffer* picture_buffer = |
479 picture_buffers_by_id_[picture.picture_buffer_id()]; | 479 picture_buffers_by_id_[picture.picture_buffer_id()]; |
480 CHECK(picture_buffer); | 480 CHECK(picture_buffer); |
481 if (!suppress_rendering_) { | 481 if (!suppress_rendering_) { |
482 rendering_helper_->RenderTexture(picture_buffer->texture_id()); | 482 rendering_helper_->RenderTexture(picture_buffer->texture_id()); |
483 } | 483 } |
484 | 484 |
485 if (num_decoded_frames_ > delay_reuse_after_frame_num_) { | 485 if (num_decoded_frames_ > delay_reuse_after_frame_num_) { |
486 base::MessageLoop::current()->PostDelayedTask(FROM_HERE, base::Bind( | 486 base::MessageLoop::current()->PostDelayedTask(FROM_HERE, base::Bind( |
487 &VideoDecodeAccelerator::ReusePictureBuffer, | 487 &VideoDecodeAccelerator::ReusePictureBuffer, |
488 base::Unretained(decoder_.get()), picture.picture_buffer_id()), | 488 decoder_->AsWeakPtr(), picture.picture_buffer_id()), |
489 base::TimeDelta::FromMilliseconds(kReuseDelayMs)); | 489 base::TimeDelta::FromMilliseconds(kReuseDelayMs)); |
490 } else { | 490 } else { |
491 decoder_->ReusePictureBuffer(picture.picture_buffer_id()); | 491 decoder_->ReusePictureBuffer(picture.picture_buffer_id()); |
492 } | 492 } |
493 } | 493 } |
494 | 494 |
495 void GLRenderingVDAClient::NotifyInitializeDone() { | 495 void GLRenderingVDAClient::NotifyInitializeDone() { |
496 SetState(CS_INITIALIZED); | 496 SetState(CS_INITIALIZED); |
497 initialize_done_ticks_ = base::TimeTicks::Now(); | 497 initialize_done_ticks_ = base::TimeTicks::Now(); |
498 for (int i = 0; i < num_in_flight_decodes_; ++i) | 498 for (int i = 0; i < num_in_flight_decodes_; ++i) |
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1051 #elif defined(OS_CHROMEOS) | 1051 #elif defined(OS_CHROMEOS) |
1052 #if defined(ARCH_CPU_ARMEL) | 1052 #if defined(ARCH_CPU_ARMEL) |
1053 content::ExynosVideoDecodeAccelerator::PreSandboxInitialization(); | 1053 content::ExynosVideoDecodeAccelerator::PreSandboxInitialization(); |
1054 #elif defined(ARCH_CPU_X86_FAMILY) | 1054 #elif defined(ARCH_CPU_X86_FAMILY) |
1055 content::VaapiWrapper::PreSandboxInitialization(); | 1055 content::VaapiWrapper::PreSandboxInitialization(); |
1056 #endif // ARCH_CPU_ARMEL | 1056 #endif // ARCH_CPU_ARMEL |
1057 #endif // OS_CHROMEOS | 1057 #endif // OS_CHROMEOS |
1058 | 1058 |
1059 return RUN_ALL_TESTS(); | 1059 return RUN_ALL_TESTS(); |
1060 } | 1060 } |
OLD | NEW |