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

Side by Side Diff: chrome/gpu/gpu_arc_video_service.h

Issue 2919193002: ArcBridge: Rename VideoAcceleratorService to VideoDecodeAccelerator. (Closed)
Patch Set: Address review comments Created 3 years, 6 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/gpu/gpu_arc_video_decode_accelerator.cc ('k') | chrome/gpu/gpu_arc_video_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_GPU_GPU_ARC_VIDEO_SERVICE_H_
6 #define CHROME_GPU_GPU_ARC_VIDEO_SERVICE_H_
7
8 #include <memory>
9 #include <vector>
10
11 #include "base/files/scoped_file.h"
12 #include "base/macros.h"
13 #include "chrome/gpu/arc_video_accelerator.h"
14 #include "components/arc/common/video_accelerator.mojom.h"
15 #include "components/arc/video_accelerator/video_accelerator.h"
16 #include "gpu/command_buffer/service/gpu_preferences.h"
17
18 namespace chromeos {
19 namespace arc {
20
21 // GpuArcVideoService manages life-cycle and IPC message translation for
22 // ArcVideoAccelerator.
23 //
24 // For each creation request from GpuArcVideoServiceHost, GpuArcVideoService
25 // will create a new IPC channel.
26 class GpuArcVideoService : public ::arc::mojom::VideoAcceleratorService,
27 public ArcVideoAccelerator::Client {
28 public:
29 explicit GpuArcVideoService(const gpu::GpuPreferences& gpu_preferences);
30 ~GpuArcVideoService() override;
31
32 private:
33 // ArcVideoAccelerator::Client implementation.
34 void OnError(ArcVideoAccelerator::Result error) override;
35 void OnBufferDone(PortType port,
36 uint32_t index,
37 const BufferMetadata& metadata) override;
38 void OnFlushDone() override;
39 void OnResetDone() override;
40 void OnOutputFormatChanged(const VideoFormat& format) override;
41
42 // ::arc::mojom::VideoAcceleratorService implementation.
43 void Initialize(::arc::mojom::ArcVideoAcceleratorConfigPtr config,
44 ::arc::mojom::VideoAcceleratorServiceClientPtr client,
45 const InitializeCallback& callback) override;
46 void BindSharedMemory(::arc::mojom::PortType port,
47 uint32_t index,
48 mojo::ScopedHandle ashmem_handle,
49 uint32_t offset,
50 uint32_t length) override;
51 void BindDmabuf(::arc::mojom::PortType port,
52 uint32_t index,
53 mojo::ScopedHandle dmabuf_handle,
54 std::vector<::arc::ArcVideoAcceleratorDmabufPlane>
55 dmabuf_planes) override;
56 void UseBuffer(::arc::mojom::PortType port,
57 uint32_t index,
58 ::arc::mojom::BufferMetadataPtr metadata) override;
59 void SetNumberOfOutputBuffers(uint32_t number) override;
60 void Flush() override;
61 void Reset() override;
62
63 base::ScopedFD UnwrapFdFromMojoHandle(mojo::ScopedHandle handle);
64
65 base::ThreadChecker thread_checker_;
66
67 gpu::GpuPreferences gpu_preferences_;
68 std::unique_ptr<ArcVideoAccelerator> accelerator_;
69 ::arc::mojom::VideoAcceleratorServiceClientPtr client_;
70
71 DISALLOW_COPY_AND_ASSIGN(GpuArcVideoService);
72 };
73
74 } // namespace arc
75 } // namespace chromeos
76
77 #endif // CHROME_GPU_GPU_ARC_VIDEO_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/gpu/gpu_arc_video_decode_accelerator.cc ('k') | chrome/gpu/gpu_arc_video_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698