]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
refactor to use the new switch_core_session_refresh_video function
authorSeven Du <dujinfang@gmail.com>
Mon, 9 Sep 2013 17:52:21 +0000 (01:52 +0800)
committerSeven Du <dujinfang@gmail.com>
Mon, 9 Sep 2013 17:52:21 +0000 (01:52 +0800)
src/mod/applications/mod_conference/mod_conference.c
src/mod/applications/mod_fsv/mod_fsv.c

index 6007fb2047477200b26534f8c72289640881352a..111e4ef917abbea9eebf29621f93dc1d1bbeb25a 100644 (file)
@@ -32,6 +32,7 @@
  * David Weekly <david@weekly.org>
  * Joao Mesquita <jmesquita@gmail.com>
  * Raymond Chandler <intralanman@freeswitch.org>
+ * Seven Du <dujinfang@gmail.com>
  *
  * mod_conference.c -- Software Conference Bridge
  *
@@ -1869,7 +1870,6 @@ static void *SWITCH_THREAD_FUNC conference_video_bridge_thread_run(switch_thread
        switch_status_t status;
        switch_frame_t *read_frame;
        conference_obj_t *conference = vh->member_a->conference;
-       switch_core_session_message_t msg = { 0 };
        
        switch_thread_rwlock_rdlock(conference->rwlock);
        switch_thread_rwlock_rdlock(vh->member_a->rwlock);
@@ -1882,16 +1882,12 @@ static void *SWITCH_THREAD_FUNC conference_video_bridge_thread_run(switch_thread
        switch_core_session_read_lock(session_a);
        switch_core_session_read_lock(session_b);
        
-       /* Tell the channel to request a fresh vid frame */
-       msg.from = __FILE__;
-       msg.message_id = SWITCH_MESSAGE_INDICATE_VIDEO_REFRESH_REQ;
-
        vh->up = 1;
        while (vh->up == 1 && switch_test_flag(vh->member_a, MFLAG_RUNNING) && switch_test_flag(vh->member_b, MFLAG_RUNNING) &&
                   switch_channel_ready(channel_a) && switch_channel_ready(channel_b))  {
 
                if (switch_channel_test_flag(channel_a, CF_VIDEO_REFRESH_REQ)) {
-                       switch_core_session_receive_message(session_b, &msg);
+                       switch_core_session_refresh_video(session_b);
                        switch_channel_clear_flag(channel_a, CF_VIDEO_REFRESH_REQ);
                }
 
index 3a90df2eb6978337c086c26ba0b6f4cfa773ef66..67acca7a7ad0e2a68061bf03e190c6b7b2b5f479 100644 (file)
@@ -114,17 +114,12 @@ SWITCH_STANDARD_APP(record_fsv_function)
        switch_codec_implementation_t read_impl = { 0 };
        switch_dtmf_t dtmf = { 0 };
        int count = 0, sanity = 30;
-       switch_core_session_message_t msg = { 0 };
 
        switch_channel_set_flag(channel, CF_VIDEO_PASSIVE);
 
-       /* Tell the channel to request a fresh vid frame */
-       msg.from = __FILE__;
-       msg.message_id = SWITCH_MESSAGE_INDICATE_VIDEO_REFRESH_REQ;
-
        switch_core_session_get_read_impl(session, &read_impl);
        switch_channel_answer(channel);
-       switch_core_session_receive_message(session, &msg);
+       switch_core_session_refresh_video(session);
 
        switch_channel_set_variable(channel, SWITCH_PLAYBACK_TERMINATOR_USED, "");
 
@@ -310,15 +305,10 @@ SWITCH_STANDARD_APP(play_fsv_function)
        switch_dtmf_t dtmf = { 0 };
        switch_frame_t *read_frame;
        switch_codec_implementation_t read_impl = { 0 };
-       switch_core_session_message_t msg = { 0 };
 
        switch_channel_set_flag(channel, CF_VIDEO_PASSIVE);
 
-       /* Tell the channel to request a fresh vid frame */
-       msg.from = __FILE__;
-       msg.message_id = SWITCH_MESSAGE_INDICATE_VIDEO_REFRESH_REQ;
-
-       switch_core_session_receive_message(session, &msg);
+       switch_core_session_refresh_video(session);
 
        switch_core_session_get_read_impl(session, &read_impl);