OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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 CONTENT_BROWSER_GPU_GPU_ARC_VIDEO_SERVICE_HOST_H_ |
| 6 #define CONTENT_BROWSER_GPU_GPU_ARC_VIDEO_SERVICE_HOST_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/threading/thread_checker.h" |
| 11 #include "components/arc/arc_bridge_service.h" |
| 12 #include "components/arc/common/video.mojom.h" |
| 13 #include "components/arc/video/arc_video_service.h" |
| 14 #include "ipc/ipc_channel_handle.h" |
| 15 #include "mojo/public/cpp/bindings/binding.h" |
| 16 |
| 17 namespace content { |
| 18 |
| 19 // This class passes requests from ArcBridgeService to GpuArcVideoService to |
| 20 // create a video accelerator channel in GPU process and sends the created |
| 21 // channel back to ArcBridgeService. |
| 22 class GpuArcVideoServiceHost : public arc::VideoHost, |
| 23 public arc::ArcVideoService, |
| 24 public arc::ArcBridgeService::Observer { |
| 25 public: |
| 26 GpuArcVideoServiceHost(); |
| 27 ~GpuArcVideoServiceHost() override; |
| 28 |
| 29 // arc::ArcVideoService implementation. |
| 30 void Initialize() override; |
| 31 |
| 32 // arc::ArcBridgeService::Observer implementation. |
| 33 void OnStateChanged(arc::ArcBridgeService::State state) override; |
| 34 void OnVideoInstanceReady() override; |
| 35 |
| 36 // arc::VideoHost implementation. |
| 37 void OnRequestArcVideoAcceleratorChannel( |
| 38 const OnRequestArcVideoAcceleratorChannelCallback& callback) override; |
| 39 |
| 40 private: |
| 41 void HandleChannelCreatedReply( |
| 42 const OnRequestArcVideoAcceleratorChannelCallback& callback, |
| 43 const IPC::ChannelHandle& handle); |
| 44 |
| 45 void Shutdown(); |
| 46 |
| 47 base::ThreadChecker thread_checker_; |
| 48 |
| 49 // IO task runner, where GpuProcessHost tasks run. |
| 50 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
| 51 |
| 52 mojo::Binding<arc::VideoHost> binding_; |
| 53 |
| 54 base::WeakPtrFactory<GpuArcVideoServiceHost> weak_factory_; |
| 55 |
| 56 DISALLOW_COPY_AND_ASSIGN(GpuArcVideoServiceHost); |
| 57 }; |
| 58 |
| 59 } // namespace content |
| 60 |
| 61 #endif // CONTENT_BROWSER_GPU_GPU_ARC_VIDEO_SERVICE_HOST_H_ |
OLD | NEW |