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

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

Issue 1842673003: Revert of Mac: Decode hardware to 420 instead of 422 (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 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);
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
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
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 }
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