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

Side by Side Diff: content/common/gpu/media/dxva_video_decode_accelerator.h

Issue 540043003: Don't dismiss picture buffers on rez change until they are available (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clear vector on invalidate Created 6 years, 3 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 | « no previous file | content/common/gpu/media/dxva_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 (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 CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_ 5 #ifndef CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_
6 #define CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_ 6 #define CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_
7 7
8 #include <d3d9.h> 8 #include <d3d9.h>
9 // Work around bug in this header by disabling the relevant warning for it. 9 // Work around bug in this header by disabling the relevant warning for it.
10 // https://connect.microsoft.com/VisualStudio/feedback/details/911260/dxva2api-h -in-win8-sdk-triggers-c4201-with-w4 10 // https://connect.microsoft.com/VisualStudio/feedback/details/911260/dxva2api-h -in-win8-sdk-triggers-c4201-with-w4
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 // Helper for handling the Decode operation. 144 // Helper for handling the Decode operation.
145 void DecodeInternal(const base::win::ScopedComPtr<IMFSample>& input_sample); 145 void DecodeInternal(const base::win::ScopedComPtr<IMFSample>& input_sample);
146 146
147 // Handles mid stream resolution changes. 147 // Handles mid stream resolution changes.
148 void HandleResolutionChanged(int width, int height); 148 void HandleResolutionChanged(int width, int height);
149 149
150 struct DXVAPictureBuffer; 150 struct DXVAPictureBuffer;
151 typedef std::map<int32, linked_ptr<DXVAPictureBuffer> > OutputBuffers; 151 typedef std::map<int32, linked_ptr<DXVAPictureBuffer> > OutputBuffers;
152 152
153 // Tells the client to dismiss the stale picture buffers passed in. 153 // Tells the client to dismiss the stale picture buffers passed in.
154 void DismissStaleBuffers(const OutputBuffers& picture_buffers); 154 void DismissStaleBuffers();
155
156 // Called after the client indicates we can recycle a stale picture buffer.
157 void DeferredDismissStaleBuffer(int32 picture_buffer_id);
155 158
156 // To expose client callbacks from VideoDecodeAccelerator. 159 // To expose client callbacks from VideoDecodeAccelerator.
157 media::VideoDecodeAccelerator::Client* client_; 160 media::VideoDecodeAccelerator::Client* client_;
158 161
159 base::win::ScopedComPtr<IMFTransform> decoder_; 162 base::win::ScopedComPtr<IMFTransform> decoder_;
160 163
161 base::win::ScopedComPtr<IDirect3D9Ex> d3d9_; 164 base::win::ScopedComPtr<IDirect3D9Ex> d3d9_;
162 base::win::ScopedComPtr<IDirect3DDevice9Ex> device_; 165 base::win::ScopedComPtr<IDirect3DDevice9Ex> device_;
163 base::win::ScopedComPtr<IDirect3DDeviceManager9> device_manager_; 166 base::win::ScopedComPtr<IDirect3DDeviceManager9> device_manager_;
164 base::win::ScopedComPtr<IDirect3DQuery9> query_; 167 base::win::ScopedComPtr<IDirect3DQuery9> query_;
(...skipping 24 matching lines...) Expand all
189 192
190 typedef std::list<PendingSampleInfo> PendingOutputSamples; 193 typedef std::list<PendingSampleInfo> PendingOutputSamples;
191 194
192 // List of decoded output samples. 195 // List of decoded output samples.
193 PendingOutputSamples pending_output_samples_; 196 PendingOutputSamples pending_output_samples_;
194 197
195 // This map maintains the picture buffers passed the client for decoding. 198 // This map maintains the picture buffers passed the client for decoding.
196 // The key is the picture buffer id. 199 // The key is the picture buffer id.
197 OutputBuffers output_picture_buffers_; 200 OutputBuffers output_picture_buffers_;
198 201
202 // After a resolution change there may be a few output buffers which have yet
203 // to be displayed so they cannot be dismissed immediately. We move them from
204 // |output_picture_buffers_| to this map so they may be dismissed once they
205 // become available.
206 OutputBuffers stale_output_picture_buffers_;
207
199 // Set to true if we requested picture slots from the client. 208 // Set to true if we requested picture slots from the client.
200 bool pictures_requested_; 209 bool pictures_requested_;
201 210
202 // Counter which holds the number of input packets before a successful 211 // Counter which holds the number of input packets before a successful
203 // decode. 212 // decode.
204 int inputs_before_decode_; 213 int inputs_before_decode_;
205 214
206 // List of input samples waiting to be processed. 215 // List of input samples waiting to be processed.
207 typedef std::list<base::win::ScopedComPtr<IMFSample>> PendingInputs; 216 typedef std::list<base::win::ScopedComPtr<IMFSample>> PendingInputs;
208 PendingInputs pending_input_buffers_; 217 PendingInputs pending_input_buffers_;
209 218
210 // Callback to set the correct gl context. 219 // Callback to set the correct gl context.
211 base::Callback<bool(void)> make_context_current_; 220 base::Callback<bool(void)> make_context_current_;
212 221
213 // WeakPtrFactory for posting tasks back to |this|. 222 // WeakPtrFactory for posting tasks back to |this|.
214 base::WeakPtrFactory<DXVAVideoDecodeAccelerator> weak_this_factory_; 223 base::WeakPtrFactory<DXVAVideoDecodeAccelerator> weak_this_factory_;
215 }; 224 };
216 225
217 } // namespace content 226 } // namespace content
218 227
219 #endif // CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_ 228 #endif // CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_
OLDNEW
« no previous file with comments | « no previous file | content/common/gpu/media/dxva_video_decode_accelerator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698