common_directx11.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*****************************************************************************
  2. INTEL CORPORATION PROPRIETARY INFORMATION
  3. This software is supplied under the terms of a license agreement or
  4. nondisclosure agreement with Intel Corporation and may not be copied
  5. or disclosed except in accordance with the terms of that agreement.
  6. Copyright(c) 2005-2014 Intel Corporation. All Rights Reserved.
  7. *****************************************************************************/
  8. #pragma once
  9. #include "common_utils.h"
  10. #include <windows.h>
  11. #include <d3d11.h>
  12. #include <dxgi1_2.h>
  13. #include <atlbase.h>
  14. #define DEVICE_MGR_TYPE MFX_HANDLE_D3D11_DEVICE
  15. // =================================================================
  16. // DirectX functionality required to manage D3D surfaces
  17. //
  18. // Create DirectX 11 device context
  19. // - Required when using D3D surfaces.
  20. // - D3D Device created and handed to Intel Media SDK
  21. // - Intel graphics device adapter will be determined automatically (does not have to be primary),
  22. // but with the following caveats:
  23. // - Device must be active (but monitor does NOT have to be attached)
  24. // - Device must be enabled in BIOS. Required for the case when used together with a discrete graphics card
  25. // - For switchable graphics solutions (mobile) make sure that Intel device is the active device
  26. mfxStatus CreateHWDevice(mfxSession session, mfxHDL* deviceHandle, HWND hWnd, bool bCreateSharedHandles);
  27. void CleanupHWDevice();
  28. void SetHWDeviceContext(CComPtr<ID3D11DeviceContext> devCtx);
  29. CComPtr<ID3D11DeviceContext> GetHWDeviceContext();
  30. void ClearYUVSurfaceD3D(mfxMemId memId);
  31. void ClearRGBSurfaceD3D(mfxMemId memId);