DuplicationManager.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  2. // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  3. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  4. // PARTICULAR PURPOSE.
  5. //
  6. // Copyright (c) Microsoft Corporation. All rights reserved
  7. #ifndef _DUPLICATIONMANAGER_H_
  8. #define _DUPLICATIONMANAGER_H_
  9. #include "CommonTypes.h"
  10. //
  11. // Handles the task of duplicating an output.
  12. //
  13. class DUPLICATIONMANAGER
  14. {
  15. public:
  16. DUPLICATIONMANAGER();
  17. ~DUPLICATIONMANAGER();
  18. _Success_(*Timeout == false && return == DUPL_RETURN_SUCCESS) DUPL_RETURN GetFrame(_Out_ FRAME_DATA* Data, _Out_ bool* Timeout);
  19. DUPL_RETURN DoneWithFrame();
  20. DUPL_RETURN InitDupl(_In_ ID3D11Device* Device, ID3D11DeviceContext* DeviceContext, UINT Output);
  21. DUPL_RETURN GetMouse(_Inout_ PTR_INFO* PtrInfo, _In_ DXGI_OUTDUPL_FRAME_INFO* FrameInfo, INT OffsetX, INT OffsetY);
  22. void GetOutputDesc(_Out_ DXGI_OUTPUT_DESC* DescPtr);
  23. HRESULT SendData(struct tmedia_producer_s* pProducer, FRAME_DATA* FrameData);
  24. private:
  25. // vars
  26. IDXGIOutputDuplication* m_DeskDupl;
  27. ID3D11Texture2D* m_AcquiredDesktopImage;
  28. _Field_size_bytes_(m_MetaDataSize) BYTE* m_MetaDataBuffer;
  29. UINT m_MetaDataSize;
  30. UINT m_OutputNumber;
  31. DXGI_OUTPUT_DESC m_OutputDesc;
  32. ID3D11Device* m_Device;
  33. ID3D11DeviceContext* m_DeviceContext;
  34. BYTE* m_BufferPtr;
  35. UINT m_BufferSize;
  36. };
  37. #endif