• 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_VIDEO_STREAM_INPUT_STATE_PROVIDER_H_
12 #define CALL_ADAPTATION_VIDEO_STREAM_INPUT_STATE_PROVIDER_H_
13 
14 #include "api/video/video_stream_encoder_observer.h"
15 #include "call/adaptation/encoder_settings.h"
16 #include "call/adaptation/video_stream_input_state.h"
17 #include "rtc_base/synchronization/mutex.h"
18 
19 namespace webrtc {
20 
21 class VideoStreamInputStateProvider {
22  public:
23   VideoStreamInputStateProvider(
24       VideoStreamEncoderObserver* frame_rate_provider);
25   virtual ~VideoStreamInputStateProvider();
26 
27   void OnHasInputChanged(bool has_input);
28   void OnFrameSizeObserved(int frame_size_pixels);
29   void OnEncoderSettingsChanged(EncoderSettings encoder_settings);
30 
31   virtual VideoStreamInputState InputState();
32 
33  private:
34   Mutex mutex_;
35   VideoStreamEncoderObserver* const frame_rate_provider_;
36   VideoStreamInputState input_state_ RTC_GUARDED_BY(mutex_);
37 };
38 
39 }  // namespace webrtc
40 
41 #endif  // CALL_ADAPTATION_VIDEO_STREAM_INPUT_STATE_PROVIDER_H_
42