[Asterisk-code-review] stasis_bridge.c: Fixed wrong video_mode shown (asterisk[13])

Kevin Harwell asteriskteam at digium.com
Tue Aug 11 17:19:53 CDT 2020


Kevin Harwell has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/14708 )

Change subject: stasis_bridge.c: Fixed wrong video_mode shown
......................................................................

stasis_bridge.c: Fixed wrong video_mode shown

Currently, if the bridge has created by the ARI, the video_mode
parameter was
not shown in the BridgeCreated event correctly.

Fixed it and added video_mode shown in the 'bridge show <bridge id>'
cli.

ASTERISK-28987

Change-Id: I8c205126724e34c2bdab9380f523eb62478e4295
---
M main/bridge.c
M res/res_stasis.c
M res/stasis/stasis_bridge.c
3 files changed, 7 insertions(+), 1 deletion(-)

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



diff --git a/main/bridge.c b/main/bridge.c
index 4798c72..23f682c 100644
--- a/main/bridge.c
+++ b/main/bridge.c
@@ -5126,6 +5126,7 @@
 	ast_cli(a->fd, "Subclass: %s\n", snapshot->subclass);
 	ast_cli(a->fd, "Creator: %s\n", snapshot->creator);
 	ast_cli(a->fd, "Name: %s\n", snapshot->name);
+	ast_cli(a->fd, "Video-Mode: %s\n", ast_bridge_video_mode_to_string(snapshot->video_mode));
 	ast_cli(a->fd, "Video-Source-Id: %s\n", snapshot->video_source_id);
 	ast_cli(a->fd, "Num-Channels: %u\n", snapshot->num_channels);
 	ast_cli(a->fd, "Num-Active: %u\n", snapshot->num_active);
diff --git a/res/res_stasis.c b/res/res_stasis.c
index 8559658..4850f6a 100644
--- a/res/res_stasis.c
+++ b/res/res_stasis.c
@@ -799,12 +799,12 @@
 
 	bridge = bridge_stasis_new(capabilities, flags, name, id);
 	if (bridge) {
-		ast_bridge_set_talker_src_video_mode(bridge);
 		if (!ao2_link(app_bridges, bridge)) {
 			ast_bridge_destroy(bridge, 0);
 			bridge = NULL;
 		}
 	}
+
 	return bridge;
 }
 
diff --git a/res/stasis/stasis_bridge.c b/res/stasis/stasis_bridge.c
index 701cbae..1b87b48 100644
--- a/res/stasis/stasis_bridge.c
+++ b/res/stasis/stasis_bridge.c
@@ -305,6 +305,11 @@
 
 	bridge = bridge_alloc(sizeof(struct ast_bridge), &bridge_stasis_v_table);
 	bridge = bridge_base_init(bridge, capabilities, flags, "Stasis", name, id);
+	if (!bridge) {
+		return NULL;
+	}
+
+	ast_bridge_set_talker_src_video_mode(bridge);
 	bridge = bridge_register(bridge);
 
 	return bridge;

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/14708
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: I8c205126724e34c2bdab9380f523eb62478e4295
Gerrit-Change-Number: 14708
Gerrit-PatchSet: 5
Gerrit-Owner: sungtae kim <pchero21 at gmail.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200811/ddf5522b/attachment.html>


More information about the asterisk-code-review mailing list