| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_GPU_GPU_VIDEO_SERVICE_H_ | |
| 6 #define CHROME_GPU_GPU_VIDEO_SERVICE_H_ | |
| 7 | |
| 8 #include <map> | |
| 9 | |
| 10 #include "base/ref_counted.h" | |
| 11 #include "base/singleton.h" | |
| 12 #include "chrome/gpu/gpu_video_decoder.h" | |
| 13 #include "ipc/ipc_channel.h" | |
| 14 | |
| 15 class GpuChannel; | |
| 16 | |
| 17 class GpuVideoService : public IPC::Channel::Listener { | |
| 18 public: | |
| 19 static GpuVideoService* GetInstance(); | |
| 20 | |
| 21 // IPC::Channel::Listener. | |
| 22 virtual void OnChannelConnected(int32 peer_pid); | |
| 23 virtual void OnChannelError(); | |
| 24 virtual bool OnMessageReceived(const IPC::Message& message); | |
| 25 | |
| 26 // TODO(hclam): Remove return value. | |
| 27 bool CreateVideoDecoder(GpuChannel* channel, | |
| 28 MessageRouter* router, | |
| 29 int32 decoder_host_id, | |
| 30 int32 decoder_id, | |
| 31 gpu::gles2::GLES2Decoder* gles2_decoder); | |
| 32 void DestroyVideoDecoder(MessageRouter* router, | |
| 33 int32 decoder_id); | |
| 34 | |
| 35 private: | |
| 36 struct GpuVideoDecoderInfo; | |
| 37 | |
| 38 GpuVideoService(); | |
| 39 virtual ~GpuVideoService(); | |
| 40 | |
| 41 std::map<int32, GpuVideoDecoderInfo> decoder_map_; | |
| 42 | |
| 43 // Specialize video service on different platform will override. | |
| 44 virtual bool IntializeGpuVideoService(); | |
| 45 virtual bool UnintializeGpuVideoService(); | |
| 46 | |
| 47 friend struct DefaultSingletonTraits<GpuVideoService>; | |
| 48 DISALLOW_COPY_AND_ASSIGN(GpuVideoService); | |
| 49 }; | |
| 50 | |
| 51 #endif // CHROME_GPU_GPU_VIDEO_SERVICE_H_ | |
| OLD | NEW |