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

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: modify content gui client hook 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 arc {
18
19 // This class takes requests for creating channels of video accelerators from
20 // arc::VideoInstance and forwards these requests to GpuArcVideoServce. It also
21 // returns the created channels back to the arc::VideoInstance.
22 //
23 // This class is the proxy end of GpuArcVideoService and runs in the browser
24 // process. The corresponding end "GpuArcVideoService" runs in the GPU process.
25 class GpuArcVideoServiceHost : public arc::ArcService,
26 public arc::ArcBridgeService::Observer,
27 public arc::VideoHost {
28 public:
29 explicit GpuArcVideoServiceHost(arc::ArcBridgeService* bridge_service);
30 ~GpuArcVideoServiceHost() override;
31
32 // arc::ArcBridgeService::Observer implementation.
33 void OnVideoInstanceReady() override;
34 void OnVideoInstanceClosed() override;
35
36 // arc::VideoHost implementation.
37 void OnRequestArcVideoAcceleratorChannel(
38 uint32_t pid,
39 const OnRequestArcVideoAcceleratorChannelCallback& callback) override;
40
41 private:
42 void BindServiceAndCreateChannel(
43 uint32_t pid,
44 const OnRequestArcVideoAcceleratorChannelCallback& callback,
45 mojo::InterfacePtrInfo<arc::VideoHost> ptr_info);
46
47 base::ThreadChecker thread_checker_;
48
49 mojo::Binding<arc::VideoHost> binding_;
50
51 arc::VideoHostPtr service_ptr_;
52
53 base::WeakPtrFactory<GpuArcVideoServiceHost> weak_factory_;
54
55 DISALLOW_COPY_AND_ASSIGN(GpuArcVideoServiceHost);
56 };
57
58 } // namespace arc
59
60 #endif // CHROME_BROWSER_CHROMEOS_ARC_GPU_ARC_VIDEO_SERVICE_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698