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