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

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

Issue 1427213002: Lock the decoder device (Angle) device from the decoder thread before copying the decoded frame to … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename member variable Created 5 years, 1 month 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 <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.
11 // https://connect.microsoft.com/VisualStudio/feedback/details/911260/dxva2api-h -in-win8-sdk-triggers-c4201-with-w4 11 // https://connect.microsoft.com/VisualStudio/feedback/details/911260/dxva2api-h -in-win8-sdk-triggers-c4201-with-w4
12 #pragma warning(push) 12 #pragma warning(push)
13 #pragma warning(disable:4201) 13 #pragma warning(disable:4201)
14 #include <dxva2api.h> 14 #include <dxva2api.h>
15 #pragma warning(pop) 15 #pragma warning(pop)
16 #include <list> 16 #include <list>
17 #include <map> 17 #include <map>
18 #include <mfidl.h> 18 #include <mfidl.h>
19 #include <vector> 19 #include <vector>
20 20
21 #include "base/compiler_specific.h" 21 #include "base/compiler_specific.h"
22 #include "base/macros.h"
22 #include "base/memory/linked_ptr.h" 23 #include "base/memory/linked_ptr.h"
23 #include "base/memory/weak_ptr.h" 24 #include "base/memory/weak_ptr.h"
24 #include "base/synchronization/lock.h" 25 #include "base/synchronization/lock.h"
25 #include "base/threading/non_thread_safe.h" 26 #include "base/threading/non_thread_safe.h"
26 #include "base/threading/thread.h" 27 #include "base/threading/thread.h"
27 #include "base/win/scoped_comptr.h" 28 #include "base/win/scoped_comptr.h"
28 #include "content/common/content_export.h" 29 #include "content/common/content_export.h"
29 #include "media/video/video_decode_accelerator.h" 30 #include "media/video/video_decode_accelerator.h"
30 31
31 interface IMFSample; 32 interface IMFSample;
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 250
250 base::win::ScopedComPtr<IDirect3D9Ex> d3d9_; 251 base::win::ScopedComPtr<IDirect3D9Ex> d3d9_;
251 base::win::ScopedComPtr<IDirect3DDevice9Ex> d3d9_device_ex_; 252 base::win::ScopedComPtr<IDirect3DDevice9Ex> d3d9_device_ex_;
252 base::win::ScopedComPtr<IDirect3DDeviceManager9> device_manager_; 253 base::win::ScopedComPtr<IDirect3DDeviceManager9> device_manager_;
253 base::win::ScopedComPtr<IDirect3DQuery9> query_; 254 base::win::ScopedComPtr<IDirect3DQuery9> query_;
254 255
255 base::win::ScopedComPtr<ID3D11DeviceContext> d3d11_device_context_; 256 base::win::ScopedComPtr<ID3D11DeviceContext> d3d11_device_context_;
256 base::win::ScopedComPtr<ID3D11Device > d3d11_device_; 257 base::win::ScopedComPtr<ID3D11Device > d3d11_device_;
257 base::win::ScopedComPtr<IMFDXGIDeviceManager> d3d11_device_manager_; 258 base::win::ScopedComPtr<IMFDXGIDeviceManager> d3d11_device_manager_;
258 base::win::ScopedComPtr<ID3D11Query> d3d11_query_; 259 base::win::ScopedComPtr<ID3D11Query> d3d11_query_;
260 base::win::ScopedComPtr<ID3D10Multithread> multi_threaded_;
259 261
260 // Ideally the reset token would be a stack variable which is used while 262 // Ideally the reset token would be a stack variable which is used while
261 // creating the device manager. However it seems that the device manager 263 // creating the device manager. However it seems that the device manager
262 // holds onto the token and attempts to access it if the underlying device 264 // holds onto the token and attempts to access it if the underlying device
263 // changes. 265 // changes.
264 // TODO(ananta): This needs to be verified. 266 // TODO(ananta): This needs to be verified.
265 uint32 dev_manager_reset_token_; 267 uint32 dev_manager_reset_token_;
266 268
267 // Reset token for the DX11 device manager. 269 // Reset token for the DX11 device manager.
268 uint32 dx11_dev_manager_reset_token_; 270 uint32 dx11_dev_manager_reset_token_;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 // H/W decoding. 358 // H/W decoding.
357 bool use_dx11_; 359 bool use_dx11_;
358 360
359 // Set to true if the DX11 video format converter input media types need to 361 // Set to true if the DX11 video format converter input media types need to
360 // be initialized. Defaults to true. 362 // be initialized. Defaults to true.
361 bool dx11_video_format_converter_media_type_needs_init_; 363 bool dx11_video_format_converter_media_type_needs_init_;
362 364
363 // The GLContext to be used by the decoder. 365 // The GLContext to be used by the decoder.
364 scoped_refptr<gfx::GLContext> gl_context_; 366 scoped_refptr<gfx::GLContext> gl_context_;
365 367
368 // Set to true if we are sharing ANGLE's device.
369 bool using_angle_device_;
370
366 // WeakPtrFactory for posting tasks back to |this|. 371 // WeakPtrFactory for posting tasks back to |this|.
367 base::WeakPtrFactory<DXVAVideoDecodeAccelerator> weak_this_factory_; 372 base::WeakPtrFactory<DXVAVideoDecodeAccelerator> weak_this_factory_;
368 373
369 // Function pointer for the MFCreateDXGIDeviceManager API. 374 // Function pointer for the MFCreateDXGIDeviceManager API.
370 static CreateDXGIDeviceManager create_dxgi_device_manager_; 375 static CreateDXGIDeviceManager create_dxgi_device_manager_;
376
377 DISALLOW_COPY_AND_ASSIGN(DXVAVideoDecodeAccelerator);
371 }; 378 };
372 379
373 } // namespace content 380 } // namespace content
374 381
375 #endif // CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_ 382 #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