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

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

Issue 170843004: Pass Client pointer in Initialize() for VDA/VEA (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 50e826de Rebase. Created 6 years, 10 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 | Annotate | Revision Log
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 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 CHECK(!decoder_.get()); 548 CHECK(!decoder_.get());
549 549
550 VideoDecodeAccelerator::Client* client = this; 550 VideoDecodeAccelerator::Client* client = this;
551 base::WeakPtr<VideoDecodeAccelerator::Client> weak_client = AsWeakPtr(); 551 base::WeakPtr<VideoDecodeAccelerator::Client> weak_client = AsWeakPtr();
552 if (throttling_client_) { 552 if (throttling_client_) {
553 client = throttling_client_.get(); 553 client = throttling_client_.get();
554 weak_client = throttling_client_->AsWeakPtr(); 554 weak_client = throttling_client_->AsWeakPtr();
555 } 555 }
556 #if defined(OS_WIN) 556 #if defined(OS_WIN)
557 decoder_.reset( 557 decoder_.reset(
558 new DXVAVideoDecodeAccelerator(client, base::Bind(&DoNothingReturnTrue))); 558 new DXVAVideoDecodeAccelerator(base::Bind(&DoNothingReturnTrue)));
559 #elif defined(OS_CHROMEOS) 559 #elif defined(OS_CHROMEOS)
560 #if defined(ARCH_CPU_ARMEL) 560 #if defined(ARCH_CPU_ARMEL)
561 561
562 scoped_ptr<V4L2Device> device = V4L2Device::Create(); 562 scoped_ptr<V4L2Device> device = V4L2Device::Create();
563 if (!device.get()) { 563 if (!device.get()) {
564 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); 564 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE);
565 return; 565 return;
566 } 566 }
567 decoder_.reset(new V4L2VideoDecodeAccelerator( 567 decoder_.reset(new V4L2VideoDecodeAccelerator(
568 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()), 568 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()),
569 client,
570 weak_client, 569 weak_client,
571 base::Bind(&DoNothingReturnTrue), 570 base::Bind(&DoNothingReturnTrue),
572 device.Pass(), 571 device.Pass(),
573 base::MessageLoopProxy::current())); 572 base::MessageLoopProxy::current()));
574 #elif defined(ARCH_CPU_X86_FAMILY) 573 #elif defined(ARCH_CPU_X86_FAMILY)
575 CHECK_EQ(gfx::kGLImplementationDesktopGL, gfx::GetGLImplementation()) 574 CHECK_EQ(gfx::kGLImplementationDesktopGL, gfx::GetGLImplementation())
576 << "Hardware video decode does not work with OSMesa"; 575 << "Hardware video decode does not work with OSMesa";
577 decoder_.reset(new VaapiVideoDecodeAccelerator( 576 decoder_.reset(new VaapiVideoDecodeAccelerator(
578 static_cast<Display*>(rendering_helper_->GetGLDisplay()), 577 static_cast<Display*>(rendering_helper_->GetGLDisplay()),
579 client,
580 base::Bind(&DoNothingReturnTrue))); 578 base::Bind(&DoNothingReturnTrue)));
581 #endif // ARCH_CPU_ARMEL 579 #endif // ARCH_CPU_ARMEL
582 #endif // OS_WIN 580 #endif // OS_WIN
583 CHECK(decoder_.get()); 581 CHECK(decoder_.get());
584 SetState(CS_DECODER_SET); 582 SetState(CS_DECODER_SET);
585 if (decoder_deleted()) 583 if (decoder_deleted())
586 return; 584 return;
587 585
588 CHECK(decoder_->Initialize(profile_)); 586 CHECK(decoder_->Initialize(profile_, client));
589 } 587 }
590 588
591 void GLRenderingVDAClient::ProvidePictureBuffers( 589 void GLRenderingVDAClient::ProvidePictureBuffers(
592 uint32 requested_num_of_buffers, 590 uint32 requested_num_of_buffers,
593 const gfx::Size& dimensions, 591 const gfx::Size& dimensions,
594 uint32 texture_target) { 592 uint32 texture_target) {
595 if (decoder_deleted()) 593 if (decoder_deleted())
596 return; 594 return;
597 std::vector<media::PictureBuffer> buffers; 595 std::vector<media::PictureBuffer> buffers;
598 596
(...skipping 984 matching lines...) Expand 10 before | Expand all | Expand 10 after
1583 } 1581 }
1584 if (it->first == "v" || it->first == "vmodule") 1582 if (it->first == "v" || it->first == "vmodule")
1585 continue; 1583 continue;
1586 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; 1584 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second;
1587 } 1585 }
1588 1586
1589 base::ShadowingAtExitManager at_exit_manager; 1587 base::ShadowingAtExitManager at_exit_manager;
1590 1588
1591 return RUN_ALL_TESTS(); 1589 return RUN_ALL_TESTS();
1592 } 1590 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698