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_RENDERER_GPU_VIDEO_SERVICE_HOST_H_ | |
6 #define CHROME_RENDERER_GPU_VIDEO_SERVICE_HOST_H_ | |
7 | |
8 #include "base/singleton.h" | |
9 #include "chrome/renderer/gpu_channel_host.h" | |
10 #include "chrome/renderer/gpu_video_decoder_host.h" | |
11 #include "ipc/ipc_channel.h" | |
12 #include "media/base/buffers.h" | |
13 #include "media/base/video_frame.h" | |
14 | |
15 // GpuVideoServiceHost lives on IO thread and is used to dispatch IPC messages | |
16 // to GpuVideoDecoderHost objects. | |
17 class GpuVideoServiceHost : public IPC::ChannelProxy::MessageFilter { | |
18 public: | |
19 GpuVideoServiceHost(); | |
20 | |
21 // IPC::ChannelProxy::MessageFilter implementations. | |
22 virtual bool OnMessageReceived(const IPC::Message& message); | |
23 virtual void OnFilterAdded(IPC::Channel* channel); | |
24 virtual void OnFilterRemoved(); | |
25 virtual void OnChannelClosing(); | |
26 | |
27 // Called on RenderThread to create a hardware accelerated video decoder | |
28 // in the GPU process. | |
29 // | |
30 // A routing ID for the GLES2 context needs to be provided when creating a | |
31 // hardware video decoder. This is important because the resources used by | |
32 // the video decoder needs to be shared with the GLES2 context corresponding | |
33 // to the RenderView. | |
34 // | |
35 // This means that a GPU video decoder is tied to a specific RenderView and | |
36 // its GLES2 context in the GPU process. | |
37 // | |
38 // Returns a GpuVideoDecoderHost as a handle to control the video decoder. | |
39 GpuVideoDecoderHost* CreateVideoDecoder(int context_route_id); | |
40 | |
41 private: | |
42 IPC::Channel* channel_; | |
43 | |
44 // Router to send messages to a GpuVideoDecoderHost. | |
45 MessageRouter router_; | |
46 | |
47 // ID for the next GpuVideoDecoderHost. | |
48 int32 next_decoder_host_id_; | |
49 | |
50 DISALLOW_COPY_AND_ASSIGN(GpuVideoServiceHost); | |
51 }; | |
52 | |
53 #endif // CHROME_RENDERER_GPU_VIDEO_SERVICE_HOST_H_ | |
OLD | NEW |