git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12814 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2009-03-27 21:53:51 +00:00
parent 0e7fd036a6
commit 04f2d5c212
2 changed files with 20 additions and 22 deletions

View File

@ -1057,11 +1057,9 @@ FSMediaStream::FSMediaStream(FSConnection & conn, const OpalMediaFormat & mediaF
, m_readRTP(0, 512)
, m_callOnStart(true)
{
m_readFrame = (switch_frame_t *) switch_core_session_alloc(m_fsSession, sizeof(*m_readFrame));
m_readFrame->codec = m_switchCodec;
m_readFrame->flags = SFF_RAW_RTP;
memset(&m_readFrame, 0, sizeof(m_readFrame));
m_readFrame.codec = m_switchCodec;
m_readFrame.flags = SFF_RAW_RTP;
}
@ -1118,7 +1116,7 @@ PBoolean FSMediaStream::Open()
<< mediaFormat.GetMediaType() << " codec " << mediaFormat << " for connection " << *this);
if (IsSink()) {
m_readFrame->rate = mediaFormat.GetClockRate();
m_readFrame.rate = mediaFormat.GetClockRate();
if (isAudio) {
switch_core_session_set_read_codec(m_fsSession, m_switchCodec);
@ -1197,7 +1195,7 @@ switch_status_t FSMediaStream::read_frame(switch_frame_t **frame, switch_io_flag
m_callOnStart = false;
}
m_readFrame->flags = 0;
m_readFrame.flags = 0;
/*
while (switch_channel_ready(m_fsChannel)) {
@ -1224,7 +1222,7 @@ switch_status_t FSMediaStream::read_frame(switch_frame_t **frame, switch_io_flag
return SWITCH_STATUS_FALSE;
}
if (!m_readRTP.GetPayloadSize()) {
m_readFrame->flags = SFF_CNG;
m_readFrame.flags = SFF_CNG;
break;
}
}
@ -1236,8 +1234,8 @@ switch_status_t FSMediaStream::read_frame(switch_frame_t **frame, switch_io_flag
switch_core_timer_next(m_switchTimer);
if (!(m_readFrame->datalen = m_readRTP.GetPayloadSize())) {
m_readFrame->flags = SFF_CNG;
if (!(m_readFrame.datalen = m_readRTP.GetPayloadSize())) {
m_readFrame.flags = SFF_CNG;
}
}
@ -1247,17 +1245,17 @@ switch_status_t FSMediaStream::read_frame(switch_frame_t **frame, switch_io_flag
//switch_core_timer_step(&m_switchTimer);
m_readFrame->buflen = m_readRTP.GetSize();
m_readFrame->data = m_readRTP.GetPayloadPtr();
m_readFrame->packet = m_readRTP.GetPointer();
m_readFrame->packetlen = m_readRTP.GetHeaderSize() + m_readFrame->datalen;
m_readFrame->payload = (switch_payload_t) m_readRTP.GetPayloadType();
m_readFrame->timestamp = m_readRTP.GetTimestamp();
m_readFrame->m = (switch_bool_t) m_readRTP.GetMarker();
m_readFrame->seq = m_readRTP.GetSequenceNumber();
m_readFrame->ssrc = m_readRTP.GetSyncSource();
m_readFrame->codec = m_switchCodec;
*frame = m_readFrame;
m_readFrame.buflen = m_readRTP.GetSize();
m_readFrame.data = m_readRTP.GetPayloadPtr();
m_readFrame.packet = m_readRTP.GetPointer();
m_readFrame.packetlen = m_readRTP.GetHeaderSize() + m_readFrame.datalen;
m_readFrame.payload = (switch_payload_t) m_readRTP.GetPayloadType();
m_readFrame.timestamp = m_readRTP.GetTimestamp();
m_readFrame.m = (switch_bool_t) m_readRTP.GetMarker();
m_readFrame.seq = m_readRTP.GetSequenceNumber();
m_readFrame.ssrc = m_readRTP.GetSyncSource();
m_readFrame.codec = m_switchCodec;
*frame = &m_readFrame;
return SWITCH_STATUS_SUCCESS;
}

View File

@ -234,7 +234,7 @@ class FSMediaStream:public OpalMediaStream {
switch_channel_t *m_fsChannel;
switch_timer_t *m_switchTimer;
switch_codec_t *m_switchCodec;
switch_frame_t *m_readFrame;
switch_frame_t m_readFrame;
RTP_DataFrame m_readRTP;
bool m_callOnStart;
uint32_t m_timeStamp;