| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef MEDIA_RENDERERS_GPU_VIDEO_ACCELERATOR_FACTORIES_H_ | 5 #ifndef MEDIA_RENDERERS_GPU_VIDEO_ACCELERATOR_FACTORIES_H_ |
| 6 #define MEDIA_RENDERERS_GPU_VIDEO_ACCELERATOR_FACTORIES_H_ | 6 #define MEDIA_RENDERERS_GPU_VIDEO_ACCELERATOR_FACTORIES_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "gpu/command_buffer/client/gles2_interface.h" | 12 #include "gpu/command_buffer/client/gles2_interface.h" |
| 13 #include "gpu/command_buffer/common/mailbox.h" | 13 #include "gpu/command_buffer/common/mailbox.h" |
| 14 #include "media/base/media_export.h" | 14 #include "media/base/media_export.h" |
| 15 #include "media/base/video_types.h" |
| 15 #include "media/video/video_decode_accelerator.h" | 16 #include "media/video/video_decode_accelerator.h" |
| 16 #include "media/video/video_encode_accelerator.h" | 17 #include "media/video/video_encode_accelerator.h" |
| 17 #include "ui/gfx/gpu_memory_buffer.h" | 18 #include "ui/gfx/gpu_memory_buffer.h" |
| 18 | 19 |
| 19 namespace base { | 20 namespace base { |
| 20 class SingleThreadTaskRunner; | 21 class SingleThreadTaskRunner; |
| 21 class SharedMemory; | 22 class SharedMemory; |
| 22 } | 23 } |
| 23 | 24 |
| 24 namespace gfx { | 25 namespace gfx { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 64 |
| 64 virtual void WaitSyncPoint(uint32 sync_point) = 0; | 65 virtual void WaitSyncPoint(uint32 sync_point) = 0; |
| 65 | 66 |
| 66 virtual scoped_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer( | 67 virtual scoped_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer( |
| 67 const gfx::Size& size, | 68 const gfx::Size& size, |
| 68 gfx::BufferFormat format, | 69 gfx::BufferFormat format, |
| 69 gfx::BufferUsage usage) = 0; | 70 gfx::BufferUsage usage) = 0; |
| 70 | 71 |
| 71 virtual bool ShouldUseGpuMemoryBuffersForVideoFrames() const = 0; | 72 virtual bool ShouldUseGpuMemoryBuffersForVideoFrames() const = 0; |
| 72 virtual unsigned ImageTextureTarget() = 0; | 73 virtual unsigned ImageTextureTarget() = 0; |
| 74 // Pixel format of the hardware video frames created when GpuMemoryBuffers |
| 75 // video frames are enabled. |
| 76 virtual VideoPixelFormat VideoFrameOutputFormat() = 0; |
| 73 virtual bool IsTextureRGSupported() = 0; | 77 virtual bool IsTextureRGSupported() = 0; |
| 74 | 78 |
| 75 virtual gpu::gles2::GLES2Interface* GetGLES2Interface() = 0; | 79 virtual gpu::gles2::GLES2Interface* GetGLES2Interface() = 0; |
| 76 | 80 |
| 77 // Allocate & return a shared memory segment. | 81 // Allocate & return a shared memory segment. |
| 78 virtual scoped_ptr<base::SharedMemory> CreateSharedMemory(size_t size) = 0; | 82 virtual scoped_ptr<base::SharedMemory> CreateSharedMemory(size_t size) = 0; |
| 79 | 83 |
| 80 // Returns the task runner the video accelerator runs on. | 84 // Returns the task runner the video accelerator runs on. |
| 81 virtual scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner() = 0; | 85 virtual scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner() = 0; |
| 82 | 86 |
| 83 // Returns the supported codec profiles of video decode accelerator. | 87 // Returns the supported codec profiles of video decode accelerator. |
| 84 virtual VideoDecodeAccelerator::SupportedProfiles | 88 virtual VideoDecodeAccelerator::SupportedProfiles |
| 85 GetVideoDecodeAcceleratorSupportedProfiles() = 0; | 89 GetVideoDecodeAcceleratorSupportedProfiles() = 0; |
| 86 | 90 |
| 87 // Returns the supported codec profiles of video encode accelerator. | 91 // Returns the supported codec profiles of video encode accelerator. |
| 88 virtual VideoEncodeAccelerator::SupportedProfiles | 92 virtual VideoEncodeAccelerator::SupportedProfiles |
| 89 GetVideoEncodeAcceleratorSupportedProfiles() = 0; | 93 GetVideoEncodeAcceleratorSupportedProfiles() = 0; |
| 90 | 94 |
| 91 protected: | 95 protected: |
| 92 friend class base::RefCountedThreadSafe<GpuVideoAcceleratorFactories>; | 96 friend class base::RefCountedThreadSafe<GpuVideoAcceleratorFactories>; |
| 93 virtual ~GpuVideoAcceleratorFactories() {} | 97 virtual ~GpuVideoAcceleratorFactories() {} |
| 94 }; | 98 }; |
| 95 | 99 |
| 96 } // namespace media | 100 } // namespace media |
| 97 | 101 |
| 98 #endif // MEDIA_RENDERERS_GPU_VIDEO_ACCELERATOR_FACTORIES_H_ | 102 #endif // MEDIA_RENDERERS_GPU_VIDEO_ACCELERATOR_FACTORIES_H_ |
| OLD | NEW |