fake_adaptation_constraint.h (1460B)
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 "absl/strings/string_view.h" 17 #include "call/adaptation/adaptation_constraint.h" 18 #include "call/adaptation/video_source_restrictions.h" 19 #include "call/adaptation/video_stream_input_state.h" 20 21 namespace webrtc { 22 23 class FakeAdaptationConstraint : public AdaptationConstraint { 24 public: 25 explicit FakeAdaptationConstraint(absl::string_view name); 26 ~FakeAdaptationConstraint() override; 27 28 void set_is_adaptation_up_allowed(bool is_adaptation_up_allowed); 29 30 // AdaptationConstraint implementation. 31 std::string Name() const override; 32 bool IsAdaptationUpAllowed( 33 const VideoStreamInputState& input_state, 34 const VideoSourceRestrictions& restrictions_before, 35 const VideoSourceRestrictions& restrictions_after) const override; 36 37 private: 38 const std::string name_; 39 bool is_adaptation_up_allowed_; 40 }; 41 42 } // namespace webrtc 43 44 #endif // CALL_ADAPTATION_TEST_FAKE_ADAPTATION_CONSTRAINT_H_