1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/layers/d3d9/Nv3DVUtils.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,86 @@ 1.4 +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- 1.5 + * This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#ifndef GFX_NV3DVUTILS_H 1.10 +#define GFX_NV3DVUTILS_H 1.11 + 1.12 +#include "Layers.h" 1.13 +#include <windows.h> 1.14 +#include <d3d9.h> 1.15 + 1.16 +namespace mozilla { 1.17 +namespace layers { 1.18 + 1.19 +#define FIREFOX_3DV_APP_HANDLE 0xECB992B6 1.20 + 1.21 +enum Nv_Stereo_Mode { 1.22 + NV_STEREO_MODE_LEFT_RIGHT = 0, 1.23 + NV_STEREO_MODE_RIGHT_LEFT = 1, 1.24 + NV_STEREO_MODE_TOP_BOTTOM = 2, 1.25 + NV_STEREO_MODE_BOTTOM_TOP = 3, 1.26 + NV_STEREO_MODE_MONO = 4, 1.27 + NV_STEREO_MODE_LAST = 5 1.28 +}; 1.29 + 1.30 +class INv3DVStreaming : public IUnknown { 1.31 + 1.32 +public: 1.33 + virtual bool Nv3DVInitialize() = 0; 1.34 + virtual bool Nv3DVRelease() = 0; 1.35 + virtual bool Nv3DVSetDevice(IUnknown* pDevice) = 0; 1.36 + virtual bool Nv3DVControl(Nv_Stereo_Mode eStereoMode, bool bEnableStereo, DWORD dw3DVAppHandle) = 0; 1.37 + virtual bool Nv3DVMetaData(DWORD dwWidth, DWORD dwHeight, HANDLE hSrcLuma, HANDLE hDst) = 0; 1.38 +}; 1.39 + 1.40 +/* 1.41 + * Nv3DVUtils class 1.42 + */ 1.43 +class Nv3DVUtils { 1.44 + 1.45 +public: 1.46 + Nv3DVUtils(); 1.47 + ~Nv3DVUtils(); 1.48 + 1.49 + /* 1.50 + * Initializes the Nv3DVUtils object. 1.51 + */ 1.52 + void Initialize(); 1.53 + 1.54 + /* 1.55 + * Release any resources if needed 1.56 + * 1.57 + */ 1.58 + void UnInitialize(); 1.59 + 1.60 + /* 1.61 + * Sets the device info, along with any other initialization that is needed after device creation 1.62 + * Pass the D3D9 device pointer is an IUnknown input argument 1.63 + */ 1.64 + void SetDeviceInfo(IUnknown *devUnknown); 1.65 + 1.66 + /* 1.67 + * Send Stereo Control Information. Used mainly to re-route 1.68 + * calls from ImageLayerD3D9 to the 3DV COM object 1.69 + */ 1.70 + void SendNv3DVControl(Nv_Stereo_Mode eStereoMode, bool bEnableStereo, DWORD dw3DVAppHandle); 1.71 + 1.72 + /* 1.73 + * Send Stereo Metadata. Used mainly to re-route calls 1.74 + * from ImageLayerD3D9 to the 3DV COM object 1.75 + */ 1.76 + void SendNv3DVMetaData(unsigned int dwWidth, unsigned int dwHeight, HANDLE hSrcLuma, HANDLE hDst); 1.77 + 1.78 +private: 1.79 + 1.80 + /* Nv3DVStreaming interface pointer */ 1.81 + nsRefPtr<INv3DVStreaming> m3DVStreaming; 1.82 + 1.83 +}; 1.84 + 1.85 + 1.86 +} /* layers */ 1.87 +} /* mozilla */ 1.88 + 1.89 +#endif /* GFX_NV3DVUTILS_H */