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

Side by Side Diff: media/filters/gpu_video_decoder.h

Issue 1490333005: Don't require VDAs to return all PictureBuffers at once. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cl feedback. Created 5 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 | « gpu/config/gpu_info_unittest.cc ('k') | media/filters/gpu_video_decoder.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 (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
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
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 true, the client cannot expect the VDA to produce any new decoded
210 // frames, until it returns all PictureBuffers it may be holding back to the
211 // VDA. In other words, the VDA may require all PictureBuffers to be able to
212 // proceed with decoding the next frame.
213 bool needs_all_picture_buffers_to_decode_;
214
206 // Bound to factories_->GetMessageLoop(). 215 // Bound to factories_->GetMessageLoop().
207 // NOTE: Weak pointers must be invalidated before all other member variables. 216 // NOTE: Weak pointers must be invalidated before all other member variables.
208 base::WeakPtrFactory<GpuVideoDecoder> weak_factory_; 217 base::WeakPtrFactory<GpuVideoDecoder> weak_factory_;
209 218
210 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecoder); 219 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecoder);
211 }; 220 };
212 221
213 } // namespace media 222 } // namespace media
214 223
215 #endif // MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ 224 #endif // MEDIA_FILTERS_GPU_VIDEO_DECODER_H_
OLDNEW
« no previous file with comments | « gpu/config/gpu_info_unittest.cc ('k') | media/filters/gpu_video_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698