]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-10097: [mod_conference] Add fgimg to conference video layouts
authorAnthony Minessale <anthm@freeswitch.org>
Mon, 6 Mar 2017 20:39:27 +0000 (14:39 -0600)
committerMike Jerris <mike@jerris.com>
Tue, 7 Mar 2017 18:53:15 +0000 (12:53 -0600)
src/switch_core_media.c
src/switch_core_media_bug.c

index cb66ab46e37c98ceb88f02979635628e206124bf..f797d04ef1fb1168a061536528ff6ce621b140a6 100644 (file)
@@ -11938,7 +11938,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_video_frame(switch_core
        switch_io_event_hook_video_read_frame_t *ptr;
        uint32_t loops = 0;
        switch_media_handle_t *smh;
-       int patchers = 0;
                
        switch_assert(session != NULL);
 
@@ -12094,10 +12093,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_video_frame(switch_core
                                
 
                                if (bp->callback && switch_test_flag(bp, SMBF_READ_VIDEO_PING)) {
-                                       if (switch_test_flag(bp, SMBF_READ_VIDEO_PATCH)) {
-                                               patchers++;
-                                       }
-
                                        bp->video_ping_frame = *frame;
 
                                        if (bp->callback(bp, bp->user_data, SWITCH_ABC_TYPE_READ_VIDEO_PING) == SWITCH_FALSE
@@ -12126,11 +12121,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_video_frame(switch_core
        }
 
        if ((*frame) && (*frame)->codec) {
-               if (patchers) {
-                       switch_set_flag((*frame)->codec, SWITCH_CODEC_FLAG_VIDEO_PATCHING);
-               } else {
-                       switch_clear_flag((*frame)->codec, SWITCH_CODEC_FLAG_VIDEO_PATCHING);
-               }
+               (*frame)->pmap = NULL;
        }
 
        if (status == SWITCH_STATUS_SUCCESS) {
index e50eb3df5765c5f4872c3eb27936b5f6e214de20..b8739e930783d665cdfbdb501c716d9a5cee555a 100644 (file)
@@ -845,6 +845,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_add(switch_core_session_t
                switch_clear_flag(session, SSF_MEDIA_BUG_TAP_ONLY);
        }
 
+       if (switch_test_flag(bug, SMBF_READ_VIDEO_PATCH) && session->video_read_codec) {
+               switch_set_flag(session->video_read_codec, SWITCH_CODEC_FLAG_VIDEO_PATCHING);
+       }
+       
        if (switch_event_create(&event, SWITCH_EVENT_MEDIA_BUG_START) == SWITCH_STATUS_SUCCESS) {
                switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Media-Bug-Function", "%s", bug->function);
                switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Media-Bug-Target", "%s", bug->target);
@@ -1186,6 +1190,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_close(switch_media_bug_t *
                        switch_thread_join(&st, bp->video_bug_thread);
                }
 
+               if (switch_test_flag(bp, SMBF_READ_VIDEO_PATCH) && bp->session->video_read_codec) {
+                       switch_clear_flag(bp->session->video_read_codec, SWITCH_CODEC_FLAG_VIDEO_PATCHING);
+               }
+
                switch_core_media_bug_destroy(bp);
                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(switch_core_media_bug_get_session(*bug)), SWITCH_LOG_DEBUG, "Removing BUG from %s\n",
                                                  switch_channel_get_name(bp->session->channel));