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 <map> |
| 9 |
| 10 #include "base/singleton.h" |
| 11 #include "chrome/common/gpu_video_common.h" |
| 12 #include "chrome/renderer/gpu_channel_host.h" |
| 13 #include "chrome/renderer/gpu_video_decoder_host.h" |
| 14 #include "ipc/ipc_channel.h" |
| 15 #include "media/base/buffers.h" |
| 16 #include "media/base/video_frame.h" |
| 17 |
| 18 class GpuVideoServiceHost : public IPC::Channel::Listener, |
| 19 public Singleton<GpuVideoServiceHost> { |
| 20 public: |
| 21 // IPC::Channel::Listener. |
| 22 virtual void OnChannelConnected(int32 peer_pid) {} |
| 23 virtual void OnChannelError(); |
| 24 virtual void OnMessageReceived(const IPC::Message& message); |
| 25 |
| 26 void OnRendererThreadInit(MessageLoop* message_loop); |
| 27 void OnGpuChannelConnected(GpuChannelHost* channel_host, |
| 28 MessageRouter* router, |
| 29 IPC::SyncChannel* channel); |
| 30 |
| 31 // call at RenderThread. one per renderer process. |
| 32 scoped_refptr<GpuVideoDecoderHost> CreateVideoDecoder( |
| 33 GpuVideoDecoderHost::EventHandler* event_handler); |
| 34 void DestroyVideoDecoder(scoped_refptr<GpuVideoDecoderHost>); |
| 35 |
| 36 private: |
| 37 GpuVideoServiceHost() : message_loop_(NULL) { |
| 38 service_info_.service_available_ = 0; |
| 39 } |
| 40 |
| 41 scoped_refptr<GpuChannelHost> channel_host_; |
| 42 MessageRouter* router_; |
| 43 GpuVideoServiceInfoParam service_info_; |
| 44 MessageLoop* message_loop_; // Message loop of render thread. |
| 45 |
| 46 friend struct DefaultSingletonTraits<GpuVideoServiceHost>; |
| 47 DISALLOW_COPY_AND_ASSIGN(GpuVideoServiceHost); |
| 48 }; |
| 49 |
| 50 #endif // CHROME_RENDERER_GPU_VIDEO_SERVICE_HOST_H_ |
| 51 |
OLD | NEW |