| OLD | NEW |
| 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 #ifndef MEDIA_GPU_IPC_CLIENT_GPU_VIDEO_DECODE_ACCELERATOR_HOST_H_ | 5 #ifndef MEDIA_GPU_IPC_CLIENT_GPU_VIDEO_DECODE_ACCELERATOR_HOST_H_ |
| 6 #define MEDIA_GPU_IPC_CLIENT_GPU_VIDEO_DECODE_ACCELERATOR_HOST_H_ | 6 #define MEDIA_GPU_IPC_CLIENT_GPU_VIDEO_DECODE_ACCELERATOR_HOST_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/threading/non_thread_safe.h" | 14 #include "base/threading/non_thread_safe.h" |
| 15 #include "gpu/ipc/client/command_buffer_proxy_impl.h" | 15 #include "gpu/ipc/client/command_buffer_proxy_impl.h" |
| 16 #include "ipc/ipc_listener.h" | 16 #include "ipc/ipc_listener.h" |
| 17 #include "media/video/video_decode_accelerator.h" | 17 #include "media/video/video_decode_accelerator.h" |
| 18 #include "ui/gfx/geometry/size.h" | 18 #include "ui/gfx/geometry/size.h" |
| 19 | 19 |
| 20 struct AcceleratedVideoDecoderHostMsg_PictureReady_Params; | |
| 21 | |
| 22 namespace gpu { | 20 namespace gpu { |
| 23 class GpuChannelHost; | 21 class GpuChannelHost; |
| 24 } | 22 } |
| 25 | 23 |
| 26 namespace media { | 24 namespace media { |
| 27 | 25 |
| 28 // This class is used to talk to VideoDecodeAccelerator in the Gpu process | 26 // This class is used to talk to VideoDecodeAccelerator in the Gpu process |
| 29 // through IPC messages. | 27 // through IPC messages. |
| 30 class GpuVideoDecodeAcceleratorHost | 28 class GpuVideoDecodeAcceleratorHost |
| 31 : public IPC::Listener, | 29 : public IPC::Listener, |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 // IPC handlers, proxying VideoDecodeAccelerator::Client for the GPU | 62 // IPC handlers, proxying VideoDecodeAccelerator::Client for the GPU |
| 65 // process. Should not be called directly. | 63 // process. Should not be called directly. |
| 66 void OnInitializationComplete(bool success); | 64 void OnInitializationComplete(bool success); |
| 67 void OnBitstreamBufferProcessed(int32_t bitstream_buffer_id); | 65 void OnBitstreamBufferProcessed(int32_t bitstream_buffer_id); |
| 68 void OnProvidePictureBuffer(uint32_t num_requested_buffers, | 66 void OnProvidePictureBuffer(uint32_t num_requested_buffers, |
| 69 VideoPixelFormat format, | 67 VideoPixelFormat format, |
| 70 uint32_t textures_per_buffer, | 68 uint32_t textures_per_buffer, |
| 71 const gfx::Size& dimensions, | 69 const gfx::Size& dimensions, |
| 72 uint32_t texture_target); | 70 uint32_t texture_target); |
| 73 void OnDismissPictureBuffer(int32_t picture_buffer_id); | 71 void OnDismissPictureBuffer(int32_t picture_buffer_id); |
| 74 void OnPictureReady( | 72 void OnPictureReady(int32_t picture_buffer_id, |
| 75 const AcceleratedVideoDecoderHostMsg_PictureReady_Params& params); | 73 int32_t bitstream_buffer_id, |
| 74 const gfx::Rect& visible_rect, |
| 75 bool allow_overlay, |
| 76 bool size_changed); |
| 76 void OnFlushDone(); | 77 void OnFlushDone(); |
| 77 void OnResetDone(); | 78 void OnResetDone(); |
| 78 void OnNotifyError(uint32_t error); | 79 void OnNotifyError(uint32_t error); |
| 79 | 80 |
| 80 scoped_refptr<gpu::GpuChannelHost> channel_; | 81 scoped_refptr<gpu::GpuChannelHost> channel_; |
| 81 | 82 |
| 82 // Route ID for the associated decoder in the GPU process. | 83 // Route ID for the associated decoder in the GPU process. |
| 83 int32_t decoder_route_id_; | 84 int32_t decoder_route_id_; |
| 84 | 85 |
| 85 // The client that will receive callbacks from the decoder. | 86 // The client that will receive callbacks from the decoder. |
| 86 Client* client_; | 87 Client* client_; |
| 87 | 88 |
| 88 // Unowned reference to the gpu::CommandBufferProxyImpl that created us. | 89 // Unowned reference to the gpu::CommandBufferProxyImpl that created us. |
| 89 // |this| registers as a DeletionObserver of |impl_|, the so reference is | 90 // |this| registers as a DeletionObserver of |impl_|, the so reference is |
| 90 // always valid as long as it is not NULL. | 91 // always valid as long as it is not NULL. |
| 91 gpu::CommandBufferProxyImpl* impl_; | 92 gpu::CommandBufferProxyImpl* impl_; |
| 92 | 93 |
| 93 // Requested dimensions of the buffer, from ProvidePictureBuffers(). | 94 // Requested dimensions of the buffer, from ProvidePictureBuffers(). |
| 94 gfx::Size picture_buffer_dimensions_; | 95 gfx::Size picture_buffer_dimensions_; |
| 95 | 96 |
| 96 // WeakPtr factory for posting tasks back to itself. | 97 // WeakPtr factory for posting tasks back to itself. |
| 97 base::WeakPtrFactory<GpuVideoDecodeAcceleratorHost> weak_this_factory_; | 98 base::WeakPtrFactory<GpuVideoDecodeAcceleratorHost> weak_this_factory_; |
| 98 | 99 |
| 99 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecodeAcceleratorHost); | 100 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecodeAcceleratorHost); |
| 100 }; | 101 }; |
| 101 | 102 |
| 102 } // namespace media | 103 } // namespace media |
| 103 | 104 |
| 104 #endif // MEDIA_GPU_IPC_CLIENT_GPU_VIDEO_DECODE_ACCELERATOR_HOST_H_ | 105 #endif // MEDIA_GPU_IPC_CLIENT_GPU_VIDEO_DECODE_ACCELERATOR_HOST_H_ |
| OLD | NEW |