Cleaned up my structs - they are now all in go

This commit is contained in:
saxon 2018-08-10 22:49:43 +09:30
parent f0c5dd7bc3
commit 85de75a4c6
1 changed files with 49 additions and 28 deletions

View File

@ -78,6 +78,10 @@ const (
RTMPT_CLOSE
)
// typedef enum
// amf.h +40
type C_AMFDataType int32
const (
AMF_NUMBER = iota
AMF_BOOLEAN
@ -97,6 +101,7 @@ const (
AMF_XML_DOC
AMF_TYPED_OBJECT
AMF_AVMPLUS /* switch to AMF3 */
AMF_INVALID = 0xff
)
const (
@ -173,7 +178,6 @@ const (
RTMP_SWF_HASHLEN = 32
RTMP_SIG_SIZE = 1536
RTMP_LARGE_HEADER_SIZE = 12
AMF_INVALID = 0xff
RTMP_MAX_HEADER_SIZE = 18
)
@ -250,11 +254,11 @@ type C_RTMP struct {
m_bSendCounter uint8
m_numInvokes int32
m_numCalls int32
m_methodCalls *C.RTMP_METHOD
m_methodCalls *C_RTMP_METHOD
m_channelsAllocatedIn int32
m_channelsAllocatedOut int32
m_vecChannelsIn **C.RTMPPacket
m_vecChannelsOut **C.RTMPPacket
m_vecChannelsIn **C_RTMPPacket
m_vecChannelsOut **C_RTMPPacket
m_channelTimestamp *int32
m_fAudioCodecs float64
m_fVideoCodecs float64
@ -264,11 +268,11 @@ type C_RTMP struct {
m_polling int32
m_resplen int32
m_unackd int32
m_clientID C.AVal
m_read C.RTMP_READ
m_write C.RTMPPacket
m_sb C.RTMPSockBuf
Link C.RTMP_LNK
m_clientID C_AVal
m_read C_RTMP_READ
m_write C_RTMPPacket
m_sb C_RTMPSockBuf
Link C_RTMP_LNK
}
// typedef struct RTMPPacket
@ -282,14 +286,14 @@ type C_RTMPPacket struct {
m_nInfoField2 int32
m_nBodySize uint32
m_nBytesRead uint32
m_chunk *C.RTMPChunk
m_chunk *C_RTMPChunk
m_body *byte
}
// typedef struct RTMPMethod
// rtmp.h +231
type C_RTMP_METHOD struct {
name C.AVal
name C_AVal
num int32
}
@ -343,22 +347,22 @@ type C_RTMPChunk struct {
// typedef struct RTMP_LNK
// rtmp.h +144
type C_RTMP_LNK struct {
hostname C.AVal
sockshost C.AVal
playpath0 C.AVal
playpath C.AVal
tcUrl C.AVal
swfUrl C.AVal
pageUrl C.AVal
app C.AVal
auth C.AVal
flashVer C.AVal
subscribepath C.AVal
usherToken C.AVal
token C.AVal
pubUser C.AVal
pubPasswd C.AVal
extras C.AMFObject
hostname C_AVal
sockshost C_AVal
playpath0 C_AVal
playpath C_AVal
tcUrl C_AVal
swfUrl C_AVal
pageUrl C_AVal
app C_AVal
auth C_AVal
flashVer C_AVal
subscribepath C_AVal
usherToken C_AVal
token C_AVal
pubUser C_AVal
pubPasswd C_AVal
extras C_AMFObject
edepth int32
seekTime int32
stopTime int32
@ -375,7 +379,24 @@ type C_RTMP_LNK struct {
// amf.h +67
type C_AMFObject struct {
o_num int32
o_props *C.AMFObjectProperty
o_props *C_AMFObjectProperty
}
// typedef struct AMFObjectProperty
// amf.h +79
type C_AMFObjectProperty struct {
p_name C_AVal
p_type C_AMFDataType
p_vu P_vu
p_UTCoffset int16
}
// typedef struct P_vu
// amf.h +73
type P_vu struct {
p_number float32
p_aval C_AVal
p_object C_AMFObject
}
// NewSession returns a new session.