mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-12 21:30:45 +01:00

And move related files into api/transport/ and api/transport/media/. The moved files are unchanged, except that congestion_control_interface.h and datagram_transport_interface.h no longer include media_transport_interface.h, instead, they forward declare the few MediaTransport* types they reference. Bug: webrtc:8733 Change-Id: I4f4000d0d111f10d15a54c99af27ec26c46ae652 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/152482 Commit-Queue: Niels Moller <nisse@webrtc.org> Reviewed-by: Bjorn Mellem <mellem@webrtc.org> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#29178}
75 lines
2.9 KiB
C++
75 lines
2.9 KiB
C++
/* Copyright 2018 The WebRTC project authors. All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license
|
|
* that can be found in the LICENSE file in the root of the source
|
|
* tree. An additional intellectual property rights grant can be found
|
|
* in the file PATENTS. All contributing project authors may
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
*/
|
|
|
|
// This is EXPERIMENTAL interface for media and datagram transports.
|
|
|
|
#ifndef API_TRANSPORT_CONGESTION_CONTROL_INTERFACE_H_
|
|
#define API_TRANSPORT_CONGESTION_CONTROL_INTERFACE_H_
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
#include <utility>
|
|
|
|
#include "api/transport/network_control.h"
|
|
#include "api/units/data_rate.h"
|
|
|
|
namespace webrtc {
|
|
|
|
// TODO(nisse): Defined together with MediaTransportInterface. But we should use
|
|
// types that aren't tied to media, so that MediaTransportInterface can depend
|
|
// on CongestionControlInterface, but not the other way around.
|
|
// api/transport/network_control.h may be a reasonable place.
|
|
class MediaTransportRttObserver;
|
|
struct MediaTransportAllocatedBitrateLimits;
|
|
struct MediaTransportTargetRateConstraints;
|
|
|
|
// Defines congestion control feedback interface for media and datagram
|
|
// transports.
|
|
class CongestionControlInterface {
|
|
public:
|
|
virtual ~CongestionControlInterface() = default;
|
|
|
|
// Updates allocation limits.
|
|
virtual void SetAllocatedBitrateLimits(
|
|
const MediaTransportAllocatedBitrateLimits& limits) = 0;
|
|
|
|
// Sets starting rate.
|
|
virtual void SetTargetBitrateLimits(
|
|
const MediaTransportTargetRateConstraints& target_rate_constraints) = 0;
|
|
|
|
// Intended for receive side. AddRttObserver registers an observer to be
|
|
// called for each RTT measurement, typically once per ACK. Before media
|
|
// transport is destructed the observer must be unregistered.
|
|
//
|
|
// TODO(sukhanov): Looks like AddRttObserver and RemoveRttObserver were
|
|
// never implemented for media transport, so keeping noop implementation.
|
|
virtual void AddRttObserver(MediaTransportRttObserver* observer) {}
|
|
virtual void RemoveRttObserver(MediaTransportRttObserver* observer) {}
|
|
|
|
// Adds a target bitrate observer. Before media transport is destructed
|
|
// the observer must be unregistered (by calling
|
|
// RemoveTargetTransferRateObserver).
|
|
// A newly registered observer will be called back with the latest recorded
|
|
// target rate, if available.
|
|
virtual void AddTargetTransferRateObserver(
|
|
TargetTransferRateObserver* observer) = 0;
|
|
|
|
// Removes an existing |observer| from observers. If observer was never
|
|
// registered, an error is logged and method does nothing.
|
|
virtual void RemoveTargetTransferRateObserver(
|
|
TargetTransferRateObserver* observer) = 0;
|
|
|
|
// Returns the last known target transfer rate as reported to the above
|
|
// observers.
|
|
virtual absl::optional<TargetTransferRate> GetLatestTargetTransferRate() = 0;
|
|
};
|
|
|
|
} // namespace webrtc
|
|
|
|
#endif // API_TRANSPORT_CONGESTION_CONTROL_INTERFACE_H_
|