Add support for target rate constraints
WebRTC video engine now configures bitrate on media transport
correctly.
Bug: webrtc:9719
Change-Id: I85884cd76644b7eca3763cec8ce9e31b5b64db27
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/127941
Commit-Queue: Peter Slatala <psla@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Bjorn Mellem <mellem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27167}
diff --git a/api/media_transport_interface.h b/api/media_transport_interface.h
index 1b5f735..718000e 100644
--- a/api/media_transport_interface.h
+++ b/api/media_transport_interface.h
@@ -50,12 +50,22 @@
virtual void OnFirstAudioPacketReceived(int64_t channel_id) = 0;
};
+// Used to configure stream allocations.
struct MediaTransportAllocatedBitrateLimits {
DataRate min_pacing_rate = DataRate::Zero();
DataRate max_padding_bitrate = DataRate::Zero();
DataRate max_total_allocated_bitrate = DataRate::Zero();
};
+// Used to configure target bitrate constraints.
+// If the value is provided, the constraint is updated.
+// If the value is omitted, the value is left unchanged.
+struct MediaTransportTargetRateConstraints {
+ absl::optional<DataRate> min_bitrate;
+ absl::optional<DataRate> max_bitrate;
+ absl::optional<DataRate> starting_bitrate;
+};
+
// A collection of settings for creation of media transport.
struct MediaTransportSettings final {
MediaTransportSettings();
@@ -315,6 +325,11 @@
virtual void SetAllocatedBitrateLimits(
const MediaTransportAllocatedBitrateLimits& limits);
+ // Sets starting rate.
+ // TODO(psla): Make abstract when downstream implementation implement it.
+ virtual void SetTargetBitrateLimits(
+ const MediaTransportTargetRateConstraints& target_rate_constraints) {}
+
// Opens a data |channel_id| for sending. May return an error if the
// specified |channel_id| is unusable. Must be called before |SendData|.
virtual RTCError OpenChannel(int channel_id) = 0;