1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/media/wmf/DXVA2Manager.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,52 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* vim:set ts=2 sw=2 sts=2 et cindent: */ 1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 +#if !defined(DXVA2Manager_h_) 1.10 +#define DXVA2Manager_h_ 1.11 + 1.12 +#include "WMF.h" 1.13 +#include "nsAutoPtr.h" 1.14 +#include "mozilla/Mutex.h" 1.15 + 1.16 +struct nsIntSize; 1.17 +struct nsIntRect; 1.18 + 1.19 +namespace mozilla { 1.20 + 1.21 +namespace layers { 1.22 +class Image; 1.23 +class ImageContainer; 1.24 +} 1.25 + 1.26 +class DXVA2Manager { 1.27 +public: 1.28 + 1.29 + // Creates and initializes a DXVA2Manager. Currently we always use D3D9Ex 1.30 + // to access DXVA, but via this interface we can seamlessly support D3D11 1.31 + // DXVA integration if need be. 1.32 + static DXVA2Manager* Create(); 1.33 + 1.34 + // Returns a pointer to the D3D device manager responsible for managing the 1.35 + // device we're using for hardware accelerated video decoding. If we're using 1.36 + // D3D9, this is an IDirect3DDeviceManager9. It is safe to call this on any 1.37 + // thread. 1.38 + virtual IUnknown* GetDXVADeviceManager() = 0; 1.39 + 1.40 + // Creates an Image for the video frame stored in aVideoSample. 1.41 + virtual HRESULT CopyToImage(IMFSample* aVideoSample, 1.42 + const nsIntRect& aRegion, 1.43 + layers::ImageContainer* aContainer, 1.44 + layers::Image** aOutImage) = 0; 1.45 + 1.46 + virtual ~DXVA2Manager(); 1.47 + 1.48 +protected: 1.49 + Mutex mLock; 1.50 + DXVA2Manager(); 1.51 +}; 1.52 + 1.53 +} // namespace mozilla 1.54 + 1.55 +#endif // DXVA2Manager_h_