FS-7513 FS-7509: crack at screen share

This commit is contained in:
Anthony Minessale authored and Michael Jerris committed 2015-05-28 12:47:03 -05:00
1 parent 84074ab804
commit 2c4c2587ed
8 files changed
+120 -16

No files matched your search

+1
View File
@@ -1464,6 +1464,7 @@ typedef enum {
CF_VIDEO_DECODED_READ,
CF_VIDEO_DEBUG_READ,
CF_VIDEO_DEBUG_WRITE,
CF_VIDEO_ONLY,
/* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */
/* IF YOU ADD NEW ONES CHECK IF THEY SHOULD PERSIST OR ZERO THEM IN switch_core_session.c switch_core_session_request_xml() */
CF_FLAG_MAX
@@ -11363,10 +11363,17 @@ SWITCH_STANDARD_APP(conference_function)
/* Chime in the core video thread */
switch_core_session_set_video_read_callback(session, video_thread_callback, (void *)&member);
/* Run the conference loop */
do {
conference_loop_output(&member);
} while (member.loop_loop);
if (switch_channel_test_flag(channel, CF_VIDEO_ONLY)) {
while(switch_test_flag((&member), MFLAG_RUNNING) && switch_channel_ready(channel)) {
switch_yield(100000);
}
} else {
/* Run the conference loop */
do {
conference_loop_output(&member);
} while (member.loop_loop);
}
switch_core_session_set_video_read_callback(session, NULL, NULL);
+6 -1
View File
@@ -3204,7 +3204,7 @@ static switch_bool_t verto__info_func(const char *method, cJSON *params, jsock_t
static switch_bool_t verto__invite_func(const char *method, cJSON *params, jsock_t *jsock, cJSON **response)
{
cJSON *obj = cJSON_CreateObject();
cJSON *obj = cJSON_CreateObject(), *screenShare = NULL;
switch_core_session_t *session = NULL;
switch_channel_t *channel;
switch_event_t *var_event;
@@ -3270,6 +3270,11 @@ static switch_bool_t verto__invite_func(const char *method, cJSON *params, jsock
destination_number = "service";
}
if ((screenShare = cJSON_GetObjectItem(dialog, "screenShare")) && screenShare->type == cJSON_True) {
switch_channel_set_flag(channel, CF_VIDEO_ONLY);
}
switch_snprintf(name, sizeof(name), "verto.rtc/%s", destination_number);
switch_channel_set_name(channel, name);
switch_channel_set_variable(channel, "jsock_uuid_str", jsock->uuid_str);
+6 -2
View File
@@ -2253,6 +2253,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_write_frame(switch_core_sessio
engine = &smh->engines[type];
if (switch_channel_test_flag(session->channel, CF_VIDEO_ONLY) && type == SWITCH_MEDIA_TYPE_AUDIO) {
return SWITCH_STATUS_SUCCESS;
}
while (!(engine->read_codec.implementation && switch_rtp_ready(engine->rtp_session))) {
if (switch_channel_ready(session->channel)) {
switch_yield(10000);
@@ -6754,7 +6759,6 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess
switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "a=msid-semantic: WMS %s\n", smh->msid);
}
if (a_engine->codec_negotiated) {
switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "m=audio %d %s", port,
get_media_profile_name(session, !a_engine->no_crypto &&
@@ -7035,7 +7039,7 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess
}
}
if (switch_channel_test_flag(session->channel, CF_VIDEO_POSSIBLE)) {
if (switch_channel_direction(session->channel) == SWITCH_CALL_DIRECTION_INBOUND) {
if (switch_channel_test_flag(smh->session->channel, CF_DTLS)) {