mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-04 17:51:03 +00:00
FS-10259: [freeswitch-core,mod_commands,mod_conference] Allow uuid_video_bitrate to supersede bitrate control from the conference
This commit is contained in:
parent
a218001b35
commit
ab1f8eae62
@ -4146,6 +4146,10 @@ SWITCH_STANDARD_API(uuid_video_refresh_function)
|
|||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
BITRATE_INUSE = (1 << 0)
|
||||||
|
} uuid_video_bitrate_enum_t;
|
||||||
|
|
||||||
#define VIDEO_BITRATE_SYNTAX "<uuid> <bitrate>"
|
#define VIDEO_BITRATE_SYNTAX "<uuid> <bitrate>"
|
||||||
SWITCH_STANDARD_API(uuid_video_bitrate_function)
|
SWITCH_STANDARD_API(uuid_video_bitrate_function)
|
||||||
{
|
{
|
||||||
@ -4163,13 +4167,29 @@ SWITCH_STANDARD_API(uuid_video_bitrate_function)
|
|||||||
switch_core_session_t *lsession = NULL;
|
switch_core_session_t *lsession = NULL;
|
||||||
|
|
||||||
if ((lsession = switch_core_session_locate(argv[0]))) {
|
if ((lsession = switch_core_session_locate(argv[0]))) {
|
||||||
int kps = switch_parse_bandwidth_string(argv[1]);
|
int kps;
|
||||||
switch_core_session_message_t msg = { 0 };
|
switch_core_session_message_t msg = { 0 };
|
||||||
|
switch_channel_t *channel = switch_core_session_get_channel(lsession);
|
||||||
|
|
||||||
|
if (argv[1] && !strcasecmp(argv[1], "clear")) {
|
||||||
|
if (switch_channel_test_app_flag_key("uuid_video_bitrate", channel, BITRATE_INUSE)) {
|
||||||
|
switch_channel_clear_flag_recursive(channel, CF_VIDEO_BITRATE_UNMANAGABLE);
|
||||||
|
switch_channel_clear_app_flag_key("uuid_video_bitrate", channel, BITRATE_INUSE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
kps = switch_parse_bandwidth_string(argv[1]);
|
||||||
|
|
||||||
msg.message_id = SWITCH_MESSAGE_INDICATE_BITRATE_REQ;
|
msg.message_id = SWITCH_MESSAGE_INDICATE_BITRATE_REQ;
|
||||||
msg.numeric_arg = kps * 1024;
|
msg.numeric_arg = kps * 1024;
|
||||||
msg.from = __FILE__;
|
msg.from = __FILE__;
|
||||||
|
|
||||||
|
if (!switch_channel_test_app_flag_key("uuid_video_bitrate", channel, BITRATE_INUSE)) {
|
||||||
|
switch_channel_set_app_flag_key("uuid_video_bitrate", channel, BITRATE_INUSE);
|
||||||
|
switch_channel_set_flag_recursive(channel, CF_VIDEO_BITRATE_UNMANAGABLE);
|
||||||
|
}
|
||||||
|
|
||||||
switch_core_session_receive_message(lsession, &msg);
|
switch_core_session_receive_message(lsession, &msg);
|
||||||
switch_core_session_video_reinit(lsession);
|
switch_core_session_video_reinit(lsession);
|
||||||
switch_channel_video_sync(switch_core_session_get_channel(lsession));
|
switch_channel_video_sync(switch_core_session_get_channel(lsession));
|
||||||
|
@ -1314,7 +1314,7 @@ SWITCH_DECLARE(switch_status_t) switch_jb_get_packet(switch_jb_t *jb, switch_rtp
|
|||||||
|
|
||||||
if (switch_channel_test_flag(jb->channel, CF_VIDEO_BITRATE_UNMANAGABLE) && jb->frame_len == jb->min_frame_len) {
|
if (switch_channel_test_flag(jb->channel, CF_VIDEO_BITRATE_UNMANAGABLE) && jb->frame_len == jb->min_frame_len) {
|
||||||
jb_debug(jb, 2, "%s", "Allow BITRATE changes\n");
|
jb_debug(jb, 2, "%s", "Allow BITRATE changes\n");
|
||||||
switch_channel_clear_flag(jb->channel, CF_VIDEO_BITRATE_UNMANAGABLE);
|
switch_channel_clear_flag_recursive(jb->channel, CF_VIDEO_BITRATE_UNMANAGABLE);
|
||||||
jb->bitrate_control = 0;
|
jb->bitrate_control = 0;
|
||||||
if (jb->session) {
|
if (jb->session) {
|
||||||
switch_core_session_request_video_refresh(jb->session);
|
switch_core_session_request_video_refresh(jb->session);
|
||||||
@ -1331,7 +1331,7 @@ SWITCH_DECLARE(switch_status_t) switch_jb_get_packet(switch_jb_t *jb, switch_rtp
|
|||||||
jb_debug(jb, 2, "Force BITRATE to %d\n", jb->bitrate_control);
|
jb_debug(jb, 2, "Force BITRATE to %d\n", jb->bitrate_control);
|
||||||
|
|
||||||
switch_core_session_receive_message(jb->session, &msg);
|
switch_core_session_receive_message(jb->session, &msg);
|
||||||
switch_channel_set_flag(jb->channel, CF_VIDEO_BITRATE_UNMANAGABLE);
|
switch_channel_set_flag_recursive(jb->channel, CF_VIDEO_BITRATE_UNMANAGABLE);
|
||||||
if (jb->session) {
|
if (jb->session) {
|
||||||
switch_core_session_request_video_refresh(jb->session);
|
switch_core_session_request_video_refresh(jb->session);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user