]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-8053 addtl touchups
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 15 Sep 2015 17:14:09 +0000 (12:14 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 15 Sep 2015 17:14:09 +0000 (12:14 -0500)
src/include/switch_types.h
src/mod/applications/mod_conference/conference_video.c
src/mod/applications/mod_conference/mod_conference.c
src/switch_core_media.c
src/switch_rtp.c

index fc81c5b33d576fd1bc7e3c79b034b74541dc0acf..98bdf94d48f8e7f3fd429849625616a04b33284c 100644 (file)
@@ -752,6 +752,7 @@ typedef enum {
        SWITCH_RTP_FLAG_MUTE,
        SWITCH_RTP_FLAG_NACK,
        SWITCH_RTP_FLAG_TMMBR,
+       SWITCH_RTP_FLAG_GEN_TS_DELTA,
        SWITCH_RTP_FLAG_INVALID
 } switch_rtp_flag_t;
 
index 7a81b92b0dd443c82bc0816e141ba7a06a38fbb7..1660a380de30ddc49436025898e3d87bcbdc5e54 100644 (file)
@@ -3264,13 +3264,27 @@ void conference_video_write_frame(conference_obj_t *conference, conference_membe
 
                switch_core_session_rwunlock(isession);
        }
+
+       if (want_refresh) {
+               for (imember = conference->members; imember; imember = imember->next) {
+                       switch_core_session_t *isession = imember->session;
+                       
+                       if (!isession || switch_core_session_read_lock(isession) != SWITCH_STATUS_SUCCESS) {
+                               continue;
+                       }
+                       
+                       if (!isession || !switch_channel_test_flag(imember->channel, CF_VIDEO) ) {
+                               continue;
+                       }
+               
+                       switch_core_session_request_video_refresh(imember->session);    
+                       switch_core_session_rwunlock(isession);
+               }
+       }
+
        switch_mutex_unlock(conference->member_mutex);
 
        switch_img_free(&tmp_frame.img);
-
-       if (want_refresh && floor_holder->session) {
-               switch_core_session_request_video_refresh(floor_holder->session);
-       }
 }
 
 switch_status_t conference_video_thread_callback(switch_core_session_t *session, switch_frame_t *frame, void *user_data)
@@ -3286,6 +3300,9 @@ switch_status_t conference_video_thread_callback(switch_core_session_t *session,
                return SWITCH_STATUS_SUCCESS;
        }
 
+       if (switch_core_session_media_flow(session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_SENDONLY) {
+               return SWITCH_STATUS_SUCCESS;
+       }
 
        if (switch_thread_rwlock_tryrdlock(member->conference->rwlock) != SWITCH_STATUS_SUCCESS) {
                return SWITCH_STATUS_FALSE;
index 2e69d76b4f8782e4461fd0c38bc79114ce46b927..0802b95987cd9a3c1fae35c226569e86d9f45252 100644 (file)
@@ -302,8 +302,11 @@ void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, void *ob
 
                                        if (imember->video_media_flow == SWITCH_MEDIA_FLOW_SENDONLY) {
                                                conference_utils_member_clear_flag(imember, MFLAG_CAN_BE_SEEN);
+                                               conference_video_find_floor(imember, SWITCH_FALSE);
                                        } else {
                                                conference_utils_member_set_flag(imember, MFLAG_CAN_BE_SEEN);
+                                               conference_video_find_floor(imember, SWITCH_TRUE);
+                                               switch_core_session_request_video_refresh(imember->session);
                                        }
                                }
 
index ac3f4d6ed7ba0a25baec816f3c847d52038b0c26..389873fbda5426481df24a762a079cfa5a63d080 100644 (file)
@@ -5958,6 +5958,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi
                flags[SWITCH_RTP_FLAG_BYTESWAP] = 0;
        }
 
+       if ((val = switch_channel_get_variable(session->channel, "rtp_gen_ts_delta")) && switch_true(val)) {
+               flags[SWITCH_RTP_FLAG_GEN_TS_DELTA] = 1;
+       }
+
        if (a_engine->rtp_session && switch_channel_test_flag(session->channel, CF_REINVITE)) {
                //const char *ip = switch_channel_get_variable(session->channel, SWITCH_LOCAL_MEDIA_IP_VARIABLE);
                //const char *port = switch_channel_get_variable(session->channel, SWITCH_LOCAL_MEDIA_PORT_VARIABLE);
index af7428646d3a47cb6eff17ea7d75d983fb634656..4ced6cbadb07b90fb967635f9980dcf51260a71a 100644 (file)
@@ -6999,8 +6999,8 @@ static int rtp_common_write(switch_rtp_t *rtp_session,
                }
        }
 
-       /* TMP DISABLE DFF  */
-       if (switch_rtp_test_flag(rtp_session, SWITCH_RTP_FLAG_VIDEO)) {
+
+       if (switch_rtp_test_flag(rtp_session, SWITCH_RTP_FLAG_GEN_TS_DELTA) || switch_rtp_test_flag(rtp_session, SWITCH_RTP_FLAG_VIDEO)) {
                /* Normalize the timestamps to our own base by generating a made up starting point then adding the measured deltas to that base 
                   so if the timestamps and ssrc of the source change, it will not break the other end's jitter bufffer / decoder etc *cough* CHROME *cough*
                 */
@@ -7010,7 +7010,7 @@ static int rtp_common_write(switch_rtp_t *rtp_session,
                }
 
                if (!rtp_session->ts_norm.last_ssrc || send_msg->header.ssrc != rtp_session->ts_norm.last_ssrc) {
-                       //#define USE_DELTA
+#define USE_DELTA
 #ifdef USE_DELTA
                        if (rtp_session->ts_norm.last_ssrc) {
                                rtp_session->ts_norm.delta_ct = 1;
@@ -7028,10 +7028,8 @@ static int rtp_common_write(switch_rtp_t *rtp_session,
                if (ntohl(send_msg->header.ts) != rtp_session->ts_norm.last_frame) {
 #ifdef USE_DELTA
                        int32_t delta = (int32_t) (ntohl(send_msg->header.ts) - rtp_session->ts_norm.last_frame);
-                       if (delta > 0 && delta < 90000) {
-                               rtp_session->ts_norm.delta = delta;
-                       }
-                       //printf("WTF %d\n", rtp_session->ts_norm.delta);
+                       
+                       rtp_session->ts_norm.delta = delta;
                        rtp_session->ts_norm.ts += rtp_session->ts_norm.delta;
 #else
                        switch_core_timer_sync(&rtp_session->timer);