michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim:set ts=2 sw=2 sts=2 et cindent: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: #if !defined(DXVA2Manager_h_) michael@0: #define DXVA2Manager_h_ michael@0: michael@0: #include "WMF.h" michael@0: #include "nsAutoPtr.h" michael@0: #include "mozilla/Mutex.h" michael@0: michael@0: struct nsIntSize; michael@0: struct nsIntRect; michael@0: michael@0: namespace mozilla { michael@0: michael@0: namespace layers { michael@0: class Image; michael@0: class ImageContainer; michael@0: } michael@0: michael@0: class DXVA2Manager { michael@0: public: michael@0: michael@0: // Creates and initializes a DXVA2Manager. Currently we always use D3D9Ex michael@0: // to access DXVA, but via this interface we can seamlessly support D3D11 michael@0: // DXVA integration if need be. michael@0: static DXVA2Manager* Create(); michael@0: michael@0: // Returns a pointer to the D3D device manager responsible for managing the michael@0: // device we're using for hardware accelerated video decoding. If we're using michael@0: // D3D9, this is an IDirect3DDeviceManager9. It is safe to call this on any michael@0: // thread. michael@0: virtual IUnknown* GetDXVADeviceManager() = 0; michael@0: michael@0: // Creates an Image for the video frame stored in aVideoSample. michael@0: virtual HRESULT CopyToImage(IMFSample* aVideoSample, michael@0: const nsIntRect& aRegion, michael@0: layers::ImageContainer* aContainer, michael@0: layers::Image** aOutImage) = 0; michael@0: michael@0: virtual ~DXVA2Manager(); michael@0: michael@0: protected: michael@0: Mutex mLock; michael@0: DXVA2Manager(); michael@0: }; michael@0: michael@0: } // namespace mozilla michael@0: michael@0: #endif // DXVA2Manager_h_