dxgi_context.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
  3. *
  4. * Use of this source code is governed by a BSD-style license
  5. * that can be found in the LICENSE file in the root of the source
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #ifndef MODULES_DESKTOP_CAPTURE_WIN_DXGI_CONTEXT_H_
  11. #define MODULES_DESKTOP_CAPTURE_WIN_DXGI_CONTEXT_H_
  12. #include <vector>
  13. #include "modules/desktop_capture/desktop_region.h"
  14. namespace webrtc {
  15. // A DxgiOutputContext stores the status of a single DxgiFrame of
  16. // DxgiOutputDuplicator.
  17. struct DxgiOutputContext final {
  18. // The updated region DxgiOutputDuplicator::DetectUpdatedRegion() output
  19. // during last Duplicate() function call. It's always relative to the (0, 0).
  20. DesktopRegion updated_region;
  21. };
  22. // A DxgiAdapterContext stores the status of a single DxgiFrame of
  23. // DxgiAdapterDuplicator.
  24. struct DxgiAdapterContext final {
  25. DxgiAdapterContext();
  26. DxgiAdapterContext(const DxgiAdapterContext& other);
  27. ~DxgiAdapterContext();
  28. // Child DxgiOutputContext belongs to this AdapterContext.
  29. std::vector<DxgiOutputContext> contexts;
  30. };
  31. // A DxgiFrameContext stores the status of a single DxgiFrame of
  32. // DxgiDuplicatorController.
  33. struct DxgiFrameContext final {
  34. public:
  35. DxgiFrameContext();
  36. // Unregister this Context instance from DxgiDuplicatorController during
  37. // destructing.
  38. ~DxgiFrameContext();
  39. // Reset current Context, so it will be reinitialized next time.
  40. void Reset();
  41. // A Context will have an exactly same |controller_id| as
  42. // DxgiDuplicatorController, to ensure it has been correctly setted up after
  43. // each DxgiDuplicatorController::Initialize().
  44. int controller_id = 0;
  45. // Child DxgiAdapterContext belongs to this DxgiFrameContext.
  46. std::vector<DxgiAdapterContext> contexts;
  47. };
  48. } // namespace webrtc
  49. #endif // MODULES_DESKTOP_CAPTURE_WIN_DXGI_CONTEXT_H_