mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-15 08:29:45 +00:00
tweak
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7582 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
217a70e4e0
commit
f4e013e2dd
@ -509,6 +509,7 @@ struct switch_codec {
|
||||
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 */
|
||||
|
@ -216,12 +216,13 @@ SWITCH_STANDARD_APP(play_fsv_function)
|
||||
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_STANDARD_APP(play_fsv_function)
|
||||
|
||||
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 @@ SWITCH_STANDARD_APP(play_fsv_function)
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
@ -1065,6 +1065,9 @@ switch_status_t sofia_glue_tech_set_video_codec(private_object_t *tech_pvt, int
|
||||
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 @@ switch_status_t sofia_glue_tech_set_codec(private_object_t *tech_pvt, int force)
|
||||
);
|
||||
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 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, sdp_session_t *
|
||||
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user