res_stasis.c: Added video_single option for bridge creation
Currently, it was not possible to create bridge with video_mode single. This made hard to put the bridge in a vidoe_single mode. So, added video_single option for Bridge creation using the ARI. This allows create a bridge with video_mode single. ASTERISK-29055 Change-Id: I43e720e5c83fc75fafe10fe22808ae7f055da2ae
This commit is contained in:
parent
80a609fcce
commit
aae0904c7d
|
@ -3818,13 +3818,15 @@ void ast_bridge_set_single_src_video_mode(struct ast_bridge *bridge, struct ast_
|
||||||
ast_bridge_lock(bridge);
|
ast_bridge_lock(bridge);
|
||||||
cleanup_video_mode(bridge);
|
cleanup_video_mode(bridge);
|
||||||
bridge->softmix.video_mode.mode = AST_BRIDGE_VIDEO_MODE_SINGLE_SRC;
|
bridge->softmix.video_mode.mode = AST_BRIDGE_VIDEO_MODE_SINGLE_SRC;
|
||||||
bridge->softmix.video_mode.mode_data.single_src_data.chan_vsrc = ast_channel_ref(video_src_chan);
|
if (video_src_chan) {
|
||||||
ast_verb(5, "Video source in bridge '%s' (%s) is now '%s' (%s)\n",
|
bridge->softmix.video_mode.mode_data.single_src_data.chan_vsrc = ast_channel_ref(video_src_chan);
|
||||||
bridge->name, bridge->uniqueid,
|
ast_verb(5, "Video source in bridge '%s' (%s) is now '%s' (%s)\n",
|
||||||
ast_channel_name(video_src_chan),
|
bridge->name, bridge->uniqueid,
|
||||||
ast_channel_uniqueid(video_src_chan));
|
ast_channel_name(video_src_chan),
|
||||||
|
ast_channel_uniqueid(video_src_chan));
|
||||||
|
ast_indicate(video_src_chan, AST_CONTROL_VIDUPDATE);
|
||||||
|
}
|
||||||
ast_bridge_publish_state(bridge);
|
ast_bridge_publish_state(bridge);
|
||||||
ast_indicate(video_src_chan, AST_CONTROL_VIDUPDATE);
|
|
||||||
ast_bridge_unlock(bridge);
|
ast_bridge_unlock(bridge);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ struct ast_ari_bridges_list_args {
|
||||||
void ast_ari_bridges_list(struct ast_variable *headers, struct ast_ari_bridges_list_args *args, struct ast_ari_response *response);
|
void ast_ari_bridges_list(struct ast_variable *headers, struct ast_ari_bridges_list_args *args, struct ast_ari_response *response);
|
||||||
/*! Argument struct for ast_ari_bridges_create() */
|
/*! Argument struct for ast_ari_bridges_create() */
|
||||||
struct ast_ari_bridges_create_args {
|
struct ast_ari_bridges_create_args {
|
||||||
/*! Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media, video_sfu). */
|
/*! Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media, video_sfu, video_single). */
|
||||||
const char *type;
|
const char *type;
|
||||||
/*! Unique ID to give to the bridge being created. */
|
/*! Unique ID to give to the bridge being created. */
|
||||||
const char *bridge_id;
|
const char *bridge_id;
|
||||||
|
@ -82,7 +82,7 @@ int ast_ari_bridges_create_parse_body(
|
||||||
void ast_ari_bridges_create(struct ast_variable *headers, struct ast_ari_bridges_create_args *args, struct ast_ari_response *response);
|
void ast_ari_bridges_create(struct ast_variable *headers, struct ast_ari_bridges_create_args *args, struct ast_ari_response *response);
|
||||||
/*! Argument struct for ast_ari_bridges_create_with_id() */
|
/*! Argument struct for ast_ari_bridges_create_with_id() */
|
||||||
struct ast_ari_bridges_create_with_id_args {
|
struct ast_ari_bridges_create_with_id_args {
|
||||||
/*! Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media, video_sfu) to set. */
|
/*! Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media, video_sfu, video_single) to set. */
|
||||||
const char *type;
|
const char *type;
|
||||||
/*! Unique ID to give to the bridge being created. */
|
/*! Unique ID to give to the bridge being created. */
|
||||||
const char *bridge_id;
|
const char *bridge_id;
|
||||||
|
|
|
@ -792,6 +792,8 @@ static struct ast_bridge *bridge_create_common(const char *type, const char *nam
|
||||||
capabilities &= ~AST_BRIDGE_CAPABILITY_NATIVE;
|
capabilities &= ~AST_BRIDGE_CAPABILITY_NATIVE;
|
||||||
} else if (!strcmp(requested_type, "video_sfu")) {
|
} else if (!strcmp(requested_type, "video_sfu")) {
|
||||||
video_mode = AST_BRIDGE_VIDEO_MODE_SFU;
|
video_mode = AST_BRIDGE_VIDEO_MODE_SFU;
|
||||||
|
} else if (!strcmp(requested_type, "video_single")) {
|
||||||
|
video_mode = AST_BRIDGE_VIDEO_MODE_SINGLE_SRC;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -313,6 +313,8 @@ struct ast_bridge *bridge_stasis_new(uint32_t capabilities, unsigned int flags,
|
||||||
* this should rarely be changed but should become configurable in the future.
|
* this should rarely be changed but should become configurable in the future.
|
||||||
*/
|
*/
|
||||||
ast_bridge_set_video_update_discard(bridge, 5);
|
ast_bridge_set_video_update_discard(bridge, 5);
|
||||||
|
} else if (video_mode == AST_BRIDGE_VIDEO_MODE_SINGLE_SRC) {
|
||||||
|
ast_bridge_set_single_src_video_mode(bridge, NULL);
|
||||||
} else {
|
} else {
|
||||||
ast_bridge_set_talker_src_video_mode(bridge);
|
ast_bridge_set_talker_src_video_mode(bridge);
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"name": "type",
|
"name": "type",
|
||||||
"description": "Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media, video_sfu).",
|
"description": "Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media, video_sfu, video_single).",
|
||||||
"paramType": "query",
|
"paramType": "query",
|
||||||
"required": false,
|
"required": false,
|
||||||
"allowMultiple": false,
|
"allowMultiple": false,
|
||||||
|
@ -69,7 +69,7 @@
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"name": "type",
|
"name": "type",
|
||||||
"description": "Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media, video_sfu) to set.",
|
"description": "Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media, video_sfu, video_single) to set.",
|
||||||
"paramType": "query",
|
"paramType": "query",
|
||||||
"required": false,
|
"required": false,
|
||||||
"allowMultiple": false,
|
"allowMultiple": false,
|
||||||
|
@ -755,7 +755,7 @@
|
||||||
},
|
},
|
||||||
"video_mode": {
|
"video_mode": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "The video mode the bridge is using. One of 'none', 'talker', or 'single'.",
|
"description": "The video mode the bridge is using. One of 'none', 'talker', 'sfu', or 'single'.",
|
||||||
"required": false
|
"required": false
|
||||||
},
|
},
|
||||||
"video_source_id": {
|
"video_source_id": {
|
||||||
|
|
Loading…
Reference in New Issue