[prev in list] [next in list] [prev in thread] [next in thread] 

List:       asterisk-commits
Subject:    [asterisk-commits] =?utf-8?q?res_stasis=3A_Add_=27video_sfu=27_as?= =?utf-8?q?_a_requested_bridge_ty
From:       SVN commits to the Asterisk project <asterisk-commits () lists ! digium ! com>
Date:       2017-09-28 18:13:32
Message-ID: mailman.59830.1506624569.27840.asterisk-commits () lists ! digium ! com
[Download RAW message or body]

Joshua Colp has submitted this change and it was merged. ( \
https://gerrit.asterisk.org/6624 )

Change subject: res_stasis: Add 'video_sfu' as a requested bridge type.
......................................................................

res_stasis: Add 'video_sfu' as a requested bridge type.

This change adds 'video_sfu' as a requested bridge type when
creating a bridge. By specifying this a mixing type bridge is
created that exchanges video in an SFU fashion.

Change-Id: I2ada47cf5f3fc176518b647c0b4aa39d55339606
---
M res/res_stasis.c
M rest-api/api-docs/bridges.json
2 files changed, 20 insertions(+), 3 deletions(-)

Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  Benjamin Keith Ford: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved; Approved for Submit



diff --git a/res/res_stasis.c b/res/res_stasis.c
index 899c8f7..f99dcee 100644
--- a/res/res_stasis.c
+++ b/res/res_stasis.c
@@ -766,6 +766,7 @@
 	int flags = AST_BRIDGE_FLAG_MERGE_INHIBIT_FROM | AST_BRIDGE_FLAG_MERGE_INHIBIT_TO
 		| AST_BRIDGE_FLAG_SWAP_INHIBIT_FROM | AST_BRIDGE_FLAG_SWAP_INHIBIT_TO
 		| AST_BRIDGE_FLAG_TRANSFER_BRIDGE_ONLY;
+	enum ast_bridge_video_mode_type video_mode = AST_BRIDGE_VIDEO_MODE_TALKER_SRC;
 
 	if (invisible) {
 		flags |= AST_BRIDGE_FLAG_INVISIBLE;
@@ -782,7 +783,15 @@
 		} else if (!strcmp(requested_type, "dtmf_events") ||
 			!strcmp(requested_type, "proxy_media")) {
 			capabilities &= ~AST_BRIDGE_CAPABILITY_NATIVE;
+		} else if (!strcmp(requested_type, "video_sfu")) {
+			video_mode = AST_BRIDGE_VIDEO_MODE_SFU;
 		}
+	}
+
+	/* For an SFU video bridge we ensure it always remains in multimix for the best \
experience. */ +	if (video_mode == AST_BRIDGE_VIDEO_MODE_SFU) {
+		capabilities = AST_BRIDGE_CAPABILITY_MULTIMIX;
+		flags &= ~AST_BRIDGE_FLAG_SMART;
 	}
 
 	if (!capabilities
@@ -794,7 +803,15 @@
 
 	bridge = bridge_stasis_new(capabilities, flags, name, id);
 	if (bridge) {
-		ast_bridge_set_talker_src_video_mode(bridge);
+		if (video_mode == AST_BRIDGE_VIDEO_MODE_SFU) {
+			ast_bridge_set_sfu_video_mode(bridge);
+			/* We require a minimum 5 seconds between video updates to stop floods from \
clients, +			 * this should rarely be changed but should become configurable in the \
future. +			 */
+			ast_bridge_set_video_update_discard(bridge, 5);
+		} else {
+			ast_bridge_set_talker_src_video_mode(bridge);
+		}
 		if (!ao2_link(app_bridges, bridge)) {
 			ast_bridge_destroy(bridge, 0);
 			bridge = NULL;
diff --git a/rest-api/api-docs/bridges.json b/rest-api/api-docs/bridges.json
index 03a1e7a..877fdf8 100644
--- a/rest-api/api-docs/bridges.json
+++ b/rest-api/api-docs/bridges.json
@@ -26,7 +26,7 @@
 					"parameters": [
 						{
 							"name": "type",
-							"description": "Comma separated list of bridge type attributes (mixing, \
holding, dtmf_events, proxy_media).", +							"description": "Comma separated list of \
bridge type attributes (mixing, holding, dtmf_events, proxy_media, video_sfu).",  \
"paramType": "query",  "required": false,
 							"allowMultiple": false,
@@ -65,7 +65,7 @@
 					"parameters": [
 						{
 							"name": "type",
-							"description": "Comma separated list of bridge type attributes (mixing, \
holding, dtmf_events, proxy_media) to set.", +							"description": "Comma separated \
list of bridge type attributes (mixing, holding, dtmf_events, proxy_media, video_sfu) \
to set.",  "paramType": "query",
 							"required": false,
 							"allowMultiple": false,

-- 
To view, visit https://gerrit.asterisk.org/6624
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I2ada47cf5f3fc176518b647c0b4aa39d55339606
Gerrit-Change-Number: 6624
Gerrit-PatchSet: 1
Gerrit-Owner: Joshua Colp <jcolp@digium.com>
Gerrit-Reviewer: Benjamin Keith Ford <bford@digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp@digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com>


[Attachment #3 (text/html)]

<p>Joshua Colp <strong>merged</strong> this change.</p><p><a \
href="https://gerrit.asterisk.org/6624">View Change</a></p><div \
style="white-space:pre-wrap">Approvals:  Kevin Harwell: Looks good to me, but someone \
else must approve  Benjamin Keith Ford: Looks good to me, but someone else must \
approve  Joshua Colp: Looks good to me, approved; Approved for Submit

</div><pre style="font-family: monospace,monospace; white-space: \
pre-wrap;">res_stasis: Add &#39;video_sfu&#39; as a requested bridge \
type.<br><br>This change adds &#39;video_sfu&#39; 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;">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, &quot;dtmf_events&quot;) ||<br> 			!strcmp(requested_type, \
&quot;proxy_media&quot;)) {<br> 			capabilities &amp;= \
~AST_BRIDGE_CAPABILITY_NATIVE;<br>+		} else if (!strcmp(requested_type, \
&quot;video_sfu&quot;)) {<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 &amp;= \
~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> 					&quot;parameters&quot;: [<br> 						{<br> 							&quot;name&quot;: \
&quot;type&quot;,<br>-							&quot;description&quot;: &quot;Comma separated list of \
bridge type attributes (mixing, holding, dtmf_events, \
proxy_media).&quot;,<br>+							&quot;description&quot;: &quot;Comma separated list \
of bridge type attributes (mixing, holding, dtmf_events, proxy_media, \
video_sfu).&quot;,<br> 							&quot;paramType&quot;: &quot;query&quot;,<br> \
&quot;required&quot;: false,<br> 							&quot;allowMultiple&quot;: false,<br>@@ -65,7 \
+65,7 @@<br> 					&quot;parameters&quot;: [<br> 						{<br> 							&quot;name&quot;: \
&quot;type&quot;,<br>-							&quot;description&quot;: &quot;Comma separated list of \
bridge type attributes (mixing, holding, dtmf_events, proxy_media) to \
set.&quot;,<br>+							&quot;description&quot;: &quot;Comma separated list of bridge \
type attributes (mixing, holding, dtmf_events, proxy_media, video_sfu) to \
set.&quot;,<br> 							&quot;paramType&quot;: &quot;query&quot;,<br> \
&quot;required&quot;: false,<br> 							&quot;allowMultiple&quot;: \
false,<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/6624">change \
6624</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/6624"/><meta itemprop="name" content="View \
Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: \
I2ada47cf5f3fc176518b647c0b4aa39d55339606 </div> <div style="display:none"> \
Gerrit-Change-Number: 6624 </div> <div style="display:none"> Gerrit-PatchSet: 1 \
</div> <div style="display:none"> Gerrit-Owner: Joshua Colp &lt;jcolp@digium.com&gt; \
</div> <div style="display:none"> Gerrit-Reviewer: Benjamin Keith Ford \
&lt;bford@digium.com&gt; </div> <div style="display:none"> Gerrit-Reviewer: Jenkins2 \
</div> <div style="display:none"> Gerrit-Reviewer: Joshua Colp \
&lt;jcolp@digium.com&gt; </div> <div style="display:none"> Gerrit-Reviewer: Kevin \
Harwell &lt;kharwell@digium.com&gt; </div>



-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-commits mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-commits
--===============2482367838211955248==--


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic