[Freeswitch-svn] [commit] r7582 - in freeswitch/trunk/src: include mod/applications/mod_fsv mod/endpoints/mod_sofia

Freeswitch SVN anthm at freeswitch.org
Mon Feb 11 12:14:14 EST 2008


Author: anthm
Date: Mon Feb 11 12:14:14 2008
New Revision: 7582

Modified:
   freeswitch/trunk/src/include/switch_module_interfaces.h
   freeswitch/trunk/src/mod/applications/mod_fsv/mod_fsv.c
   freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c

Log:
tweak

Modified: freeswitch/trunk/src/include/switch_module_interfaces.h
==============================================================================
--- freeswitch/trunk/src/include/switch_module_interfaces.h	(original)
+++ freeswitch/trunk/src/include/switch_module_interfaces.h	Mon Feb 11 12:14:14 2008
@@ -509,6 +509,7 @@
 	switch_memory_pool_t *memory_pool;
 	/*! private data for the codec module to store handle specific info */
 	void *private_info;
+	switch_payload_t agreed_pt;
 };
 
 /*! \brief A table of settings and callbacks that define a paticular implementation of a codec */

Modified: freeswitch/trunk/src/mod/applications/mod_fsv/mod_fsv.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_fsv/mod_fsv.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_fsv/mod_fsv.c	Mon Feb 11 12:14:14 2008
@@ -216,12 +216,13 @@
 	switch_frame_t write_frame = {0}, vid_frame = {0};
 	int fd = -1;
 	int bytes;
-	switch_codec_t *read_codec = NULL, codec = {0}, vid_codec = {0};
+	switch_codec_t *read_codec = NULL, codec = {0}, vid_codec = {0}, *read_vid_codec;
 	unsigned char *aud_buffer;
 	unsigned char *vid_buffer;
 	struct file_header h;
 	uint32_t ts = 0, last = 0;	
 	switch_timer_t timer = {0};
+	switch_payload_t pt = 0;
 
 	aud_buffer = switch_core_session_alloc(session, SWITCH_RECOMMENDED_BUFFER_SIZE);
 	vid_buffer = switch_core_session_alloc(session, SWITCH_RECOMMENDED_BUFFER_SIZE);
@@ -243,6 +244,10 @@
 
 	switch_channel_set_variable(channel, "sip_force_video_fmtp", h.video_fmtp);
 	switch_channel_answer(channel);
+	
+	if ((read_vid_codec = switch_core_session_get_video_read_codec(session))) {
+		pt = read_vid_codec->agreed_pt;
+	}
 
 	write_frame.codec = &codec;
 	write_frame.data = aud_buffer;
@@ -304,7 +309,9 @@
 			}
 			
 			ts = ntohl(h->ts);
-			h->pt = vid_codec.implementation->ianacode;
+			if (pt) {
+				h->pt = pt;
+			}
 			if (switch_channel_test_flag(channel, CF_VIDEO)) {
 				switch_core_session_write_video_frame(session, &vid_frame, -1, 0);
 			}

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c	Mon Feb 11 12:14:14 2008
@@ -1065,6 +1065,9 @@
 			tech_pvt->video_read_frame.codec = &tech_pvt->video_read_codec;
 			
 			tech_pvt->video_fmtp_out = switch_core_session_strdup(tech_pvt->session, tech_pvt->video_write_codec.fmtp_out);
+
+			tech_pvt->video_write_codec.agreed_pt = tech_pvt->video_agreed_pt;
+			tech_pvt->video_read_codec.agreed_pt = tech_pvt->video_agreed_pt;
 			switch_core_session_set_video_read_codec(tech_pvt->session, &tech_pvt->video_read_codec);
 			switch_core_session_set_video_write_codec(tech_pvt->session, &tech_pvt->video_write_codec);
 		}
@@ -1137,6 +1140,9 @@
 					  );
 	tech_pvt->read_frame.codec = &tech_pvt->read_codec;
 	
+	tech_pvt->write_codec.agreed_pt = tech_pvt->agreed_pt;
+	tech_pvt->read_codec.agreed_pt = tech_pvt->agreed_pt;
+
 	switch_core_session_set_read_codec(tech_pvt->session, &tech_pvt->read_codec);
 	switch_core_session_set_write_codec(tech_pvt->session, &tech_pvt->write_codec);
 	tech_pvt->fmtp_out = switch_core_session_strdup(tech_pvt->session, tech_pvt->write_codec.fmtp_out);
@@ -1903,6 +1909,8 @@
 						switch_channel_set_variable(tech_pvt->channel, SWITCH_REMOTE_VIDEO_IP_VARIABLE, tech_pvt->remote_sdp_audio_ip);
 						switch_channel_set_variable(tech_pvt->channel, SWITCH_REMOTE_VIDEO_PORT_VARIABLE, tmp);
 						switch_channel_set_variable(tech_pvt->channel, "sip_video_fmtp", tech_pvt->video_rm_fmtp);
+						switch_snprintf(tmp, sizeof(tmp), "%d", tech_pvt->video_agreed_pt);
+						switch_channel_set_variable(tech_pvt->channel, "sip_video_pt", tmp);
                         break;
 					} else {
 						vmatch = 0;



More information about the Freeswitch-svn mailing list