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 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 | 444 |
445 worker_task_runner_->PostTask( | 445 worker_task_runner_->PostTask( |
446 FROM_HERE, base::Bind(&PoolImpl::CopyVideoFrameToGpuMemoryBuffers, this, | 446 FROM_HERE, base::Bind(&PoolImpl::CopyVideoFrameToGpuMemoryBuffers, this, |
447 video_frame, frame_resources, frame_ready_cb)); | 447 video_frame, frame_resources, frame_ready_cb)); |
448 } | 448 } |
449 | 449 |
450 bool GpuMemoryBufferVideoFramePool::PoolImpl::OnMemoryDump( | 450 bool GpuMemoryBufferVideoFramePool::PoolImpl::OnMemoryDump( |
451 const base::trace_event::MemoryDumpArgs& args, | 451 const base::trace_event::MemoryDumpArgs& args, |
452 base::trace_event::ProcessMemoryDump* pmd) { | 452 base::trace_event::ProcessMemoryDump* pmd) { |
453 const uint64_t tracing_process_id = | 453 const uint64_t tracing_process_id = |
454 base::trace_event::MemoryDumpManager::GetInstance() | 454 base::trace_event::MemoryDumpManager::GetInstance()->tracing_process_id(); |
455 ->GetTracingProcessId(); | |
456 const int kImportance = 2; | 455 const int kImportance = 2; |
457 for (const FrameResources* frame_resources : resources_pool_) { | 456 for (const FrameResources* frame_resources : resources_pool_) { |
458 for (const PlaneResource& plane_resource : | 457 for (const PlaneResource& plane_resource : |
459 frame_resources->plane_resources) { | 458 frame_resources->plane_resources) { |
460 if (plane_resource.gpu_memory_buffer) { | 459 if (plane_resource.gpu_memory_buffer) { |
461 gfx::GpuMemoryBufferId buffer_id = | 460 gfx::GpuMemoryBufferId buffer_id = |
462 plane_resource.gpu_memory_buffer->GetId(); | 461 plane_resource.gpu_memory_buffer->GetId(); |
463 std::string dump_name = base::StringPrintf( | 462 std::string dump_name = base::StringPrintf( |
464 "media/video_frame_memory/buffer_%d", buffer_id.id); | 463 "media/video_frame_memory/buffer_%d", buffer_id.id); |
465 base::trace_event::MemoryAllocatorDump* dump = | 464 base::trace_event::MemoryAllocatorDump* dump = |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
826 } | 825 } |
827 | 826 |
828 void GpuMemoryBufferVideoFramePool::MaybeCreateHardwareFrame( | 827 void GpuMemoryBufferVideoFramePool::MaybeCreateHardwareFrame( |
829 const scoped_refptr<VideoFrame>& video_frame, | 828 const scoped_refptr<VideoFrame>& video_frame, |
830 const FrameReadyCB& frame_ready_cb) { | 829 const FrameReadyCB& frame_ready_cb) { |
831 DCHECK(video_frame); | 830 DCHECK(video_frame); |
832 pool_impl_->CreateHardwareFrame(video_frame, frame_ready_cb); | 831 pool_impl_->CreateHardwareFrame(video_frame, frame_ready_cb); |
833 } | 832 } |
834 | 833 |
835 } // namespace media | 834 } // namespace media |
OLD | NEW |