common_directx11.h 1.2 KB

1234567891011121314151617181920212223242526272829
  1. #pragma once
  2. #include "common_utils.h"
  3. #include <windows.h>
  4. #include <d3d11.h>
  5. #include <dxgi1_2.h>
  6. #include <atlbase.h>
  7. #define DEVICE_MGR_TYPE MFX_HANDLE_D3D11_DEVICE
  8. // =================================================================
  9. // DirectX functionality required to manage D3D surfaces
  10. //
  11. // Create DirectX 11 device context
  12. // - Required when using D3D surfaces.
  13. // - D3D Device created and handed to Intel Media SDK
  14. // - Intel graphics device adapter will be determined automatically (does not have to be primary),
  15. // but with the following caveats:
  16. // - Device must be active (but monitor does NOT have to be attached)
  17. // - Device must be enabled in BIOS. Required for the case when used together with a discrete graphics card
  18. // - For switchable graphics solutions (mobile) make sure that Intel device is the active device
  19. mfxStatus CreateHWDevice(mfxSession session, mfxHDL *deviceHandle, HWND hWnd, bool bCreateSharedHandles);
  20. void CleanupHWDevice();
  21. void SetHWDeviceContext(CComPtr<ID3D11DeviceContext> devCtx);
  22. CComPtr<ID3D11DeviceContext> GetHWDeviceContext();
  23. void ClearYUVSurfaceD3D(mfxMemId memId);
  24. void ClearRGBSurfaceD3D(mfxMemId memId);