Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "media/video/gpu_memory_buffer_video_frame_pool.h" | 5 #include "media/video/gpu_memory_buffer_video_frame_pool.h" |
| 6 | 6 |
| 7 #include <GLES2/gl2.h> | 7 #include <GLES2/gl2.h> |
| 8 #include <GLES2/gl2ext.h> | 8 #include <GLES2/gl2ext.h> |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 #include <stdint.h> | 10 #include <stdint.h> |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 465 base::trace_event::MemoryAllocatorDump* dump = | 465 base::trace_event::MemoryAllocatorDump* dump = |
| 466 pmd->CreateAllocatorDump(dump_name); | 466 pmd->CreateAllocatorDump(dump_name); |
| 467 size_t buffer_size_in_bytes = gfx::BufferSizeForBufferFormat( | 467 size_t buffer_size_in_bytes = gfx::BufferSizeForBufferFormat( |
| 468 plane_resource.size, plane_resource.gpu_memory_buffer->GetFormat()); | 468 plane_resource.size, plane_resource.gpu_memory_buffer->GetFormat()); |
| 469 dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize, | 469 dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize, |
| 470 base::trace_event::MemoryAllocatorDump::kUnitsBytes, | 470 base::trace_event::MemoryAllocatorDump::kUnitsBytes, |
| 471 buffer_size_in_bytes); | 471 buffer_size_in_bytes); |
| 472 dump->AddScalar("free_size", | 472 dump->AddScalar("free_size", |
| 473 base::trace_event::MemoryAllocatorDump::kUnitsBytes, | 473 base::trace_event::MemoryAllocatorDump::kUnitsBytes, |
| 474 frame_resources->IsInUse() ? 0 : buffer_size_in_bytes); | 474 frame_resources->IsInUse() ? 0 : buffer_size_in_bytes); |
| 475 base::trace_event::MemoryAllocatorDumpGuid shared_buffer_guid = | 475 const auto& shared_buffer_guid = |
|
DaleCurtis
2017/04/14 18:27:32
is const& really what you want here?
hajimehoshi
2017/04/17 06:18:07
Actually not. Done.
| |
| 476 gfx::GetGpuMemoryBufferGUIDForTracing(tracing_process_id, | 476 plane_resource.gpu_memory_buffer->GetHandle().GetGUIDForTracing( |
| 477 buffer_id); | 477 tracing_process_id); |
| 478 pmd->CreateSharedGlobalAllocatorDump(shared_buffer_guid); | 478 pmd->CreateSharedGlobalAllocatorDump(shared_buffer_guid); |
| 479 pmd->AddOwnershipEdge(dump->guid(), shared_buffer_guid, kImportance); | 479 pmd->AddOwnershipEdge(dump->guid(), shared_buffer_guid, kImportance); |
| 480 } | 480 } |
| 481 } | 481 } |
| 482 } | 482 } |
| 483 return true; | 483 return true; |
| 484 } | 484 } |
| 485 | 485 |
| 486 void GpuMemoryBufferVideoFramePool::PoolImpl::OnCopiesDone( | 486 void GpuMemoryBufferVideoFramePool::PoolImpl::OnCopiesDone( |
| 487 const scoped_refptr<VideoFrame>& video_frame, | 487 const scoped_refptr<VideoFrame>& video_frame, |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 826 } | 826 } |
| 827 | 827 |
| 828 void GpuMemoryBufferVideoFramePool::MaybeCreateHardwareFrame( | 828 void GpuMemoryBufferVideoFramePool::MaybeCreateHardwareFrame( |
| 829 const scoped_refptr<VideoFrame>& video_frame, | 829 const scoped_refptr<VideoFrame>& video_frame, |
| 830 const FrameReadyCB& frame_ready_cb) { | 830 const FrameReadyCB& frame_ready_cb) { |
| 831 DCHECK(video_frame); | 831 DCHECK(video_frame); |
| 832 pool_impl_->CreateHardwareFrame(video_frame, frame_ready_cb); | 832 pool_impl_->CreateHardwareFrame(video_frame, frame_ready_cb); |
| 833 } | 833 } |
| 834 | 834 |
| 835 } // namespace media | 835 } // namespace media |
| OLD | NEW |