| 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" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 // through IPC messages. | 21 // through IPC messages. |
| 22 class GpuVideoDecodeAcceleratorHost | 22 class GpuVideoDecodeAcceleratorHost |
| 23 : public IPC::Listener, | 23 : public IPC::Listener, |
| 24 public media::VideoDecodeAccelerator, | 24 public media::VideoDecodeAccelerator, |
| 25 public CommandBufferProxyImpl::DeletionObserver, | 25 public CommandBufferProxyImpl::DeletionObserver, |
| 26 public base::NonThreadSafe { | 26 public base::NonThreadSafe { |
| 27 public: | 27 public: |
| 28 // |channel| is used to send IPC messages to GPU process. | 28 // |channel| is used to send IPC messages to GPU process. |
| 29 GpuVideoDecodeAcceleratorHost(GpuChannelHost* channel, | 29 GpuVideoDecodeAcceleratorHost(GpuChannelHost* channel, |
| 30 int32 decoder_route_id, | 30 int32 decoder_route_id, |
| 31 media::VideoDecodeAccelerator::Client* client, | |
| 32 CommandBufferProxyImpl* impl); | 31 CommandBufferProxyImpl* impl); |
| 33 | 32 |
| 34 // IPC::Listener implementation. | 33 // IPC::Listener implementation. |
| 35 virtual void OnChannelError() OVERRIDE; | 34 virtual void OnChannelError() OVERRIDE; |
| 36 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 35 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 37 | 36 |
| 38 // media::VideoDecodeAccelerator implementation. | 37 // media::VideoDecodeAccelerator implementation. |
| 39 virtual bool Initialize(media::VideoCodecProfile profile) OVERRIDE; | 38 virtual bool Initialize(Client* client, |
| 39 media::VideoCodecProfile profile) OVERRIDE; |
| 40 virtual void Decode(const media::BitstreamBuffer& bitstream_buffer) OVERRIDE; | 40 virtual void Decode(const media::BitstreamBuffer& bitstream_buffer) OVERRIDE; |
| 41 virtual void AssignPictureBuffers( | 41 virtual void AssignPictureBuffers( |
| 42 const std::vector<media::PictureBuffer>& buffers) OVERRIDE; | 42 const std::vector<media::PictureBuffer>& buffers) OVERRIDE; |
| 43 virtual void ReusePictureBuffer(int32 picture_buffer_id) OVERRIDE; | 43 virtual void ReusePictureBuffer(int32 picture_buffer_id) OVERRIDE; |
| 44 virtual void Flush() OVERRIDE; | 44 virtual void Flush() OVERRIDE; |
| 45 virtual void Reset() OVERRIDE; | 45 virtual void Reset() OVERRIDE; |
| 46 virtual void Destroy() OVERRIDE; | 46 virtual void Destroy() OVERRIDE; |
| 47 | 47 |
| 48 // CommandBufferProxyImpl::DeletionObserver implemetnation. | 48 // CommandBufferProxyImpl::DeletionObserver implemetnation. |
| 49 virtual void OnWillDeleteImpl() OVERRIDE; | 49 virtual void OnWillDeleteImpl() OVERRIDE; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 63 void OnFlushDone(); | 63 void OnFlushDone(); |
| 64 void OnResetDone(); | 64 void OnResetDone(); |
| 65 void OnErrorNotification(uint32 error); | 65 void OnErrorNotification(uint32 error); |
| 66 | 66 |
| 67 // Sends IPC messages to the Gpu process. | 67 // Sends IPC messages to the Gpu process. |
| 68 GpuChannelHost* channel_; | 68 GpuChannelHost* channel_; |
| 69 | 69 |
| 70 // Route ID for the associated decoder in the GPU process. | 70 // Route ID for the associated decoder in the GPU process. |
| 71 int32 decoder_route_id_; | 71 int32 decoder_route_id_; |
| 72 | 72 |
| 73 // Reference to the client that will receive callbacks from the decoder. | 73 // The client that will receive callbacks from the decoder. |
| 74 media::VideoDecodeAccelerator::Client* client_; | 74 Client* client_; |
| 75 | 75 |
| 76 // Unowned reference to the CommandBufferProxyImpl that created us. | 76 // Unowned reference to the CommandBufferProxyImpl that created us. |
| 77 CommandBufferProxyImpl* impl_; | 77 CommandBufferProxyImpl* impl_; |
| 78 | 78 |
| 79 // Requested dimensions of the buffer, from ProvidePictureBuffers(). | 79 // Requested dimensions of the buffer, from ProvidePictureBuffers(). |
| 80 gfx::Size picture_buffer_dimensions_; | 80 gfx::Size picture_buffer_dimensions_; |
| 81 | 81 |
| 82 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecodeAcceleratorHost); | 82 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecodeAcceleratorHost); |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 } // namespace content | 85 } // namespace content |
| 86 | 86 |
| 87 #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 |