mirror of https://bitbucket.org/ausocean/av.git
using my constants instead
This commit is contained in:
parent
6fc7640b6b
commit
e83689c8e8
14
rtmp/rtmp.go
14
rtmp/rtmp.go
|
@ -255,7 +255,7 @@ type RTMPChunk struct {
|
|||
c_headerSize int
|
||||
c_chunkSize int
|
||||
c_chunk *byte
|
||||
c_header [C.RTMP_MAX_HEADER_SIZE]byte
|
||||
c_header [RTMP_MAX_HEADER_SIZE]byte
|
||||
}
|
||||
|
||||
type ushort [2]byte
|
||||
|
@ -488,7 +488,7 @@ func sendPacket(r *C.RTMP, packet *C.RTMPPacket, queue int) int {
|
|||
last := 0
|
||||
var nSize, hSize, cSize, nChunkSize, tlen int
|
||||
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 c byte
|
||||
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 &&
|
||||
packet.m_headerType == RTMP_PACKET_SIZE_SMALL {
|
||||
// TODO: port this constant
|
||||
packet.m_headerType = C.RTMP_PACKET_SIZE_MINIMUM
|
||||
packet.m_headerType = RTMP_PACKET_SIZE_MINIMUM
|
||||
}
|
||||
|
||||
last = int(prevPacket.m_nTimeStamp)
|
||||
|
@ -551,7 +551,7 @@ func sendPacket(r *C.RTMP, packet *C.RTMPPacket, queue int) int {
|
|||
header = incBytePtr(hbuf, 6)
|
||||
// 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
|
||||
hend = incBytePtr(hbuf, C.RTMP_MAX_HEADER_SIZE)
|
||||
hend = incBytePtr(hbuf, RTMP_MAX_HEADER_SIZE)
|
||||
}
|
||||
|
||||
switch {
|
||||
|
@ -630,7 +630,7 @@ func sendPacket(r *C.RTMP, packet *C.RTMPPacket, queue int) int {
|
|||
|
||||
// send all chunks in one HTTP request
|
||||
// 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
|
||||
if chunks > 1 {
|
||||
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
|
||||
// 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
|
||||
var method C.AVal
|
||||
var ptr unsafe.Pointer
|
||||
|
@ -769,7 +769,7 @@ func writeN(r *C.RTMP, buffer unsafe.Pointer, n int) int {
|
|||
for n > 0 {
|
||||
var nBytes int
|
||||
|
||||
if (r.Link.protocol & C.RTMP_FEATURE_HTTP) != 0 {
|
||||
if (r.Link.protocol & RTMP_FEATURE_HTTP) != 0 {
|
||||
// TODO: port HTTP_POST
|
||||
nBytes = httpPost(r, RTMPT_SEND, (*byte)(ptr), n)
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue