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