blob: f4a3e0bfa07fdccc7aa34cc8ad7531d2f9cff6a2 [file] [log] [blame]
Henrik Boströmd516b252020-04-17 12:10:59 +02001/*
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 Handell8fe932a2020-07-06 17:41:35 +020017#include "rtc_base/synchronization/mutex.h"
Henrik Boströmd516b252020-04-17 12:10:59 +020018
19namespace webrtc {
20
21class VideoStreamInputStateProvider {
22 public:
23 VideoStreamInputStateProvider(
24 VideoStreamEncoderObserver* frame_rate_provider);
Evan Shrubsole34b1a422020-07-02 14:42:09 +020025 virtual ~VideoStreamInputStateProvider();
Henrik Boströmd516b252020-04-17 12:10:59 +020026
27 void OnHasInputChanged(bool has_input);
28 void OnFrameSizeObserved(int frame_size_pixels);
29 void OnEncoderSettingsChanged(EncoderSettings encoder_settings);
30
Evan Shrubsole34b1a422020-07-02 14:42:09 +020031 virtual VideoStreamInputState InputState();
Henrik Boströmd516b252020-04-17 12:10:59 +020032
33 private:
Markus Handell8fe932a2020-07-06 17:41:35 +020034 Mutex mutex_;
Henrik Boströmd516b252020-04-17 12:10:59 +020035 VideoStreamEncoderObserver* const frame_rate_provider_;
Markus Handell8fe932a2020-07-06 17:41:35 +020036 VideoStreamInputState input_state_ RTC_GUARDED_BY(mutex_);
Henrik Boströmd516b252020-04-17 12:10:59 +020037};
38
39} // namespace webrtc
40
41#endif // CALL_ADAPTATION_VIDEO_STREAM_INPUT_STATE_PROVIDER_H_