Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(574)

Side by Side Diff: content/common/gpu/media/video_decode_accelerator_unittest.cc

Issue 1848403003: Mac h264: Add a flag to specify GLImage status in hardware decode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 typedef std::map<int32_t, scoped_refptr<TextureRef>> TextureRefMap; 360 typedef std::map<int32_t, scoped_refptr<TextureRef>> TextureRefMap;
361 361
362 scoped_ptr<media::VideoDecodeAccelerator> CreateFakeVDA(); 362 scoped_ptr<media::VideoDecodeAccelerator> CreateFakeVDA();
363 scoped_ptr<media::VideoDecodeAccelerator> CreateDXVAVDA(); 363 scoped_ptr<media::VideoDecodeAccelerator> CreateDXVAVDA();
364 scoped_ptr<media::VideoDecodeAccelerator> CreateV4L2VDA(); 364 scoped_ptr<media::VideoDecodeAccelerator> CreateV4L2VDA();
365 scoped_ptr<media::VideoDecodeAccelerator> CreateV4L2SliceVDA(); 365 scoped_ptr<media::VideoDecodeAccelerator> CreateV4L2SliceVDA();
366 scoped_ptr<media::VideoDecodeAccelerator> CreateVaapiVDA(); 366 scoped_ptr<media::VideoDecodeAccelerator> CreateVaapiVDA();
367 367
368 void BindImage(uint32_t client_texture_id, 368 void BindImage(uint32_t client_texture_id,
369 uint32_t texture_target, 369 uint32_t texture_target,
370 scoped_refptr<gl::GLImage> image); 370 scoped_refptr<gl::GLImage> image,
371 bool can_bind_as_sampler);
371 372
372 void SetState(ClientState new_state); 373 void SetState(ClientState new_state);
373 void FinishInitialization(); 374 void FinishInitialization();
374 void ReturnPicture(int32_t picture_buffer_id); 375 void ReturnPicture(int32_t picture_buffer_id);
375 376
376 // Delete the associated decoder helper. 377 // Delete the associated decoder helper.
377 void DeleteDecoder(); 378 void DeleteDecoder();
378 379
379 // Compute & return the first encoded bytes (including a start frame) to send 380 // 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 381 // to the decoder, starting at |start_pos| and returning one fragment. Skips
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) 572 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)
572 decoder.reset(new VaapiVideoDecodeAccelerator( 573 decoder.reset(new VaapiVideoDecodeAccelerator(
573 base::Bind(&DoNothingReturnTrue), 574 base::Bind(&DoNothingReturnTrue),
574 base::Bind(&GLRenderingVDAClient::BindImage, base::Unretained(this)))); 575 base::Bind(&GLRenderingVDAClient::BindImage, base::Unretained(this))));
575 #endif 576 #endif
576 return decoder; 577 return decoder;
577 } 578 }
578 579
579 void GLRenderingVDAClient::BindImage(uint32_t client_texture_id, 580 void GLRenderingVDAClient::BindImage(uint32_t client_texture_id,
580 uint32_t texture_target, 581 uint32_t texture_target,
581 scoped_refptr<gl::GLImage> image) {} 582 scoped_refptr<gl::GLImage> image,
583 bool can_bind_to_sampler) {}
582 584
583 void GLRenderingVDAClient::CreateAndStartDecoder() { 585 void GLRenderingVDAClient::CreateAndStartDecoder() {
584 LOG_ASSERT(decoder_deleted()); 586 LOG_ASSERT(decoder_deleted());
585 LOG_ASSERT(!decoder_.get()); 587 LOG_ASSERT(!decoder_.get());
586 588
587 VideoDecodeAccelerator::Client* client = this; 589 VideoDecodeAccelerator::Client* client = this;
588 590
589 scoped_ptr<media::VideoDecodeAccelerator> decoders[] = { 591 scoped_ptr<media::VideoDecodeAccelerator> decoders[] = {
590 CreateFakeVDA(), 592 CreateFakeVDA(),
591 CreateDXVAVDA(), 593 CreateDXVAVDA(),
(...skipping 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after
1648 content::VaapiWrapper::PreSandboxInitialization(); 1650 content::VaapiWrapper::PreSandboxInitialization();
1649 #endif 1651 #endif
1650 1652
1651 content::g_env = 1653 content::g_env =
1652 reinterpret_cast<content::VideoDecodeAcceleratorTestEnvironment*>( 1654 reinterpret_cast<content::VideoDecodeAcceleratorTestEnvironment*>(
1653 testing::AddGlobalTestEnvironment( 1655 testing::AddGlobalTestEnvironment(
1654 new content::VideoDecodeAcceleratorTestEnvironment())); 1656 new content::VideoDecodeAcceleratorTestEnvironment()));
1655 1657
1656 return RUN_ALL_TESTS(); 1658 return RUN_ALL_TESTS();
1657 } 1659 }
OLDNEW
« no previous file with comments | « content/common/gpu/media/vaapi_video_decode_accelerator.cc ('k') | content/common/gpu/media/vt_video_decode_accelerator_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698