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 11 #ifndef CALL_ADAPTATION_TEST_FAKE_ADAPTATION_CONSTRAINT_H_ 12 #define CALL_ADAPTATION_TEST_FAKE_ADAPTATION_CONSTRAINT_H_ 13 14 #include <string> 15 16 #include "call/adaptation/adaptation_constraint.h" 17 18 namespace webrtc { 19 20 class FakeAdaptationConstraint : public AdaptationConstraint { 21 public: 22 explicit FakeAdaptationConstraint(std::string name); 23 ~FakeAdaptationConstraint() override; 24 25 void set_is_adaptation_up_allowed(bool is_adaptation_up_allowed); 26 27 // AdaptationConstraint implementation. 28 std::string Name() const override; 29 bool IsAdaptationUpAllowed( 30 const VideoStreamInputState& input_state, 31 const VideoSourceRestrictions& restrictions_before, 32 const VideoSourceRestrictions& restrictions_after, 33 rtc::scoped_refptr<Resource> reason_resource) const override; 34 35 private: 36 const std::string name_; 37 bool is_adaptation_up_allowed_; 38 }; 39 40 } // namespace webrtc 41 42 #endif // CALL_ADAPTATION_TEST_FAKE_ADAPTATION_CONSTRAINT_H_ 43