OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_GPU_GPU_VIDEO_SERVICE_H_ | 5 #ifndef CHROME_GPU_GPU_VIDEO_SERVICE_H_ |
6 #define CHROME_GPU_GPU_VIDEO_SERVICE_H_ | 6 #define CHROME_GPU_GPU_VIDEO_SERVICE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/ref_counted.h" | 10 #include "base/ref_counted.h" |
11 #include "base/singleton.h" | 11 #include "base/singleton.h" |
12 #include "chrome/gpu/gpu_video_decoder.h" | 12 #include "chrome/gpu/gpu_video_decoder.h" |
13 #include "ipc/ipc_channel.h" | 13 #include "ipc/ipc_channel.h" |
14 | 14 |
15 class GpuChannel; | 15 class GpuChannel; |
16 | 16 |
17 class GpuVideoService : public IPC::Channel::Listener, | 17 class GpuVideoService : public IPC::Channel::Listener { |
18 public Singleton<GpuVideoService> { | |
19 public: | 18 public: |
| 19 static GpuVideoService* GetInstance(); |
| 20 |
20 // IPC::Channel::Listener. | 21 // IPC::Channel::Listener. |
21 virtual void OnChannelConnected(int32 peer_pid); | 22 virtual void OnChannelConnected(int32 peer_pid); |
22 virtual void OnChannelError(); | 23 virtual void OnChannelError(); |
23 virtual void OnMessageReceived(const IPC::Message& message); | 24 virtual void OnMessageReceived(const IPC::Message& message); |
24 | 25 |
25 // TODO(hclam): Remove return value. | 26 // TODO(hclam): Remove return value. |
26 bool CreateVideoDecoder(GpuChannel* channel, | 27 bool CreateVideoDecoder(GpuChannel* channel, |
27 MessageRouter* router, | 28 MessageRouter* router, |
28 int32 decoder_host_id, | 29 int32 decoder_host_id, |
29 int32 decoder_id, | 30 int32 decoder_id, |
(...skipping 11 matching lines...) Expand all Loading... |
41 | 42 |
42 // Specialize video service on different platform will override. | 43 // Specialize video service on different platform will override. |
43 virtual bool IntializeGpuVideoService(); | 44 virtual bool IntializeGpuVideoService(); |
44 virtual bool UnintializeGpuVideoService(); | 45 virtual bool UnintializeGpuVideoService(); |
45 | 46 |
46 friend struct DefaultSingletonTraits<GpuVideoService>; | 47 friend struct DefaultSingletonTraits<GpuVideoService>; |
47 DISALLOW_COPY_AND_ASSIGN(GpuVideoService); | 48 DISALLOW_COPY_AND_ASSIGN(GpuVideoService); |
48 }; | 49 }; |
49 | 50 |
50 #endif // CHROME_GPU_GPU_VIDEO_SERVICE_H_ | 51 #endif // CHROME_GPU_GPU_VIDEO_SERVICE_H_ |
OLD | NEW |