|
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* vim:set ts=2 sw=2 sts=2 et cindent: */ |
|
3 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
4 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
6 #if !defined(DXVA2Manager_h_) |
|
7 #define DXVA2Manager_h_ |
|
8 |
|
9 #include "WMF.h" |
|
10 #include "nsAutoPtr.h" |
|
11 #include "mozilla/Mutex.h" |
|
12 |
|
13 struct nsIntSize; |
|
14 struct nsIntRect; |
|
15 |
|
16 namespace mozilla { |
|
17 |
|
18 namespace layers { |
|
19 class Image; |
|
20 class ImageContainer; |
|
21 } |
|
22 |
|
23 class DXVA2Manager { |
|
24 public: |
|
25 |
|
26 // Creates and initializes a DXVA2Manager. Currently we always use D3D9Ex |
|
27 // to access DXVA, but via this interface we can seamlessly support D3D11 |
|
28 // DXVA integration if need be. |
|
29 static DXVA2Manager* Create(); |
|
30 |
|
31 // Returns a pointer to the D3D device manager responsible for managing the |
|
32 // device we're using for hardware accelerated video decoding. If we're using |
|
33 // D3D9, this is an IDirect3DDeviceManager9. It is safe to call this on any |
|
34 // thread. |
|
35 virtual IUnknown* GetDXVADeviceManager() = 0; |
|
36 |
|
37 // Creates an Image for the video frame stored in aVideoSample. |
|
38 virtual HRESULT CopyToImage(IMFSample* aVideoSample, |
|
39 const nsIntRect& aRegion, |
|
40 layers::ImageContainer* aContainer, |
|
41 layers::Image** aOutImage) = 0; |
|
42 |
|
43 virtual ~DXVA2Manager(); |
|
44 |
|
45 protected: |
|
46 Mutex mLock; |
|
47 DXVA2Manager(); |
|
48 }; |
|
49 |
|
50 } // namespace mozilla |
|
51 |
|
52 #endif // DXVA2Manager_h_ |