fake_adaptation_constraint.cc (1383B)
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 #include "call/adaptation/test/fake_adaptation_constraint.h" 12 13 #include <string> 14 15 #include "absl/strings/string_view.h" 16 #include "call/adaptation/video_source_restrictions.h" 17 #include "call/adaptation/video_stream_input_state.h" 18 19 namespace webrtc { 20 21 FakeAdaptationConstraint::FakeAdaptationConstraint(absl::string_view name) 22 : name_(name), is_adaptation_up_allowed_(true) {} 23 24 FakeAdaptationConstraint::~FakeAdaptationConstraint() = default; 25 26 void FakeAdaptationConstraint::set_is_adaptation_up_allowed( 27 bool is_adaptation_up_allowed) { 28 is_adaptation_up_allowed_ = is_adaptation_up_allowed; 29 } 30 31 std::string FakeAdaptationConstraint::Name() const { 32 return name_; 33 } 34 35 bool FakeAdaptationConstraint::IsAdaptationUpAllowed( 36 const VideoStreamInputState& /* input_state */, 37 const VideoSourceRestrictions& /* restrictions_before */, 38 const VideoSourceRestrictions& /* restrictions_after */) const { 39 return is_adaptation_up_allowed_; 40 } 41 42 } // namespace webrtc