diff options
author | Matt Jordan <mjordan@digium.com> | 2016-11-08 10:11:41 -0600 |
---|---|---|
committer | Matt Jordan <mjordan@digium.com> | 2016-11-14 17:03:09 -0500 |
commit | a72ef381135639c62d97b9f6b1964403c9c92b78 (patch) | |
tree | 0f452f795f624cf7d4580a901bc9ab70fb1cdef4 /res/stasis | |
parent | d1739bcf07502e5e59917818dfcf514b95a6c2e3 (diff) |
res/ari/resource_bridges: Add the ability to manipulate the video source
In multi-party bridges, Asterisk currently supports two video modes:
* Follow the talker, in which the speaker with the most energy is shown
to all participants but the speaker, and the speaker sees the
previous video source
* Explicitly set video sources, in which all participants see a locked
video source
Prior to this patch, ARI had no ability to manipulate the video source.
This isn't important for two-party bridges, in which Asterisk merely
relays the video between the participants. However, in a multi-party
bridge, it can be advantageous to allow an external application to
manipulate the video source.
This patch provides two new routes to accomplish this:
(1) setVideoSource: POST /bridges/{bridgeId}/videoSource/{channelId}
Sets a video source to an explicit channel
(2) clearVideoSource: DELETE /bridges/{bridgeId}/videoSource
Removes any explicit video source, and sets the video mode to talk
detection
ASTERISK-26595 #close
Change-Id: I98e455d5bffc08ea5e8d6b84ccaf063c714e6621
Diffstat (limited to 'res/stasis')
-rw-r--r-- | res/stasis/app.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/res/stasis/app.c b/res/stasis/app.c index ac316fac0..0b75ed5d7 100644 --- a/res/stasis/app.c +++ b/res/stasis/app.c @@ -698,6 +698,13 @@ static void sub_bridge_update_handler(void *data, json = simple_bridge_event("BridgeDestroyed", old_snapshot, tv); } else if (!old_snapshot) { json = simple_bridge_event("BridgeCreated", new_snapshot, tv); + } else if (new_snapshot && old_snapshot + && strcmp(new_snapshot->video_source_id, old_snapshot->video_source_id)) { + json = simple_bridge_event("BridgeVideoSourceChanged", new_snapshot, tv); + if (json && !ast_strlen_zero(old_snapshot->video_source_id)) { + ast_json_object_set(json, "old_video_source_id", + ast_json_string_create(old_snapshot->video_source_id)); + } } if (json) { |