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

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

Issue 1553603002: Use IDXGIKeyedMutex to synchronize between DXVA decoder and main context (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
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 <d3d11.h> 8 #include <d3d11.h>
9 #include <d3d9.h> 9 #include <d3d9.h>
10 // Work around bug in this header by disabling the relevant warning for it. 10 // Work around bug in this header by disabling the relevant warning for it.
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 void CopySurfaceComplete(IDirect3DSurface9* src_surface, 213 void CopySurfaceComplete(IDirect3DSurface9* src_surface,
214 IDirect3DSurface9* dest_surface, 214 IDirect3DSurface9* dest_surface,
215 int picture_buffer_id, 215 int picture_buffer_id,
216 int input_buffer_id); 216 int input_buffer_id);
217 217
218 // Copies the source texture |src_texture| to the destination |dest_texture|. 218 // Copies the source texture |src_texture| to the destination |dest_texture|.
219 // The copying is done on the decoder thread. The |video_frame| parameter 219 // The copying is done on the decoder thread. The |video_frame| parameter
220 // is the sample containing the frame to be copied. 220 // is the sample containing the frame to be copied.
221 void CopyTexture(ID3D11Texture2D* src_texture, 221 void CopyTexture(ID3D11Texture2D* src_texture,
222 ID3D11Texture2D* dest_texture, 222 ID3D11Texture2D* dest_texture,
223 base::win::ScopedComPtr<IDXGIKeyedMutex> dest_keyed_mutex,
224 uint64_t keyed_mutex_value,
223 IMFSample* video_frame, 225 IMFSample* video_frame,
224 int picture_buffer_id, 226 int picture_buffer_id,
225 int input_buffer_id); 227 int input_buffer_id);
226 228
227 // Flushes the decoder device to ensure that the decoded surface is copied 229 // Flushes the decoder device to ensure that the decoded surface is copied
228 // to the target surface. |iterations| helps to maintain an upper limit on 230 // to the target surface. |iterations| helps to maintain an upper limit on
229 // the number of times we try to complete the flush operation. 231 // the number of times we try to complete the flush operation.
230 void FlushDecoder(int iterations, 232 void FlushDecoder(int iterations,
231 IDirect3DSurface9* src_surface, 233 IDirect3DSurface9* src_surface,
232 IDirect3DSurface9* dest_surface, 234 IDirect3DSurface9* dest_surface,
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 base::WeakPtr<DXVAVideoDecodeAccelerator> weak_ptr_; 355 base::WeakPtr<DXVAVideoDecodeAccelerator> weak_ptr_;
354 356
355 // Set to true if we are in the context of a Flush operation. Used to prevent 357 // Set to true if we are in the context of a Flush operation. Used to prevent
356 // multiple flush done notifications being sent out. 358 // multiple flush done notifications being sent out.
357 bool pending_flush_; 359 bool pending_flush_;
358 360
359 // Defaults to false. Indicates if we should use D3D or DX11 interfaces for 361 // Defaults to false. Indicates if we should use D3D or DX11 interfaces for
360 // H/W decoding. 362 // H/W decoding.
361 bool use_dx11_; 363 bool use_dx11_;
362 364
365 // True if we should use DXGI keyed mutexes to synchronize between the two
366 // contexts.
367 bool use_keyed_mutex_;
368
363 // Set to true if the DX11 video format converter input media types need to 369 // Set to true if the DX11 video format converter input media types need to
364 // be initialized. Defaults to true. 370 // be initialized. Defaults to true.
365 bool dx11_video_format_converter_media_type_needs_init_; 371 bool dx11_video_format_converter_media_type_needs_init_;
366 372
367 // The GLContext to be used by the decoder. 373 // The GLContext to be used by the decoder.
368 scoped_refptr<gfx::GLContext> gl_context_; 374 scoped_refptr<gfx::GLContext> gl_context_;
369 375
370 // Set to true if we are sharing ANGLE's device. 376 // Set to true if we are sharing ANGLE's device.
371 bool using_angle_device_; 377 bool using_angle_device_;
372 378
373 // WeakPtrFactory for posting tasks back to |this|. 379 // WeakPtrFactory for posting tasks back to |this|.
374 base::WeakPtrFactory<DXVAVideoDecodeAccelerator> weak_this_factory_; 380 base::WeakPtrFactory<DXVAVideoDecodeAccelerator> weak_this_factory_;
375 381
376 // Function pointer for the MFCreateDXGIDeviceManager API. 382 // Function pointer for the MFCreateDXGIDeviceManager API.
377 static CreateDXGIDeviceManager create_dxgi_device_manager_; 383 static CreateDXGIDeviceManager create_dxgi_device_manager_;
378 384
379 DISALLOW_COPY_AND_ASSIGN(DXVAVideoDecodeAccelerator); 385 DISALLOW_COPY_AND_ASSIGN(DXVAVideoDecodeAccelerator);
380 }; 386 };
381 387
382 } // namespace content 388 } // namespace content
383 389
384 #endif // CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_ 390 #endif // CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698