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

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

Powered by Google App Engine
This is Rietveld 408576698