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

Side by Side Diff: chrome/browser/chromeos/arc/video/gpu_arc_video_service_host.cc

Issue 2892863002: ArcBridge: Add VideoEncodeAccelerator implementation. (Closed)
Patch Set: add missing public_dep to the typemap file. Created 3 years, 5 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
« no previous file with comments | « chrome/browser/chrome_content_gpu_manifest_overlay.json ('k') | chrome/gpu/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/arc/video/gpu_arc_video_service_host.h" 5 #include "chrome/browser/chromeos/arc/video/gpu_arc_video_service_host.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 13 matching lines...) Expand all
24 24
25 namespace arc { 25 namespace arc {
26 26
27 namespace { 27 namespace {
28 28
29 void ConnectToVideoDecodeAcceleratorOnIOThread( 29 void ConnectToVideoDecodeAcceleratorOnIOThread(
30 mojom::VideoDecodeAcceleratorRequest request) { 30 mojom::VideoDecodeAcceleratorRequest request) {
31 content::BindInterfaceInGpuProcess(std::move(request)); 31 content::BindInterfaceInGpuProcess(std::move(request));
32 } 32 }
33 33
34 void ConnectToVideoEncodeAcceleratorOnIOThread(
35 mojom::VideoEncodeAcceleratorRequest request) {
36 content::BindInterfaceInGpuProcess(std::move(request));
37 }
38
34 } // namespace 39 } // namespace
35 40
36 class VideoAcceleratorFactoryService : public mojom::VideoAcceleratorFactory { 41 class VideoAcceleratorFactoryService : public mojom::VideoAcceleratorFactory {
37 public: 42 public:
38 VideoAcceleratorFactoryService() = default; 43 VideoAcceleratorFactoryService() = default;
39 44
40 void CreateDecodeAccelerator( 45 void CreateDecodeAccelerator(
41 mojom::VideoDecodeAcceleratorRequest request) override { 46 mojom::VideoDecodeAcceleratorRequest request) override {
42 content::BrowserThread::PostTask( 47 content::BrowserThread::PostTask(
43 content::BrowserThread::IO, FROM_HERE, 48 content::BrowserThread::IO, FROM_HERE,
44 base::BindOnce(&ConnectToVideoDecodeAcceleratorOnIOThread, 49 base::BindOnce(&ConnectToVideoDecodeAcceleratorOnIOThread,
45 base::Passed(&request))); 50 base::Passed(&request)));
46 } 51 }
47 52
48 void CreateEncodeAccelerator( 53 void CreateEncodeAccelerator(
49 mojom::VideoEncodeAcceleratorRequest request) override { 54 mojom::VideoEncodeAcceleratorRequest request) override {
50 // TODO(owenlin): Implement this function. 55 content::BrowserThread::PostTask(
56 content::BrowserThread::IO, FROM_HERE,
57 base::BindOnce(&ConnectToVideoEncodeAcceleratorOnIOThread,
58 base::Passed(&request)));
51 } 59 }
52 60
53 private: 61 private:
54 DISALLOW_COPY_AND_ASSIGN(VideoAcceleratorFactoryService); 62 DISALLOW_COPY_AND_ASSIGN(VideoAcceleratorFactoryService);
55 }; 63 };
56 64
57 GpuArcVideoServiceHost::GpuArcVideoServiceHost(ArcBridgeService* bridge_service) 65 GpuArcVideoServiceHost::GpuArcVideoServiceHost(ArcBridgeService* bridge_service)
58 : ArcService(bridge_service), binding_(this) { 66 : ArcService(bridge_service), binding_(this) {
59 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 67 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
60 arc_bridge_service()->video()->AddObserver(this); 68 arc_bridge_service()->video()->AddObserver(this);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 mojo::ScopedHandle child_handle{mojo::Handle(wrapped_handle)}; 111 mojo::ScopedHandle child_handle{mojo::Handle(wrapped_handle)};
104 112
105 callback.Run(std::move(child_handle), token); 113 callback.Run(std::move(child_handle), token);
106 114
107 mojo::MakeStrongBinding( 115 mojo::MakeStrongBinding(
108 base::MakeUnique<VideoAcceleratorFactoryService>(), 116 base::MakeUnique<VideoAcceleratorFactoryService>(),
109 mojom::VideoAcceleratorFactoryRequest(std::move(server_pipe))); 117 mojom::VideoAcceleratorFactoryRequest(std::move(server_pipe)));
110 } 118 }
111 119
112 } // namespace arc 120 } // namespace arc
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_gpu_manifest_overlay.json ('k') | chrome/gpu/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698