<p>Joshua Colp has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/6623">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_stasis: Add 'video_sfu' as a requested bridge type.<br><br>This change adds 'video_sfu' as a requested bridge type when<br>creating a bridge. By specifying this a mixing type bridge is<br>created that exchanges video in an SFU fashion.<br><br>Change-Id: I2ada47cf5f3fc176518b647c0b4aa39d55339606<br>---<br>M res/res_stasis.c<br>M rest-api/api-docs/bridges.json<br>2 files changed, 20 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/23/6623/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/res/res_stasis.c b/res/res_stasis.c<br>index 899c8f7..f99dcee 100644<br>--- a/res/res_stasis.c<br>+++ b/res/res_stasis.c<br>@@ -766,6 +766,7 @@<br> int flags = AST_BRIDGE_FLAG_MERGE_INHIBIT_FROM | AST_BRIDGE_FLAG_MERGE_INHIBIT_TO<br> | AST_BRIDGE_FLAG_SWAP_INHIBIT_FROM | AST_BRIDGE_FLAG_SWAP_INHIBIT_TO<br> | AST_BRIDGE_FLAG_TRANSFER_BRIDGE_ONLY;<br>+ enum ast_bridge_video_mode_type video_mode = AST_BRIDGE_VIDEO_MODE_TALKER_SRC;<br> <br> if (invisible) {<br> flags |= AST_BRIDGE_FLAG_INVISIBLE;<br>@@ -782,7 +783,15 @@<br> } else if (!strcmp(requested_type, "dtmf_events") ||<br> !strcmp(requested_type, "proxy_media")) {<br> capabilities &= ~AST_BRIDGE_CAPABILITY_NATIVE;<br>+ } else if (!strcmp(requested_type, "video_sfu")) {<br>+ video_mode = AST_BRIDGE_VIDEO_MODE_SFU;<br> }<br>+ }<br>+<br>+ /* For an SFU video bridge we ensure it always remains in multimix for the best experience. */<br>+ if (video_mode == AST_BRIDGE_VIDEO_MODE_SFU) {<br>+ capabilities = AST_BRIDGE_CAPABILITY_MULTIMIX;<br>+ flags &= ~AST_BRIDGE_FLAG_SMART;<br> }<br> <br> if (!capabilities<br>@@ -794,7 +803,15 @@<br> <br> bridge = bridge_stasis_new(capabilities, flags, name, id);<br> if (bridge) {<br>- ast_bridge_set_talker_src_video_mode(bridge);<br>+ if (video_mode == AST_BRIDGE_VIDEO_MODE_SFU) {<br>+ ast_bridge_set_sfu_video_mode(bridge);<br>+ /* We require a minimum 5 seconds between video updates to stop floods from clients,<br>+ * this should rarely be changed but should become configurable in the future.<br>+ */<br>+ ast_bridge_set_video_update_discard(bridge, 5);<br>+ } else {<br>+ ast_bridge_set_talker_src_video_mode(bridge);<br>+ }<br> if (!ao2_link(app_bridges, bridge)) {<br> ast_bridge_destroy(bridge, 0);<br> bridge = NULL;<br>diff --git a/rest-api/api-docs/bridges.json b/rest-api/api-docs/bridges.json<br>index 03a1e7a..877fdf8 100644<br>--- a/rest-api/api-docs/bridges.json<br>+++ b/rest-api/api-docs/bridges.json<br>@@ -26,7 +26,7 @@<br> "parameters": [<br> {<br> "name": "type",<br>- "description": "Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media).",<br>+ "description": "Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media, video_sfu).",<br> "paramType": "query",<br> "required": false,<br> "allowMultiple": false,<br>@@ -65,7 +65,7 @@<br> "parameters": [<br> {<br> "name": "type",<br>- "description": "Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media) to set.",<br>+ "description": "Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media, video_sfu) to set.",<br> "paramType": "query",<br> "required": false,<br> "allowMultiple": false,<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/6623">change 6623</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/6623"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 15.0 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I2ada47cf5f3fc176518b647c0b4aa39d55339606 </div>
<div style="display:none"> Gerrit-Change-Number: 6623 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Joshua Colp <jcolp@digium.com> </div>