mirror of https://bitbucket.org/ausocean/av.git
rtmp: prepare for the horror of walking backwards
This commit is contained in:
parent
ac15477af1
commit
b054ab103f
20
rtmp/rtmp.go
20
rtmp/rtmp.go
|
@ -204,7 +204,7 @@ func C_RTMP_GetTime() int32 {
|
||||||
// rtmp.c +189
|
// rtmp.c +189
|
||||||
func C_RTMPPacket_Alloc(p *C_RTMPPacket, nSize uint32) (ok bool) {
|
func C_RTMPPacket_Alloc(p *C_RTMPPacket, nSize uint32) (ok bool) {
|
||||||
buf := make([]byte, RTMP_MAX_HEADER_SIZE+nSize)
|
buf := make([]byte, RTMP_MAX_HEADER_SIZE+nSize)
|
||||||
p.m_header = buf[:RTMP_MAX_HEADER_SIZE]
|
p.m_header = buf
|
||||||
p.m_body = buf[RTMP_MAX_HEADER_SIZE:]
|
p.m_body = buf[RTMP_MAX_HEADER_SIZE:]
|
||||||
p.m_nBytesRead = 0
|
p.m_nBytesRead = 0
|
||||||
return true
|
return true
|
||||||
|
@ -525,7 +525,7 @@ func C_SendConnectPacket(r *C_RTMP, cp *C_RTMPPacket) (ok bool) {
|
||||||
m_nTimeStamp: 0,
|
m_nTimeStamp: 0,
|
||||||
m_nInfoField2: 0,
|
m_nInfoField2: 0,
|
||||||
m_hasAbsTimestamp: false,
|
m_hasAbsTimestamp: false,
|
||||||
m_header: pbuf[:RTMP_MAX_HEADER_SIZE],
|
m_header: pbuf[:],
|
||||||
m_body: pbuf[RTMP_MAX_HEADER_SIZE:],
|
m_body: pbuf[RTMP_MAX_HEADER_SIZE:],
|
||||||
}
|
}
|
||||||
enc := packet.m_body
|
enc := packet.m_body
|
||||||
|
@ -645,7 +645,7 @@ func C_RTMP_SendCreateStream(r *C_RTMP) (ok bool) {
|
||||||
m_nTimeStamp: 0,
|
m_nTimeStamp: 0,
|
||||||
m_nInfoField2: 0,
|
m_nInfoField2: 0,
|
||||||
m_hasAbsTimestamp: false,
|
m_hasAbsTimestamp: false,
|
||||||
m_header: pbuf[:RTMP_MAX_HEADER_SIZE],
|
m_header: pbuf[:],
|
||||||
m_body: pbuf[RTMP_MAX_HEADER_SIZE:],
|
m_body: pbuf[RTMP_MAX_HEADER_SIZE:],
|
||||||
}
|
}
|
||||||
enc := packet.m_body
|
enc := packet.m_body
|
||||||
|
@ -672,7 +672,7 @@ func C_SendReleaseStream(r *C_RTMP) (ok bool) {
|
||||||
m_nTimeStamp: 0,
|
m_nTimeStamp: 0,
|
||||||
m_nInfoField2: 0,
|
m_nInfoField2: 0,
|
||||||
m_hasAbsTimestamp: false,
|
m_hasAbsTimestamp: false,
|
||||||
m_header: pbuf[:RTMP_MAX_HEADER_SIZE],
|
m_header: pbuf[:],
|
||||||
m_body: pbuf[RTMP_MAX_HEADER_SIZE:],
|
m_body: pbuf[RTMP_MAX_HEADER_SIZE:],
|
||||||
}
|
}
|
||||||
enc := packet.m_body
|
enc := packet.m_body
|
||||||
|
@ -703,7 +703,7 @@ func C_SendFCPublish(r *C_RTMP) (ok bool) {
|
||||||
m_nTimeStamp: 0,
|
m_nTimeStamp: 0,
|
||||||
m_nInfoField2: 0,
|
m_nInfoField2: 0,
|
||||||
m_hasAbsTimestamp: false,
|
m_hasAbsTimestamp: false,
|
||||||
m_header: pbuf[:RTMP_MAX_HEADER_SIZE],
|
m_header: pbuf[:],
|
||||||
m_body: pbuf[RTMP_MAX_HEADER_SIZE:],
|
m_body: pbuf[RTMP_MAX_HEADER_SIZE:],
|
||||||
}
|
}
|
||||||
enc := packet.m_body
|
enc := packet.m_body
|
||||||
|
@ -734,7 +734,7 @@ func C_SendFCUnpublish(r *C_RTMP) (ok bool) {
|
||||||
m_nTimeStamp: 0,
|
m_nTimeStamp: 0,
|
||||||
m_nInfoField2: 0,
|
m_nInfoField2: 0,
|
||||||
m_hasAbsTimestamp: false,
|
m_hasAbsTimestamp: false,
|
||||||
m_header: pbuf[:RTMP_MAX_HEADER_SIZE],
|
m_header: pbuf[:],
|
||||||
m_body: pbuf[RTMP_MAX_HEADER_SIZE:],
|
m_body: pbuf[RTMP_MAX_HEADER_SIZE:],
|
||||||
}
|
}
|
||||||
enc := packet.m_body
|
enc := packet.m_body
|
||||||
|
@ -766,7 +766,7 @@ func C_SendPublish(r *C_RTMP) (ok bool) {
|
||||||
m_nTimeStamp: 0,
|
m_nTimeStamp: 0,
|
||||||
m_nInfoField2: r.m_stream_id,
|
m_nInfoField2: r.m_stream_id,
|
||||||
m_hasAbsTimestamp: false,
|
m_hasAbsTimestamp: false,
|
||||||
m_header: pbuf[:RTMP_MAX_HEADER_SIZE],
|
m_header: pbuf[:],
|
||||||
m_body: pbuf[RTMP_MAX_HEADER_SIZE:],
|
m_body: pbuf[RTMP_MAX_HEADER_SIZE:],
|
||||||
}
|
}
|
||||||
enc := packet.m_body
|
enc := packet.m_body
|
||||||
|
@ -804,7 +804,7 @@ func C_SendDeleteStream(r *C_RTMP, dStreamId float64) (ok bool) {
|
||||||
m_nTimeStamp: 0,
|
m_nTimeStamp: 0,
|
||||||
m_nInfoField2: 0,
|
m_nInfoField2: 0,
|
||||||
m_hasAbsTimestamp: false,
|
m_hasAbsTimestamp: false,
|
||||||
m_header: pbuf[:RTMP_MAX_HEADER_SIZE],
|
m_header: pbuf[:],
|
||||||
m_body: pbuf[RTMP_MAX_HEADER_SIZE:],
|
m_body: pbuf[RTMP_MAX_HEADER_SIZE:],
|
||||||
}
|
}
|
||||||
enc := packet.m_body
|
enc := packet.m_body
|
||||||
|
@ -833,7 +833,7 @@ func C_SendBytesReceived(r *C_RTMP) (ok bool) {
|
||||||
m_nTimeStamp: 0,
|
m_nTimeStamp: 0,
|
||||||
m_nInfoField2: 0,
|
m_nInfoField2: 0,
|
||||||
m_hasAbsTimestamp: false,
|
m_hasAbsTimestamp: false,
|
||||||
m_header: pbuf[:RTMP_MAX_HEADER_SIZE],
|
m_header: pbuf[:],
|
||||||
m_body: pbuf[RTMP_MAX_HEADER_SIZE:],
|
m_body: pbuf[RTMP_MAX_HEADER_SIZE:],
|
||||||
}
|
}
|
||||||
enc := packet.m_body
|
enc := packet.m_body
|
||||||
|
@ -857,7 +857,7 @@ func C_SendCheckBW(r *C_RTMP) (ok bool) {
|
||||||
m_nTimeStamp: 0,
|
m_nTimeStamp: 0,
|
||||||
m_nInfoField2: 0,
|
m_nInfoField2: 0,
|
||||||
m_hasAbsTimestamp: false,
|
m_hasAbsTimestamp: false,
|
||||||
m_header: pbuf[:RTMP_MAX_HEADER_SIZE],
|
m_header: pbuf[:],
|
||||||
m_body: pbuf[RTMP_MAX_HEADER_SIZE:],
|
m_body: pbuf[RTMP_MAX_HEADER_SIZE:],
|
||||||
}
|
}
|
||||||
enc := packet.m_body
|
enc := packet.m_body
|
||||||
|
|
Loading…
Reference in New Issue