adaptation_constraint.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Copyright 2020 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 CALL_ADAPTATION_ADAPTATION_CONSTRAINT_H_
  11. #define CALL_ADAPTATION_ADAPTATION_CONSTRAINT_H_
  12. #include <string>
  13. #include "api/adaptation/resource.h"
  14. #include "api/scoped_refptr.h"
  15. #include "call/adaptation/video_source_restrictions.h"
  16. #include "call/adaptation/video_stream_input_state.h"
  17. namespace webrtc {
  18. // Adaptation constraints have the ability to prevent applying a proposed
  19. // adaptation (expressed as restrictions before/after adaptation).
  20. class AdaptationConstraint {
  21. public:
  22. virtual ~AdaptationConstraint();
  23. virtual std::string Name() const = 0;
  24. // TODO(https://crbug.com/webrtc/11172): When we have multi-stream adaptation
  25. // support, this interface needs to indicate which stream the adaptation
  26. // applies to.
  27. virtual bool IsAdaptationUpAllowed(
  28. const VideoStreamInputState& input_state,
  29. const VideoSourceRestrictions& restrictions_before,
  30. const VideoSourceRestrictions& restrictions_after,
  31. rtc::scoped_refptr<Resource> reason_resource) const = 0;
  32. };
  33. } // namespace webrtc
  34. #endif // CALL_ADAPTATION_ADAPTATION_CONSTRAINT_H_