summaryrefslogtreecommitdiff
path: root/main/bridge.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2018-04-04 15:12:50 -0300
committerJoshua Colp <jcolp@digium.com>2018-04-17 11:25:17 -0600
commit8de3fa2b56cc954836a13e7d77079754d26fb990 (patch)
treed751852e79f8fd46f2e3307c488b0f2356aff443 /main/bridge.c
parent3255a286b34a15d5bdaa93663d8654c0568ab14d (diff)
bridge_softmix / app_confbridge: Add support for REMB combining.
This change adds the ability for multiple REMB reports in bridge_softmix to be combined according to a configured behavior into a single report. This single report is sent back to the sender of video, which adjusts the encoding bitrate to be at or below the bitrate of the report. The available behaviors are: lowest, highest, and average. Lowest uses the lowest received bitrate. Highest uses the highest received bitrate. Average goes through the received bitrates adding them to the previous average and creates a new average. Other behaviors can be added in the future and the existing average one may be adjusted, but this provides the foundation to do so. Support for configuring which behavior to use has been added to app_confbridge. ASTERISK-27804 Change-Id: I9eafe4e7c1f72d67074a8d6acb26bfcf19322b66
Diffstat (limited to 'main/bridge.c')
-rw-r--r--main/bridge.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/main/bridge.c b/main/bridge.c
index 8795081e2..2b347fd3f 100644
--- a/main/bridge.c
+++ b/main/bridge.c
@@ -3852,8 +3852,19 @@ void ast_bridge_set_video_update_discard(struct ast_bridge *bridge, unsigned int
void ast_bridge_set_remb_send_interval(struct ast_bridge *bridge, unsigned int remb_send_interval)
{
+ ast_assert(bridge->softmix.video_mode.mode == AST_BRIDGE_VIDEO_MODE_SFU);
+
+ ast_bridge_lock(bridge);
+ bridge->softmix.video_mode.mode_data.sfu_data.remb_send_interval = remb_send_interval;
+ ast_bridge_unlock(bridge);
+}
+
+void ast_brige_set_remb_behavior(struct ast_bridge *bridge, enum ast_bridge_video_sfu_remb_behavior behavior)
+{
+ ast_assert(bridge->softmix.video_mode.mode == AST_BRIDGE_VIDEO_MODE_SFU);
+
ast_bridge_lock(bridge);
- bridge->softmix.video_mode.remb_send_interval = remb_send_interval;
+ bridge->softmix.video_mode.mode_data.sfu_data.remb_behavior = behavior;
ast_bridge_unlock(bridge);
}