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

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
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 // Helper function to validate |port| and |index|. 109 // Helper function to validate |port| and |index|.
109 bool ValidatePortAndIndex(PortType port, uint32_t index) const; 110 bool ValidatePortAndIndex(PortType port, uint32_t index) const;
110 111
111 // Return true if |dmabuf_planes| is valid for a dmabuf |fd|. 112 // Return true if |dmabuf_planes| is valid for a dmabuf |fd|.
112 bool VerifyDmabuf(const base::ScopedFD& fd, 113 bool VerifyDmabuf(const base::ScopedFD& fd,
113 const std::vector<DmabufPlane>& dmabuf_planes) const; 114 const std::vector<::arc::ArcVideoAcceleratorDmabufPlane>&
115 dmabuf_planes) const;
114 116
115 // Creates an InputRecord for the given |bitstream_buffer_id|. The 117 // Creates an InputRecord for the given |bitstream_buffer_id|. The
116 // |buffer_index| is the index of the associated input buffer. The |timestamp| 118 // |buffer_index| is the index of the associated input buffer. The |timestamp|
117 // is the time the video frame should be displayed. 119 // is the time the video frame should be displayed.
118 void CreateInputRecord(int32_t bitstream_buffer_id, 120 void CreateInputRecord(int32_t bitstream_buffer_id,
119 uint32_t buffer_index, 121 uint32_t buffer_index,
120 int64_t timestamp); 122 int64_t timestamp);
121 123
122 // Finds the InputRecord which matches to given |bitstream_buffer_id|. 124 // Finds the InputRecord which matches to given |bitstream_buffer_id|.
123 // Returns |nullptr| if it cannot be found. 125 // Returns |nullptr| if it cannot be found.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 167
166 gpu::GpuPreferences gpu_preferences_; 168 gpu::GpuPreferences gpu_preferences_;
167 169
168 DISALLOW_COPY_AND_ASSIGN(ArcGpuVideoDecodeAccelerator); 170 DISALLOW_COPY_AND_ASSIGN(ArcGpuVideoDecodeAccelerator);
169 }; 171 };
170 172
171 } // namespace arc 173 } // namespace arc
172 } // namespace chromeos 174 } // namespace chromeos
173 175
174 #endif // CHROME_GPU_ARC_GPU_VIDEO_DECODE_ACCELERATOR_H_ 176 #endif // CHROME_GPU_ARC_GPU_VIDEO_DECODE_ACCELERATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698