OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ | 5 #ifndef MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ |
6 #define MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ | 6 #define MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
128 // Request a shared-memory segment of at least |min_size| bytes. Will | 128 // Request a shared-memory segment of at least |min_size| bytes. Will |
129 // allocate as necessary. | 129 // allocate as necessary. |
130 scoped_ptr<SHMBuffer> GetSHM(size_t min_size); | 130 scoped_ptr<SHMBuffer> GetSHM(size_t min_size); |
131 | 131 |
132 // Return a shared-memory segment to the available pool. | 132 // Return a shared-memory segment to the available pool. |
133 void PutSHM(scoped_ptr<SHMBuffer> shm_buffer); | 133 void PutSHM(scoped_ptr<SHMBuffer> shm_buffer); |
134 | 134 |
135 // Destroy all PictureBuffers in |buffers|, and delete their textures. | 135 // Destroy all PictureBuffers in |buffers|, and delete their textures. |
136 void DestroyPictureBuffers(PictureBufferMap* buffers); | 136 void DestroyPictureBuffers(PictureBufferMap* buffers); |
137 | 137 |
138 // Returns true if the video decoder can support |profile| and |coded_size|. | 138 // Returns true if the video decoder with |capabilities| can support |
139 bool IsProfileSupported(VideoCodecProfile profile, | 139 // |profile| and |coded_size|. |
140 const gfx::Size& coded_size); | 140 bool IsProfileSupported( |
141 const VideoDecodeAccelerator::Capabilities& capabilities, | |
142 VideoCodecProfile profile, | |
143 const gfx::Size& coded_size); | |
141 | 144 |
142 // Assert the contract that this class is operated on the right thread. | 145 // Assert the contract that this class is operated on the right thread. |
143 void DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() const; | 146 void DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() const; |
144 | 147 |
145 bool needs_bitstream_conversion_; | 148 bool needs_bitstream_conversion_; |
146 | 149 |
147 GpuVideoAcceleratorFactories* factories_; | 150 GpuVideoAcceleratorFactories* factories_; |
148 | 151 |
149 // Populated during Initialize() (on success) and unchanged until an error | 152 // Populated during Initialize() (on success) and unchanged until an error |
150 // occurs. | 153 // occurs. |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
196 | 199 |
197 // picture_buffer_id and the frame wrapping the corresponding Picture, for | 200 // picture_buffer_id and the frame wrapping the corresponding Picture, for |
198 // frames that have been decoded but haven't been requested by a Decode() yet. | 201 // frames that have been decoded but haven't been requested by a Decode() yet. |
199 int32 next_picture_buffer_id_; | 202 int32 next_picture_buffer_id_; |
200 int32 next_bitstream_buffer_id_; | 203 int32 next_bitstream_buffer_id_; |
201 | 204 |
202 // Set during ProvidePictureBuffers(), used for checking and implementing | 205 // Set during ProvidePictureBuffers(), used for checking and implementing |
203 // HasAvailableOutputFrames(). | 206 // HasAvailableOutputFrames(). |
204 int available_pictures_; | 207 int available_pictures_; |
205 | 208 |
209 // If false, then we may assume that the VDA cannot stall sending picture | |
210 // buffers until all of them have decoded frames. If true, then it may | |
211 // stall as long as one picture buffer is outstanding. | |
Pawel Osciak
2015/12/05 00:18:55
Please clarify what "outstanding" means, where the
liberato (no reviews please)
2015/12/07 19:04:39
done. please let me know if the new text is more
| |
212 bool can_stall_anytime_; | |
Pawel Osciak
2015/12/05 00:18:55
What does "anytime" mean? Should we drop it? It's
liberato (no reviews please)
2015/12/07 19:04:39
true, which is why i tried to frame it as "one pic
| |
213 | |
206 // Bound to factories_->GetMessageLoop(). | 214 // Bound to factories_->GetMessageLoop(). |
207 // NOTE: Weak pointers must be invalidated before all other member variables. | 215 // NOTE: Weak pointers must be invalidated before all other member variables. |
208 base::WeakPtrFactory<GpuVideoDecoder> weak_factory_; | 216 base::WeakPtrFactory<GpuVideoDecoder> weak_factory_; |
209 | 217 |
210 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecoder); | 218 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecoder); |
211 }; | 219 }; |
212 | 220 |
213 } // namespace media | 221 } // namespace media |
214 | 222 |
215 #endif // MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ | 223 #endif // MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ |
OLD | NEW |