using my constants instead

This commit is contained in:
saxon 2018-07-19 15:38:10 +09:30
parent 6fc7640b6b
commit e83689c8e8
1 changed files with 7 additions and 7 deletions

View File

@ -255,7 +255,7 @@ type RTMPChunk struct {
c_headerSize int c_headerSize int
c_chunkSize int c_chunkSize int
c_chunk *byte c_chunk *byte
c_header [C.RTMP_MAX_HEADER_SIZE]byte c_header [RTMP_MAX_HEADER_SIZE]byte
} }
type ushort [2]byte type ushort [2]byte
@ -488,7 +488,7 @@ func sendPacket(r *C.RTMP, packet *C.RTMPPacket, queue int) int {
last := 0 last := 0
var nSize, hSize, cSize, nChunkSize, tlen int var nSize, hSize, cSize, nChunkSize, tlen int
var header, hptr, hend, buffer, tbuf, toff unsafe.Pointer var header, hptr, hend, buffer, tbuf, toff unsafe.Pointer
var goHbuf [C.RTMP_MAX_HEADER_SIZE]byte var goHbuf [RTMP_MAX_HEADER_SIZE]byte
var hbuf = unsafe.Pointer(&goHbuf[0]) var hbuf = unsafe.Pointer(&goHbuf[0])
var c byte var c byte
var t int32 var t int32
@ -527,7 +527,7 @@ func sendPacket(r *C.RTMP, packet *C.RTMPPacket, queue int) int {
if prevPacket.m_nTimeStamp == packet.m_nTimeStamp && if prevPacket.m_nTimeStamp == packet.m_nTimeStamp &&
packet.m_headerType == RTMP_PACKET_SIZE_SMALL { packet.m_headerType == RTMP_PACKET_SIZE_SMALL {
// TODO: port this constant // TODO: port this constant
packet.m_headerType = C.RTMP_PACKET_SIZE_MINIMUM packet.m_headerType = RTMP_PACKET_SIZE_MINIMUM
} }
last = int(prevPacket.m_nTimeStamp) last = int(prevPacket.m_nTimeStamp)
@ -551,7 +551,7 @@ func sendPacket(r *C.RTMP, packet *C.RTMPPacket, queue int) int {
header = incBytePtr(hbuf, 6) header = incBytePtr(hbuf, 6)
// TODO: be cautious about this sizeof - make sure it works how you think it // TODO: be cautious about this sizeof - make sure it works how you think it
// does. C code used sizeof(hbuf) where hbuf is a *char // does. C code used sizeof(hbuf) where hbuf is a *char
hend = incBytePtr(hbuf, C.RTMP_MAX_HEADER_SIZE) hend = incBytePtr(hbuf, RTMP_MAX_HEADER_SIZE)
} }
switch { switch {
@ -630,7 +630,7 @@ func sendPacket(r *C.RTMP, packet *C.RTMPPacket, queue int) int {
// send all chunks in one HTTP request // send all chunks in one HTTP request
// TODO: port RTMP_FEATURE_HTTP // TODO: port RTMP_FEATURE_HTTP
if int(r.Link.protocol&C.RTMP_FEATURE_HTTP) != 0 { if int(r.Link.protocol&RTMP_FEATURE_HTTP) != 0 {
chunks := (nSize + nChunkSize - 1) / nChunkSize chunks := (nSize + nChunkSize - 1) / nChunkSize
if chunks > 1 { if chunks > 1 {
tlen = chunks*(cSize+1) + nSize + hSize tlen = chunks*(cSize+1) + nSize + hSize
@ -715,7 +715,7 @@ func sendPacket(r *C.RTMP, packet *C.RTMPPacket, queue int) int {
// We invoked a remote method // We invoked a remote method
// TODO: port the const // TODO: port the const
if packet.m_packetType == C.RTMP_PACKET_TYPE_INVOKE { if packet.m_packetType == RTMP_PACKET_TYPE_INVOKE {
// TODO: port C.AVal // TODO: port C.AVal
var method C.AVal var method C.AVal
var ptr unsafe.Pointer var ptr unsafe.Pointer
@ -769,7 +769,7 @@ func writeN(r *C.RTMP, buffer unsafe.Pointer, n int) int {
for n > 0 { for n > 0 {
var nBytes int var nBytes int
if (r.Link.protocol & C.RTMP_FEATURE_HTTP) != 0 { if (r.Link.protocol & RTMP_FEATURE_HTTP) != 0 {
// TODO: port HTTP_POST // TODO: port HTTP_POST
nBytes = httpPost(r, RTMPT_SEND, (*byte)(ptr), n) nBytes = httpPost(r, RTMPT_SEND, (*byte)(ptr), n)
} else { } else {