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

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

Issue 2039813002: Add format modifier IDs for EGL_EXT_image_dma_buf_import extension (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add format modifier IDs for EGL_EXT_image_dma_buf_import extension Created 4 years, 5 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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 363
364 gfx::GpuMemoryBufferHandle TextureRef::ExportGpuMemoryBufferHandle() const { 364 gfx::GpuMemoryBufferHandle TextureRef::ExportGpuMemoryBufferHandle() const {
365 gfx::GpuMemoryBufferHandle handle; 365 gfx::GpuMemoryBufferHandle handle;
366 #if defined(USE_OZONE) 366 #if defined(USE_OZONE)
367 CHECK(pixmap_); 367 CHECK(pixmap_);
368 int duped_fd = HANDLE_EINTR(dup(pixmap_->GetDmaBufFd(0))); 368 int duped_fd = HANDLE_EINTR(dup(pixmap_->GetDmaBufFd(0)));
369 LOG_ASSERT(duped_fd != -1) << "Failed duplicating dmabuf fd"; 369 LOG_ASSERT(duped_fd != -1) << "Failed duplicating dmabuf fd";
370 handle.type = gfx::OZONE_NATIVE_PIXMAP; 370 handle.type = gfx::OZONE_NATIVE_PIXMAP;
371 handle.native_pixmap_handle.fds.emplace_back( 371 handle.native_pixmap_handle.fds.emplace_back(
372 base::FileDescriptor(duped_fd, true)); 372 base::FileDescriptor(duped_fd, true));
373 handle.native_pixmap_handle.strides_and_offsets.emplace_back( 373 handle.native_pixmap_handle.planes.emplace_back(
374 pixmap_->GetDmaBufPitch(0), pixmap_->GetDmaBufOffset(0)); 374 pixmap_->GetDmaBufPitch(0), pixmap_->GetDmaBufOffset(0),
375 pixmap_->GetDmaBufModifier(0));
375 #endif 376 #endif
376 return handle; 377 return handle;
377 } 378 }
378 379
379 // Client that can accept callbacks from a VideoDecodeAccelerator and is used by 380 // Client that can accept callbacks from a VideoDecodeAccelerator and is used by
380 // the TESTs below. 381 // the TESTs below.
381 class GLRenderingVDAClient 382 class GLRenderingVDAClient
382 : public VideoDecodeAccelerator::Client, 383 : public VideoDecodeAccelerator::Client,
383 public base::SupportsWeakPtr<GLRenderingVDAClient> { 384 public base::SupportsWeakPtr<GLRenderingVDAClient> {
384 public: 385 public:
(...skipping 1394 matching lines...) Expand 10 before | Expand all | Expand 10 after
1779 media::VaapiWrapper::PreSandboxInitialization(); 1780 media::VaapiWrapper::PreSandboxInitialization();
1780 #endif 1781 #endif
1781 1782
1782 media::g_env = 1783 media::g_env =
1783 reinterpret_cast<media::VideoDecodeAcceleratorTestEnvironment*>( 1784 reinterpret_cast<media::VideoDecodeAcceleratorTestEnvironment*>(
1784 testing::AddGlobalTestEnvironment( 1785 testing::AddGlobalTestEnvironment(
1785 new media::VideoDecodeAcceleratorTestEnvironment())); 1786 new media::VideoDecodeAcceleratorTestEnvironment()));
1786 1787
1787 return RUN_ALL_TESTS(); 1788 return RUN_ALL_TESTS();
1788 } 1789 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698