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

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

Issue 793993002: Use InterlockedAdd(0) to get the current state in DXVAVideoDecodeAccelerator::GetState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use static_assert for type size Created 6 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 | « 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 160
161 // Called after the client indicates we can recycle a stale picture buffer. 161 // Called after the client indicates we can recycle a stale picture buffer.
162 void DeferredDismissStaleBuffer(int32 picture_buffer_id); 162 void DeferredDismissStaleBuffer(int32 picture_buffer_id);
163 163
164 // Sets the state of the decoder. Called from the main thread and the decoder 164 // Sets the state of the decoder. Called from the main thread and the decoder
165 // thread. The state is changed on the main thread. 165 // thread. The state is changed on the main thread.
166 void SetState(State state); 166 void SetState(State state);
167 167
168 // Gets the state of the decoder. Can be called from the main thread and 168 // Gets the state of the decoder. Can be called from the main thread and
169 // the decoder thread. Thread safe. 169 // the decoder thread. Thread safe.
170 State GetState() const; 170 State GetState();
171 171
172 // Worker function for the Decoder Reset functionality. Executes on the 172 // Worker function for the Decoder Reset functionality. Executes on the
173 // decoder thread and queues tasks on the main thread as needed. 173 // decoder thread and queues tasks on the main thread as needed.
174 void ResetHelper(); 174 void ResetHelper();
175 175
176 // Starts the thread used for decoding. 176 // Starts the thread used for decoding.
177 void StartDecoderThread(); 177 void StartDecoderThread();
178 178
179 // Returns if we have output samples waiting to be processed. We only 179 // Returns if we have output samples waiting to be processed. We only
180 // allow one output sample to be present in the output queue at any given 180 // allow one output sample to be present in the output queue at any given
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 // creating the device manager. However it seems that the device manager 217 // creating the device manager. However it seems that the device manager
218 // holds onto the token and attempts to access it if the underlying device 218 // holds onto the token and attempts to access it if the underlying device
219 // changes. 219 // changes.
220 // TODO(ananta): This needs to be verified. 220 // TODO(ananta): This needs to be verified.
221 uint32 dev_manager_reset_token_; 221 uint32 dev_manager_reset_token_;
222 222
223 // The EGL config to use for decoded frames. 223 // The EGL config to use for decoded frames.
224 EGLConfig egl_config_; 224 EGLConfig egl_config_;
225 225
226 // Current state of the decoder. 226 // Current state of the decoder.
227 State state_; 227 volatile State state_;
228 228
229 MFT_INPUT_STREAM_INFO input_stream_info_; 229 MFT_INPUT_STREAM_INFO input_stream_info_;
230 MFT_OUTPUT_STREAM_INFO output_stream_info_; 230 MFT_OUTPUT_STREAM_INFO output_stream_info_;
231 231
232 // Contains information about a decoded sample. 232 // Contains information about a decoded sample.
233 struct PendingSampleInfo { 233 struct PendingSampleInfo {
234 PendingSampleInfo(int32 buffer_id, IMFSample* sample); 234 PendingSampleInfo(int32 buffer_id, IMFSample* sample);
235 ~PendingSampleInfo(); 235 ~PendingSampleInfo();
236 236
237 int32 input_buffer_id; 237 int32 input_buffer_id;
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 const base::WeakPtr<DXVAVideoDecodeAccelerator> weak_ptr_; 300 const base::WeakPtr<DXVAVideoDecodeAccelerator> weak_ptr_;
301 301
302 // Set to true if we are in the context of a Flush operation. Used to prevent 302 // Set to true if we are in the context of a Flush operation. Used to prevent
303 // multiple flush done notifications being sent out. 303 // multiple flush done notifications being sent out.
304 bool pending_flush_; 304 bool pending_flush_;
305 }; 305 };
306 306
307 } // namespace content 307 } // namespace content
308 308
309 #endif // CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_ 309 #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