<p>Friendly Automation <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/14702">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
Friendly Automation: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">stasis_bridge.c: Fixed wrong video_mode shown<br><br>Currently, if the bridge has created by the ARI, the video_mode<br>parameter was<br>not shown in the BridgeCreated event correctly.<br><br>Fixed it and added video_mode shown in the 'bridge show <bridge id>'<br>cli.<br><br>ASTERISK-28987<br><br>Change-Id: I8c205126724e34c2bdab9380f523eb62478e4295<br>---<br>M main/bridge.c<br>M res/res_stasis.c<br>M res/stasis/stasis_bridge.c<br>M res/stasis/stasis_bridge.h<br>4 files changed, 20 insertions(+), 12 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 fb7012d..9304495 100644</span><br><span>--- a/main/bridge.c</span><br><span>+++ b/main/bridge.c</span><br><span>@@ -5160,6 +5160,7 @@</span><br><span> ast_cli(a->fd, "Subclass: %s\n", snapshot->subclass);</span><br><span> ast_cli(a->fd, "Creator: %s\n", snapshot->creator);</span><br><span> ast_cli(a->fd, "Name: %s\n", snapshot->name);</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_cli(a->fd, "Video-Mode: %s\n", ast_bridge_video_mode_to_string(snapshot->video_mode));</span><br><span> ast_cli(a->fd, "Video-Source-Id: %s\n", snapshot->video_source_id);</span><br><span> ast_cli(a->fd, "Num-Channels: %u\n", snapshot->num_channels);</span><br><span> ast_cli(a->fd, "Num-Active: %u\n", snapshot->num_active);</span><br><span>diff --git a/res/res_stasis.c b/res/res_stasis.c</span><br><span>index 64f05ef..f975386 100644</span><br><span>--- a/res/res_stasis.c</span><br><span>+++ b/res/res_stasis.c</span><br><span>@@ -808,22 +808,14 @@</span><br><span> return NULL;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- bridge = bridge_stasis_new(capabilities, flags, name, id);</span><br><span style="color: hsl(120, 100%, 40%);">+ bridge = bridge_stasis_new(capabilities, flags, name, id, video_mode);</span><br><span> if (bridge) {</span><br><span style="color: hsl(0, 100%, 40%);">- if (video_mode == AST_BRIDGE_VIDEO_MODE_SFU) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_bridge_set_sfu_video_mode(bridge);</span><br><span style="color: hsl(0, 100%, 40%);">- /* We require a minimum 5 seconds between video updates to stop floods from clients,</span><br><span style="color: hsl(0, 100%, 40%);">- * this should rarely be changed but should become configurable in the future.</span><br><span style="color: hsl(0, 100%, 40%);">- */</span><br><span style="color: hsl(0, 100%, 40%);">- ast_bridge_set_video_update_discard(bridge, 5);</span><br><span style="color: hsl(0, 100%, 40%);">- } else {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_bridge_set_talker_src_video_mode(bridge);</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span> if (!ao2_link(app_bridges, bridge)) {</span><br><span> ast_bridge_destroy(bridge, 0);</span><br><span> bridge = NULL;</span><br><span> }</span><br><span> }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> return bridge;</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 d78e59c..d5f70a0 100644</span><br><span>--- a/res/stasis/stasis_bridge.c</span><br><span>+++ b/res/stasis/stasis_bridge.c</span><br><span>@@ -297,12 +297,26 @@</span><br><span> ast_bridge_base_v_table.pull(self, bridge_channel);</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-struct ast_bridge *bridge_stasis_new(uint32_t capabilities, unsigned int flags, const char *name, const char *id)</span><br><span style="color: hsl(120, 100%, 40%);">+struct ast_bridge *bridge_stasis_new(uint32_t capabilities, unsigned int flags, const char *name, const char *id, enum ast_bridge_video_mode_type video_mode)</span><br><span> {</span><br><span> void *bridge;</span><br><span> </span><br><span> bridge = bridge_alloc(sizeof(struct ast_bridge), &bridge_stasis_v_table);</span><br><span> bridge = bridge_base_init(bridge, capabilities, flags, "Stasis", name, id);</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!bridge) {</span><br><span style="color: hsl(120, 100%, 40%);">+ return NULL;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ if (video_mode == AST_BRIDGE_VIDEO_MODE_SFU) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_bridge_set_sfu_video_mode(bridge);</span><br><span style="color: hsl(120, 100%, 40%);">+ /* We require a minimum 5 seconds between video updates to stop floods from clients,</span><br><span style="color: hsl(120, 100%, 40%);">+ * this should rarely be changed but should become configurable in the future.</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_bridge_set_video_update_discard(bridge, 5);</span><br><span style="color: hsl(120, 100%, 40%);">+ } else {</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_bridge_set_talker_src_video_mode(bridge);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> bridge = bridge_register(bridge);</span><br><span> </span><br><span> return bridge;</span><br><span>diff --git a/res/stasis/stasis_bridge.h b/res/stasis/stasis_bridge.h</span><br><span>index 2590fd7..6e2a48b 100644</span><br><span>--- a/res/stasis/stasis_bridge.h</span><br><span>+++ b/res/stasis/stasis_bridge.h</span><br><span>@@ -50,11 +50,12 @@</span><br><span> * \param flags Flags that will alter the behavior of the bridge</span><br><span> * \param name Name given to the bridge by Stasis (optional)</span><br><span> * \param id Unique ID given to the bridge by Stasis (optional)</span><br><span style="color: hsl(120, 100%, 40%);">+ * \param video_mode Video mode of the bridge</span><br><span> *</span><br><span> * \retval a pointer to a new bridge on success</span><br><span> * \retval NULL on failure</span><br><span> */</span><br><span style="color: hsl(0, 100%, 40%);">-struct ast_bridge *bridge_stasis_new(uint32_t capabilities, unsigned int flags, const char *name, const char *id);</span><br><span style="color: hsl(120, 100%, 40%);">+struct ast_bridge *bridge_stasis_new(uint32_t capabilities, unsigned int flags, const char *name, const char *id, enum ast_bridge_video_mode_type video_mode);</span><br><span> </span><br><span> /*!</span><br><span> * \internal</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/14702">change 14702</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/+/14702"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 17 </div>
<div style="display:none"> Gerrit-Change-Id: I8c205126724e34c2bdab9380f523eb62478e4295 </div>
<div style="display:none"> Gerrit-Change-Number: 14702 </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>