calls_video_incoming.h 1021 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. This file is part of Telegram Desktop,
  3. the official desktop application for the Telegram messaging service.
  4. For license and copyright information please follow this link:
  5. https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
  6. */
  7. #pragma once
  8. #include "calls/calls_panel.h"
  9. namespace Ui::GL {
  10. enum class Backend;
  11. struct ChosenRenderer;
  12. } // namespace Ui::GL
  13. namespace Calls {
  14. class Panel::Incoming final {
  15. public:
  16. Incoming(
  17. not_null<QWidget*> parent,
  18. not_null<Webrtc::VideoTrack*> track,
  19. Ui::GL::Backend backend);
  20. [[nodiscard]] not_null<QWidget*> widget() const;
  21. [[nodiscard]] not_null<Ui::RpWidgetWrap*> rp() const;
  22. void setControlsAlignment(style::align align);
  23. private:
  24. class RendererGL;
  25. class RendererSW;
  26. [[nodiscard]] Ui::GL::ChosenRenderer chooseRenderer(
  27. Ui::GL::Backend backend);
  28. const std::unique_ptr<Ui::RpWidgetWrap> _surface;
  29. const not_null<Webrtc::VideoTrack*> _track;
  30. style::align _topControlsAlignment = style::al_left;
  31. bool _opengl = false;
  32. };
  33. } // namespace Calls