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

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

Issue 2513973002: Use mojo typemap to simplify the code using DmabufPlane (Closed)
Patch Set: Addressed comments Created 4 years 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/DEPS ('k') | chrome/gpu/arc_gpu_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_ARC_GPU_VIDEO_DECODE_ACCELERATOR_H_ 5 #ifndef CHROME_GPU_ARC_GPU_VIDEO_DECODE_ACCELERATOR_H_
6 #define CHROME_GPU_ARC_GPU_VIDEO_DECODE_ACCELERATOR_H_ 6 #define CHROME_GPU_ARC_GPU_VIDEO_DECODE_ACCELERATOR_H_
7 7
8 #include <list> 8 #include <list>
9 #include <memory> 9 #include <memory>
10 #include <queue> 10 #include <queue>
(...skipping 27 matching lines...) Expand all
38 ArcVideoAccelerator::Client* client) override; 38 ArcVideoAccelerator::Client* client) override;
39 void SetNumberOfOutputBuffers(size_t number) override; 39 void SetNumberOfOutputBuffers(size_t number) override;
40 void BindSharedMemory(PortType port, 40 void BindSharedMemory(PortType port,
41 uint32_t index, 41 uint32_t index,
42 base::ScopedFD ashmem_fd, 42 base::ScopedFD ashmem_fd,
43 off_t offset, 43 off_t offset,
44 size_t length) override; 44 size_t length) override;
45 void BindDmabuf(PortType port, 45 void BindDmabuf(PortType port,
46 uint32_t index, 46 uint32_t index,
47 base::ScopedFD dmabuf_fd, 47 base::ScopedFD dmabuf_fd,
48 const std::vector<DmabufPlane>& dmabuf_planes) override; 48 const std::vector<::arc::ArcVideoAcceleratorDmabufPlane>&
49 dmabuf_planes) override;
49 void UseBuffer(PortType port, 50 void UseBuffer(PortType port,
50 uint32_t index, 51 uint32_t index,
51 const BufferMetadata& metadata) override; 52 const BufferMetadata& metadata) override;
52 void Reset() override; 53 void Reset() override;
53 void Flush() override; 54 void Flush() override;
54 55
55 // Implementation of the VideoDecodeAccelerator::Client interface. 56 // Implementation of the VideoDecodeAccelerator::Client interface.
56 void ProvidePictureBuffers(uint32_t requested_num_of_buffers, 57 void ProvidePictureBuffers(uint32_t requested_num_of_buffers,
57 media::VideoPixelFormat output_format, 58 media::VideoPixelFormat output_format,
58 uint32_t textures_per_buffer, 59 uint32_t textures_per_buffer,
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 size_t length = 0; 92 size_t length = 0;
92 93
93 InputBufferInfo(); 94 InputBufferInfo();
94 InputBufferInfo(InputBufferInfo&& other); 95 InputBufferInfo(InputBufferInfo&& other);
95 ~InputBufferInfo(); 96 ~InputBufferInfo();
96 }; 97 };
97 98
98 // The information about the dmabuf used as an output buffer. 99 // The information about the dmabuf used as an output buffer.
99 struct OutputBufferInfo { 100 struct OutputBufferInfo {
100 base::ScopedFD handle; 101 base::ScopedFD handle;
101 std::vector<DmabufPlane> planes; 102 std::vector<::arc::ArcVideoAcceleratorDmabufPlane> planes;
102 103
103 OutputBufferInfo(); 104 OutputBufferInfo();
104 OutputBufferInfo(OutputBufferInfo&& other); 105 OutputBufferInfo(OutputBufferInfo&& other);
105 ~OutputBufferInfo(); 106 ~OutputBufferInfo();
106 }; 107 };
107 108
108 // The helper method to simplify reporting of the status returned to UMA. 109 // The helper method to simplify reporting of the status returned to UMA.
109 ArcVideoAccelerator::Result InitializeTask( 110 ArcVideoAccelerator::Result InitializeTask(
110 const Config& config, 111 const Config& config,
111 ArcVideoAccelerator::Client* client); 112 ArcVideoAccelerator::Client* client);
112 113
113 // Helper function to validate |port| and |index|. 114 // Helper function to validate |port| and |index|.
114 bool ValidatePortAndIndex(PortType port, uint32_t index) const; 115 bool ValidatePortAndIndex(PortType port, uint32_t index) const;
115 116
116 // Return true if |dmabuf_planes| is valid for a dmabuf |fd|. 117 // Return true if |dmabuf_planes| is valid for a dmabuf |fd|.
117 bool VerifyDmabuf(const base::ScopedFD& fd, 118 bool VerifyDmabuf(const base::ScopedFD& fd,
118 const std::vector<DmabufPlane>& dmabuf_planes) const; 119 const std::vector<::arc::ArcVideoAcceleratorDmabufPlane>&
120 dmabuf_planes) const;
119 121
120 // Creates an InputRecord for the given |bitstream_buffer_id|. The 122 // Creates an InputRecord for the given |bitstream_buffer_id|. The
121 // |buffer_index| is the index of the associated input buffer. The |timestamp| 123 // |buffer_index| is the index of the associated input buffer. The |timestamp|
122 // is the time the video frame should be displayed. 124 // is the time the video frame should be displayed.
123 void CreateInputRecord(int32_t bitstream_buffer_id, 125 void CreateInputRecord(int32_t bitstream_buffer_id,
124 uint32_t buffer_index, 126 uint32_t buffer_index,
125 int64_t timestamp); 127 int64_t timestamp);
126 128
127 // Finds the InputRecord which matches to given |bitstream_buffer_id|. 129 // Finds the InputRecord which matches to given |bitstream_buffer_id|.
128 // Returns |nullptr| if it cannot be found. 130 // Returns |nullptr| if it cannot be found.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 172
171 gpu::GpuPreferences gpu_preferences_; 173 gpu::GpuPreferences gpu_preferences_;
172 174
173 DISALLOW_COPY_AND_ASSIGN(ArcGpuVideoDecodeAccelerator); 175 DISALLOW_COPY_AND_ASSIGN(ArcGpuVideoDecodeAccelerator);
174 }; 176 };
175 177
176 } // namespace arc 178 } // namespace arc
177 } // namespace chromeos 179 } // namespace chromeos
178 180
179 #endif // CHROME_GPU_ARC_GPU_VIDEO_DECODE_ACCELERATOR_H_ 181 #endif // CHROME_GPU_ARC_GPU_VIDEO_DECODE_ACCELERATOR_H_
OLDNEW
« no previous file with comments | « chrome/gpu/DEPS ('k') | chrome/gpu/arc_gpu_video_decode_accelerator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698