peer_connection_controls.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Copyright 2020 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef REMOTING_PROTOCOL_PEER_CONNECTION_CONTROLS_H_
  5. #define REMOTING_PROTOCOL_PEER_CONNECTION_CONTROLS_H_
  6. #include "third_party/abseil-cpp/absl/types/optional.h"
  7. namespace remoting {
  8. namespace protocol {
  9. // Interface for changing peer connection parameters after the connection is
  10. // established.
  11. class PeerConnectionControls {
  12. public:
  13. virtual ~PeerConnectionControls() = default;
  14. // Sets preferred min and max bitrates for the peer connection. nullopt means
  15. // no preference.
  16. virtual void SetPreferredBitrates(absl::optional<int> min_bitrate_bps,
  17. absl::optional<int> max_bitrate_bps) = 0;
  18. // Performs an ICE restart. This causes the host to initiate a new SDP
  19. // offer/answer exchange, and restarts the ICE gathering/connection sequence.
  20. // This can be used to re-establish a connection, without needing to
  21. // re-authenticate the user.
  22. virtual void RequestIceRestart() = 0;
  23. // Requests a new SDP offer/answer exchange, without restarting ICE. This can
  24. // be used to change SDP configuration (for example, switching to a different
  25. // codec), without needing a full reconnection.
  26. virtual void RequestSdpRestart() = 0;
  27. };
  28. } // namespace protocol
  29. } // namespace remoting
  30. #endif // REMOTING_PROTOCOL_PEER_CONNECTION_CONTROLS_H_