<p>George Joseph <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/14906">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Joshua Colp: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved; Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_stasis.c: Added video_single option for bridge creation<br><br>Currently, it was not possible to create bridge with video_mode single.<br>This made hard to put the bridge in a vidoe_single mode.<br>So, added video_single option for Bridge creation using the ARI.<br>This allows create a bridge with video_mode single.<br><br>ASTERISK-29055<br><br>Change-Id: I43e720e5c83fc75fafe10fe22808ae7f055da2ae<br>---<br>M main/bridge.c<br>M res/ari/resource_bridges.h<br>M res/res_stasis.c<br>M res/stasis/stasis_bridge.c<br>M rest-api/api-docs/bridges.json<br>5 files changed, 17 insertions(+), 11 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/main/bridge.c b/main/bridge.c</span><br><span>index afd6bdd..cf3cc32 100644</span><br><span>--- a/main/bridge.c</span><br><span>+++ b/main/bridge.c</span><br><span>@@ -3837,13 +3837,15 @@</span><br><span> ast_bridge_lock(bridge);</span><br><span> cleanup_video_mode(bridge);</span><br><span> bridge->softmix.video_mode.mode = AST_BRIDGE_VIDEO_MODE_SINGLE_SRC;</span><br><span style="color: hsl(0, 100%, 40%);">- bridge->softmix.video_mode.mode_data.single_src_data.chan_vsrc = ast_channel_ref(video_src_chan);</span><br><span style="color: hsl(0, 100%, 40%);">- ast_verb(5, "Video source in bridge '%s' (%s) is now '%s' (%s)\n",</span><br><span style="color: hsl(0, 100%, 40%);">- bridge->name, bridge->uniqueid,</span><br><span style="color: hsl(0, 100%, 40%);">- ast_channel_name(video_src_chan),</span><br><span style="color: hsl(0, 100%, 40%);">- ast_channel_uniqueid(video_src_chan));</span><br><span style="color: hsl(120, 100%, 40%);">+ if (video_src_chan) {</span><br><span style="color: hsl(120, 100%, 40%);">+ bridge->softmix.video_mode.mode_data.single_src_data.chan_vsrc = ast_channel_ref(video_src_chan);</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_verb(5, "Video source in bridge '%s' (%s) is now '%s' (%s)\n",</span><br><span style="color: hsl(120, 100%, 40%);">+ bridge->name, bridge->uniqueid,</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_channel_name(video_src_chan),</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_channel_uniqueid(video_src_chan));</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_indicate(video_src_chan, AST_CONTROL_VIDUPDATE);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> ast_bridge_publish_state(bridge);</span><br><span style="color: hsl(0, 100%, 40%);">- ast_indicate(video_src_chan, AST_CONTROL_VIDUPDATE);</span><br><span> ast_bridge_unlock(bridge);</span><br><span> }</span><br><span> </span><br><span>diff --git a/res/ari/resource_bridges.h b/res/ari/resource_bridges.h</span><br><span>index 0d0286c..9c73d84 100644</span><br><span>--- a/res/ari/resource_bridges.h</span><br><span>+++ b/res/ari/resource_bridges.h</span><br><span>@@ -52,7 +52,7 @@</span><br><span> void ast_ari_bridges_list(struct ast_variable *headers, struct ast_ari_bridges_list_args *args, struct ast_ari_response *response);</span><br><span> /*! Argument struct for ast_ari_bridges_create() */</span><br><span> struct ast_ari_bridges_create_args {</span><br><span style="color: hsl(0, 100%, 40%);">- /*! Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media, video_sfu). */</span><br><span style="color: hsl(120, 100%, 40%);">+ /*! Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media, video_sfu, video_single). */</span><br><span> const char *type;</span><br><span> /*! Unique ID to give to the bridge being created. */</span><br><span> const char *bridge_id;</span><br><span>@@ -82,7 +82,7 @@</span><br><span> void ast_ari_bridges_create(struct ast_variable *headers, struct ast_ari_bridges_create_args *args, struct ast_ari_response *response);</span><br><span> /*! Argument struct for ast_ari_bridges_create_with_id() */</span><br><span> struct ast_ari_bridges_create_with_id_args {</span><br><span style="color: hsl(0, 100%, 40%);">- /*! Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media, video_sfu) to set. */</span><br><span style="color: hsl(120, 100%, 40%);">+ /*! Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media, video_sfu, video_single) to set. */</span><br><span> const char *type;</span><br><span> /*! Unique ID to give to the bridge being created. */</span><br><span> const char *bridge_id;</span><br><span>diff --git a/res/res_stasis.c b/res/res_stasis.c</span><br><span>index 3f8ae74..b3b31f9 100644</span><br><span>--- a/res/res_stasis.c</span><br><span>+++ b/res/res_stasis.c</span><br><span>@@ -792,6 +792,8 @@</span><br><span> capabilities &= ~AST_BRIDGE_CAPABILITY_NATIVE;</span><br><span> } else if (!strcmp(requested_type, "video_sfu")) {</span><br><span> video_mode = AST_BRIDGE_VIDEO_MODE_SFU;</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (!strcmp(requested_type, "video_single")) {</span><br><span style="color: hsl(120, 100%, 40%);">+ video_mode = AST_BRIDGE_VIDEO_MODE_SINGLE_SRC;</span><br><span> }</span><br><span> }</span><br><span> </span><br><span>diff --git a/res/stasis/stasis_bridge.c b/res/stasis/stasis_bridge.c</span><br><span>index d5f70a0..fdfd8fb 100644</span><br><span>--- a/res/stasis/stasis_bridge.c</span><br><span>+++ b/res/stasis/stasis_bridge.c</span><br><span>@@ -313,6 +313,8 @@</span><br><span> * this should rarely be changed but should become configurable in the future.</span><br><span> */</span><br><span> ast_bridge_set_video_update_discard(bridge, 5);</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (video_mode == AST_BRIDGE_VIDEO_MODE_SINGLE_SRC) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_bridge_set_single_src_video_mode(bridge, NULL);</span><br><span> } else {</span><br><span> ast_bridge_set_talker_src_video_mode(bridge);</span><br><span> }</span><br><span>diff --git a/rest-api/api-docs/bridges.json b/rest-api/api-docs/bridges.json</span><br><span>index 22743c3..3e757e9 100644</span><br><span>--- a/rest-api/api-docs/bridges.json</span><br><span>+++ b/rest-api/api-docs/bridges.json</span><br><span>@@ -30,7 +30,7 @@</span><br><span> "parameters": [</span><br><span> {</span><br><span> "name": "type",</span><br><span style="color: hsl(0, 100%, 40%);">- "description": "Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media, video_sfu).",</span><br><span style="color: hsl(120, 100%, 40%);">+ "description": "Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media, video_sfu, video_single).",</span><br><span> "paramType": "query",</span><br><span> "required": false,</span><br><span> "allowMultiple": false,</span><br><span>@@ -69,7 +69,7 @@</span><br><span> "parameters": [</span><br><span> {</span><br><span> "name": "type",</span><br><span style="color: hsl(0, 100%, 40%);">- "description": "Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media, video_sfu) to set.",</span><br><span style="color: hsl(120, 100%, 40%);">+ "description": "Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media, video_sfu, video_single) to set.",</span><br><span> "paramType": "query",</span><br><span> "required": false,</span><br><span> "allowMultiple": false,</span><br><span>@@ -746,7 +746,7 @@</span><br><span> },</span><br><span> "video_mode": {</span><br><span> "type": "string",</span><br><span style="color: hsl(0, 100%, 40%);">- "description": "The video mode the bridge is using. One of 'none', 'talker', or 'single'.",</span><br><span style="color: hsl(120, 100%, 40%);">+ "description": "The video mode the bridge is using. One of 'none', 'talker', 'sfu', or 'single'.",</span><br><span> "required": false</span><br><span> },</span><br><span> "video_source_id": {</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/14906">change 14906</a>. To unsubscribe, or for help writing mail filters, 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/c/asterisk/+/14906"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: I43e720e5c83fc75fafe10fe22808ae7f055da2ae </div>
<div style="display:none"> Gerrit-Change-Number: 14906 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: sungtae kim <pchero21@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>