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 CONTENT_COMMON_GPU_CLIENT_GPU_VIDEO_DECODE_ACCELERATOR_HOST_H_ | 5 #ifndef CONTENT_COMMON_GPU_CLIENT_GPU_VIDEO_DECODE_ACCELERATOR_HOST_H_ |
6 #define CONTENT_COMMON_GPU_CLIENT_GPU_VIDEO_DECODE_ACCELERATOR_HOST_H_ | 6 #define CONTENT_COMMON_GPU_CLIENT_GPU_VIDEO_DECODE_ACCELERATOR_HOST_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
11 #include "base/threading/non_thread_safe.h" | 11 #include "base/threading/non_thread_safe.h" |
12 #include "content/common/gpu/client/command_buffer_proxy_impl.h" | 12 #include "content/common/gpu/client/command_buffer_proxy_impl.h" |
13 #include "ipc/ipc_listener.h" | 13 #include "ipc/ipc_listener.h" |
14 #include "media/video/video_decode_accelerator.h" | 14 #include "media/video/video_decode_accelerator.h" |
| 15 #include "ui/gfx/size.h" |
15 | 16 |
16 namespace content { | 17 namespace content { |
17 class GpuChannelHost; | 18 class GpuChannelHost; |
18 | 19 |
19 // This class is used to talk to VideoDecodeAccelerator in the Gpu process | 20 // This class is used to talk to VideoDecodeAccelerator in the Gpu process |
20 // through IPC messages. | 21 // through IPC messages. |
21 class GpuVideoDecodeAcceleratorHost | 22 class GpuVideoDecodeAcceleratorHost |
22 : public IPC::Listener, | 23 : public IPC::Listener, |
23 public media::VideoDecodeAccelerator, | 24 public media::VideoDecodeAccelerator, |
24 public CommandBufferProxyImpl::DeletionObserver, | 25 public CommandBufferProxyImpl::DeletionObserver, |
(...skipping 23 matching lines...) Expand all Loading... |
48 virtual void OnWillDeleteImpl() OVERRIDE; | 49 virtual void OnWillDeleteImpl() OVERRIDE; |
49 | 50 |
50 private: | 51 private: |
51 // Only Destroy() should be deleting |this|. | 52 // Only Destroy() should be deleting |this|. |
52 virtual ~GpuVideoDecodeAcceleratorHost(); | 53 virtual ~GpuVideoDecodeAcceleratorHost(); |
53 | 54 |
54 void Send(IPC::Message* message); | 55 void Send(IPC::Message* message); |
55 | 56 |
56 void OnBitstreamBufferProcessed(int32 bitstream_buffer_id); | 57 void OnBitstreamBufferProcessed(int32 bitstream_buffer_id); |
57 void OnProvidePictureBuffer(uint32 num_requested_buffers, | 58 void OnProvidePictureBuffer(uint32 num_requested_buffers, |
58 const gfx::Size& buffer_size, | 59 const gfx::Size& dimensions, |
59 uint32 texture_target); | 60 uint32 texture_target); |
60 void OnDismissPictureBuffer(int32 picture_buffer_id); | 61 void OnDismissPictureBuffer(int32 picture_buffer_id); |
61 void OnPictureReady(int32 picture_buffer_id, int32 bitstream_buffer_id); | 62 void OnPictureReady(int32 picture_buffer_id, int32 bitstream_buffer_id); |
62 void OnFlushDone(); | 63 void OnFlushDone(); |
63 void OnResetDone(); | 64 void OnResetDone(); |
64 void OnErrorNotification(uint32 error); | 65 void OnErrorNotification(uint32 error); |
65 | 66 |
66 // Sends IPC messages to the Gpu process. | 67 // Sends IPC messages to the Gpu process. |
67 GpuChannelHost* channel_; | 68 GpuChannelHost* channel_; |
68 | 69 |
69 // Route ID for the associated decoder in the GPU process. | 70 // Route ID for the associated decoder in the GPU process. |
70 int32 decoder_route_id_; | 71 int32 decoder_route_id_; |
71 | 72 |
72 // Reference to the client that will receive callbacks from the decoder. | 73 // Reference to the client that will receive callbacks from the decoder. |
73 media::VideoDecodeAccelerator::Client* client_; | 74 media::VideoDecodeAccelerator::Client* client_; |
74 | 75 |
75 // Unowned reference to the CommandBufferProxyImpl that created us. | 76 // Unowned reference to the CommandBufferProxyImpl that created us. |
76 CommandBufferProxyImpl* impl_; | 77 CommandBufferProxyImpl* impl_; |
77 | 78 |
| 79 // Requested dimensions of the buffer, from ProvidePictureBuffers(). |
| 80 gfx::Size picture_buffer_dimensions_; |
| 81 |
78 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecodeAcceleratorHost); | 82 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecodeAcceleratorHost); |
79 }; | 83 }; |
80 | 84 |
81 } // namespace content | 85 } // namespace content |
82 | 86 |
83 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_VIDEO_DECODE_ACCELERATOR_HOST_H_ | 87 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_VIDEO_DECODE_ACCELERATOR_HOST_H_ |
OLD | NEW |