Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1256)

Side by Side Diff: chrome/browser/chromeos/arc/gpu_arc_video_service_host.h

Issue 1641353003: GpuArcVideoService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@arc-4-owen-ArcGpuVideoDecodeAccelerator
Patch Set: update ArcVideoAccelerator api Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 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_BROWSER_CHROMEOS_ARC_GPU_ARC_VIDEO_SERVICE_HOST_H_
6 #define CHROME_BROWSER_CHROMEOS_ARC_GPU_ARC_VIDEO_SERVICE_HOST_H_
7
8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/threading/thread_checker.h"
11 #include "components/arc/arc_bridge_service.h"
12 #include "components/arc/arc_service.h"
13 #include "components/arc/common/video.mojom.h"
14 #include "mojo/public/cpp/bindings/binding.h"
15 #include "mojo/public/cpp/bindings/interface_ptr_info.h"
16
17 namespace base {
18 class SingleThreadTaskRunner;
19 }
20
21 namespace arc {
22
23 // This class passes requests from arc::VideoInstance to GpuArcVideoService to
Owen Lin 2016/03/14 08:45:52 s/passes/takes/ How aobut: This class takes reque
kcwu 2016/03/14 12:55:49 Done.
24 // create a video accelerator channel in GPU process and reply the created
25 // channel.
26 //
27 // Don't be confused two senses of "host" of this class. This class, which
28 // implements arc::VideoHost, handles requests from arc::VideoInstance. At the
29 // same time, as its name says, this class is the host of corresponding class,
30 // GpuArcVideoService, in the GPU process.
Owen Lin 2016/03/14 08:45:52 I don't think this comment helps. I would suggest
kcwu 2016/03/14 12:55:49 Done.
31 class GpuArcVideoServiceHost : public arc::ArcService,
32 public arc::ArcBridgeService::Observer,
33 public arc::VideoHost {
34 public:
35 explicit GpuArcVideoServiceHost(arc::ArcBridgeService* bridge_service);
36 ~GpuArcVideoServiceHost() override;
37
38 // arc::ArcBridgeService::Observer implementation.
39 void OnVideoInstanceReady() override;
40 void OnVideoInstanceClosed() override;
41
42 // arc::VideoHost implementation.
43 void OnRequestArcVideoAcceleratorChannel(
44 uint32_t pid,
45 const OnRequestArcVideoAcceleratorChannelCallback& callback) override;
46
47 private:
48 void BindServiceAndCreateChannel(
49 uint32_t pid,
50 const OnRequestArcVideoAcceleratorChannelCallback& callback,
51 mojo::InterfacePtrInfo<arc::VideoHost>* ptr_info);
52
53 base::ThreadChecker thread_checker_;
54
55 mojo::Binding<arc::VideoHost> binding_;
56
57 // IO task runner, where GpuProcessHost tasks run.
58 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
59
60 arc::VideoHostPtr service_ptr_;
61
62 base::WeakPtrFactory<GpuArcVideoServiceHost> weak_factory_;
63
64 DISALLOW_COPY_AND_ASSIGN(GpuArcVideoServiceHost);
65 };
66
67 } // namespace arc
68
69 #endif // CHROME_BROWSER_CHROMEOS_ARC_GPU_ARC_VIDEO_SERVICE_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698