| 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> |
| 11 | 11 |
| 12 #include <algorithm> | 12 #include <algorithm> |
| 13 #include <list> | 13 #include <list> |
| 14 #include <memory> | 14 #include <memory> |
| 15 #include <utility> | 15 #include <utility> |
| 16 | 16 |
| 17 #include "base/barrier_closure.h" | 17 #include "base/barrier_closure.h" |
| 18 #include "base/bind.h" | 18 #include "base/bind.h" |
| 19 #include "base/containers/stack_container.h" | 19 #include "base/containers/stack_container.h" |
| 20 #include "base/location.h" | 20 #include "base/location.h" |
| 21 #include "base/macros.h" | 21 #include "base/macros.h" |
| 22 #include "base/memory/linked_ptr.h" | 22 #include "base/memory/linked_ptr.h" |
| 23 #include "base/strings/stringprintf.h" | 23 #include "base/strings/stringprintf.h" |
| 24 #include "base/trace_event/memory_dump_manager.h" |
| 24 #include "base/trace_event/memory_dump_provider.h" | 25 #include "base/trace_event/memory_dump_provider.h" |
| 25 #include "base/trace_event/trace_event.h" | 26 #include "base/trace_event/trace_event.h" |
| 26 #include "gpu/GLES2/gl2extchromium.h" | 27 #include "gpu/GLES2/gl2extchromium.h" |
| 27 #include "gpu/command_buffer/client/gles2_interface.h" | 28 #include "gpu/command_buffer/client/gles2_interface.h" |
| 28 #include "media/base/bind_to_current_loop.h" | 29 #include "media/base/bind_to_current_loop.h" |
| 29 #include "media/renderers/gpu_video_accelerator_factories.h" | 30 #include "media/renderers/gpu_video_accelerator_factories.h" |
| 30 #include "third_party/libyuv/include/libyuv.h" | 31 #include "third_party/libyuv/include/libyuv.h" |
| 31 #include "ui/gfx/buffer_format_util.h" | 32 #include "ui/gfx/buffer_format_util.h" |
| 33 #include "ui/gfx/gpu_memory_buffer_tracing.h" |
| 32 #include "ui/gl/trace_util.h" | 34 #include "ui/gl/trace_util.h" |
| 33 | 35 |
| 34 namespace media { | 36 namespace media { |
| 35 | 37 |
| 36 // Implementation of a pool of GpuMemoryBuffers used to back VideoFrames. | 38 // Implementation of a pool of GpuMemoryBuffers used to back VideoFrames. |
| 37 class GpuMemoryBufferVideoFramePool::PoolImpl | 39 class GpuMemoryBufferVideoFramePool::PoolImpl |
| 38 : public base::RefCountedThreadSafe< | 40 : public base::RefCountedThreadSafe< |
| 39 GpuMemoryBufferVideoFramePool::PoolImpl>, | 41 GpuMemoryBufferVideoFramePool::PoolImpl>, |
| 40 public base::trace_event::MemoryDumpProvider { | 42 public base::trace_event::MemoryDumpProvider { |
| 41 public: | 43 public: |
| (...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 763 } | 765 } |
| 764 | 766 |
| 765 void GpuMemoryBufferVideoFramePool::MaybeCreateHardwareFrame( | 767 void GpuMemoryBufferVideoFramePool::MaybeCreateHardwareFrame( |
| 766 const scoped_refptr<VideoFrame>& video_frame, | 768 const scoped_refptr<VideoFrame>& video_frame, |
| 767 const FrameReadyCB& frame_ready_cb) { | 769 const FrameReadyCB& frame_ready_cb) { |
| 768 DCHECK(video_frame); | 770 DCHECK(video_frame); |
| 769 pool_impl_->CreateHardwareFrame(video_frame, frame_ready_cb); | 771 pool_impl_->CreateHardwareFrame(video_frame, frame_ready_cb); |
| 770 } | 772 } |
| 771 | 773 |
| 772 } // namespace media | 774 } // namespace media |
| OLD | NEW |