Henrik Boström | d516b25 | 2020-04-17 12:10:59 +0200 | [diff] [blame] | 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" |
Markus Handell | 8fe932a | 2020-07-06 17:41:35 +0200 | [diff] [blame] | 17 | #include "rtc_base/synchronization/mutex.h" |
Henrik Boström | d516b25 | 2020-04-17 12:10:59 +0200 | [diff] [blame] | 18 | |
| 19 | namespace webrtc { |
| 20 | |
| 21 | class VideoStreamInputStateProvider { |
| 22 | public: |
| 23 | VideoStreamInputStateProvider( |
| 24 | VideoStreamEncoderObserver* frame_rate_provider); |
Evan Shrubsole | 34b1a42 | 2020-07-02 14:42:09 +0200 | [diff] [blame] | 25 | virtual ~VideoStreamInputStateProvider(); |
Henrik Boström | d516b25 | 2020-04-17 12:10:59 +0200 | [diff] [blame] | 26 | |
| 27 | void OnHasInputChanged(bool has_input); |
| 28 | void OnFrameSizeObserved(int frame_size_pixels); |
| 29 | void OnEncoderSettingsChanged(EncoderSettings encoder_settings); |
| 30 | |
Evan Shrubsole | 34b1a42 | 2020-07-02 14:42:09 +0200 | [diff] [blame] | 31 | virtual VideoStreamInputState InputState(); |
Henrik Boström | d516b25 | 2020-04-17 12:10:59 +0200 | [diff] [blame] | 32 | |
| 33 | private: |
Markus Handell | 8fe932a | 2020-07-06 17:41:35 +0200 | [diff] [blame] | 34 | Mutex mutex_; |
Henrik Boström | d516b25 | 2020-04-17 12:10:59 +0200 | [diff] [blame] | 35 | VideoStreamEncoderObserver* const frame_rate_provider_; |
Markus Handell | 8fe932a | 2020-07-06 17:41:35 +0200 | [diff] [blame] | 36 | VideoStreamInputState input_state_ RTC_GUARDED_BY(mutex_); |
Henrik Boström | d516b25 | 2020-04-17 12:10:59 +0200 | [diff] [blame] | 37 | }; |
| 38 | |
| 39 | } // namespace webrtc |
| 40 | |
| 41 | #endif // CALL_ADAPTATION_VIDEO_STREAM_INPUT_STATE_PROVIDER_H_ |