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

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

Issue 1421903006: ui/gl: Move GLImage into gl namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ozone demo Created 5 years, 1 month 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, scoped_refptr<TextureRef>> TextureRefMap; 360 typedef std::map<int32, 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 client_texture_id, 368 void BindImage(uint32 client_texture_id,
369 uint32 texture_target, 369 uint32 texture_target,
370 scoped_refptr<gfx::GLImage> image); 370 scoped_refptr<gl::GLImage> image);
371 371
372 void SetState(ClientState new_state); 372 void SetState(ClientState new_state);
373 void FinishInitialization(); 373 void FinishInitialization();
374 void ReturnPicture(int32 picture_buffer_id); 374 void ReturnPicture(int32 picture_buffer_id);
375 375
376 // Delete the associated decoder helper. 376 // Delete the associated decoder helper.
377 void DeleteDecoder(); 377 void DeleteDecoder();
378 378
379 // 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
380 // 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) 569 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)
570 decoder.reset(new VaapiVideoDecodeAccelerator( 570 decoder.reset(new VaapiVideoDecodeAccelerator(
571 base::Bind(&DoNothingReturnTrue), 571 base::Bind(&DoNothingReturnTrue),
572 base::Bind(&GLRenderingVDAClient::BindImage, base::Unretained(this)))); 572 base::Bind(&GLRenderingVDAClient::BindImage, base::Unretained(this))));
573 #endif 573 #endif
574 return decoder.Pass(); 574 return decoder.Pass();
575 } 575 }
576 576
577 void GLRenderingVDAClient::BindImage(uint32 client_texture_id, 577 void GLRenderingVDAClient::BindImage(uint32 client_texture_id,
578 uint32 texture_target, 578 uint32 texture_target,
579 scoped_refptr<gfx::GLImage> image) { 579 scoped_refptr<gl::GLImage> image) {}
580 }
581 580
582 void GLRenderingVDAClient::CreateAndStartDecoder() { 581 void GLRenderingVDAClient::CreateAndStartDecoder() {
583 LOG_ASSERT(decoder_deleted()); 582 LOG_ASSERT(decoder_deleted());
584 LOG_ASSERT(!decoder_.get()); 583 LOG_ASSERT(!decoder_.get());
585 584
586 VideoDecodeAccelerator::Client* client = this; 585 VideoDecodeAccelerator::Client* client = this;
587 586
588 scoped_ptr<media::VideoDecodeAccelerator> decoders[] = { 587 scoped_ptr<media::VideoDecodeAccelerator> decoders[] = {
589 CreateFakeVDA(), 588 CreateFakeVDA(),
590 CreateDXVAVDA(), 589 CreateDXVAVDA(),
(...skipping 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after
1655 content::VaapiWrapper::PreSandboxInitialization(); 1654 content::VaapiWrapper::PreSandboxInitialization();
1656 #endif 1655 #endif
1657 1656
1658 content::g_env = 1657 content::g_env =
1659 reinterpret_cast<content::VideoDecodeAcceleratorTestEnvironment*>( 1658 reinterpret_cast<content::VideoDecodeAcceleratorTestEnvironment*>(
1660 testing::AddGlobalTestEnvironment( 1659 testing::AddGlobalTestEnvironment(
1661 new content::VideoDecodeAcceleratorTestEnvironment())); 1660 new content::VideoDecodeAcceleratorTestEnvironment()));
1662 1661
1663 return RUN_ALL_TESTS(); 1662 return RUN_ALL_TESTS();
1664 } 1663 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698