p->m_headerType = 0;
p->m_packetType = 0;
p->m_nChannel = 0;
- p->m_nInfoField1 = 0;
+ p->m_nTimeStamp = 0;
p->m_nInfoField2 = 0;
p->m_hasAbsTimestamp = false;
p->m_nBodySize = 0;
{
RTMP_Log(RTMP_LOGDEBUG,
"RTMP PACKET: packet type: 0x%02x. channel: 0x%02x. info 1: %d info 2: %d. Body size: %lu. body: 0x%02x",
- p->m_packetType, p->m_nChannel, p->m_nInfoField1, p->m_nInfoField2,
+ p->m_packetType, p->m_nChannel, p->m_nTimeStamp, p->m_nInfoField2,
p->m_nBodySize, p->m_body ? (unsigned char)p->m_body[0] : 0);
}
packet.m_nChannel = 0x03; // control channel (invoke)
packet.m_headerType = RTMP_PACKET_SIZE_LARGE;
packet.m_packetType = 0x14; // INVOKE
- packet.m_nInfoField1 = 0;
+ packet.m_nTimeStamp = 0;
packet.m_nInfoField2 = 0;
packet.m_hasAbsTimestamp = 0;
packet.m_body = pbuf + RTMP_MAX_HEADER_SIZE;
packet.m_nChannel = 0x03; // control channel (invoke)
packet.m_headerType = RTMP_PACKET_SIZE_MEDIUM;
packet.m_packetType = 0x14; // INVOKE
- packet.m_nInfoField1 = 0;
+ packet.m_nTimeStamp = 0;
packet.m_nInfoField2 = 0;
packet.m_hasAbsTimestamp = 0;
packet.m_body = pbuf + RTMP_MAX_HEADER_SIZE;
packet.m_nChannel = 0x03; // control channel (invoke)
packet.m_headerType = RTMP_PACKET_SIZE_MEDIUM;
packet.m_packetType = 0x14; // INVOKE
- packet.m_nInfoField1 = 0;
+ packet.m_nTimeStamp = 0;
packet.m_nInfoField2 = 0;
packet.m_hasAbsTimestamp = 0;
packet.m_body = pbuf + RTMP_MAX_HEADER_SIZE;
packet.m_nChannel = 0x03; // control channel (invoke)
packet.m_headerType = RTMP_PACKET_SIZE_MEDIUM;
packet.m_packetType = 0x14; // INVOKE
- packet.m_nInfoField1 = 0;
+ packet.m_nTimeStamp = 0;
packet.m_nInfoField2 = 0;
packet.m_hasAbsTimestamp = 0;
packet.m_body = pbuf + RTMP_MAX_HEADER_SIZE;
packet.m_nChannel = 0x03; // control channel (invoke)
packet.m_headerType = RTMP_PACKET_SIZE_MEDIUM;
packet.m_packetType = 0x14; // INVOKE
- packet.m_nInfoField1 = 0;
+ packet.m_nTimeStamp = 0;
packet.m_nInfoField2 = 0;
packet.m_hasAbsTimestamp = 0;
packet.m_body = pbuf + RTMP_MAX_HEADER_SIZE;
packet.m_nChannel = 0x03; // control channel (invoke)
packet.m_headerType = RTMP_PACKET_SIZE_MEDIUM;
packet.m_packetType = 0x14; // INVOKE
- packet.m_nInfoField1 = 0;
+ packet.m_nTimeStamp = 0;
packet.m_nInfoField2 = 0;
packet.m_hasAbsTimestamp = 0;
packet.m_body = pbuf + RTMP_MAX_HEADER_SIZE;
packet.m_nChannel = 0x03; // control channel (invoke)
packet.m_headerType = RTMP_PACKET_SIZE_MEDIUM;
packet.m_packetType = 0x14; // INVOKE
- packet.m_nInfoField1 = 0;
+ packet.m_nTimeStamp = 0;
packet.m_nInfoField2 = 0;
packet.m_hasAbsTimestamp = 0;
packet.m_body = pbuf + RTMP_MAX_HEADER_SIZE;
packet.m_nChannel = 0x04; // source channel (invoke)
packet.m_headerType = RTMP_PACKET_SIZE_LARGE;
packet.m_packetType = 0x14; // INVOKE
- packet.m_nInfoField1 = 0;
+ packet.m_nTimeStamp = 0;
packet.m_nInfoField2 = r->m_stream_id;
packet.m_hasAbsTimestamp = 0;
packet.m_body = pbuf + RTMP_MAX_HEADER_SIZE;
packet.m_nChannel = 0x03; // control channel (invoke)
packet.m_headerType = RTMP_PACKET_SIZE_MEDIUM;
packet.m_packetType = 0x14; // INVOKE
- packet.m_nInfoField1 = 0;
+ packet.m_nTimeStamp = 0;
packet.m_nInfoField2 = 0;
packet.m_hasAbsTimestamp = 0;
packet.m_body = pbuf + RTMP_MAX_HEADER_SIZE;
packet.m_nChannel = 0x08; // video channel
packet.m_headerType = RTMP_PACKET_SIZE_MEDIUM;
packet.m_packetType = 0x14; // invoke
- packet.m_nInfoField1 = 0;
+ packet.m_nTimeStamp = 0;
packet.m_nInfoField2 = 0;
packet.m_hasAbsTimestamp = 0;
packet.m_body = pbuf + RTMP_MAX_HEADER_SIZE;
packet.m_nChannel = 0x08; // video channel
packet.m_headerType = RTMP_PACKET_SIZE_MEDIUM;
packet.m_packetType = 0x14; // invoke
- packet.m_nInfoField1 = 0;
+ packet.m_nTimeStamp = 0;
packet.m_nInfoField2 = 0;
packet.m_hasAbsTimestamp = 0;
packet.m_body = pbuf + RTMP_MAX_HEADER_SIZE;
packet.m_nChannel = 0x02; // control channel (invoke)
packet.m_headerType = RTMP_PACKET_SIZE_LARGE;
packet.m_packetType = 0x05; // Server BW
- packet.m_nInfoField1 = 0;
+ packet.m_nTimeStamp = 0;
packet.m_nInfoField2 = 0;
packet.m_hasAbsTimestamp = 0;
packet.m_body = pbuf + RTMP_MAX_HEADER_SIZE;
packet.m_nChannel = 0x02; // control channel (invoke)
packet.m_headerType = RTMP_PACKET_SIZE_LARGE;
packet.m_packetType = 0x06; // Client BW
- packet.m_nInfoField1 = 0;
+ packet.m_nTimeStamp = 0;
packet.m_nInfoField2 = 0;
packet.m_hasAbsTimestamp = 0;
packet.m_body = pbuf + RTMP_MAX_HEADER_SIZE;
packet.m_nChannel = 0x02; // control channel (invoke)
packet.m_headerType = RTMP_PACKET_SIZE_MEDIUM;
packet.m_packetType = 0x03; // bytes in
- packet.m_nInfoField1 = 0;
+ packet.m_nTimeStamp = 0;
packet.m_nInfoField2 = 0;
packet.m_hasAbsTimestamp = 0;
packet.m_body = pbuf + RTMP_MAX_HEADER_SIZE;
packet.m_nChannel = 0x03; // control channel (invoke)
packet.m_headerType = RTMP_PACKET_SIZE_LARGE;
packet.m_packetType = 0x14; // INVOKE
- packet.m_nInfoField1 = 0; /* RTMP_GetTime(); */
+ packet.m_nTimeStamp = 0; /* RTMP_GetTime(); */
packet.m_nInfoField2 = 0;
packet.m_hasAbsTimestamp = 0;
packet.m_body = pbuf + RTMP_MAX_HEADER_SIZE;
packet.m_nChannel = 0x03; // control channel (invoke)
packet.m_headerType = RTMP_PACKET_SIZE_MEDIUM;
packet.m_packetType = 0x14; // INVOKE
- packet.m_nInfoField1 = 0x16 * r->m_nBWCheckCounter; // temp inc value. till we figure it out.
+ packet.m_nTimeStamp = 0x16 * r->m_nBWCheckCounter; // temp inc value. till we figure it out.
packet.m_nInfoField2 = 0;
packet.m_hasAbsTimestamp = 0;
packet.m_body = pbuf + RTMP_MAX_HEADER_SIZE;
packet.m_nChannel = 0x08; // we make 8 our stream channel
packet.m_headerType = RTMP_PACKET_SIZE_LARGE;
packet.m_packetType = 0x14; // INVOKE
+ packet.m_nTimeStamp = 0;
packet.m_nInfoField2 = r->m_stream_id; //0x01000000;
- packet.m_nInfoField1 = 0;
packet.m_hasAbsTimestamp = 0;
packet.m_body = pbuf + RTMP_MAX_HEADER_SIZE;
packet.m_nChannel = 0x03; /* control channel (invoke) */
packet.m_headerType = RTMP_PACKET_SIZE_MEDIUM;
packet.m_packetType = 0x14;
+ packet.m_nTimeStamp = 0;
packet.m_nInfoField2 = 0;
- packet.m_nInfoField1 = 0;
packet.m_hasAbsTimestamp = 0;
packet.m_body = pbuf + RTMP_MAX_HEADER_SIZE;
packet.m_nChannel = 0x02; // control channel (ping)
packet.m_headerType = RTMP_PACKET_SIZE_MEDIUM;
packet.m_packetType = 0x04; // ctrl
- packet.m_nInfoField1 = 0; /* RTMP_GetTime(); */
+ packet.m_nTimeStamp = 0; /* RTMP_GetTime(); */
packet.m_nInfoField2 = 0;
packet.m_hasAbsTimestamp = 0;
packet.m_body = pbuf + RTMP_MAX_HEADER_SIZE;
if (nSize >= 3)
{
- packet->m_nInfoField1 = AMF_DecodeInt24(header);
+ packet->m_nTimeStamp = AMF_DecodeInt24(header);
- //RTMP_Log(RTMP_LOGDEBUG, "%s, reading RTMP packet chunk on channel %x, headersz %i, timestamp %i, abs timestamp %i", __FUNCTION__, packet.m_nChannel, nSize, packet.m_nInfoField1, packet.m_hasAbsTimestamp);
+ //RTMP_Log(RTMP_LOGDEBUG, "%s, reading RTMP packet chunk on channel %x, headersz %i, timestamp %i, abs timestamp %i", __FUNCTION__, packet.m_nChannel, nSize, packet.m_nTimeStamp, packet.m_hasAbsTimestamp);
if (nSize >= 6)
{
packet->m_nInfoField2 = DecodeInt32LE(header + 7);
}
}
- if (packet->m_nInfoField1 == 0xffffff)
+ if (packet->m_nTimeStamp == 0xffffff)
{
if (ReadN(r, header + nSize, 4) != 4)
{
__FUNCTION__);
return false;
}
- packet->m_nInfoField1 = AMF_DecodeInt32(header + nSize);
+ packet->m_nTimeStamp = AMF_DecodeInt32(header + nSize);
hSize += 4;
}
}
if (RTMPPacket_IsReady(packet))
{
- packet->m_nTimeStamp = packet->m_nInfoField1;
-
// make packet's timestamp absolute
if (!packet->m_hasAbsTimestamp)
packet->m_nTimeStamp += r->m_channelTimestamp[packet->m_nChannel]; // timestamps seem to be always relative!!
&& packet->m_headerType == RTMP_PACKET_SIZE_MEDIUM)
packet->m_headerType = RTMP_PACKET_SIZE_SMALL;
- if (prevPacket->m_nInfoField1 == packet->m_nInfoField1
+ if (prevPacket->m_nTimeStamp == packet->m_nTimeStamp
&& packet->m_headerType == RTMP_PACKET_SIZE_SMALL)
packet->m_headerType = RTMP_PACKET_SIZE_MINIMUM;
- last = prevPacket->m_nInfoField1;
+ last = prevPacket->m_nTimeStamp;
}
if (packet->m_headerType > 3) // sanity
int nSize = packetSize[packet->m_headerType];
int hSize = nSize, cSize = 0;
char *header, *hptr, *hend, hbuf[RTMP_MAX_HEADER_SIZE], c;
- uint32_t t = packet->m_nInfoField1 - last;
+ uint32_t t = packet->m_nTimeStamp - last;
if (packet->m_body)
{
pkt->m_packetType = *buf++;
pkt->m_nBodySize = AMF_DecodeInt24(buf);
buf += 3;
- pkt->m_nInfoField1 = AMF_DecodeInt24(buf);
+ pkt->m_nTimeStamp = AMF_DecodeInt24(buf);
buf += 3;
- pkt->m_nInfoField1 |= *buf++ << 24;
+ pkt->m_nTimeStamp |= *buf++ << 24;
buf += 3;
s2 -= 11;
if (((pkt->m_packetType == 0x08 || pkt->m_packetType == 0x09) &&
- !pkt->m_nInfoField1) || pkt->m_packetType == 0x12)
+ !pkt->m_nTimeStamp) || pkt->m_packetType == 0x12)
{
pkt->m_headerType = RTMP_PACKET_SIZE_LARGE;
if (pkt->m_packetType == 0x12)