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