video_stream_input_state_provider.h 1.3 KB

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