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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 typedef std::map<int32_t, scoped_refptr<TextureRef>> TextureRefMap; | 359 typedef std::map<int32_t, scoped_refptr<TextureRef>> TextureRefMap; |
360 | 360 |
361 scoped_ptr<media::VideoDecodeAccelerator> CreateFakeVDA(); | 361 scoped_ptr<media::VideoDecodeAccelerator> CreateFakeVDA(); |
362 scoped_ptr<media::VideoDecodeAccelerator> CreateDXVAVDA(); | 362 scoped_ptr<media::VideoDecodeAccelerator> CreateDXVAVDA(); |
363 scoped_ptr<media::VideoDecodeAccelerator> CreateV4L2VDA(); | 363 scoped_ptr<media::VideoDecodeAccelerator> CreateV4L2VDA(); |
364 scoped_ptr<media::VideoDecodeAccelerator> CreateV4L2SliceVDA(); | 364 scoped_ptr<media::VideoDecodeAccelerator> CreateV4L2SliceVDA(); |
365 scoped_ptr<media::VideoDecodeAccelerator> CreateVaapiVDA(); | 365 scoped_ptr<media::VideoDecodeAccelerator> CreateVaapiVDA(); |
366 | 366 |
367 void BindImage(uint32_t client_texture_id, | 367 void BindImage(uint32_t client_texture_id, |
368 uint32_t texture_target, | 368 uint32_t texture_target, |
369 scoped_refptr<gl::GLImage> image, | 369 scoped_refptr<gl::GLImage> image); |
370 bool can_bind_as_sampler); | |
371 | 370 |
372 void SetState(ClientState new_state); | 371 void SetState(ClientState new_state); |
373 void FinishInitialization(); | 372 void FinishInitialization(); |
374 void ReturnPicture(int32_t picture_buffer_id); | 373 void ReturnPicture(int32_t picture_buffer_id); |
375 | 374 |
376 // Delete the associated decoder helper. | 375 // Delete the associated decoder helper. |
377 void DeleteDecoder(); | 376 void DeleteDecoder(); |
378 | 377 |
379 // Compute & return the first encoded bytes (including a start frame) to send | 378 // Compute & return the first encoded bytes (including a start frame) to send |
380 // to the decoder, starting at |start_pos| and returning one fragment. Skips | 379 // to the decoder, starting at |start_pos| and returning one fragment. Skips |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) | 570 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) |
572 decoder.reset(new VaapiVideoDecodeAccelerator( | 571 decoder.reset(new VaapiVideoDecodeAccelerator( |
573 base::Bind(&DoNothingReturnTrue), | 572 base::Bind(&DoNothingReturnTrue), |
574 base::Bind(&GLRenderingVDAClient::BindImage, base::Unretained(this)))); | 573 base::Bind(&GLRenderingVDAClient::BindImage, base::Unretained(this)))); |
575 #endif | 574 #endif |
576 return decoder; | 575 return decoder; |
577 } | 576 } |
578 | 577 |
579 void GLRenderingVDAClient::BindImage(uint32_t client_texture_id, | 578 void GLRenderingVDAClient::BindImage(uint32_t client_texture_id, |
580 uint32_t texture_target, | 579 uint32_t texture_target, |
581 scoped_refptr<gl::GLImage> image, | 580 scoped_refptr<gl::GLImage> image) {} |
582 bool can_bind_to_sampler) {} | |
583 | 581 |
584 void GLRenderingVDAClient::CreateAndStartDecoder() { | 582 void GLRenderingVDAClient::CreateAndStartDecoder() { |
585 LOG_ASSERT(decoder_deleted()); | 583 LOG_ASSERT(decoder_deleted()); |
586 LOG_ASSERT(!decoder_.get()); | 584 LOG_ASSERT(!decoder_.get()); |
587 | 585 |
588 VideoDecodeAccelerator::Client* client = this; | 586 VideoDecodeAccelerator::Client* client = this; |
589 | 587 |
590 scoped_ptr<media::VideoDecodeAccelerator> decoders[] = { | 588 scoped_ptr<media::VideoDecodeAccelerator> decoders[] = { |
591 CreateFakeVDA(), | 589 CreateFakeVDA(), |
592 CreateDXVAVDA(), | 590 CreateDXVAVDA(), |
(...skipping 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1646 content::VaapiWrapper::PreSandboxInitialization(); | 1644 content::VaapiWrapper::PreSandboxInitialization(); |
1647 #endif | 1645 #endif |
1648 | 1646 |
1649 content::g_env = | 1647 content::g_env = |
1650 reinterpret_cast<content::VideoDecodeAcceleratorTestEnvironment*>( | 1648 reinterpret_cast<content::VideoDecodeAcceleratorTestEnvironment*>( |
1651 testing::AddGlobalTestEnvironment( | 1649 testing::AddGlobalTestEnvironment( |
1652 new content::VideoDecodeAcceleratorTestEnvironment())); | 1650 new content::VideoDecodeAcceleratorTestEnvironment())); |
1653 | 1651 |
1654 return RUN_ALL_TESTS(); | 1652 return RUN_ALL_TESTS(); |
1655 } | 1653 } |
OLD | NEW |