gfx/layers/d3d9/Nv3DVUtils.h

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:cbcaba2e1181
1 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6 #ifndef GFX_NV3DVUTILS_H
7 #define GFX_NV3DVUTILS_H
8
9 #include "Layers.h"
10 #include <windows.h>
11 #include <d3d9.h>
12
13 namespace mozilla {
14 namespace layers {
15
16 #define FIREFOX_3DV_APP_HANDLE 0xECB992B6
17
18 enum Nv_Stereo_Mode {
19 NV_STEREO_MODE_LEFT_RIGHT = 0,
20 NV_STEREO_MODE_RIGHT_LEFT = 1,
21 NV_STEREO_MODE_TOP_BOTTOM = 2,
22 NV_STEREO_MODE_BOTTOM_TOP = 3,
23 NV_STEREO_MODE_MONO = 4,
24 NV_STEREO_MODE_LAST = 5
25 };
26
27 class INv3DVStreaming : public IUnknown {
28
29 public:
30 virtual bool Nv3DVInitialize() = 0;
31 virtual bool Nv3DVRelease() = 0;
32 virtual bool Nv3DVSetDevice(IUnknown* pDevice) = 0;
33 virtual bool Nv3DVControl(Nv_Stereo_Mode eStereoMode, bool bEnableStereo, DWORD dw3DVAppHandle) = 0;
34 virtual bool Nv3DVMetaData(DWORD dwWidth, DWORD dwHeight, HANDLE hSrcLuma, HANDLE hDst) = 0;
35 };
36
37 /*
38 * Nv3DVUtils class
39 */
40 class Nv3DVUtils {
41
42 public:
43 Nv3DVUtils();
44 ~Nv3DVUtils();
45
46 /*
47 * Initializes the Nv3DVUtils object.
48 */
49 void Initialize();
50
51 /*
52 * Release any resources if needed
53 *
54 */
55 void UnInitialize();
56
57 /*
58 * Sets the device info, along with any other initialization that is needed after device creation
59 * Pass the D3D9 device pointer is an IUnknown input argument
60 */
61 void SetDeviceInfo(IUnknown *devUnknown);
62
63 /*
64 * Send Stereo Control Information. Used mainly to re-route
65 * calls from ImageLayerD3D9 to the 3DV COM object
66 */
67 void SendNv3DVControl(Nv_Stereo_Mode eStereoMode, bool bEnableStereo, DWORD dw3DVAppHandle);
68
69 /*
70 * Send Stereo Metadata. Used mainly to re-route calls
71 * from ImageLayerD3D9 to the 3DV COM object
72 */
73 void SendNv3DVMetaData(unsigned int dwWidth, unsigned int dwHeight, HANDLE hSrcLuma, HANDLE hDst);
74
75 private:
76
77 /* Nv3DVStreaming interface pointer */
78 nsRefPtr<INv3DVStreaming> m3DVStreaming;
79
80 };
81
82
83 } /* layers */
84 } /* mozilla */
85
86 #endif /* GFX_NV3DVUTILS_H */

mercurial