| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_RENDERER_GPU_GPU_VIDEO_DECODE_ACCELERATOR_HOST_H_ | 5 #ifndef CONTENT_RENDERER_GPU_GPU_VIDEO_DECODE_ACCELERATOR_HOST_H_ |
| 6 #define CONTENT_RENDERER_GPU_GPU_VIDEO_DECODE_ACCELERATOR_HOST_H_ | 6 #define CONTENT_RENDERER_GPU_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/threading/non_thread_safe.h" | 11 #include "base/threading/non_thread_safe.h" |
| 11 #include "ipc/ipc_channel.h" | 12 #include "ipc/ipc_channel.h" |
| 12 #include "media/video/video_decode_accelerator.h" | 13 #include "media/video/video_decode_accelerator.h" |
| 13 | 14 |
| 14 class GpuChannelHost; | 15 class GpuChannelHost; |
| 15 | 16 |
| 16 // This class is used to talk to VideoDecodeAccelerator in the Gpu process | 17 // This class is used to talk to VideoDecodeAccelerator in the Gpu process |
| 17 // through IPC messages. | 18 // through IPC messages. |
| 18 class GpuVideoDecodeAcceleratorHost | 19 class GpuVideoDecodeAcceleratorHost |
| 19 : public IPC::Channel::Listener, | 20 : public IPC::Channel::Listener, |
| 20 public media::VideoDecodeAccelerator, | 21 public media::VideoDecodeAccelerator, |
| 21 public base::NonThreadSafe { | 22 public base::NonThreadSafe, |
| 23 public base::SupportsWeakPtr<GpuVideoDecodeAcceleratorHost> { |
| 22 public: | 24 public: |
| 23 // |channel| is used to send IPC messages to GPU process. | 25 // |channel| is used to send IPC messages to GPU process. |
| 24 GpuVideoDecodeAcceleratorHost(GpuChannelHost* channel, | 26 GpuVideoDecodeAcceleratorHost(GpuChannelHost* channel, |
| 25 int32 decoder_route_id, | 27 int32 decoder_route_id, |
| 26 media::VideoDecodeAccelerator::Client* client); | 28 media::VideoDecodeAccelerator::Client* client); |
| 27 virtual ~GpuVideoDecodeAcceleratorHost(); | 29 virtual ~GpuVideoDecodeAcceleratorHost(); |
| 28 | 30 |
| 29 // IPC::Channel::Listener implementation. | 31 // IPC::Channel::Listener implementation. |
| 30 virtual void OnChannelError() OVERRIDE; | 32 virtual void OnChannelError() OVERRIDE; |
| 31 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 33 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 62 // attempting to use an outdated or reused route id. | 64 // attempting to use an outdated or reused route id. |
| 63 int32 decoder_route_id_; | 65 int32 decoder_route_id_; |
| 64 | 66 |
| 65 // Reference to the client that will receive callbacks from the decoder. | 67 // Reference to the client that will receive callbacks from the decoder. |
| 66 media::VideoDecodeAccelerator::Client* client_; | 68 media::VideoDecodeAccelerator::Client* client_; |
| 67 | 69 |
| 68 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecodeAcceleratorHost); | 70 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecodeAcceleratorHost); |
| 69 }; | 71 }; |
| 70 | 72 |
| 71 #endif // CONTENT_RENDERER_GPU_GPU_VIDEO_DECODE_ACCELERATOR_HOST_H_ | 73 #endif // CONTENT_RENDERER_GPU_GPU_VIDEO_DECODE_ACCELERATOR_HOST_H_ |
| OLD | NEW |