<p>sungtae kim has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/14882">View Change</a></p><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>Change-Id: I43e720e5c83fc75fafe10fe22808ae7f055da2ae<br>---<br>M main/bridge.c<br>M res/res_stasis.c<br>M res/stasis/stasis_bridge.c<br>M rest-api/api-docs/bridges.json<br>4 files changed, 15 insertions(+), 9 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/82/14882/1</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 add586c..4a8075f 100644</span><br><span>--- a/main/bridge.c</span><br><span>+++ b/main/bridge.c</span><br><span>@@ -3809,13 +3809,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/res_stasis.c b/res/res_stasis.c</span><br><span>index f975386..7d05e8b 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 a465137..bf0a001 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>@@ -755,7 +755,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/+/14882">change 14882</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/+/14882"/><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-Change-Id: I43e720e5c83fc75fafe10fe22808ae7f055da2ae </div>
<div style="display:none"> Gerrit-Change-Number: 14882 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: sungtae kim <pchero21@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>