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

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

Issue 1822173002: Mac: Decode hardware to 420 instead of 422 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix name Created 4 years, 9 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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
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);
370 371
371 void SetState(ClientState new_state); 372 void SetState(ClientState new_state);
372 void FinishInitialization(); 373 void FinishInitialization();
373 void ReturnPicture(int32_t picture_buffer_id); 374 void ReturnPicture(int32_t picture_buffer_id);
374 375
375 // Delete the associated decoder helper. 376 // Delete the associated decoder helper.
376 void DeleteDecoder(); 377 void DeleteDecoder();
377 378
378 // Compute & return the first encoded bytes (including a start frame) to send 379 // Compute & return the first encoded bytes (including a start frame) to send
379 // to the decoder, starting at |start_pos| and returning one fragment. Skips 380 // to the decoder, starting at |start_pos| and returning one fragment. Skips
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) 571 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)
571 decoder.reset(new VaapiVideoDecodeAccelerator( 572 decoder.reset(new VaapiVideoDecodeAccelerator(
572 base::Bind(&DoNothingReturnTrue), 573 base::Bind(&DoNothingReturnTrue),
573 base::Bind(&GLRenderingVDAClient::BindImage, base::Unretained(this)))); 574 base::Bind(&GLRenderingVDAClient::BindImage, base::Unretained(this))));
574 #endif 575 #endif
575 return decoder; 576 return decoder;
576 } 577 }
577 578
578 void GLRenderingVDAClient::BindImage(uint32_t client_texture_id, 579 void GLRenderingVDAClient::BindImage(uint32_t client_texture_id,
579 uint32_t texture_target, 580 uint32_t texture_target,
580 scoped_refptr<gl::GLImage> image) {} 581 scoped_refptr<gl::GLImage> image,
582 bool can_bind_to_sampler) {}
581 583
582 void GLRenderingVDAClient::CreateAndStartDecoder() { 584 void GLRenderingVDAClient::CreateAndStartDecoder() {
583 LOG_ASSERT(decoder_deleted()); 585 LOG_ASSERT(decoder_deleted());
584 LOG_ASSERT(!decoder_.get()); 586 LOG_ASSERT(!decoder_.get());
585 587
586 VideoDecodeAccelerator::Client* client = this; 588 VideoDecodeAccelerator::Client* client = this;
587 589
588 scoped_ptr<media::VideoDecodeAccelerator> decoders[] = { 590 scoped_ptr<media::VideoDecodeAccelerator> decoders[] = {
589 CreateFakeVDA(), 591 CreateFakeVDA(),
590 CreateDXVAVDA(), 592 CreateDXVAVDA(),
(...skipping 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after
1644 content::VaapiWrapper::PreSandboxInitialization(); 1646 content::VaapiWrapper::PreSandboxInitialization();
1645 #endif 1647 #endif
1646 1648
1647 content::g_env = 1649 content::g_env =
1648 reinterpret_cast<content::VideoDecodeAcceleratorTestEnvironment*>( 1650 reinterpret_cast<content::VideoDecodeAcceleratorTestEnvironment*>(
1649 testing::AddGlobalTestEnvironment( 1651 testing::AddGlobalTestEnvironment(
1650 new content::VideoDecodeAcceleratorTestEnvironment())); 1652 new content::VideoDecodeAcceleratorTestEnvironment()));
1651 1653
1652 return RUN_ALL_TESTS(); 1654 return RUN_ALL_TESTS();
1653 } 1655 }
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