desktop_capturer_wrapper.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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_DESKTOP_CAPTURER_WRAPPER_H_
  11. #define MODULES_DESKTOP_CAPTURE_DESKTOP_CAPTURER_WRAPPER_H_
  12. #include <memory>
  13. #include "modules/desktop_capture/desktop_capture_types.h"
  14. #include "modules/desktop_capture/desktop_capturer.h"
  15. #include "modules/desktop_capture/desktop_geometry.h"
  16. #include "modules/desktop_capture/shared_memory.h"
  17. namespace webrtc {
  18. // Wraps a DesktopCapturer and forwards all the function calls to it.
  19. class DesktopCapturerWrapper : public DesktopCapturer {
  20. public:
  21. explicit DesktopCapturerWrapper(
  22. std::unique_ptr<DesktopCapturer> base_capturer);
  23. ~DesktopCapturerWrapper() override;
  24. // DesktopCapturer implementations.
  25. void Start(Callback* callback) override;
  26. void SetSharedMemoryFactory(
  27. std::unique_ptr<SharedMemoryFactory> shared_memory_factory) override;
  28. void CaptureFrame() override;
  29. void SetExcludedWindow(WindowId window) override;
  30. bool GetSourceList(SourceList* sources) override;
  31. bool SelectSource(SourceId id) override;
  32. bool FocusOnSelectedSource() override;
  33. bool IsOccluded(const DesktopVector& pos) override;
  34. protected:
  35. // Guaranteed to be valid.
  36. const std::unique_ptr<DesktopCapturer> base_capturer_;
  37. };
  38. } // namespace webrtc
  39. #endif // MODULES_DESKTOP_CAPTURE_DESKTOP_CAPTURER_WRAPPER_H_