media_caps_impl.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // Copyright 2016 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef CHROMECAST_BROWSER_MEDIA_MEDIA_CAPS_IMPL_H_
  5. #define CHROMECAST_BROWSER_MEDIA_MEDIA_CAPS_IMPL_H_
  6. #include <vector>
  7. #include "chromecast/common/mojom/media_caps.mojom.h"
  8. #include "mojo/public/cpp/bindings/pending_remote.h"
  9. #include "mojo/public/cpp/bindings/receiver_set.h"
  10. #include "mojo/public/cpp/bindings/remote_set.h"
  11. #include "ui/gfx/geometry/size.h"
  12. namespace chromecast {
  13. namespace media {
  14. struct CodecProfileLevel;
  15. class MediaCapsImpl : public mojom::MediaCaps {
  16. public:
  17. MediaCapsImpl();
  18. MediaCapsImpl(const MediaCapsImpl&) = delete;
  19. MediaCapsImpl& operator=(const MediaCapsImpl&) = delete;
  20. ~MediaCapsImpl() override;
  21. void Initialize();
  22. void AddReceiver(mojo::PendingReceiver<mojom::MediaCaps> receiver);
  23. mojo::PendingRemote<mojom::MediaCaps> GetPendingRemote();
  24. void AddSupportedCodecProfileLevel(
  25. const CodecProfileLevel& codec_profile_level);
  26. private:
  27. // chromecast::mojom::MediaCaps implementation.
  28. void AddObserver(
  29. mojo::PendingRemote<mojom::MediaCapsObserver> observer) override;
  30. void ScreenResolutionChanged(uint32_t width, uint32_t height) override;
  31. void ScreenInfoChanged(int32_t hdcp_version,
  32. int32_t supported_eotfs,
  33. int32_t dolby_vision_flags,
  34. int32_t screen_width_mm,
  35. int32_t screen_height_mm,
  36. bool current_mode_supports_hdr,
  37. bool current_mode_supports_dv) override;
  38. int32_t hdcp_version_;
  39. int32_t supported_eotfs_;
  40. int32_t dolby_vision_flags_;
  41. int32_t screen_width_mm_;
  42. int32_t screen_height_mm_;
  43. bool current_mode_supports_hdr_;
  44. bool current_mode_supports_dv_;
  45. gfx::Size screen_resolution_;
  46. std::vector<CodecProfileLevel> codec_profile_levels_;
  47. mojo::RemoteSet<mojom::MediaCapsObserver> observers_;
  48. mojo::ReceiverSet<mojom::MediaCaps> receivers_;
  49. };
  50. } // namespace media
  51. } // namespace chromecast
  52. #endif // CHROMECAST_BROWSER_MEDIA_MEDIA_CAPS_IMPL_H_