goog_cc_factory.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Copyright (c) 2018 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 API_TRANSPORT_GOOG_CC_FACTORY_H_
  11. #define API_TRANSPORT_GOOG_CC_FACTORY_H_
  12. #include <memory>
  13. #include "api/network_state_predictor.h"
  14. #include "api/transport/network_control.h"
  15. #include "rtc_base/deprecation.h"
  16. namespace webrtc {
  17. class RtcEventLog;
  18. struct GoogCcFactoryConfig {
  19. std::unique_ptr<NetworkStateEstimatorFactory>
  20. network_state_estimator_factory = nullptr;
  21. NetworkStatePredictorFactoryInterface* network_state_predictor_factory =
  22. nullptr;
  23. bool feedback_only = false;
  24. };
  25. class GoogCcNetworkControllerFactory
  26. : public NetworkControllerFactoryInterface {
  27. public:
  28. GoogCcNetworkControllerFactory() = default;
  29. explicit RTC_DEPRECATED GoogCcNetworkControllerFactory(
  30. RtcEventLog* event_log);
  31. explicit GoogCcNetworkControllerFactory(
  32. NetworkStatePredictorFactoryInterface* network_state_predictor_factory);
  33. explicit GoogCcNetworkControllerFactory(GoogCcFactoryConfig config);
  34. std::unique_ptr<NetworkControllerInterface> Create(
  35. NetworkControllerConfig config) override;
  36. TimeDelta GetProcessInterval() const override;
  37. protected:
  38. RtcEventLog* const event_log_ = nullptr;
  39. GoogCcFactoryConfig factory_config_;
  40. };
  41. // Deprecated, use GoogCcFactoryConfig to enable feedback only mode instead.
  42. // Factory to create packet feedback only GoogCC, this can be used for
  43. // connections providing packet receive time feedback but no other reports.
  44. class RTC_DEPRECATED GoogCcFeedbackNetworkControllerFactory
  45. : public GoogCcNetworkControllerFactory {
  46. public:
  47. explicit GoogCcFeedbackNetworkControllerFactory(RtcEventLog* event_log);
  48. };
  49. } // namespace webrtc
  50. #endif // API_TRANSPORT_GOOG_CC_FACTORY_H_